Hi community,
I'm fighting with the processing of pre-processing instructions according to C#
specs. The BNF is:
Whitespace(opt) '#' Whitespace(opt) 'error' input-characters
Whitespace(opt) '#' Whitespace(opt) 'warning' input-characters
Whitespace(opt) '#' Whitespace(opt) 'line' ...
where
Whitespace(opt) can be optionally one or more spaces ('\u0020','\u00A0', and a
few more)
Input-characters is anything except newline ('\n', and a few more)
I wrote in the Lexer, where the other rules are fragments
PP_DIAGNOSTIC : (WHITESPACE* HASH WHITESPACE* 'error')=>WHITESPACE*
HASH WHITESPACE* ERROR INPUT_CHARACTER*
| (WHITESPACE* HASH WHITESPACE*
'warning')=>WHITESPACE* HASH WHITESPACE* WARNING INPUT_CHARACTER*
;
PP_LINE : (WHITESPACE* HASH WHITESPACE* 'line')=>
WHITESPACE* HASH WHITESPACE* LINE PP_LINE_INDICATOR NEWLINE
;
fragment PP_LINE_INDICATOR : INTEGER_LITERAL PP_FILE_NAME?
| IDENTIFIER_OR_KEYWORD
;
fragment PP_FILE_NAME : STRING_LITERAL
;
fragment HASH : '#';
Unfortunately the DFA in the Lexer doesn't recognize correctly which Lexer rule
applies and now I'm wondering why this is so. Some thoughts and help would be
greatly appreciated.
Thanks in advance,
Eduard
________________________________
The essential is to excite the spectators. If that means playing Hamlet
on a flying trapeze or in an aquarium, you do it.
- Orson Welles
It is not the strongest of the species that survives, nor the most
intelligent that survives. It is the one that is the most adaptable to change.
- Charles Darwin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address