tokens.mly 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. (*
  38. (b) if the token was declared left-associative, then the conflict is resolved
  39. in favor of reduction;
  40. (c) if the token was declared right-associative, then the conflict is resolved
  41. in favor of shifting.
  42. *)
  43. (* Exclamation should have the lower priority because the comments shall never
  44. take place of the statements
  45. *)
  46. %right NO
  47. (* The priority for the variable should be lower than the equality priority
  48. if I want to allow declare new variables *)
  49. %left p_variable
  50. %left OR
  51. %left AND
  52. %left EQUAL
  53. %left GT LT
  54. %left EXCLAMATION
  55. %left PLUS MINUS
  56. %left STAR DIV
  57. %left MOD
  58. %left FUNCTION
  59. %left L_PAREN
  60. %right R_PAREN
  61. %left COMA
  62. %left KEYWORD
  63. %%