szabivan

ambiguous formula parser

Apr 18th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. package szabivan.cup;
  2.  
  3. import java_cup.runtime.*;
  4. import formula.data.*;
  5.  
  6. class FormulaParser;
  7.  
  8. terminal VEE, WEDGE, IMPLIES, IFF, LPAREN, RPAREN, UP, DOWN, NEGATION;
  9. terminal String VARIABLE;
  10.  
  11. non terminal Formula formula;
  12.  
  13. formula ::= VARIABLE |
  14. LPAREN formula RPAREN |
  15. formula VEE formula |
  16. formula WEDGE formula |
  17. formula IMPLIES formula |
  18. formula IFF formula |
  19. NEGATION formula |
  20. UP |
  21. DOWN
  22. ;
Advertisement
Add Comment
Please, Sign In to add comment