node.hh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef RUBY_PARSER_NODE_HH
  2. #define RUBY_PARSER_NODE_HH
  3. #include <memory>
  4. #include <vector>
  5. #include "token.hh"
  6. namespace ruby_parser {
  7. enum class node_type {
  8. ENCODING_LITERAL = 1,
  9. FILE_LITERAL = 2,
  10. LINE_LITERAL = 3,
  11. ALIAS = 4,
  12. AND_ASGN = 5,
  13. ARG = 6,
  14. ARG_EXPR = 7,
  15. ARGS = 8,
  16. ARRAY = 9,
  17. BACK_REF = 10,
  18. BEGIN = 11,
  19. BLOCK = 12,
  20. BLOCK_PASS = 13,
  21. BLOCKARG = 14,
  22. BLOCKARG_EXPR = 15,
  23. CASE = 16,
  24. CBASE = 17,
  25. CLASS = 18,
  26. CONST = 19,
  27. CVAR = 20,
  28. DEF = 21,
  29. DEFS = 22,
  30. DSTR = 23,
  31. DSYM = 24,
  32. ENSURE = 25,
  33. EXRANGE = 26,
  34. FALSE = 27,
  35. FOR = 28,
  36. GVAR = 29,
  37. HASH = 30,
  38. IDENT = 31,
  39. IF = 32,
  40. INT = 33,
  41. INRANGE = 34,
  42. IVAR = 35,
  43. KWARG = 36,
  44. KWBEGIN = 37,
  45. KWOPTARG = 38,
  46. KWRESTARG = 39,
  47. KWSPLAT = 40,
  48. LAMBDA = 41,
  49. MASGN = 42,
  50. MATCH_CURRENT_LINE = 43,
  51. MATCH_WITH_LVASGN = 44,
  52. MLHS = 45,
  53. MODULE = 46,
  54. NIL = 47,
  55. NOT = 48,
  56. NTH_REF = 49,
  57. OBJC_KWARG = 50,
  58. OBJC_RESTARG = 51,
  59. OP_ASGN = 52,
  60. OPTARG = 53,
  61. OR_ASGN = 54,
  62. PAIR = 55,
  63. POSTEXE = 56,
  64. PREEXE = 57,
  65. PROTOTYPE = 58,
  66. REGEXP = 59,
  67. REGOPT = 60,
  68. RESBODY = 61,
  69. RESCUE = 62,
  70. RESTARG = 63,
  71. RESTARG_EXPR = 64,
  72. SCLASS = 65,
  73. SELF = 66,
  74. SEND = 67,
  75. SHADOWARG = 68,
  76. SPLAT = 69,
  77. STR = 70,
  78. SYM = 71,
  79. TR_ARRAY = 72,
  80. TR_CAST = 73,
  81. TR_CPATH = 74,
  82. TR_GENARGS = 75,
  83. TR_GENDECL = 76,
  84. TR_GENINST = 77,
  85. TR_HASH = 78,
  86. TR_IVARDECL = 79,
  87. TR_NIL = 80,
  88. TR_NILLABLE = 81,
  89. TR_OR = 82,
  90. TR_PROC = 83,
  91. TR_SPECIAL = 84,
  92. TR_TUPLE = 85,
  93. TRUE = 86,
  94. TYPED_ARG = 87,
  95. UNDEF = 88,
  96. WHEN = 89,
  97. XSTR = 90,
  98. WHILE = 91,
  99. UNTIL = 92,
  100. AND = 93,
  101. OR = 94,
  102. SUPER = 95,
  103. YIELD = 96,
  104. RETURN = 97,
  105. BREAK = 98,
  106. NEXT = 99,
  107. DEFINED = 100,
  108. REDO = 101,
  109. RETRY = 102,
  110. ZSUPER = 103,
  111. // internal pseudo-nodes
  112. // TODO - move these out of node.hh and into something specific to the
  113. // parser
  114. NODE_LIST = -1,
  115. NODE_DELIMITED_LIST = -2,
  116. NODE_DELIMITED_BLOCK = -3,
  117. NODE_WITH_TOKEN = -4,
  118. };
  119. }
  120. #endif