-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
By using nex to parse SQL, I encounter the following problem:
Say two statements "BETWEEN expr AND expr" and "IF( expr AND expr)", there are two "AND" token that are different. In flex we can write rule like this:
%s BTWMODE
AND { BEGIN INITIAL; return AND; }
AND { return ANDOP; }
BETWEEN { BEGIN BTWMODE; return BETWEEN; }
%s represents an inclusive-mode lexing.(%x exclusive-mode correspondingly)
What is the equivalent counterpart of it?
In addition, flex has an option "case-insensitive" to ignore case, seems nex has no such switch, so I have to write rules like /[Ss][Ee][Ll][Ee][Cc][Tt]/ to represent the "select" keyword. Is there a recommend way to achieve this?
Metadata
Metadata
Assignees
Labels
No labels