Is it possible to set priorities for rules to avoid the “longest-earliest” matching pattern?
- 阅读更多 关于 Is it possible to set priorities for rules to avoid the “longest-earliest” matching pattern?
Another simple question : is there any way to tell flex to prefer a rule that matches a short thing over a rule that matches a longer thing ? I can't find any good documentation about that. Here is why I need that : I parse a file for a pseudo language that contains some keywords corresponding to control instructions. I'd like them to be the absolute priority so that they're not parsed as parts of an expression. I actually need this priority thing because I don't have to write a full grammar for my project (that would be totally overkill in my case since I perform structural analysis on the