[antlr-interest] Re: With apologies for the list-spam, here's another question
offline314159
offline at shaw.ca
Mon Mar 1 13:13:09 PST 2004
> Sure. What's the indicator that you've gone beyond a "reasonable
> length"? Just add code to the NEWLINE rule:
There's no hard and fast indicator, though the spec recommends 70
chars. So, it'll be different from file to file.
> NEWLINE
> : '\n' {newline();}
> ( {getColumn()>MAX}? (' '|'\t')+ {$setType(Token.SKIP);})?
> ;
However, it looks to me like what i want to do is instead modify my
NEWLINE like so:
NEWLINE
:
('\n' ('\t'|' '))=>
'\n'('\t'|' ')+ {$setType(Token.SKIP); newline();}
|
'\n' {newline();}
;
Because with help from Loring, i've gotten the value part done, but i
haven't accounted for the possibility that there might be a fold
before the first ':' character. Which, as i see it, this would
account for.
Does this sound right? Am i missing some form of interaction that i
should be aware of?
> This will ignore newline followed by whitespace if newline is
beyond
> MAX column. :)
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list