Skip to content

Generated C++ parser does not allow whitespace to be a token #431

@ghost

Description

The following token definition generates bad C++ parser.

token Foo '\'' ["01x "]* '\'' ;

The lex file generated is <YYINITIAL>'( |0|1|x)*' yylval._string = strdup(yytext); return _SYMB_171; but it needs to be <YYINITIAL>'(\ |0|1|x)*' yylval._string = strdup(yytext); return _SYMB_171; for it to compile.

The make file reports the following error message

flex -Pasl_ -oLexer.C ASL.l
ASL.l:219: unrecognized rule
ASL.l:220: unrecognized rule
make: *** [Lexer.C] Error 1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions