lex
how to setup flex/bison rules for parsing a comma-delimited argument list
I would like to be able to parse a non-empty, one-or-many element, comma-delimited (and optionally parenthesized) list using flex/bison parse ru开发者_运维技巧les.[详细]
2023-03-10 13:46 分类:问答Boost.Spirit: Lex + Qi error reporting
I am writing a parser for quite complicated config files that make use of indentation etc. I decided to use Lex to break input into tokens as it seems to make life easier. The problem is that I cannot[详细]
2023-03-04 08:00 分类:问答Using Ocamllex for lexing strings (The Tiger Compiler)
I\'m trying to follow Appel\'s \"Modern Compiler Implementation in ML\" and am writing the lexer using Ocamllex.[详细]
2023-02-28 16:39 分类:问答lextestpass.l:384: error: expected expression before ‘int’
So I have this definition in a header file (actually the y.tab.h file): typedef enum yytokentype { TOKEN_UNKNOWN = 1000,[详细]
2023-02-27 05:10 分类:问答Any differences between terms parse trees and derivation trees?
The terms AST (Abstract Syntax Tree), parse tree and derivation tree are bandied about by different people when referring to the result of parsing texts conforming to a grammar. Assuming we are talkin[详细]
2023-02-27 01:55 分类:问答Extra right brace in yacc output
My lex file has: word [^{}\"=,\\t\\n@\\\\ ]+ \\{{ return(LBRACE); } \\}{ return(RBRACE); } {word}{ yylval = yytext; printf(\"WORD=%s\",yytext); return(WORD);[详细]
2023-02-26 20:33 分类:问答Regex for strings in Bibtex
I\'m trying to parse Bibtex files using lex/yacc. Strings in the bibtex database can be surrounded by quotes \"...\" or with braces - {...}[详细]
2023-02-26 07:18 分类:问答semantic phase of c compiler
if write 1=a in the sample c program, it doesnt detect it as an error. How do i solve this problem? Also how do i do global and local scope of variables. Thanks if anyone can solve it[详细]
2023-02-25 09:39 分类:问答Error compiling Lex output in C++
When I compile Lex\'s output as C++, I get these errors: $ make [6%] Building CXX object lib/CMakeFiles/lang.dir/lex_lexer.cpp.o[详细]
2023-02-25 09:39 分类:问答Parsing: library functions, FSM, explode() or lex/yacc?
When I have to parse text (e.g. config files or other rather simple/descriptive languages), there are several solutions that come to my mind:[详细]
2023-02-25 06:05 分类:问答