Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. parser grammar wrbparser;
  2.  
  3. @header{
  4. package parser;
  5. }
  6.  
  7. options {
  8. language = Java;
  9. tokenVocab = wrblexer;
  10. }
  11.  
  12. prog : variable;
  13. variable : ( LETTER CONNECT )? term;
  14. term : term ( ADD | SUB ) atom
  15. | atom;
  16. atom : atom ( MUL | DIV ) ( number | clipped )
  17. | ( number | clipped );
  18. clipped : LBRACKET clipped ( ADD | SUB | MUL | DIV ) clippedterm RBRACKET
  19. | LBRACKET clippedterm ( ADD | SUB | MUL | DIV ) clipped RBRACKET
  20. | LBRACKET clippedterm RBRACKET;
  21. clippedterm : clippedterm ( ADD | SUB ) clippedatom
  22. | clippedatom;
  23. clippedatom : clippedatom ( MUL | DIV ) number
  24. | number;
  25. number : ( SIGN )? PNUMBER ( POINT PNUMBER )?;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement