Make the lexer only recognise known preprocessor directives.

This is another one for the list of occam oddities: there are situations where
both a hex literal and a preprocessor directive are legal, so the two can't be
ambiguous -- no #FACE or #ADA in the future!
This commit is contained in:
Adam Sampson 2007-08-21 21:12:44 +00:00
parent 1bac142a53
commit 87574796fb

View File

@ -34,7 +34,10 @@ $hexDigit = [0-9 a-f A-F]
$horizSpace = [\ \t]
$vertSpace = [\r\n]
@preprocessor = "#" [^\n]*
@directive = "ELSE" | "ENDIF" | "IF" | "INCLUDE"
| "OPTION" | "PRAGMA" | "RELAX" | "USE"
@preprocessor = "#" @directive [^\n]*
@reserved = "[" | "]" | "(" | ")"
| "::" | ":=" | ":" | "," | ";" | "&"