tokens.mly 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. %token <unit -> string>LOCATION_START
  2. %token LOCATION_END
  3. %token PLUS
  4. %token MINUS
  5. %token INCR DECR
  6. %token MULT_EQUAL DIV_EQUAL
  7. %token STAR
  8. %token DIV
  9. %token MOD
  10. %token AMPERSAND
  11. %token COMA
  12. %token EQUAL
  13. %token COLUMN
  14. %token L_BRACKET R_BRACKET
  15. %token L_PAREN R_PAREN
  16. %token LT GT
  17. %token EXCLAMATION
  18. %token AND OR
  19. %token EOL
  20. %token <string>IDENT
  21. %token <string>LITERAL
  22. %token <string>INTEGER
  23. %token TEXT_MARKER
  24. %token ENTER_EMBED LEAVE_EMBED
  25. %token COMMENT
  26. %token ACT
  27. %token IF
  28. %token ELSE
  29. %token ELIF
  30. %token END
  31. %token LET
  32. %token SET
  33. %token OBJ
  34. %token NO
  35. %token <Qsp_syntax.T.keywords>KEYWORD
  36. %token <Qsp_syntax.T.function_>FUNCTION
  37. %token <Qsp_syntax.T.function_>FUNCTION_NOARGS
  38. (*
  39. (b) if the token was declared left-associative, then the conflict is resolved
  40. in favor of reduction;
  41. (c) if the token was declared right-associative, then the conflict is resolved
  42. in favor of shifting.
  43. *)
  44. (* Exclamation should have the lower priority because the comments shall never
  45. take place of the statements
  46. *)
  47. %right NO
  48. (* The priority for the variable should be lower than the equality priority
  49. if I want to allow declare new variables *)
  50. %left p_variable
  51. %left OR
  52. %left AND
  53. %left EQUAL
  54. %left GT LT
  55. %left EXCLAMATION
  56. %left PLUS MINUS
  57. %left STAR DIV
  58. %left MOD
  59. %left FUNCTION
  60. %left L_PAREN
  61. %right R_PAREN
  62. %left COMA
  63. %left KEYWORD
  64. %%