Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

334 linhas
9.4 KiB

  1. /* A Bison parser, made by GNU Bison 2.4.2. */
  2. /* Skeleton interface for Bison LALR(1) parsers in C++
  3. Copyright (C) 2002-2010 Free Software Foundation, Inc.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* As a special exception, you may create a larger work that contains
  15. part or all of the Bison parser skeleton and distribute that work
  16. under terms of your choice, so long as that work isn't itself a
  17. parser generator using the skeleton or a modified version thereof
  18. as a parser skeleton. Alternatively, if you modify or redistribute
  19. the parser skeleton itself, you may (at your option) remove this
  20. special exception, which will cause the skeleton and the resulting
  21. Bison output files to be licensed under the GNU General Public
  22. License without this special exception.
  23. This special exception was added by the Free Software Foundation in
  24. version 2.2 of Bison. */
  25. /* C++ LALR(1) parser skeleton written by Akim Demaille. */
  26. #ifndef PARSER_HEADER_H
  27. # define PARSER_HEADER_H
  28. #include <string>
  29. #include <iostream>
  30. #include "stack.hh"
  31. namespace lol {
  32. /* Line 34 of lalr1.cc */
  33. #line 49 "generated/scenesetup-parser.h"
  34. class position;
  35. class location;
  36. } // lol
  37. /* Line 34 of lalr1.cc */
  38. #line 56 "generated/scenesetup-parser.h"
  39. #include "location.hh"
  40. /* Enabling traces. */
  41. #ifndef YYDEBUG
  42. # define YYDEBUG 1
  43. #endif
  44. /* Enabling verbose error messages. */
  45. #ifdef YYERROR_VERBOSE
  46. # undef YYERROR_VERBOSE
  47. # define YYERROR_VERBOSE 1
  48. #else
  49. # define YYERROR_VERBOSE 1
  50. #endif
  51. /* Enabling the token table. */
  52. #ifndef YYTOKEN_TABLE
  53. # define YYTOKEN_TABLE 0
  54. #endif
  55. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  56. If N is 0, then set CURRENT to the empty location which ends
  57. the previous symbol: RHS[0] (always defined). */
  58. #ifndef YYLLOC_DEFAULT
  59. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  60. do { \
  61. if (N) \
  62. { \
  63. (Current).begin = (Rhs)[1].begin; \
  64. (Current).end = (Rhs)[N].end; \
  65. } \
  66. else \
  67. { \
  68. (Current).begin = (Current).end = (Rhs)[0].end; \
  69. } \
  70. } while (false)
  71. #endif
  72. namespace lol {
  73. /* Line 34 of lalr1.cc */
  74. #line 101 "generated/scenesetup-parser.h"
  75. /// A Bison parser.
  76. class SceneSetupParser
  77. {
  78. public:
  79. /// Symbol semantic values.
  80. #ifndef YYSTYPE
  81. union semantic_type
  82. {
  83. /* Line 34 of lalr1.cc */
  84. #line 33 "scenesetup-parser.y"
  85. float fval;
  86. int ival;
  87. bool bval;
  88. float vval[4];
  89. int ivval[4];
  90. char* sval;
  91. char* svval;
  92. /* Can't use uin32_t here for some reason */
  93. unsigned u32val;
  94. /* Line 34 of lalr1.cc */
  95. #line 128 "generated/scenesetup-parser.h"
  96. };
  97. #else
  98. typedef YYSTYPE semantic_type;
  99. #endif
  100. /// Symbol locations.
  101. typedef location location_type;
  102. /// Tokens.
  103. struct token
  104. {
  105. /* Tokens. */
  106. enum yytokentype {
  107. T_END = 0,
  108. T_COLOR = 258,
  109. T_ADDLIGHT = 259,
  110. T_OBJPOSITION = 260,
  111. T_OBJLOOKAT = 261,
  112. T_OBJCOLOR = 262,
  113. T_CLEARCOLOR = 263,
  114. T_SHOWGIZMO = 264,
  115. T_SHOWLIGHT = 265,
  116. T_CUSTOMCMD = 266,
  117. T_ERROR = 267,
  118. F_NUMBER = 268,
  119. I_NUMBER = 269,
  120. STRING = 270,
  121. STRING_VAR = 271,
  122. BOOLEAN = 272,
  123. COLOR = 273
  124. };
  125. };
  126. /// Token type.
  127. typedef token::yytokentype token_type;
  128. /// Build a parser object.
  129. SceneSetupParser (class SceneSetupCompiler& uc_yyarg);
  130. virtual ~SceneSetupParser ();
  131. /// Parse.
  132. /// \returns 0 iff parsing succeeded.
  133. virtual int parse ();
  134. #if YYDEBUG
  135. /// The current debugging stream.
  136. std::ostream& debug_stream () const;
  137. /// Set the current debugging stream.
  138. void set_debug_stream (std::ostream &);
  139. /// Type for debugging levels.
  140. typedef int debug_level_type;
  141. /// The current debugging level.
  142. debug_level_type debug_level () const;
  143. /// Set the current debugging level.
  144. void set_debug_level (debug_level_type l);
  145. #endif
  146. private:
  147. /// Report a syntax error.
  148. /// \param loc where the syntax error is found.
  149. /// \param msg a description of the syntax error.
  150. virtual void error (const location_type& loc, const std::string& msg);
  151. /// Generate an error message.
  152. /// \param state the state where the error occurred.
  153. /// \param tok the lookahead token.
  154. virtual std::string yysyntax_error_ (int yystate, int tok);
  155. #if YYDEBUG
  156. /// \brief Report a symbol value on the debug stream.
  157. /// \param yytype The token type.
  158. /// \param yyvaluep Its semantic value.
  159. /// \param yylocationp Its location.
  160. virtual void yy_symbol_value_print_ (int yytype,
  161. const semantic_type* yyvaluep,
  162. const location_type* yylocationp);
  163. /// \brief Report a symbol on the debug stream.
  164. /// \param yytype The token type.
  165. /// \param yyvaluep Its semantic value.
  166. /// \param yylocationp Its location.
  167. virtual void yy_symbol_print_ (int yytype,
  168. const semantic_type* yyvaluep,
  169. const location_type* yylocationp);
  170. #endif
  171. /// State numbers.
  172. typedef int state_type;
  173. /// State stack type.
  174. typedef stack<state_type> state_stack_type;
  175. /// Semantic value stack type.
  176. typedef stack<semantic_type> semantic_stack_type;
  177. /// location stack type.
  178. typedef stack<location_type> location_stack_type;
  179. /// The state stack.
  180. state_stack_type yystate_stack_;
  181. /// The semantic value stack.
  182. semantic_stack_type yysemantic_stack_;
  183. /// The location stack.
  184. location_stack_type yylocation_stack_;
  185. /// Internal symbol numbers.
  186. typedef unsigned char token_number_type;
  187. /* Tables. */
  188. /// For a state, the index in \a yytable_ of its portion.
  189. static const signed char yypact_[];
  190. static const signed char yypact_ninf_;
  191. /// For a state, default rule to reduce.
  192. /// Unless\a yytable_ specifies something else to do.
  193. /// Zero means the default is an error.
  194. static const unsigned char yydefact_[];
  195. static const signed char yypgoto_[];
  196. static const signed char yydefgoto_[];
  197. /// What to do in a state.
  198. /// \a yytable_[yypact_[s]]: what to do in state \a s.
  199. /// - if positive, shift that token.
  200. /// - if negative, reduce the rule which number is the opposite.
  201. /// - if zero, do what YYDEFACT says.
  202. static const unsigned char yytable_[];
  203. static const signed char yytable_ninf_;
  204. static const signed char yycheck_[];
  205. /// For a state, its accessing symbol.
  206. static const unsigned char yystos_[];
  207. /// For a rule, its LHS.
  208. static const unsigned char yyr1_[];
  209. /// For a rule, its RHS length.
  210. static const unsigned char yyr2_[];
  211. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  212. /// For a symbol, its name in clear.
  213. static const char* const yytname_[];
  214. #endif
  215. #if YYERROR_VERBOSE
  216. /// Convert the symbol name \a n to a form suitable for a diagnostic.
  217. virtual std::string yytnamerr_ (const char *n);
  218. #endif
  219. #if YYDEBUG
  220. /// A type to store symbol numbers and -1.
  221. typedef signed char rhs_number_type;
  222. /// A `-1'-separated list of the rules' RHS.
  223. static const rhs_number_type yyrhs_[];
  224. /// For each rule, the index of the first RHS symbol in \a yyrhs_.
  225. static const unsigned char yyprhs_[];
  226. /// For each rule, its source line number.
  227. static const unsigned char yyrline_[];
  228. /// For each scanner token number, its symbol number.
  229. static const unsigned short int yytoken_number_[];
  230. /// Report on the debug stream that the rule \a r is going to be reduced.
  231. virtual void yy_reduce_print_ (int r);
  232. /// Print the state stack on the debug stream.
  233. virtual void yystack_print_ ();
  234. /* Debugging. */
  235. int yydebug_;
  236. std::ostream* yycdebug_;
  237. #endif
  238. /// Convert a scanner token number \a t to a symbol number.
  239. token_number_type yytranslate_ (int t);
  240. /// \brief Reclaim the memory associated to a symbol.
  241. /// \param yymsg Why this token is reclaimed.
  242. /// \param yytype The symbol type.
  243. /// \param yyvaluep Its semantic value.
  244. /// \param yylocationp Its location.
  245. inline void yydestruct_ (const char* yymsg,
  246. int yytype,
  247. semantic_type* yyvaluep,
  248. location_type* yylocationp);
  249. /// Pop \a n symbols the three stacks.
  250. inline void yypop_ (unsigned int n = 1);
  251. /* Constants. */
  252. static const int yyeof_;
  253. /* LAST_ -- Last index in TABLE_. */
  254. static const int yylast_;
  255. static const int yynnts_;
  256. static const int yyempty_;
  257. static const int yyfinal_;
  258. static const int yyterror_;
  259. static const int yyerrcode_;
  260. static const int yyntokens_;
  261. static const unsigned int yyuser_token_number_max_;
  262. static const token_number_type yyundef_token_;
  263. /* User arguments. */
  264. class SceneSetupCompiler& uc;
  265. };
  266. } // lol
  267. /* Line 34 of lalr1.cc */
  268. #line 330 "generated/scenesetup-parser.h"
  269. #endif /* ! defined PARSER_HEADER_H */