tokens.mly 1.4 KB

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