GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-parse.h
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.8.2. */
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 <https://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
60  {
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_LT = 274, /* EXPR_LT */
82  EXPR_LE = 275, /* EXPR_LE */
83  EXPR_EQ = 276, /* EXPR_EQ */
84  EXPR_NE = 277, /* EXPR_NE */
85  EXPR_GE = 278, /* EXPR_GE */
86  EXPR_GT = 279, /* EXPR_GT */
87  LEFTDIV = 280, /* LEFTDIV */
88  EMUL = 281, /* EMUL */
89  EDIV = 282, /* EDIV */
90  ELEFTDIV = 283, /* ELEFTDIV */
91  HERMITIAN = 284, /* HERMITIAN */
92  TRANSPOSE = 285, /* TRANSPOSE */
93  PLUS_PLUS = 286, /* PLUS_PLUS */
94  MINUS_MINUS = 287, /* MINUS_MINUS */
95  POW = 288, /* POW */
96  EPOW = 289, /* EPOW */
97  NUMBER = 290, /* NUMBER */
98  STRUCT_ELT = 291, /* STRUCT_ELT */
99  NAME = 292, /* NAME */
100  END = 293, /* END */
101  DQ_STRING = 294, /* DQ_STRING */
102  SQ_STRING = 295, /* SQ_STRING */
103  FOR = 296, /* FOR */
104  PARFOR = 297, /* PARFOR */
105  WHILE = 298, /* WHILE */
106  DO = 299, /* DO */
107  UNTIL = 300, /* UNTIL */
108  SPMD = 301, /* SPMD */
109  IF = 302, /* IF */
110  ELSEIF = 303, /* ELSEIF */
111  ELSE = 304, /* ELSE */
112  SWITCH = 305, /* SWITCH */
113  CASE = 306, /* CASE */
114  OTHERWISE = 307, /* OTHERWISE */
115  BREAK = 308, /* BREAK */
116  CONTINUE = 309, /* CONTINUE */
117  FUNC_RET = 310, /* FUNC_RET */
118  UNWIND = 311, /* UNWIND */
119  CLEANUP = 312, /* CLEANUP */
120  TRY = 313, /* TRY */
121  CATCH = 314, /* CATCH */
122  GLOBAL = 315, /* GLOBAL */
123  PERSISTENT = 316, /* PERSISTENT */
124  FCN_HANDLE = 317, /* FCN_HANDLE */
125  CLASSDEF = 318, /* CLASSDEF */
126  PROPERTIES = 319, /* PROPERTIES */
127  METHODS = 320, /* METHODS */
128  EVENTS = 321, /* EVENTS */
129  ENUMERATION = 322, /* ENUMERATION */
130  METAQUERY = 323, /* METAQUERY */
131  SUPERCLASSREF = 324, /* SUPERCLASSREF */
132  FQ_IDENT = 325, /* FQ_IDENT */
133  GET = 326, /* GET */
134  SET = 327, /* SET */
135  FCN = 328, /* FCN */
136  ARGUMENTS = 329, /* ARGUMENTS */
137  LEXICAL_ERROR = 330, /* LEXICAL_ERROR */
138  END_OF_INPUT = 331, /* END_OF_INPUT */
139  INPUT_FILE = 332, /* INPUT_FILE */
140  UNARY = 333 /* UNARY */
141  };
143 #endif
144 
145 /* Value type. */
146 #if ! defined OCTAVE_STYPE && ! defined OCTAVE_STYPE_IS_DECLARED
148 {
149 #line 139 "../libinterp/parse-tree/oct-parse.yy"
150 
152 
153  // The type of the basic tokens returned by the lexer.
154  octave::token *tok_val;
155 
156  // Comment strings that we need to deal with mid-rule.
157  octave::comment_list *comment_type;
158 
159  // Types for the nonterminals we generate.
161  octave::tree *tree_type;
162  octave::tree_matrix *tree_matrix_type;
163  octave::tree_cell *tree_cell_type;
164  octave::tree_expression *tree_expression_type;
165  octave::tree_constant *tree_constant_type;
166  octave::tree_fcn_handle *tree_fcn_handle_type;
167  octave::tree_superclass_ref *tree_superclass_ref_type;
168  octave::tree_metaclass_query *tree_metaclass_query_type;
169  octave::tree_function_def *tree_function_def_type;
170  octave::tree_anon_fcn_handle *tree_anon_fcn_handle_type;
171  octave::tree_identifier *tree_identifier_type;
172  octave::tree_index_expression *tree_index_expression_type;
173  octave::tree_colon_expression *tree_colon_expression_type;
174  octave::tree_argument_list *tree_argument_list_type;
175  octave::tree_parameter_list *tree_parameter_list_type;
176  octave::tree_command *tree_command_type;
177  octave::tree_if_command *tree_if_command_type;
178  octave::tree_if_clause *tree_if_clause_type;
179  octave::tree_if_command_list *tree_if_command_list_type;
180  octave::tree_switch_command *tree_switch_command_type;
181  octave::tree_switch_case *tree_switch_case_type;
182  octave::tree_switch_case_list *tree_switch_case_list_type;
183  octave::tree_decl_elt *tree_decl_elt_type;
184  octave::tree_decl_init_list *tree_decl_init_list_type;
185  octave::tree_decl_command *tree_decl_command_type;
186  octave::tree_statement *tree_statement_type;
187  octave::tree_statement_list *tree_statement_list_type;
188  octave::tree_arguments_block *tree_arguments_block_type;
189  octave::tree_args_block_attribute_list *tree_args_block_attribute_list_type;
190  octave::tree_args_block_validation_list *tree_args_block_validation_list_type;
191  octave::tree_arg_size_spec *tree_arg_size_spec_type;
192  octave::tree_arg_validation *tree_arg_validation_type;
193  octave::tree_arg_validation_fcns *tree_arg_validation_fcns_type;
195 
196  octave::tree_classdef *tree_classdef_type;
197  octave::tree_classdef_attribute* tree_classdef_attribute_type;
198  octave::tree_classdef_attribute_list* tree_classdef_attribute_list_type;
199  octave::tree_classdef_superclass* tree_classdef_superclass_type;
200  octave::tree_classdef_superclass_list* tree_classdef_superclass_list_type;
201  octave::tree_classdef_body* tree_classdef_body_type;
202  octave::tree_classdef_property* tree_classdef_property_type;
203  octave::tree_classdef_property_list* tree_classdef_property_list_type;
204  octave::tree_classdef_properties_block* tree_classdef_properties_block_type;
205  octave::tree_classdef_methods_list* tree_classdef_methods_list_type;
206  octave::tree_classdef_methods_block* tree_classdef_methods_block_type;
207  octave::tree_classdef_event* tree_classdef_event_type;
208  octave::tree_classdef_events_list* tree_classdef_events_list_type;
209  octave::tree_classdef_events_block* tree_classdef_events_block_type;
210  octave::tree_classdef_enum* tree_classdef_enum_type;
211  octave::tree_classdef_enum_list* tree_classdef_enum_list_type;
212  octave::tree_classdef_enum_block* tree_classdef_enum_block_type;
213 
214 #line 215 "libinterp/parse-tree/oct-parse.h"
215 
216 };
217 typedef union OCTAVE_STYPE OCTAVE_STYPE;
218 # define OCTAVE_STYPE_IS_TRIVIAL 1
219 # define OCTAVE_STYPE_IS_DECLARED 1
220 #endif
221 
222 
223 
224 
225 #ifndef YYPUSH_MORE_DEFINED
226 # define YYPUSH_MORE_DEFINED
227 enum { YYPUSH_MORE = 4 };
228 #endif
229 
230 typedef struct octave_pstate octave_pstate;
231 
232 
233 int octave_parse (octave::base_parser& parser);
235  int pushed_char, OCTAVE_STYPE const *pushed_val, octave::base_parser& parser);
236 int octave_pull_parse (octave_pstate *ps, octave::base_parser& parser);
239 
240 
241 #endif /* !YY_OCTAVE_LIBINTERP_PARSE_TREE_OCT_PARSE_H_INCLUDED */
Definition: parse.h:822
octave_pstate * octave_pstate_new(void)
Definition: oct-parse.cc:3088
int octave_push_parse(octave_pstate *ps, int pushed_char, OCTAVE_STYPE const *pushed_val, octave::base_parser &parser)
Definition: oct-parse.cc:3123
enum octave_tokentype octave_token_kind_t
Definition: oct-parse.h:142
int octave_pull_parse(octave_pstate *ps, octave::base_parser &parser)
Definition: oct-parse.cc:3046
void octave_pstate_delete(octave_pstate *ps)
Definition: oct-parse.cc:3102
@ YYPUSH_MORE
Definition: oct-parse.h:227
int octave_parse(octave::base_parser &parser)
Definition: oct-parse.cc:3032
struct octave_pstate octave_pstate
Definition: oct-parse.h:230
octave_tokentype
Definition: oct-parse.h:60
@ LEFTDIV
Definition: oct-parse.h:87
@ EDIV
Definition: oct-parse.h:89
@ PROPERTIES
Definition: oct-parse.h:126
@ FCN_HANDLE
Definition: oct-parse.h:124
@ FUNC_RET
Definition: oct-parse.h:117
@ PLUS_PLUS
Definition: oct-parse.h:93
@ OCTAVE_EOF
Definition: oct-parse.h:62
@ END_OF_INPUT
Definition: oct-parse.h:138
@ DIV_EQ
Definition: oct-parse.h:68
@ GET
Definition: oct-parse.h:133
@ NUMBER
Definition: oct-parse.h:97
@ SUPERCLASSREF
Definition: oct-parse.h:131
@ ELEFTDIV
Definition: oct-parse.h:90
@ EXPR_LT
Definition: oct-parse.h:81
@ DQ_STRING
Definition: oct-parse.h:101
@ IF
Definition: oct-parse.h:109
@ MINUS_MINUS
Definition: oct-parse.h:94
@ POW
Definition: oct-parse.h:95
@ WHILE
Definition: oct-parse.h:105
@ TRANSPOSE
Definition: oct-parse.h:92
@ OR_EQ
Definition: oct-parse.h:76
@ EXPR_AND_AND
Definition: oct-parse.h:77
@ EXPR_NE
Definition: oct-parse.h:84
@ EXPR_OR_OR
Definition: oct-parse.h:78
@ CONTINUE
Definition: oct-parse.h:116
@ EPOW_EQ
Definition: oct-parse.h:74
@ EVENTS
Definition: oct-parse.h:128
@ SWITCH
Definition: oct-parse.h:112
@ OCTAVE_error
Definition: oct-parse.h:63
@ TRY
Definition: oct-parse.h:120
@ EPOW
Definition: oct-parse.h:96
@ SQ_STRING
Definition: oct-parse.h:102
@ MUL_EQ
Definition: oct-parse.h:67
@ AND_EQ
Definition: oct-parse.h:75
@ NAME
Definition: oct-parse.h:99
@ EMUL_EQ
Definition: oct-parse.h:71
@ INPUT_FILE
Definition: oct-parse.h:139
@ ELSEIF
Definition: oct-parse.h:110
@ POW_EQ
Definition: oct-parse.h:70
@ CATCH
Definition: oct-parse.h:121
@ ARGUMENTS
Definition: oct-parse.h:136
@ OCTAVE_UNDEF
Definition: oct-parse.h:64
@ ADD_EQ
Definition: oct-parse.h:65
@ ELSE
Definition: oct-parse.h:111
@ BREAK
Definition: oct-parse.h:115
@ SUB_EQ
Definition: oct-parse.h:66
@ CASE
Definition: oct-parse.h:113
@ PERSISTENT
Definition: oct-parse.h:123
@ UNTIL
Definition: oct-parse.h:107
@ FOR
Definition: oct-parse.h:103
@ UNARY
Definition: oct-parse.h:140
@ EXPR_LE
Definition: oct-parse.h:82
@ SET
Definition: oct-parse.h:134
@ PARFOR
Definition: oct-parse.h:104
@ DO
Definition: oct-parse.h:106
@ STRUCT_ELT
Definition: oct-parse.h:98
@ EXPR_GE
Definition: oct-parse.h:85
@ LEXICAL_ERROR
Definition: oct-parse.h:137
@ ENUMERATION
Definition: oct-parse.h:129
@ OCTAVE_EMPTY
Definition: oct-parse.h:61
@ METHODS
Definition: oct-parse.h:127
@ FCN
Definition: oct-parse.h:135
@ OTHERWISE
Definition: oct-parse.h:114
@ EXPR_OR
Definition: oct-parse.h:80
@ CLEANUP
Definition: oct-parse.h:119
@ FQ_IDENT
Definition: oct-parse.h:132
@ METAQUERY
Definition: oct-parse.h:130
@ EMUL
Definition: oct-parse.h:88
@ LEFTDIV_EQ
Definition: oct-parse.h:69
@ END
Definition: oct-parse.h:100
@ CLASSDEF
Definition: oct-parse.h:125
@ SPMD
Definition: oct-parse.h:108
@ HERMITIAN
Definition: oct-parse.h:91
@ EDIV_EQ
Definition: oct-parse.h:72
@ ELEFTDIV_EQ
Definition: oct-parse.h:73
@ EXPR_GT
Definition: oct-parse.h:86
@ UNWIND
Definition: oct-parse.h:118
@ EXPR_EQ
Definition: oct-parse.h:83
@ GLOBAL
Definition: oct-parse.h:122
@ EXPR_AND
Definition: oct-parse.h:79
int octave_debug
octave::tree_switch_command * tree_switch_command_type
Definition: oct-parse.h:180
octave::tree_arg_validation_fcns * tree_arg_validation_fcns_type
Definition: oct-parse.h:193
int dummy_type
Definition: oct-parse.h:151
octave::tree_argument_list * tree_argument_list_type
Definition: oct-parse.h:174
octave::tree_switch_case * tree_switch_case_type
Definition: oct-parse.h:181
octave::tree_classdef_enum * tree_classdef_enum_type
Definition: oct-parse.h:210
octave::tree_classdef_methods_block * tree_classdef_methods_block_type
Definition: oct-parse.h:206
octave::tree_arguments_block * tree_arguments_block_type
Definition: oct-parse.h:188
octave::tree_command * tree_command_type
Definition: oct-parse.h:176
octave::tree_if_clause * tree_if_clause_type
Definition: oct-parse.h:178
octave::tree_expression * tree_expression_type
Definition: oct-parse.h:164
octave::tree_classdef_body * tree_classdef_body_type
Definition: oct-parse.h:201
octave::tree_classdef_properties_block * tree_classdef_properties_block_type
Definition: oct-parse.h:204
octave::tree_classdef_events_list * tree_classdef_events_list_type
Definition: oct-parse.h:208
octave::tree_classdef_events_block * tree_classdef_events_block_type
Definition: oct-parse.h:209
octave::tree_classdef_enum_list * tree_classdef_enum_list_type
Definition: oct-parse.h:211
octave::tree_if_command * tree_if_command_type
Definition: oct-parse.h:177
octave::tree_decl_elt * tree_decl_elt_type
Definition: oct-parse.h:183
octave::tree_parameter_list * tree_parameter_list_type
Definition: oct-parse.h:175
octave::tree_index_expression * tree_index_expression_type
Definition: oct-parse.h:172
octave::tree_anon_fcn_handle * tree_anon_fcn_handle_type
Definition: oct-parse.h:170
octave::tree_classdef_superclass * tree_classdef_superclass_type
Definition: oct-parse.h:199
octave::comment_list * comment_type
Definition: oct-parse.h:157
octave::tree * tree_type
Definition: oct-parse.h:161
octave::tree_constant * tree_constant_type
Definition: oct-parse.h:165
octave::tree_decl_command * tree_decl_command_type
Definition: oct-parse.h:185
octave::tree_metaclass_query * tree_metaclass_query_type
Definition: oct-parse.h:168
octave::tree_superclass_ref * tree_superclass_ref_type
Definition: oct-parse.h:167
octave::tree_matrix * tree_matrix_type
Definition: oct-parse.h:162
octave::tree_colon_expression * tree_colon_expression_type
Definition: oct-parse.h:173
octave::token * tok_val
Definition: oct-parse.h:154
octave::tree_args_block_validation_list * tree_args_block_validation_list_type
Definition: oct-parse.h:190
octave::tree_classdef_attribute * tree_classdef_attribute_type
Definition: oct-parse.h:197
octave::tree_classdef_property_list * tree_classdef_property_list_type
Definition: oct-parse.h:203
octave::tree_statement * tree_statement_type
Definition: oct-parse.h:186
octave::tree_statement_list * tree_statement_list_type
Definition: oct-parse.h:187
octave::tree_if_command_list * tree_if_command_list_type
Definition: oct-parse.h:179
octave::tree_decl_init_list * tree_decl_init_list_type
Definition: oct-parse.h:184
octave::tree_classdef * tree_classdef_type
Definition: oct-parse.h:196
octave::tree_identifier * tree_identifier_type
Definition: oct-parse.h:171
octave::tree_arg_validation * tree_arg_validation_type
Definition: oct-parse.h:192
octave::tree_args_block_attribute_list * tree_args_block_attribute_list_type
Definition: oct-parse.h:189
octave::tree_fcn_handle * tree_fcn_handle_type
Definition: oct-parse.h:166
octave::tree_classdef_attribute_list * tree_classdef_attribute_list_type
Definition: oct-parse.h:198
octave::tree_switch_case_list * tree_switch_case_list_type
Definition: oct-parse.h:182
octave::tree_arg_size_spec * tree_arg_size_spec_type
Definition: oct-parse.h:191
octave::tree_function_def * tree_function_def_type
Definition: oct-parse.h:169
octave::tree_classdef_property * tree_classdef_property_type
Definition: oct-parse.h:202
char punct_type
Definition: oct-parse.h:160
octave::tree_classdef_methods_list * tree_classdef_methods_list_type
Definition: oct-parse.h:205
octave::tree_classdef_superclass_list * tree_classdef_superclass_list_type
Definition: oct-parse.h:200
octave_user_function * octave_user_function_type
Definition: oct-parse.h:194
octave::tree_classdef_enum_block * tree_classdef_enum_block_type
Definition: oct-parse.h:212
octave::tree_classdef_event * tree_classdef_event_type
Definition: oct-parse.h:207
octave::tree_cell * tree_cell_type
Definition: oct-parse.h:163