lex - How flex handle ambiguous patterns -


i want use flex handle patterns. in case, both constant , function name alphabetical strings begin uppercase letter. example, in mother(liz, bob), how can differentiate mother , liz? want ( single token, can not regard mother( pattern.

normally, unnecessary generate different token types different kinds of identifier. parser shouldn't need distinction if different uses can distinguished syntactically. (if need semantic information differentiate, , sentence ambiguous without information, might need semantic feedback not appear case here.)

if don't have parser, need syntactic analysis. say, example, function names always followed ( -- means language doesn't allow higher order functions. write wrapper around yylex reads 1 token in advance , emits function_name or constant_name, depending on following token.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -