On Sun, 2009-12-13 at 17:38 +0100, Hans-Martin Adorf wrote:
> An no, blanks are not permitted between #b and #e, since these
> character sequences are prefixes for binary numbers in Scheme (#b
> signifies a binary number, #e an exact number).
>
> How can I switch off spaces?
the action `{ $channel = HIDDEN; }` on any lexer rule will cause
token(s) matched by that rule to be retained but not passed to the
parser.
the action `{ skip(); /*I think I got that name correct*/ }` on any
lexer rule will cause token(s) matched to be thrown away.
maybe looking through the Example grammars might make this clearer....
so for Scheme, since both whitespace and comments are used to separate
tokens but are otherwise ignored, you might have lexer rules:
fragment EOL : ( '\r' '\n'? | '\n' ) ;
WS : ( ' ' | '\t' | EOL )+ { $channel = HIDDEN; };
// single-line comments
SL_COMMENT: ';' (options{greedy=false;}: . )* EOL { $channel=HIDDEN; };
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
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.