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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -