Hi everybody,
I am working on the Java 1.5 grammar provided by the antlr website. I need to 
change the rule FloatingPointLiteral to a parser rule. If I change just the 
name of the lexer rule to create a parser rule, I get some 
RecognitionExceptions. I don't get why my grammar is not able anymore to 
recognize floating point literals if I just change the lexer rule to a parser 
rule. 
floatingPointLiteral    :       (Number)+ POINT (Number)* Exponent? 
FloatTypeSuffix?     |       POINT (Number)+ Exponent? FloatTypeSuffix?     |   
    (Number)+ Exponent FloatTypeSuffix?     |       (Number)+ FloatTypeSuffix   
 ;
If the name of the rule is FloatingPointLiteral it works, but if it's 
floatingPointLiteral (parser rule), it doesn't work anymore.Could anyone 
explain me what the problem is ? I guess the parser can't recognize the tokens 
correctly, but it is strange because they are exactly the same ! In fact, I 
would like to create an object to store the literal, that is why I wanted to 
transform the lexer rule into a parser rule, to return my own object. Is this 
possible (by this way or another) ?Thanks in advance.                           
             

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.

Reply via email to