1 /* A Bison parser, made by GNU Bison 3.7.5.  */
2 
3 /* Bison interface for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6    Inc.
7 
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation, either version 3 of the License, or
11    (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20 
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30 
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33 
34 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
35    especially those whose name start with YY_ or yy_.  They are
36    private implementation details that can be changed or removed.  */
37 
38 #ifndef YY_OCTAVE_LIBINTERP_PARSE_TREE_OCT_PARSE_H_INCLUDED
39 # define YY_OCTAVE_LIBINTERP_PARSE_TREE_OCT_PARSE_H_INCLUDED
40 /* Debug traces.  */
41 #ifndef OCTAVE_DEBUG
42 # if defined YYDEBUG
43 #if YYDEBUG
44 #   define OCTAVE_DEBUG 1
45 #  else
46 #   define OCTAVE_DEBUG 0
47 #  endif
48 # else /* ! defined YYDEBUG */
49 #  define OCTAVE_DEBUG 0
50 # endif /* ! defined YYDEBUG */
51 #endif  /* ! defined OCTAVE_DEBUG */
52 #if OCTAVE_DEBUG
53 extern int octave_debug;
54 #endif
55 
56 /* Token kinds.  */
57 #ifndef OCTAVE_TOKENTYPE
58 # define OCTAVE_TOKENTYPE
59   enum octave_tokentype
60   {
61     OCTAVE_EMPTY = -2,
62     OCTAVE_EOF = 0,                /* "end of file"  */
63     OCTAVE_error = 256,            /* error  */
64     OCTAVE_UNDEF = 257,            /* "invalid token"  */
65     ADD_EQ = 258,                  /* ADD_EQ  */
66     SUB_EQ = 259,                  /* SUB_EQ  */
67     MUL_EQ = 260,                  /* MUL_EQ  */
68     DIV_EQ = 261,                  /* DIV_EQ  */
69     LEFTDIV_EQ = 262,              /* LEFTDIV_EQ  */
70     POW_EQ = 263,                  /* POW_EQ  */
71     EMUL_EQ = 264,                 /* EMUL_EQ  */
72     EDIV_EQ = 265,                 /* EDIV_EQ  */
73     ELEFTDIV_EQ = 266,             /* ELEFTDIV_EQ  */
74     EPOW_EQ = 267,                 /* EPOW_EQ  */
75     AND_EQ = 268,                  /* AND_EQ  */
76     OR_EQ = 269,                   /* OR_EQ  */
77     EXPR_AND_AND = 270,            /* EXPR_AND_AND  */
78     EXPR_OR_OR = 271,              /* EXPR_OR_OR  */
79     EXPR_AND = 272,                /* EXPR_AND  */
80     EXPR_OR = 273,                 /* EXPR_OR  */
81     EXPR_NOT = 274,                /* EXPR_NOT  */
82     EXPR_LT = 275,                 /* EXPR_LT  */
83     EXPR_LE = 276,                 /* EXPR_LE  */
84     EXPR_EQ = 277,                 /* EXPR_EQ  */
85     EXPR_NE = 278,                 /* EXPR_NE  */
86     EXPR_GE = 279,                 /* EXPR_GE  */
87     EXPR_GT = 280,                 /* EXPR_GT  */
88     LEFTDIV = 281,                 /* LEFTDIV  */
89     EMUL = 282,                    /* EMUL  */
90     EDIV = 283,                    /* EDIV  */
91     ELEFTDIV = 284,                /* ELEFTDIV  */
92     EPLUS = 285,                   /* EPLUS  */
93     EMINUS = 286,                  /* EMINUS  */
94     HERMITIAN = 287,               /* HERMITIAN  */
95     TRANSPOSE = 288,               /* TRANSPOSE  */
96     PLUS_PLUS = 289,               /* PLUS_PLUS  */
97     MINUS_MINUS = 290,             /* MINUS_MINUS  */
98     POW = 291,                     /* POW  */
99     EPOW = 292,                    /* EPOW  */
100     NUM = 293,                     /* NUM  */
101     IMAG_NUM = 294,                /* IMAG_NUM  */
102     STRUCT_ELT = 295,              /* STRUCT_ELT  */
103     NAME = 296,                    /* NAME  */
104     END = 297,                     /* END  */
105     DQ_STRING = 298,               /* DQ_STRING  */
106     SQ_STRING = 299,               /* SQ_STRING  */
107     FOR = 300,                     /* FOR  */
108     PARFOR = 301,                  /* PARFOR  */
109     WHILE = 302,                   /* WHILE  */
110     DO = 303,                      /* DO  */
111     UNTIL = 304,                   /* UNTIL  */
112     IF = 305,                      /* IF  */
113     ELSEIF = 306,                  /* ELSEIF  */
114     ELSE = 307,                    /* ELSE  */
115     SWITCH = 308,                  /* SWITCH  */
116     CASE = 309,                    /* CASE  */
117     OTHERWISE = 310,               /* OTHERWISE  */
118     BREAK = 311,                   /* BREAK  */
119     CONTINUE = 312,                /* CONTINUE  */
120     FUNC_RET = 313,                /* FUNC_RET  */
121     UNWIND = 314,                  /* UNWIND  */
122     CLEANUP = 315,                 /* CLEANUP  */
123     TRY = 316,                     /* TRY  */
124     CATCH = 317,                   /* CATCH  */
125     GLOBAL = 318,                  /* GLOBAL  */
126     PERSISTENT = 319,              /* PERSISTENT  */
127     FCN_HANDLE = 320,              /* FCN_HANDLE  */
128     CLASSDEF = 321,                /* CLASSDEF  */
129     PROPERTIES = 322,              /* PROPERTIES  */
130     METHODS = 323,                 /* METHODS  */
131     EVENTS = 324,                  /* EVENTS  */
132     ENUMERATION = 325,             /* ENUMERATION  */
133     METAQUERY = 326,               /* METAQUERY  */
134     SUPERCLASSREF = 327,           /* SUPERCLASSREF  */
135     FQ_IDENT = 328,                /* FQ_IDENT  */
136     GET = 329,                     /* GET  */
137     SET = 330,                     /* SET  */
138     FCN = 331,                     /* FCN  */
139     LEXICAL_ERROR = 332,           /* LEXICAL_ERROR  */
140     END_OF_INPUT = 333,            /* END_OF_INPUT  */
141     INPUT_FILE = 334,              /* INPUT_FILE  */
142     UNARY = 335                    /* UNARY  */
143   };
144   typedef enum octave_tokentype octave_token_kind_t;
145 #endif
146 /* Token kinds.  */
147 #define OCTAVE_EMPTY -2
148 #define OCTAVE_EOF 0
149 #define OCTAVE_error 256
150 #define OCTAVE_UNDEF 257
151 #define ADD_EQ 258
152 #define SUB_EQ 259
153 #define MUL_EQ 260
154 #define DIV_EQ 261
155 #define LEFTDIV_EQ 262
156 #define POW_EQ 263
157 #define EMUL_EQ 264
158 #define EDIV_EQ 265
159 #define ELEFTDIV_EQ 266
160 #define EPOW_EQ 267
161 #define AND_EQ 268
162 #define OR_EQ 269
163 #define EXPR_AND_AND 270
164 #define EXPR_OR_OR 271
165 #define EXPR_AND 272
166 #define EXPR_OR 273
167 #define EXPR_NOT 274
168 #define EXPR_LT 275
169 #define EXPR_LE 276
170 #define EXPR_EQ 277
171 #define EXPR_NE 278
172 #define EXPR_GE 279
173 #define EXPR_GT 280
174 #define LEFTDIV 281
175 #define EMUL 282
176 #define EDIV 283
177 #define ELEFTDIV 284
178 #define EPLUS 285
179 #define EMINUS 286
180 #define HERMITIAN 287
181 #define TRANSPOSE 288
182 #define PLUS_PLUS 289
183 #define MINUS_MINUS 290
184 #define POW 291
185 #define EPOW 292
186 #define NUM 293
187 #define IMAG_NUM 294
188 #define STRUCT_ELT 295
189 #define NAME 296
190 #define END 297
191 #define DQ_STRING 298
192 #define SQ_STRING 299
193 #define FOR 300
194 #define PARFOR 301
195 #define WHILE 302
196 #define DO 303
197 #define UNTIL 304
198 #define IF 305
199 #define ELSEIF 306
200 #define ELSE 307
201 #define SWITCH 308
202 #define CASE 309
203 #define OTHERWISE 310
204 #define BREAK 311
205 #define CONTINUE 312
206 #define FUNC_RET 313
207 #define UNWIND 314
208 #define CLEANUP 315
209 #define TRY 316
210 #define CATCH 317
211 #define GLOBAL 318
212 #define PERSISTENT 319
213 #define FCN_HANDLE 320
214 #define CLASSDEF 321
215 #define PROPERTIES 322
216 #define METHODS 323
217 #define EVENTS 324
218 #define ENUMERATION 325
219 #define METAQUERY 326
220 #define SUPERCLASSREF 327
221 #define FQ_IDENT 328
222 #define GET 329
223 #define SET 330
224 #define FCN 331
225 #define LEXICAL_ERROR 332
226 #define END_OF_INPUT 333
227 #define INPUT_FILE 334
228 #define UNARY 335
229 
230 /* Value type.  */
231 #if ! defined OCTAVE_STYPE && ! defined OCTAVE_STYPE_IS_DECLARED
232 union OCTAVE_STYPE
233 {
234 #line 139 "../libinterp/parse-tree/oct-parse.yy"
235 
236   int dummy_type;
237 
238   // The type of the basic tokens returned by the lexer.
239   octave::token *tok_val;
240 
241   // Comment strings that we need to deal with mid-rule.
242   octave::comment_list *comment_type;
243 
244   // Types for the nonterminals we generate.
245   char punct_type;
246   octave::tree *tree_type;
247   octave::tree_matrix *tree_matrix_type;
248   octave::tree_cell *tree_cell_type;
249   octave::tree_expression *tree_expression_type;
250   octave::tree_constant *tree_constant_type;
251   octave::tree_fcn_handle *tree_fcn_handle_type;
252   octave::tree_superclass_ref *tree_superclass_ref_type;
253   octave::tree_metaclass_query *tree_metaclass_query_type;
254   octave::tree_function_def *tree_function_def_type;
255   octave::tree_anon_fcn_handle *tree_anon_fcn_handle_type;
256   octave::tree_identifier *tree_identifier_type;
257   octave::tree_index_expression *tree_index_expression_type;
258   octave::tree_colon_expression *tree_colon_expression_type;
259   octave::tree_argument_list *tree_argument_list_type;
260   octave::tree_parameter_list *tree_parameter_list_type;
261   octave::tree_command *tree_command_type;
262   octave::tree_if_command *tree_if_command_type;
263   octave::tree_if_clause *tree_if_clause_type;
264   octave::tree_if_command_list *tree_if_command_list_type;
265   octave::tree_switch_command *tree_switch_command_type;
266   octave::tree_switch_case *tree_switch_case_type;
267   octave::tree_switch_case_list *tree_switch_case_list_type;
268   octave::tree_decl_elt *tree_decl_elt_type;
269   octave::tree_decl_init_list *tree_decl_init_list_type;
270   octave::tree_decl_command *tree_decl_command_type;
271   octave::tree_statement *tree_statement_type;
272   octave::tree_statement_list *tree_statement_list_type;
273   octave_user_function *octave_user_function_type;
274 
275   octave::tree_classdef *tree_classdef_type;
276   octave::tree_classdef_attribute* tree_classdef_attribute_type;
277   octave::tree_classdef_attribute_list* tree_classdef_attribute_list_type;
278   octave::tree_classdef_superclass* tree_classdef_superclass_type;
279   octave::tree_classdef_superclass_list* tree_classdef_superclass_list_type;
280   octave::tree_classdef_body* tree_classdef_body_type;
281   octave::tree_classdef_property* tree_classdef_property_type;
282   octave::tree_classdef_property_list* tree_classdef_property_list_type;
283   octave::tree_classdef_properties_block* tree_classdef_properties_block_type;
284   octave::tree_classdef_methods_list* tree_classdef_methods_list_type;
285   octave::tree_classdef_methods_block* tree_classdef_methods_block_type;
286   octave::tree_classdef_event* tree_classdef_event_type;
287   octave::tree_classdef_events_list* tree_classdef_events_list_type;
288   octave::tree_classdef_events_block* tree_classdef_events_block_type;
289   octave::tree_classdef_enum* tree_classdef_enum_type;
290   octave::tree_classdef_enum_list* tree_classdef_enum_list_type;
291   octave::tree_classdef_enum_block* tree_classdef_enum_block_type;
292 
293 #line 294 "libinterp/parse-tree/oct-parse.h"
294 
295 };
296 typedef union OCTAVE_STYPE OCTAVE_STYPE;
297 # define OCTAVE_STYPE_IS_TRIVIAL 1
298 # define OCTAVE_STYPE_IS_DECLARED 1
299 #endif
300 
301 
302 
303 #ifndef YYPUSH_MORE_DEFINED
304 # define YYPUSH_MORE_DEFINED
305 enum { YYPUSH_MORE = 4 };
306 #endif
307 
308 typedef struct octave_pstate octave_pstate;
309 
310 
311 int octave_parse (octave::base_parser& parser);
312 int octave_push_parse (octave_pstate *ps,
313                   int pushed_char, OCTAVE_STYPE const *pushed_val, octave::base_parser& parser);
314 int octave_pull_parse (octave_pstate *ps, octave::base_parser& parser);
315 octave_pstate *octave_pstate_new (void);
316 void octave_pstate_delete (octave_pstate *ps);
317 
318 
319 #endif /* !YY_OCTAVE_LIBINTERP_PARSE_TREE_OCT_PARSE_H_INCLUDED  */
320