lexical-analysis
How to recognize words in text with non-word tokens?
I am currently parsing a bunch of mails and want to get wor开发者_如何学运维ds and other interesting tokens out of mails (even with spelling errors or combination of characters and letters, like \"zeb[详细]
2022-12-15 03:22 分类:问答lex/yacc and parser/scanner
lex and yacc are supposed to be used together. Which ones is the scanner and which one is the parser? Which one creates a scanner and which one create开发者_运维技巧s a parser?Lex (flex) is the lexi[详细]
2022-12-14 17:43 分类:问答Possible typos in ECMAScript 5 specification?
Does anybody know why, at the end of section 7.6 of the ECMA-262, 5th Edition specification, the nonterminals UnicodeLetter, UnicodeCombiningMark, UnicodeDigit, UnicodeconnectorPunctuation, and Unicod[详细]
2022-12-14 15:22 分类:问答What constitutes a 'word' in vim?
Let\'s say we have the following in vim atm: int main () { printf(\"hello\"); return 0; } In vim, w moves a word to the right, but what exactly constitutes a \'word\'?[详细]
2022-12-14 06:16 分类:问答What to name these columns in my symbol table
I\'m using yacc to make a symbol table for a made-up language grammar. Column 1 will have either \"variable\" or \"function.\"[详细]
2022-12-14 02:00 分类:问答How to exclude more than one character in rule?
I\'m trying to write a string matching rule in ANTLRWorks, and I need开发者_如何学运维 to match either escaped quotes or any non quote character. I can match escaped quotes but I\'m having trouble wit[详细]
2022-12-13 13:24 分类:问答How to put a final summary message in a yacc program?
When I redirect input to my yacc p开发者_StackOverflowrogram from an input file, after it finishes parsing the file I want the yacc parser to print a summary of what it did.I want it to do the same th[详细]
2022-12-13 13:09 分类:问答yylval and union
What is the purpose of union in the yacc file?Is it directly related to yylval in the fl开发者_运维技巧ex file?If you don\'t use yylval, then you don\'t need to use union?The purpose of the union is t[详细]
2022-12-13 12:52 分类:问答ANTLRWorks error compiling grammar: "syntax error: invalid char literal: INVALID"
I wrote a stub for a grammar (only matches comments so far), and it\'s giving me the error: syntax error: invalid char literal: <INVALID>[详细]
2022-12-13 10:31 分类:问答How to use yylval with strings in yacc
I want to pass the actual string of a token.If I have a token called ID, then I want my yacc file to actually know what ID is called.I thing I have to pass a string using yylval to the yacc file from[详细]
2022-12-13 03:17 分类:问答