You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
2.6 KiB

3 years ago
  1. /* We currently rely on the token ID mapping to be the same between PHP 5 and PHP 7 - so the same lexer can be used for
  2. * both. This is enforced by sharing this token file. */
  3. %right T_THROW
  4. %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
  5. %left ','
  6. %left T_LOGICAL_OR
  7. %left T_LOGICAL_XOR
  8. %left T_LOGICAL_AND
  9. %right T_PRINT
  10. %right T_YIELD
  11. %right T_DOUBLE_ARROW
  12. %right T_YIELD_FROM
  13. %left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL
  14. %left '?' ':'
  15. %right T_COALESCE
  16. %left T_BOOLEAN_OR
  17. %left T_BOOLEAN_AND
  18. %left '|'
  19. %left '^'
  20. %left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
  21. %nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP
  22. %nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
  23. %left T_SL T_SR
  24. %left '+' '-' '.'
  25. %left '*' '/' '%'
  26. %right '!'
  27. %nonassoc T_INSTANCEOF
  28. %right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
  29. %right T_POW
  30. %right '['
  31. %nonassoc T_NEW T_CLONE
  32. %token T_EXIT
  33. %token T_IF
  34. %left T_ELSEIF
  35. %left T_ELSE
  36. %left T_ENDIF
  37. %token T_LNUMBER
  38. %token T_DNUMBER
  39. %token T_STRING
  40. %token T_STRING_VARNAME
  41. %token T_VARIABLE
  42. %token T_NUM_STRING
  43. %token T_INLINE_HTML
  44. %token T_ENCAPSED_AND_WHITESPACE
  45. %token T_CONSTANT_ENCAPSED_STRING
  46. %token T_ECHO
  47. %token T_DO
  48. %token T_WHILE
  49. %token T_ENDWHILE
  50. %token T_FOR
  51. %token T_ENDFOR
  52. %token T_FOREACH
  53. %token T_ENDFOREACH
  54. %token T_DECLARE
  55. %token T_ENDDECLARE
  56. %token T_AS
  57. %token T_SWITCH
  58. %token T_MATCH
  59. %token T_ENDSWITCH
  60. %token T_CASE
  61. %token T_DEFAULT
  62. %token T_BREAK
  63. %token T_CONTINUE
  64. %token T_GOTO
  65. %token T_FUNCTION
  66. %token T_FN
  67. %token T_CONST
  68. %token T_RETURN
  69. %token T_TRY
  70. %token T_CATCH
  71. %token T_FINALLY
  72. %token T_THROW
  73. %token T_USE
  74. %token T_INSTEADOF
  75. %token T_GLOBAL
  76. %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY
  77. %token T_VAR
  78. %token T_UNSET
  79. %token T_ISSET
  80. %token T_EMPTY
  81. %token T_HALT_COMPILER
  82. %token T_CLASS
  83. %token T_TRAIT
  84. %token T_INTERFACE
  85. %token T_ENUM
  86. %token T_EXTENDS
  87. %token T_IMPLEMENTS
  88. %token T_OBJECT_OPERATOR
  89. %token T_NULLSAFE_OBJECT_OPERATOR
  90. %token T_DOUBLE_ARROW
  91. %token T_LIST
  92. %token T_ARRAY
  93. %token T_CALLABLE
  94. %token T_CLASS_C
  95. %token T_TRAIT_C
  96. %token T_METHOD_C
  97. %token T_FUNC_C
  98. %token T_LINE
  99. %token T_FILE
  100. %token T_START_HEREDOC
  101. %token T_END_HEREDOC
  102. %token T_DOLLAR_OPEN_CURLY_BRACES
  103. %token T_CURLY_OPEN
  104. %token T_PAAMAYIM_NEKUDOTAYIM
  105. %token T_NAMESPACE
  106. %token T_NS_C
  107. %token T_DIR
  108. %token T_NS_SEPARATOR
  109. %token T_ELLIPSIS
  110. %token T_NAME_FULLY_QUALIFIED
  111. %token T_NAME_QUALIFIED
  112. %token T_NAME_RELATIVE
  113. %token T_ATTRIBUTE
  114. %token T_ENUM