SHARE
TWEET

Untitled

a guest Dec 6th, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %import common.ESCAPED_STRING   -> STRING
  2. %import common.NUMBER
  3. %import common.WS
  4. %import common.LETTER
  5. %import common.CNAME
  6. %ignore WS
  7.  
  8. start: (statement_expr | function_expr)+
  9. number_expr: (add_expr | sub_expr)
  10.  
  11. statement_expr: (number_expr | (assignment_expr | assignment_backwards_expr | assignment_any_expr))
  12.  
  13. EOL: "uwu"
  14.  
  15. assignment_subject_expr: (number_expr+) | STRING
  16.  
  17. identifier_expr: CNAME
  18.  
  19. type_expr: "COC" | "BHAL"
  20.  
  21. assignment_expr: "🍆💦" type_expr identifier_expr [("," identifier_expr)+] "=" assignment_subject_expr EOL
  22. assignment_backwards_expr: assignment_subject_expr "=" "🍆💦" identifier_expr [("," identifier_expr)+] type_expr EOL
  23.  
  24. function_expr: "proc" identifier_expr "(" [(identifier_expr ",")+ identifier_expr] ")" "{" statement_expr+ "}"
  25.  
  26. assignment_any_expr: assignment_subject_expr "=" "🍆💦" type_expr identifier_expr [("," identifier_expr)+] "=" assignment_subject_expr EOL
  27.  
  28. sign_pos_expr: "+"
  29. sign_neg_expr: "-"
  30. sign_expr: (sign_neg_expr | sign_neg_expr)
  31.  
  32. add_expr: inner_expr [("+" (inner_expr | important_expr))+]
  33. sub_expr: inner_expr [("-" (inner_expr | important_expr))+]
  34.  
  35. mul_expr: inner_expr ("*" inner_expr)+
  36. div_expr: inner_expr ("/" inner_expr)+
  37.  
  38. important_expr: (mul_expr | div_expr)
  39.  
  40. inner_expr: [sign_expr] NUMBER | (number_expr)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top