Where's the syntax error in this (f)lex snippet? -


i'm having great time doing lexer using flex. problem is, code editor doesn't color syntax of file, , seems rule has error in it. since i'm not sure how use single quotes , double quotes inside intervals, thought i'd share snippet you:

[^\\\'\n]+ {     wchar_t* string;     utf8_decode(yytext, &string);     yyextra->append(string);     free(string); } 

flex tells me there's 'unrecognized rule' on utf8_decode line. if remove whole rule, things fine again.

can tell i'm doing wrong here?

the action must begin on same line pattern. use

[^\\\'\n]+ {     wchar_t* string;     utf8_decode(yytext, &string);     yyextra->append(string);     free(string); } 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -