From 87574796fbc4ac996f24b100a545cc218dee5afa Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Tue, 21 Aug 2007 21:12:44 +0000 Subject: [PATCH] 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! --- LexOccam.x | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LexOccam.x b/LexOccam.x index 0a2b2c9..8e621a5 100644 --- a/LexOccam.x +++ b/LexOccam.x @@ -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 = "[" | "]" | "(" | ")" | "::" | ":=" | ":" | "," | ";" | "&"