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
Post a Comment