Hi,
I'm having some trouble with the lexer looping forever on input that
should be possible to disambiguate in limited time. Not exactly sure why
this happens. It is definitely possible I have done something stupid in
my grammar, of course.
I've seen eternal looping before, for some constructs. A typical example
was the input of a single quote, before defining anything that allows a
single quote. This behavior seems a bit strange, in my opinion, but I
never figured out why it happened.
The current problem is for input such as "::foo". (without the double
quotes).
The relevant productions (the only ones that include colon) look like this:
fragment
OperatorChar
:
'+' | '-' | '*' | '%' | '<'
| '>' | '!' | '?' | '~' | '&'
| '|' | '^' | '$' | '=' | '@'
| '\'' | '`' | ':'
;
Identifier
:
'[]'
| '{}'
| (OperatorChar | '/') (OperatorChar | '#' | '/')*
| '#' (OperatorChar | '#')+
| '.' '.'+
| Letter (Letter|IDDigit|':'|'!'|'?'|'$')*
| ':' (Letter|IDDigit) (Letter|IDDigit|':'|'!'|'?'|'$')*
;
Where Identifier is part of the main production for the parser.
The full grammar can be seen at:
http://github.com/olabini/ioke/raw/9e2795c9c5f2b326c0cbb3dfb456f885b9625ba2/src/grammar/ioke.g
Cheers
--
Ola Bini (http://olabini.com)
Ioke creator (http://ioke.org)
JRuby Core Developer (http://jruby.org)
Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
Practical JRuby on Rails (http://apress.com/book/view/9781590598818)
"Yields falsehood when quined" yields falsehood when quined.
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
-~----------~----~----~----~------~----~------~--~---