tokens.mly 1.4 KB

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