Guest User

Untitled

a guest
Aug 14th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. How to get rid of the following multiple alternatives warnings in my ANTLR3 grammar?
  2. [11:45:19] warning(200): mygrammar.g:14:57: Decision can match input such as "','" using multiple alternatives: 1, 2
  3. As a result, alternative(s) 2 were disabled for that input
  4. [11:45:19] warning(200): C:UsersJarrod Robersonmygrammar.g:14:57: Decision can match input such as "','" using multiple alternatives: 1, 2
  5. As a result, alternative(s) 2 were disabled for that input
  6.  
  7. myfunction(x) ->
  8. sqr(a) -> a * a,
  9. y -> sqr(x).
  10.  
  11. function : ID '(' args ')' '->' statement (',' statement)* ;
  12.  
  13. statement : ATOM
  14. | expression
  15. | assignment
  16. | function
  17. ;
  18.  
  19. program : (statement'.')*;
  20.  
  21. f(x)-> g(y)-> y*y, x=y
  22.  
  23. function
  24. : ID '(' args ')' '->' statement ((',' statement)=> ',' statement)*
  25. ;
  26.  
  27. myfunction(x) ->
  28. sqr(a) -> a * a,
  29. y = sqr(x).
  30.  
  31. function
  32. : ID '(' args ')' '->' statement (',' statement)* '.'
  33. ;
Add Comment
Please, Sign In to add comment