Gabriel Petrovay wrote:
Hi Jim,

1. warning(200): exit_test.g:9:3: Decision can match input such as
"IF" using multiple alternatives: 1, 3

The IF does not MATCH the first alternative, therefore, the warning is
NOT correct.
  
OK - I did not realize that you were the expert - what are you asking me for then?

I assure you however that the warning is correct and your alt 1 (p_IfExpr) starts with IF. If you use ANTLR Works, it will give you a nice graphic explaining your problem. Do you understand the difference between terminals and non-terminals?

Why is the warning disappearing when I delete the second alternative?
If the warning were correct, it should still be displayed.
  
Please load the grammar into ANTLR works (which I have done) and follow the instructions I sent you before.

PARSER GRAMMAR
--------------------------

p_ExprSingle
    : p_IfExpr   // Alt #1, starts with IF
    | {false}?=> p_ExitExpr
    | p_StepExpr // Alt #3, starts with IF
    ;

p_IfExpr
    : IF LPAREN p_ExprSingle RPAREN
    ;

p_StepExpr
    : L_NCName | IF | EXIT
    | LBRACKET p_ExprSingle RBRACKET
    ;

p_ReplaceExpr
    : REPLACE p_ExprSingle WITH p_ExprSingle
    ;

p_ExitExpr
    : EXIT WITH p_ExprSingle
    ;

  


--~--~---------~--~----~------------~-------~--~----~
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

Reply via email to