GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
oct-parse.cc
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Bison implementation 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/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41/* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48/* Identify Bison output, and Bison version. */
49#define YYBISON 30802
50
51/* Bison version string. */
52#define YYBISON_VERSION "3.8.2"
53
54/* Skeleton name. */
55#define YYSKELETON_NAME "yacc.c"
56
57/* Pure parsers. */
58#define YYPURE 1
59
60/* Push parsers. */
61#define YYPUSH 1
62
63/* Pull parsers. */
64#define YYPULL 1
65
66/* Substitute the type names. */
67#define YYSTYPE OCTAVE_STYPE
68/* Substitute the variable and function names. */
69#define yyparse octave_parse
70#define yypush_parse octave_push_parse
71#define yypull_parse octave_pull_parse
72#define yypstate_new octave_pstate_new
73#define yypstate_clear octave_pstate_clear
74#define yypstate_delete octave_pstate_delete
75#define yypstate octave_pstate
76#define yylex octave_lex
77#define yyerror octave_error
78#define yydebug octave_debug
79#define yynerrs octave_nerrs
80
81/* First part of user prologue. */
82#line 30 "../libinterp/parse-tree/oct-parse.yy"
83
84
85// Uncomment to enable parser debugging
86// #define OCTAVE_PARSER_DEBUG 1
87#if defined (OCTAVE_PARSER_DEBUG)
88 // Magic variable used by Bison
89 #define OCTAVE_DEBUG 1
90#endif
91
92#if defined (HAVE_CONFIG_H)
93# include "config.h"
94#endif
95
96#include <cstdio>
97#include <cstdlib>
98
99#include <iostream>
100#include <map>
101#include <sstream>
102
103#include "Matrix.h"
104#include "cmd-edit.h"
105#include "cmd-hist.h"
106#include "file-ops.h"
107#include "file-stat.h"
108#include "oct-env.h"
109#include "oct-time.h"
110#include "quit.h"
111
112#include "Cell.h"
113#include "anon-fcn-validator.h"
114#include "builtin-defun-decls.h"
115#include "defun.h"
116#include "dynamic-ld.h"
117#include "error.h"
118#include "input.h"
119#include "interpreter-private.h"
120#include "interpreter.h"
121#include "lex.h"
122#include "load-path.h"
123#include "oct-sysdep.h"
124#include "oct-hist.h"
125#include "oct-map.h"
126#include "ov-classdef.h"
127#include "ov-fcn-handle.h"
128#include "ov-usr-fcn.h"
129#include "ov-null-mat.h"
130#include "pager.h"
131#include "parse.h"
132#include "pt-all.h"
133#include "pt-eval.h"
134#include "separator-list.h"
135#include "symtab.h"
136#include "token.h"
137#include "unwind-prot.h"
138#include "utils.h"
139#include "variables.h"
140
141// oct-parse.h must be included after pt-all.h
142#include "oct-parse.h"
143
144extern int octave_lex (YYSTYPE *, void *);
145
146// Forward declarations for some functions defined at the bottom of
147// the file.
148
149static void yyerror (octave::base_parser& parser, const char *s);
150
151#define lexer (parser.get_lexer ())
152#define scanner lexer.m_scanner
153
154// Previous versions of Octave used Bison's YYUSE macro to avoid
155// warnings about unused values in rules. But that Bison macro was
156// apparently never intended to be public. So define our own. All we
157// need to do is mention the symantic value somewhere in the rule. It
158// doesn't actually need to be used to avoid the Bison warning, so just
159// define this macro to discard its parameter.
160#define OCTAVE_YYUSE(...)
161
162#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
163 // Disable this warning for code that is generated by Bison,
164 // including grammar rules. Push the current state so we can
165 // restore the warning state prior to functions we define at
166 // the bottom of the file.
167# pragma GCC diagnostic push
168# pragma GCC diagnostic ignored "-Wold-style-cast"
169#endif
170
171
172#line 173 "libinterp/parse-tree/oct-parse.cc"
173
174# ifndef YY_CAST
175# ifdef __cplusplus
176# define YY_CAST(Type, Val) static_cast<Type> (Val)
177# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
178# else
179# define YY_CAST(Type, Val) ((Type) (Val))
180# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
181# endif
182# endif
183# ifndef YY_NULLPTR
184# if defined __cplusplus
185# if 201103L <= __cplusplus
186# define YY_NULLPTR nullptr
187# else
188# define YY_NULLPTR 0
189# endif
190# else
191# define YY_NULLPTR ((void*)0)
192# endif
193# endif
194
195#include "oct-parse.h"
196/* Symbol kind. */
198{
200 YYSYMBOL_YYEOF = 0, /* "end of file" */
201 YYSYMBOL_YYerror = 1, /* error */
202 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
203 YYSYMBOL_3_ = 3, /* '=' */
204 YYSYMBOL_4_ = 4, /* ':' */
205 YYSYMBOL_5_ = 5, /* '-' */
206 YYSYMBOL_6_ = 6, /* '+' */
207 YYSYMBOL_7_ = 7, /* '*' */
208 YYSYMBOL_8_ = 8, /* '/' */
209 YYSYMBOL_9_ = 9, /* '~' */
210 YYSYMBOL_10_ = 10, /* '!' */
211 YYSYMBOL_11_ = 11, /* '(' */
212 YYSYMBOL_12_ = 12, /* ')' */
213 YYSYMBOL_13_ = 13, /* '[' */
214 YYSYMBOL_14_ = 14, /* ']' */
215 YYSYMBOL_15_ = 15, /* '{' */
216 YYSYMBOL_16_ = 16, /* '}' */
217 YYSYMBOL_17_ = 17, /* '.' */
218 YYSYMBOL_18_ = 18, /* '@' */
219 YYSYMBOL_19_ = 19, /* ',' */
220 YYSYMBOL_20_ = 20, /* ';' */
221 YYSYMBOL_21_n_ = 21, /* '\n' */
222 YYSYMBOL_ADD_EQ = 22, /* ADD_EQ */
223 YYSYMBOL_SUB_EQ = 23, /* SUB_EQ */
224 YYSYMBOL_MUL_EQ = 24, /* MUL_EQ */
225 YYSYMBOL_DIV_EQ = 25, /* DIV_EQ */
226 YYSYMBOL_LEFTDIV_EQ = 26, /* LEFTDIV_EQ */
227 YYSYMBOL_POW_EQ = 27, /* POW_EQ */
228 YYSYMBOL_EMUL_EQ = 28, /* EMUL_EQ */
229 YYSYMBOL_EDIV_EQ = 29, /* EDIV_EQ */
230 YYSYMBOL_ELEFTDIV_EQ = 30, /* ELEFTDIV_EQ */
231 YYSYMBOL_EPOW_EQ = 31, /* EPOW_EQ */
232 YYSYMBOL_AND_EQ = 32, /* AND_EQ */
233 YYSYMBOL_OR_EQ = 33, /* OR_EQ */
234 YYSYMBOL_EXPR_AND_AND = 34, /* EXPR_AND_AND */
235 YYSYMBOL_EXPR_OR_OR = 35, /* EXPR_OR_OR */
236 YYSYMBOL_EXPR_AND = 36, /* EXPR_AND */
237 YYSYMBOL_EXPR_OR = 37, /* EXPR_OR */
238 YYSYMBOL_EXPR_LT = 38, /* EXPR_LT */
239 YYSYMBOL_EXPR_LE = 39, /* EXPR_LE */
240 YYSYMBOL_EXPR_EQ = 40, /* EXPR_EQ */
241 YYSYMBOL_EXPR_NE = 41, /* EXPR_NE */
242 YYSYMBOL_EXPR_GE = 42, /* EXPR_GE */
243 YYSYMBOL_EXPR_GT = 43, /* EXPR_GT */
244 YYSYMBOL_LEFTDIV = 44, /* LEFTDIV */
245 YYSYMBOL_EMUL = 45, /* EMUL */
246 YYSYMBOL_EDIV = 46, /* EDIV */
247 YYSYMBOL_ELEFTDIV = 47, /* ELEFTDIV */
248 YYSYMBOL_HERMITIAN = 48, /* HERMITIAN */
249 YYSYMBOL_TRANSPOSE = 49, /* TRANSPOSE */
250 YYSYMBOL_PLUS_PLUS = 50, /* PLUS_PLUS */
251 YYSYMBOL_MINUS_MINUS = 51, /* MINUS_MINUS */
252 YYSYMBOL_POW = 52, /* POW */
253 YYSYMBOL_EPOW = 53, /* EPOW */
254 YYSYMBOL_NUMBER = 54, /* NUMBER */
255 YYSYMBOL_CONSTANT = 55, /* CONSTANT */
256 YYSYMBOL_STRUCT_ELT = 56, /* STRUCT_ELT */
257 YYSYMBOL_NAME = 57, /* NAME */
258 YYSYMBOL_END = 58, /* END */
259 YYSYMBOL_DQ_STRING = 59, /* DQ_STRING */
260 YYSYMBOL_SQ_STRING = 60, /* SQ_STRING */
261 YYSYMBOL_FOR = 61, /* FOR */
262 YYSYMBOL_PARFOR = 62, /* PARFOR */
263 YYSYMBOL_WHILE = 63, /* WHILE */
264 YYSYMBOL_DO = 64, /* DO */
265 YYSYMBOL_UNTIL = 65, /* UNTIL */
266 YYSYMBOL_SPMD = 66, /* SPMD */
267 YYSYMBOL_IF = 67, /* IF */
268 YYSYMBOL_ELSEIF = 68, /* ELSEIF */
269 YYSYMBOL_ELSE = 69, /* ELSE */
270 YYSYMBOL_SWITCH = 70, /* SWITCH */
271 YYSYMBOL_CASE = 71, /* CASE */
272 YYSYMBOL_OTHERWISE = 72, /* OTHERWISE */
273 YYSYMBOL_BREAK = 73, /* BREAK */
274 YYSYMBOL_CONTINUE = 74, /* CONTINUE */
275 YYSYMBOL_RETURN = 75, /* RETURN */
276 YYSYMBOL_UNWIND = 76, /* UNWIND */
277 YYSYMBOL_CLEANUP = 77, /* CLEANUP */
278 YYSYMBOL_TRY = 78, /* TRY */
279 YYSYMBOL_CATCH = 79, /* CATCH */
280 YYSYMBOL_GLOBAL = 80, /* GLOBAL */
281 YYSYMBOL_PERSISTENT = 81, /* PERSISTENT */
282 YYSYMBOL_FCN_HANDLE = 82, /* FCN_HANDLE */
283 YYSYMBOL_CLASSDEF = 83, /* CLASSDEF */
284 YYSYMBOL_PROPERTIES = 84, /* PROPERTIES */
285 YYSYMBOL_METHODS = 85, /* METHODS */
286 YYSYMBOL_EVENTS = 86, /* EVENTS */
287 YYSYMBOL_ENUMERATION = 87, /* ENUMERATION */
288 YYSYMBOL_METAQUERY = 88, /* METAQUERY */
289 YYSYMBOL_SUPERCLASSREF = 89, /* SUPERCLASSREF */
290 YYSYMBOL_FQ_IDENT = 90, /* FQ_IDENT */
291 YYSYMBOL_GET = 91, /* GET */
292 YYSYMBOL_SET = 92, /* SET */
293 YYSYMBOL_FUNCTION = 93, /* FUNCTION */
294 YYSYMBOL_ARGUMENTS = 94, /* ARGUMENTS */
295 YYSYMBOL_LEXICAL_ERROR = 95, /* LEXICAL_ERROR */
296 YYSYMBOL_END_OF_INPUT = 96, /* END_OF_INPUT */
297 YYSYMBOL_INPUT_FILE = 97, /* INPUT_FILE */
298 YYSYMBOL_UNARY = 98, /* UNARY */
299 YYSYMBOL_YYACCEPT = 99, /* $accept */
300 YYSYMBOL_input = 100, /* input */
301 YYSYMBOL_simple_list = 101, /* simple_list */
302 YYSYMBOL_simple_list1 = 102, /* simple_list1 */
303 YYSYMBOL_statement_list = 103, /* statement_list */
304 YYSYMBOL_opt_list = 104, /* opt_list */
305 YYSYMBOL_list = 105, /* list */
306 YYSYMBOL_list1 = 106, /* list1 */
307 YYSYMBOL_opt_fcn_list = 107, /* opt_fcn_list */
308 YYSYMBOL_fcn_list = 108, /* fcn_list */
309 YYSYMBOL_fcn_list1 = 109, /* fcn_list1 */
310 YYSYMBOL_statement = 110, /* statement */
311 YYSYMBOL_word_list_cmd = 111, /* word_list_cmd */
312 YYSYMBOL_word_list = 112, /* word_list */
313 YYSYMBOL_identifier = 113, /* identifier */
314 YYSYMBOL_superclass_identifier = 114, /* superclass_identifier */
315 YYSYMBOL_meta_identifier = 115, /* meta_identifier */
316 YYSYMBOL_string = 116, /* string */
317 YYSYMBOL_constant = 117, /* constant */
318 YYSYMBOL_matrix = 118, /* matrix */
319 YYSYMBOL_matrix_rows = 119, /* matrix_rows */
320 YYSYMBOL_cell = 120, /* cell */
321 YYSYMBOL_cell_rows = 121, /* cell_rows */
322 YYSYMBOL_cell_or_matrix_row = 122, /* cell_or_matrix_row */
323 YYSYMBOL_fcn_handle = 123, /* fcn_handle */
324 YYSYMBOL_anon_fcn_handle = 124, /* anon_fcn_handle */
325 YYSYMBOL_primary_expr = 125, /* primary_expr */
326 YYSYMBOL_magic_colon = 126, /* magic_colon */
327 YYSYMBOL_magic_tilde = 127, /* magic_tilde */
328 YYSYMBOL_arg_list = 128, /* arg_list */
329 YYSYMBOL_indirect_ref_op = 129, /* indirect_ref_op */
330 YYSYMBOL_oper_expr = 130, /* oper_expr */
331 YYSYMBOL_power_expr = 131, /* power_expr */
332 YYSYMBOL_colon_expr = 132, /* colon_expr */
333 YYSYMBOL_simple_expr = 133, /* simple_expr */
334 YYSYMBOL_assign_lhs = 134, /* assign_lhs */
335 YYSYMBOL_assign_expr = 135, /* assign_expr */
336 YYSYMBOL_expression = 136, /* expression */
337 YYSYMBOL_command = 137, /* command */
338 YYSYMBOL_declaration = 138, /* declaration */
339 YYSYMBOL_decl_init_list = 139, /* decl_init_list */
340 YYSYMBOL_decl_elt = 140, /* decl_elt */
341 YYSYMBOL_select_command = 141, /* select_command */
342 YYSYMBOL_if_command = 142, /* if_command */
343 YYSYMBOL_if_clause_list = 143, /* if_clause_list */
344 YYSYMBOL_if_clause = 144, /* if_clause */
345 YYSYMBOL_elseif_clause = 145, /* elseif_clause */
346 YYSYMBOL_else_clause = 146, /* else_clause */
347 YYSYMBOL_switch_command = 147, /* switch_command */
348 YYSYMBOL_case_list = 148, /* case_list */
349 YYSYMBOL_case_list1 = 149, /* case_list1 */
350 YYSYMBOL_switch_case = 150, /* switch_case */
351 YYSYMBOL_default_case = 151, /* default_case */
352 YYSYMBOL_loop_command = 152, /* loop_command */
353 YYSYMBOL_jump_command = 153, /* jump_command */
354 YYSYMBOL_spmd_command = 154, /* spmd_command */
355 YYSYMBOL_except_command = 155, /* except_command */
356 YYSYMBOL_push_fcn_symtab = 156, /* push_fcn_symtab */
357 YYSYMBOL_param_list_beg = 157, /* param_list_beg */
358 YYSYMBOL_param_list_end = 158, /* param_list_end */
359 YYSYMBOL_opt_param_list = 159, /* opt_param_list */
360 YYSYMBOL_param_list = 160, /* param_list */
361 YYSYMBOL_param_list1 = 161, /* param_list1 */
362 YYSYMBOL_param_list2 = 162, /* param_list2 */
363 YYSYMBOL_param_list_elt = 163, /* param_list_elt */
364 YYSYMBOL_return_list = 164, /* return_list */
365 YYSYMBOL_return_list1 = 165, /* return_list1 */
366 YYSYMBOL_parsing_local_fcns = 166, /* parsing_local_fcns */
367 YYSYMBOL_push_script_symtab = 167, /* push_script_symtab */
368 YYSYMBOL_begin_file = 168, /* begin_file */
369 YYSYMBOL_file = 169, /* file */
370 YYSYMBOL_function_beg = 170, /* function_beg */
371 YYSYMBOL_fcn_name = 171, /* fcn_name */
372 YYSYMBOL_function_end = 172, /* function_end */
373 YYSYMBOL_function = 173, /* function */
374 YYSYMBOL_function_body = 174, /* function_body */
375 YYSYMBOL_arguments_block_list = 175, /* arguments_block_list */
376 YYSYMBOL_arguments_block = 176, /* arguments_block */
377 YYSYMBOL_arguments_beg = 177, /* arguments_beg */
378 YYSYMBOL_args_attr_list = 178, /* args_attr_list */
379 YYSYMBOL_args_validation_list = 179, /* args_validation_list */
380 YYSYMBOL_arg_name = 180, /* arg_name */
381 YYSYMBOL_arg_validation = 181, /* arg_validation */
382 YYSYMBOL_size_spec = 182, /* size_spec */
383 YYSYMBOL_class_name = 183, /* class_name */
384 YYSYMBOL_validation_fcns = 184, /* validation_fcns */
385 YYSYMBOL_classdef_beg = 185, /* classdef_beg */
386 YYSYMBOL_classdef = 186, /* classdef */
387 YYSYMBOL_attr_list = 187, /* attr_list */
388 YYSYMBOL_attr_list1 = 188, /* attr_list1 */
389 YYSYMBOL_attr = 189, /* attr */
390 YYSYMBOL_superclass_list = 190, /* superclass_list */
391 YYSYMBOL_superclass_list1 = 191, /* superclass_list1 */
392 YYSYMBOL_superclass = 192, /* superclass */
393 YYSYMBOL_class_body = 193, /* class_body */
394 YYSYMBOL_class_body1 = 194, /* class_body1 */
395 YYSYMBOL_properties_block = 195, /* properties_block */
396 YYSYMBOL_properties_beg = 196, /* properties_beg */
397 YYSYMBOL_property_list = 197, /* property_list */
398 YYSYMBOL_property_list1 = 198, /* property_list1 */
399 YYSYMBOL_class_property = 199, /* class_property */
400 YYSYMBOL_methods_block = 200, /* methods_block */
401 YYSYMBOL_methods_beg = 201, /* methods_beg */
402 YYSYMBOL_method_decl1 = 202, /* method_decl1 */
403 YYSYMBOL_method_decl = 203, /* method_decl */
404 YYSYMBOL_204_1 = 204, /* $@1 */
405 YYSYMBOL_method = 205, /* method */
406 YYSYMBOL_method_list = 206, /* method_list */
407 YYSYMBOL_method_list1 = 207, /* method_list1 */
408 YYSYMBOL_events_block = 208, /* events_block */
409 YYSYMBOL_events_beg = 209, /* events_beg */
410 YYSYMBOL_event_list = 210, /* event_list */
411 YYSYMBOL_event_list1 = 211, /* event_list1 */
412 YYSYMBOL_class_event = 212, /* class_event */
413 YYSYMBOL_enum_block = 213, /* enum_block */
414 YYSYMBOL_enumeration_beg = 214, /* enumeration_beg */
415 YYSYMBOL_enum_list = 215, /* enum_list */
416 YYSYMBOL_enum_list1 = 216, /* enum_list1 */
417 YYSYMBOL_class_enum = 217, /* class_enum */
418 YYSYMBOL_stmt_begin = 218, /* stmt_begin */
419 YYSYMBOL_anon_fcn_begin = 219, /* anon_fcn_begin */
420 YYSYMBOL_parse_error = 220, /* parse_error */
421 YYSYMBOL_sep_no_nl = 221, /* sep_no_nl */
422 YYSYMBOL_opt_sep_no_nl = 222, /* opt_sep_no_nl */
423 YYSYMBOL_sep = 223, /* sep */
424 YYSYMBOL_opt_sep = 224 /* opt_sep */
427
428
429
430
431#ifdef short
432# undef short
433#endif
434
435/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
436 <limits.h> and (if available) <stdint.h> are included
437 so that the code can choose integer types of a good width. */
438
439#ifndef __PTRDIFF_MAX__
440# include <limits.h> /* INFRINGES ON USER NAME SPACE */
441# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
442# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
443# define YY_STDINT_H
444# endif
445#endif
446
447/* Narrow types that promote to a signed type and that can represent a
448 signed or unsigned integer of at least N bits. In tables they can
449 save space and decrease cache pressure. Promoting to a signed type
450 helps avoid bugs in integer arithmetic. */
451
452#ifdef __INT_LEAST8_MAX__
453typedef __INT_LEAST8_TYPE__ yytype_int8;
454#elif defined YY_STDINT_H
455typedef int_least8_t yytype_int8;
456#else
457typedef signed char yytype_int8;
458#endif
459
460#ifdef __INT_LEAST16_MAX__
461typedef __INT_LEAST16_TYPE__ yytype_int16;
462#elif defined YY_STDINT_H
463typedef int_least16_t yytype_int16;
464#else
465typedef short yytype_int16;
466#endif
467
468/* Work around bug in HP-UX 11.23, which defines these macros
469 incorrectly for preprocessor constants. This workaround can likely
470 be removed in 2023, as HPE has promised support for HP-UX 11.23
471 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
472 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
473#ifdef __hpux
474# undef UINT_LEAST8_MAX
475# undef UINT_LEAST16_MAX
476# define UINT_LEAST8_MAX 255
477# define UINT_LEAST16_MAX 65535
478#endif
479
480#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
481typedef __UINT_LEAST8_TYPE__ yytype_uint8;
482#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
483 && UINT_LEAST8_MAX <= INT_MAX)
484typedef uint_least8_t yytype_uint8;
485#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
486typedef unsigned char yytype_uint8;
487#else
488typedef short yytype_uint8;
489#endif
490
491#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
492typedef __UINT_LEAST16_TYPE__ yytype_uint16;
493#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
494 && UINT_LEAST16_MAX <= INT_MAX)
495typedef uint_least16_t yytype_uint16;
496#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
497typedef unsigned short yytype_uint16;
498#else
499typedef int yytype_uint16;
500#endif
501
502#ifndef YYPTRDIFF_T
503# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
504# define YYPTRDIFF_T __PTRDIFF_TYPE__
505# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
506# elif defined PTRDIFF_MAX
507# ifndef ptrdiff_t
508# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
509# endif
510# define YYPTRDIFF_T ptrdiff_t
511# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
512# else
513# define YYPTRDIFF_T long
514# define YYPTRDIFF_MAXIMUM LONG_MAX
515# endif
516#endif
517
518#ifndef YYSIZE_T
519# ifdef __SIZE_TYPE__
520# define YYSIZE_T __SIZE_TYPE__
521# elif defined size_t
522# define YYSIZE_T size_t
523# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
524# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
525# define YYSIZE_T size_t
526# else
527# define YYSIZE_T unsigned
528# endif
529#endif
530
531#define YYSIZE_MAXIMUM \
532 YY_CAST (YYPTRDIFF_T, \
533 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
534 ? YYPTRDIFF_MAXIMUM \
535 : YY_CAST (YYSIZE_T, -1)))
536
537#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
538
539
540/* Stored state numbers (used for stacks). */
542
543/* State numbers in computations. */
544typedef int yy_state_fast_t;
545
546#ifndef YY_
547# if defined YYENABLE_NLS && YYENABLE_NLS
548# if ENABLE_NLS
549# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
550# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
551# endif
552# endif
553# ifndef YY_
554# define YY_(Msgid) Msgid
555# endif
556#endif
557
558
559#ifndef YY_ATTRIBUTE_PURE
560# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
561# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
562# else
563# define YY_ATTRIBUTE_PURE
564# endif
565#endif
566
567#ifndef YY_ATTRIBUTE_UNUSED
568# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
569# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
570# else
571# define YY_ATTRIBUTE_UNUSED
572# endif
573#endif
574
575/* Suppress unused-variable warnings by "using" E. */
576#if ! defined lint || defined __GNUC__
577# define YY_USE(E) ((void) (E))
578#else
579# define YY_USE(E) /* empty */
580#endif
581
582/* Suppress an incorrect diagnostic about yylval being uninitialized. */
583#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
584# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
585# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
586 _Pragma ("GCC diagnostic push") \
587 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
588# else
589# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
590 _Pragma ("GCC diagnostic push") \
591 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
592 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
593# endif
594# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
595 _Pragma ("GCC diagnostic pop")
596#else
597# define YY_INITIAL_VALUE(Value) Value
598#endif
599#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
600# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
601# define YY_IGNORE_MAYBE_UNINITIALIZED_END
602#endif
603#ifndef YY_INITIAL_VALUE
604# define YY_INITIAL_VALUE(Value) /* Nothing. */
605#endif
606
607#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
608# define YY_IGNORE_USELESS_CAST_BEGIN \
609 _Pragma ("GCC diagnostic push") \
610 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
611# define YY_IGNORE_USELESS_CAST_END \
612 _Pragma ("GCC diagnostic pop")
613#endif
614#ifndef YY_IGNORE_USELESS_CAST_BEGIN
615# define YY_IGNORE_USELESS_CAST_BEGIN
616# define YY_IGNORE_USELESS_CAST_END
617#endif
618
619
620#define YY_ASSERT(E) ((void) (0 && (E)))
621
622#if !defined yyoverflow
623
624/* The parser invokes alloca or malloc; define the necessary symbols. */
625
626# ifdef YYSTACK_ALLOC
627 /* Pacify GCC's 'empty if-body' warning. */
628# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
629# ifndef YYSTACK_ALLOC_MAXIMUM
630 /* The OS might guarantee only one guard page at the bottom of the stack,
631 and a page size can be as small as 4096 bytes. So we cannot safely
632 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
633 to allow for a few compiler-allocated temporary stack slots. */
634# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
635# endif
636# else
637# define YYSTACK_ALLOC YYMALLOC
638# define YYSTACK_FREE YYFREE
639# ifndef YYSTACK_ALLOC_MAXIMUM
640# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
641# endif
642# if (defined __cplusplus && ! defined EXIT_SUCCESS \
643 && ! ((defined YYMALLOC || defined malloc) \
644 && (defined YYFREE || defined free)))
645# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
646# ifndef EXIT_SUCCESS
647# define EXIT_SUCCESS 0
648# endif
649# endif
650# ifndef YYMALLOC
651# define YYMALLOC malloc
652# if ! defined malloc && ! defined EXIT_SUCCESS
653void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
654# endif
655# endif
656# ifndef YYFREE
657# define YYFREE free
658# if ! defined free && ! defined EXIT_SUCCESS
659void free (void *); /* INFRINGES ON USER NAME SPACE */
660# endif
661# endif
662# endif
663#endif /* !defined yyoverflow */
664
665#if (! defined yyoverflow \
666 && (! defined __cplusplus \
667 || (defined OCTAVE_STYPE_IS_TRIVIAL && OCTAVE_STYPE_IS_TRIVIAL)))
668
669/* A type that is properly aligned for any stack member. */
670union yyalloc
671{
672 yy_state_t yyss_alloc;
673 YYSTYPE yyvs_alloc;
674};
675
676/* The size of the maximum gap between one aligned stack and the next. */
677# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
678
679/* The size of an array large to enough to hold all stacks, each with
680 N elements. */
681# define YYSTACK_BYTES(N) \
682 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
683 + YYSTACK_GAP_MAXIMUM)
684
685# define YYCOPY_NEEDED 1
686
687/* Relocate STACK from its old location to the new one. The
688 local variables YYSIZE and YYSTACKSIZE give the old and new number of
689 elements in the stack, and YYPTR gives the new location of the
690 stack. Advance YYPTR to a properly aligned location for the next
691 stack. */
692# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
693 do \
694 { \
695 YYPTRDIFF_T yynewbytes; \
696 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
697 Stack = &yyptr->Stack_alloc; \
698 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
699 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
700 } \
701 while (0)
702
703#endif
704
705#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
706/* Copy COUNT objects from SRC to DST. The source and destination do
707 not overlap. */
708# ifndef YYCOPY
709# if defined __GNUC__ && 1 < __GNUC__
710# define YYCOPY(Dst, Src, Count) \
711 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
712# else
713# define YYCOPY(Dst, Src, Count) \
714 do \
715 { \
716 YYPTRDIFF_T yyi; \
717 for (yyi = 0; yyi < (Count); yyi++) \
718 (Dst)[yyi] = (Src)[yyi]; \
719 } \
720 while (0)
721# endif
722# endif
723#endif /* !YYCOPY_NEEDED */
724
725/* YYFINAL -- State number of the termination state. */
726#define YYFINAL 120
727/* YYLAST -- Last index in YYTABLE. */
728#define YYLAST 1520
729
730/* YYNTOKENS -- Number of terminals. */
731#define YYNTOKENS 99
732/* YYNNTS -- Number of nonterminals. */
733#define YYNNTS 126
734/* YYNRULES -- Number of rules. */
735#define YYNRULES 309
736/* YYNSTATES -- Number of states. */
737#define YYNSTATES 529
738
739/* YYMAXUTOK -- Last valid token kind. */
740#define YYMAXUTOK 334
741
742
743/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
744 as returned by yylex, with out-of-bounds checking. */
745#define YYTRANSLATE(YYX) \
746 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
747 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
748 : YYSYMBOL_YYUNDEF)
749
750/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
751 as returned by yylex. */
752static const yytype_int8 yytranslate[] =
753{
754 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
755 21, 2, 2, 2, 2, 2, 2, 2, 2, 2,
756 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757 2, 2, 2, 10, 2, 2, 2, 2, 2, 2,
758 11, 12, 7, 6, 19, 5, 17, 8, 2, 2,
759 2, 2, 2, 2, 2, 2, 2, 2, 4, 20,
760 2, 3, 2, 2, 18, 2, 2, 2, 2, 2,
761 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
762 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763 2, 13, 2, 14, 2, 2, 2, 2, 2, 2,
764 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766 2, 2, 2, 15, 2, 16, 9, 2, 2, 2,
767 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
768 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
769 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
771 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
772 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
773 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
774 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
775 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
776 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
777 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
778 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
779 2, 2, 2, 2, 2, 2, 1, 2, 22, 23,
780 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
781 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
782 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
783 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
784 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
785 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
786 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
787 94, 95, 96, 97, 98
788};
789
790#if OCTAVE_DEBUG
791/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
792static const yytype_int16 yyrline[] =
793{
794 0, 418, 418, 429, 440, 447, 454, 463, 473, 475,
795 479, 490, 491, 495, 505, 507, 512, 513, 517, 527,
796 529, 533, 535, 537, 549, 559, 561, 569, 574, 578,
797 582, 584, 588, 590, 594, 598, 600, 604, 608, 610,
798 623, 624, 631, 633, 640, 647, 656, 664, 675, 688,
799 690, 692, 694, 699, 701, 703, 705, 709, 713, 717,
800 719, 721, 723, 725, 727, 731, 738, 740, 742, 744,
801 752, 760, 768, 776, 778, 780, 782, 784, 786, 788,
802 790, 792, 794, 796, 798, 800, 802, 804, 806, 808,
803 810, 812, 814, 818, 820, 822, 824, 832, 840, 848,
804 856, 858, 860, 862, 864, 866, 868, 870, 874, 882,
805 892, 894, 896, 898, 900, 902, 904, 906, 908, 910,
806 912, 914, 918, 930, 932, 934, 936, 938, 940, 942,
807 944, 946, 948, 950, 952, 954, 958, 973, 980, 988,
808 990, 992, 994, 996, 998, 1000, 1008, 1013, 1020, 1022,
809 1026, 1028, 1036, 1038, 1046, 1056, 1058, 1062, 1066, 1071,
810 1072, 1080, 1095, 1096, 1098, 1100, 1104, 1106, 1110, 1120,
811 1128, 1138, 1142, 1150, 1161, 1172, 1189, 1194, 1199, 1207,
812 1221, 1229, 1237, 1252, 1264, 1281, 1291, 1292, 1296, 1303,
813 1315, 1316, 1333, 1335, 1339, 1341, 1349, 1357, 1375, 1392,
814 1394, 1404, 1408, 1417, 1421, 1448, 1478, 1487, 1497, 1506,
815 1517, 1529, 1563, 1567, 1573, 1577, 1588, 1594, 1602, 1619,
816 1628, 1629, 1643, 1648, 1663, 1667, 1675, 1686, 1687, 1700,
817 1701, 1707, 1708, 1724, 1742, 1759, 1760, 1770, 1772, 1776,
818 1778, 1780, 1782, 1787, 1792, 1805, 1807, 1811, 1816, 1820,
819 1831, 1833, 1835, 1837, 1839, 1847, 1855, 1863, 1874, 1888,
820 1896, 1900, 1912, 1914, 1947, 1951, 1965, 1972, 1977, 1984,
821 1987, 1986, 2000, 2002, 2007, 2011, 2022, 2024, 2034, 2048,
822 2056, 2060, 2071, 2073, 2083, 2087, 2101, 2109, 2113, 2124,
823 2126, 2136, 2145, 2152, 2159, 2165, 2169, 2171, 2173, 2175,
824 2180, 2181, 2185, 2187, 2189, 2191, 2193, 2195, 2200, 2201
825};
826#endif
827
828/** Accessing symbol of state STATE. */
829#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
830
831#if OCTAVE_DEBUG || 0
832/* The user-facing name of the symbol whose (internal) number is
833 YYSYMBOL. No bounds checking. */
834static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
835
836/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
837 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
838static const char *const yytname[] =
839{
840 "\"end of file\"", "error", "\"invalid token\"", "'='", "':'", "'-'",
841 "'+'", "'*'", "'/'", "'~'", "'!'", "'('", "')'", "'['", "']'", "'{'",
842 "'}'", "'.'", "'@'", "','", "';'", "'\\n'", "ADD_EQ", "SUB_EQ", "MUL_EQ",
843 "DIV_EQ", "LEFTDIV_EQ", "POW_EQ", "EMUL_EQ", "EDIV_EQ", "ELEFTDIV_EQ",
844 "EPOW_EQ", "AND_EQ", "OR_EQ", "EXPR_AND_AND", "EXPR_OR_OR", "EXPR_AND",
845 "EXPR_OR", "EXPR_LT", "EXPR_LE", "EXPR_EQ", "EXPR_NE", "EXPR_GE",
846 "EXPR_GT", "LEFTDIV", "EMUL", "EDIV", "ELEFTDIV", "HERMITIAN",
847 "TRANSPOSE", "PLUS_PLUS", "MINUS_MINUS", "POW", "EPOW", "NUMBER",
848 "CONSTANT", "STRUCT_ELT", "NAME", "END", "DQ_STRING", "SQ_STRING", "FOR",
849 "PARFOR", "WHILE", "DO", "UNTIL", "SPMD", "IF", "ELSEIF", "ELSE",
850 "SWITCH", "CASE", "OTHERWISE", "BREAK", "CONTINUE", "RETURN", "UNWIND",
851 "CLEANUP", "TRY", "CATCH", "GLOBAL", "PERSISTENT", "FCN_HANDLE",
852 "CLASSDEF", "PROPERTIES", "METHODS", "EVENTS", "ENUMERATION",
853 "METAQUERY", "SUPERCLASSREF", "FQ_IDENT", "GET", "SET", "FUNCTION",
854 "ARGUMENTS", "LEXICAL_ERROR", "END_OF_INPUT", "INPUT_FILE", "UNARY",
855 "$accept", "input", "simple_list", "simple_list1", "statement_list",
856 "opt_list", "list", "list1", "opt_fcn_list", "fcn_list", "fcn_list1",
857 "statement", "word_list_cmd", "word_list", "identifier",
858 "superclass_identifier", "meta_identifier", "string", "constant",
859 "matrix", "matrix_rows", "cell", "cell_rows", "cell_or_matrix_row",
860 "fcn_handle", "anon_fcn_handle", "primary_expr", "magic_colon",
861 "magic_tilde", "arg_list", "indirect_ref_op", "oper_expr", "power_expr",
862 "colon_expr", "simple_expr", "assign_lhs", "assign_expr", "expression",
863 "command", "declaration", "decl_init_list", "decl_elt", "select_command",
864 "if_command", "if_clause_list", "if_clause", "elseif_clause",
865 "else_clause", "switch_command", "case_list", "case_list1",
866 "switch_case", "default_case", "loop_command", "jump_command",
867 "spmd_command", "except_command", "push_fcn_symtab", "param_list_beg",
868 "param_list_end", "opt_param_list", "param_list", "param_list1",
869 "param_list2", "param_list_elt", "return_list", "return_list1",
870 "parsing_local_fcns", "push_script_symtab", "begin_file", "file",
871 "function_beg", "fcn_name", "function_end", "function", "function_body",
872 "arguments_block_list", "arguments_block", "arguments_beg",
873 "args_attr_list", "args_validation_list", "arg_name", "arg_validation",
874 "size_spec", "class_name", "validation_fcns", "classdef_beg", "classdef",
875 "attr_list", "attr_list1", "attr", "superclass_list", "superclass_list1",
876 "superclass", "class_body", "class_body1", "properties_block",
877 "properties_beg", "property_list", "property_list1", "class_property",
878 "methods_block", "methods_beg", "method_decl1", "method_decl", "$@1",
879 "method", "method_list", "method_list1", "events_block", "events_beg",
880 "event_list", "event_list1", "class_event", "enum_block",
881 "enumeration_beg", "enum_list", "enum_list1", "class_enum", "stmt_begin",
882 "anon_fcn_begin", "parse_error", "sep_no_nl", "opt_sep_no_nl", "sep",
883 "opt_sep", YY_NULLPTR
884};
885
886static const char *
887yysymbol_name (yysymbol_kind_t yysymbol)
888{
889 return yytname[yysymbol];
890}
891#endif
892
893#define YYPACT_NINF (-376)
894
895#define yypact_value_is_default(Yyn) \
896 ((Yyn) == YYPACT_NINF)
897
898#define YYTABLE_NINF (-301)
899
900#define yytable_value_is_error(Yyn) \
901 0
902
903/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
904 STATE-NUM. */
905static const yytype_int16 yypact[] =
906{
907 516, -376, 1292, 1292, 1292, 1292, 1281, 1038, 1038, 6,
908 -376, -376, 1292, 1292, -376, -376, -376, -376, 1351, 1362,
909 1281, 113, 113, 113, 1281, -376, -376, -376, 113, 113,
910 1, 1, -376, -376, -376, -376, 68, -3, 175, -376,
911 -376, -12, -376, -376, -376, -376, -376, -376, -376, -376,
912 -376, 1441, -376, 607, 696, -376, -376, -376, -376, -376,
913 -376, 151, -376, -376, -376, -376, -376, -376, 14, -27,
914 113, -376, 20, -376, -376, 204, -376, -376, 275, 275,
915 275, 275, 79, -376, 1292, 1266, 102, -376, -376, -376,
916 101, -376, 131, -376, -376, 28, -376, 275, 275, 1281,
917 321, 145, 1281, 147, -376, -376, -376, -376, 89, 121,
918 938, 100, 1281, 113, 97, -19, 187, 1, -376, 1,
919 -376, -376, -376, 776, -376, -12, -376, 1292, 1292, 1292,
920 1292, 1292, 1104, 1119, -376, 1292, 1292, 1292, 1292, -376,
921 -376, -376, -376, 1377, 1377, 17, 1292, 1292, 1292, 1292,
922 1292, 1292, 1292, 1292, 1292, 1292, 1281, 1281, 1281, 1281,
923 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 113,
924 113, -376, 120, -376, -376, 115, 857, 18, 179, 192,
925 218, 222, 6, -376, -376, -376, 211, -376, 1038, 1266,
926 -376, 1038, -376, -376, -376, -376, 228, 231, -376, 1023,
927 708, 1281, 775, 1281, 113, 1281, -376, -376, -376, -376,
928 -376, 113, -376, -376, -376, 167, 113, -376, 113, 1281,
929 -376, -376, -376, 1456, 1467, 1467, 275, 275, -376, 34,
930 -376, 136, 275, 275, 275, 275, 1377, 1377, 1377, 1377,
931 1377, 1377, -376, 176, 176, 1281, -376, 226, 310, 343,
932 333, -376, -376, -376, -376, -376, -376, -376, -376, -376,
933 -376, -376, -376, -376, -376, -376, -376, -376, -376, -376,
934 1281, -376, -376, -376, -376, 240, -376, -376, -376, 65,
935 1, 1, 37, 113, -376, 1266, -376, -376, -376, -376,
936 -376, -376, -376, -1, -376, -376, 1281, -376, 1281, -376,
937 212, -376, 695, -376, 113, 113, 113, 214, 167, -376,
938 -376, 216, 938, -376, 1292, -376, 1266, -376, 176, 176,
939 176, 176, 176, 176, 1185, 1200, -376, -376, 30, 264,
940 -376, 25, 1, 113, -376, 1, -376, -376, -376, 6,
941 -376, -39, 609, -376, 265, 113, 260, 113, -376, -376,
942 -376, 1281, -376, -376, -376, -376, -376, 225, 440, -376,
943 55, -376, 156, 1281, -376, -376, 113, 1, 1, 281,
944 57, -376, 113, 194, -376, 113, -376, -376, -376, -376,
945 113, -376, 113, 113, 227, 1281, 233, -376, -376, -376,
946 -376, 277, -376, -376, -376, 1281, 113, 25, 256, 199,
947 -376, 113, -376, -39, -376, 609, 285, 239, -376, 286,
948 -376, 113, -376, -376, -376, -376, 210, 114, 45, -376,
949 194, -376, -376, 1, 1, -376, 113, -376, -376, -376,
950 -376, -376, -376, -376, 245, 113, -376, 113, -376, 113,
951 -376, 113, -376, 113, 210, -376, -376, 292, -376, 113,
952 296, 250, -376, 114, 240, 240, 240, 240, -376, -376,
953 23, 251, 1266, -376, 1, -376, -376, -376, -376, -376,
954 1, 32, 1, 1, 296, -376, 59, -376, 295, 296,
955 253, 113, -376, 48, 311, -376, -376, -376, -376, 255,
956 113, -376, 258, 113, -376, 306, 262, 113, -376, -376,
957 -376, 1266, 315, -376, -376, 23, -376, -376, -376, -376,
958 39, -376, 1, 1281, -376, 1, 191, 1281, -376, 1,
959 -376, -376, 309, -376, -376, -376, 6, -376, -376
960};
961
962/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
963 Performed when YYTABLE does not specify something else to do. Zero
964 means the default is an error. */
965static const yytype_int16 yydefact[] =
966{
967 0, 295, 0, 0, 0, 0, 0, 40, 40, 0,
968 296, 297, 0, 0, 32, 27, 30, 31, 0, 0,
969 0, 308, 308, 308, 0, 176, 177, 178, 308, 308,
970 0, 0, 46, 29, 28, 294, 0, 0, 300, 8,
971 23, 49, 55, 54, 33, 50, 52, 53, 51, 138,
972 66, 110, 111, 136, 0, 137, 21, 22, 139, 140,
973 152, 159, 155, 153, 141, 142, 143, 144, 0, 0,
974 308, 4, 0, 145, 5, 301, 6, 49, 82, 81,
975 79, 80, 0, 57, 58, 41, 0, 35, 60, 61,
976 42, 59, 0, 38, 184, 0, 293, 77, 78, 0,
977 122, 0, 0, 0, 292, 302, 303, 304, 0, 309,
978 11, 0, 0, 308, 0, 0, 150, 146, 148, 147,
979 1, 2, 3, 301, 7, 24, 25, 0, 0, 0,
980 0, 0, 0, 0, 65, 0, 0, 0, 0, 73,
981 74, 67, 68, 0, 0, 0, 0, 0, 0, 0,
982 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
983 0, 0, 0, 0, 0, 0, 0, 0, 0, 308,
984 308, 156, 0, 206, 203, 0, 11, 0, 0, 0,
985 207, 0, 186, 298, 299, 56, 44, 34, 40, 43,
986 37, 40, 189, 58, 195, 194, 0, 191, 192, 0,
987 0, 0, 0, 0, 308, 0, 305, 306, 307, 10,
988 12, 308, 14, 179, 292, 162, 308, 182, 308, 0,
989 149, 9, 26, 108, 86, 85, 87, 88, 69, 0,
990 71, 0, 91, 89, 90, 92, 0, 0, 0, 0,
991 0, 0, 93, 83, 84, 0, 75, 120, 121, 118,
992 119, 112, 113, 114, 117, 115, 116, 123, 124, 125,
993 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
994 0, 160, 154, 204, 233, 235, 201, 196, 199, 0,
995 0, 0, 0, 308, 187, 45, 36, 62, 63, 64,
996 39, 185, 188, 0, 48, 47, 0, 292, 0, 292,
997 0, 171, 309, 13, 308, 308, 308, 0, 164, 166,
998 163, 0, 11, 151, 0, 70, 0, 72, 107, 106,
999 104, 105, 102, 103, 0, 0, 94, 95, 0, 0,
1000 292, 0, 0, 308, 198, 0, 208, 209, 207, 186,
1001 214, 0, 11, 193, 0, 308, 123, 308, 170, 15,
1002 157, 0, 169, 161, 167, 165, 180, 0, 109, 96,
1003 0, 98, 0, 0, 100, 76, 308, 0, 0, 239,
1004 0, 237, 308, 16, 200, 308, 210, 211, 212, 219,
1005 308, 216, 308, 308, 0, 0, 0, 292, 181, 97,
1006 99, 0, 158, 241, 242, 0, 308, 0, 243, 0,
1007 17, 308, 19, 0, 215, 11, 220, 0, 172, 0,
1008 174, 308, 101, 240, 236, 238, 0, 248, 308, 205,
1009 18, 213, 217, 0, 0, 173, 308, 168, 247, 245,
1010 259, 266, 279, 286, 0, 308, 250, 308, 251, 308,
1011 252, 308, 253, 308, 0, 244, 20, 0, 224, 308,
1012 227, 0, 234, 249, 235, 235, 235, 235, 246, 221,
1013 309, 0, 0, 222, 229, 175, 254, 255, 256, 257,
1014 260, 183, 280, 287, 227, 218, 0, 230, 231, 227,
1015 0, 308, 262, 267, 0, 273, 269, 272, 276, 0,
1016 308, 284, 0, 308, 282, 0, 0, 308, 289, 223,
1017 228, 0, 225, 264, 258, 309, 261, 268, 270, 265,
1018 183, 278, 281, 0, 285, 288, 0, 0, 263, 0,
1019 277, 283, 0, 290, 232, 226, 267, 271, 291
1020};
1021
1022/* YYPGOTO[NTERM-NUM]. */
1023static const yytype_int16 yypgoto[] =
1024{
1025 -376, -376, -376, -376, 33, 21, -376, -376, -376, -376,
1026 -376, 4, -376, -376, 0, -376, -376, -17, -376, -376,
1027 -376, -376, -376, -2, -376, -376, -56, -167, -88, -83,
1028 -87, 8, -23, -376, 106, 7, -376, 3, -376, -376,
1029 298, -81, -376, -376, -376, -376, -376, -376, -376, -376,
1030 -376, 22, 26, -376, -376, -376, -376, -376, -376, -376,
1031 2, -8, -376, -376, 43, 266, -376, -376, -376, -376,
1032 -376, -376, 58, -33, -357, 12, -376, -28, -376, -376,
1033 -376, -71, -375, -376, -376, -376, -376, -376, -210, -376,
1034 -7, -376, -376, -53, -376, -376, -61, -376, -376, -376,
1035 -111, -58, -376, -123, -376, -376, -110, -376, -376, -52,
1036 -376, -376, -376, -109, -51, -376, -376, -376, -108, -199,
1037 -376, -376, 366, 368, -206, 60
1038};
1039
1040/* YYDEFGOTO[NTERM-NUM]. */
1041static const yytype_int16 yydefgoto[] =
1042{
1043 0, 36, 37, 38, 340, 209, 210, 211, 399, 400,
1044 401, 212, 40, 125, 77, 42, 43, 44, 45, 46,
1045 86, 47, 92, 87, 48, 49, 50, 88, 89, 90,
1046 145, 51, 243, 52, 53, 54, 55, 91, 57, 58,
1047 117, 118, 59, 60, 61, 62, 171, 172, 63, 307,
1048 308, 309, 310, 64, 65, 66, 67, 68, 95, 292,
1049 283, 284, 196, 197, 198, 484, 279, 333, 69, 70,
1050 71, 72, 182, 378, 73, 341, 380, 381, 382, 424,
1051 449, 450, 463, 464, 478, 502, 275, 276, 332, 370,
1052 371, 417, 418, 429, 434, 435, 436, 437, 480, 481,
1053 482, 438, 439, 486, 487, 519, 488, 489, 490, 440,
1054 441, 492, 493, 494, 442, 443, 496, 497, 498, 204,
1055 199, 74, 75, 76, 109, 110
1056};
1057
1058/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1059 positive, shift that token. If negative, reduce the rule whose
1060 number is the opposite. If YYTABLE_NINF, syntax error. */
1061static const yytype_int16 yytable[] =
1062{
1063 41, 96, 186, 56, 39, 302, 93, 194, 193, 82,
1064 78, 79, 80, 81, 195, 304, 402, 94, 121, 376,
1065 97, 98, 287, 104, 126, 101, 103, 113, 245, 192,
1066 116, 116, 277, 177, 367, 368, 220, 193, 220, 217,
1067 -190, 363, 206, 207, 208, 177, 315, 16, 17, 229,
1068 231, -197, 177, 316, 108, 111, 15, 377, 15, 94,
1069 218, 114, 115, 446, 105, 106, 107, 389, 120, 396,
1070 174, 500, 180, 246, 316, 15, 397, 15, 316, 334,
1071 15, 444, 15, 112, 335, 15, 364, 242, 242, 15,
1072 -274, 185, 80, 122, 15, 116, 15, -275, 345, 499,
1073 347, 288, 82, 175, 503, 82, 200, 173, 222, 202,
1074 41, 178, 179, 56, 485, 214, 187, 116, 287, 116,
1075 189, 244, 188, 41, 100, 100, 56, 221, 178, 179,
1076 176, 366, 105, 106, 107, 223, 224, 225, 226, 227,
1077 206, 207, 208, 232, 233, 234, 235, 190, 201, 287,
1078 203, 191, 317, 485, 205, 316, 328, 328, 213, 257,
1079 258, 259, 260, 261, 262, 263, 264, 265, 266, 267,
1080 268, 269, 390, 215, 216, 316, 41, 278, 272, 56,
1081 242, 242, 242, 242, 242, 242, 286, 324, 411, 290,
1082 219, 325, 289, 134, 10, 11, 280, 288, 430, 431,
1083 432, 433, 295, 271, 297, 194, 299, 524, 301, 281,
1084 316, 273, 195, 318, 319, 320, 321, 322, 323, 169,
1085 170, -197, 313, 183, 184, 282, 326, 327, 288, 270,
1086 285, 328, 328, 328, 328, 328, 328, 300, 305, 306,
1087 291, 360, 362, 460, 470, 471, 472, 473, 329, 311,
1088 293, 331, 247, 248, 249, 250, 251, 252, 253, 254,
1089 255, 256, 148, 149, 150, 151, 152, 153, 154, 155,
1090 348, 303, 353, 330, 356, 505, 365, 383, 312, 385,
1091 336, 337, 338, 388, 395, 408, 132, -183, 289, 412,
1092 133, 410, 134, 116, 416, 419, 423, 425, 426, 344,
1093 428, 346, 41, 452, 459, 56, 349, 462, 465, 475,
1094 501, 504, 41, 509, 508, 56, 511, 513, 517, 289,
1095 514, 528, 358, 139, 140, 141, 142, 143, 144, 119,
1096 354, 369, 372, 357, 355, 374, 343, 350, 181, 352,
1097 339, 375, 41, 342, 146, 56, 148, 149, 150, 151,
1098 152, 153, 154, 155, 387, 146, 147, 148, 149, 150,
1099 151, 152, 153, 154, 155, 351, 391, 393, 394, 148,
1100 421, 150, 151, 152, 153, 154, 155, 422, 384, 476,
1101 386, 150, 151, 152, 153, 154, 155, 403, 409, 474,
1102 415, 458, 466, 373, 518, 467, 527, 369, 413, 392,
1103 520, 468, 469, 521, 123, 41, 124, 523, 56, 0,
1104 0, 0, 0, 404, 0, 0, 407, 0, 516, 0,
1105 0, 0, 0, 447, 448, 0, 0, 0, 0, 0,
1106 0, 0, 398, 0, 0, 342, 0, 0, 0, 0,
1107 405, 0, 406, 0, 427, 128, 129, 130, 131, 0,
1108 0, 132, 0, 0, 0, 133, 414, 134, 0, 451,
1109 448, 420, 0, 0, 477, 0, 0, 0, 0, 0,
1110 479, 483, 491, 495, 0, 507, 0, 0, 445, 0,
1111 0, 0, 0, 0, 135, 136, 137, 138, 139, 140,
1112 141, 142, 143, 144, 0, 453, 0, 454, 0, 455,
1113 0, 456, 0, 457, 0, 479, 0, 0, 0, 461,
1114 483, 0, 491, 0, 0, 495, 522, 1, 507, 526,
1115 525, 2, 3, 0, 0, 4, 5, 6, 0, 7,
1116 0, 8, 0, 0, 9, 10, 11, -300, 0, 0,
1117 0, 506, 0, 0, 0, 0, 0, 0, 0, 0,
1118 510, 0, 0, 512, 0, 0, 0, 515, 0, 0,
1119 0, 0, 0, 0, 0, 0, 12, 13, 0, 0,
1120 14, 0, 0, 15, 0, 16, 17, 18, 19, 20,
1121 21, 0, 22, 23, 0, 0, 24, 0, 0, 25,
1122 26, 27, 28, 0, 29, 0, 30, 31, 32, 0,
1123 0, 0, 0, 0, 33, 34, 0, 0, 0, -183,
1124 -122, 35, -300, -202, 2, 3, 0, 0, 4, 5,
1125 6, 0, 7, 0, 8, 0, 0, 9, 0, -122,
1126 -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
1127 -122, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1128 155, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1129 13, 0, 0, 14, 0, 0, 15, 0, 16, 17,
1130 18, 19, 20, 21, 0, 22, 23, 0, 0, 24,
1131 0, 0, 25, 26, 27, 28, 0, 29, 0, 30,
1132 31, 32, 0, 0, 0, 0, 0, 33, 34, 156,
1133 2, 3, -183, 379, 4, 5, 6, 0, 7, 0,
1134 8, 296, 0, 9, 206, 207, 208, 0, 157, 158,
1135 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1136 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
1137 167, 168, 0, 0, 0, 12, 13, 0, 0, 14,
1138 0, 0, 15, 0, 16, 17, 18, 19, 20, 21,
1139 0, 22, 23, 0, 0, 24, 0, 0, 25, 26,
1140 27, 28, 0, 29, 0, 30, 31, 32, 298, 0,
1141 0, 2, 3, 33, 34, 4, 5, 6, -183, 7,
1142 0, 8, 0, 0, 9, 183, 184, 157, 158, 159,
1143 160, 161, 162, 163, 164, 165, 166, 167, 168, 0,
1144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1145 0, 0, 0, 0, 0, 0, 12, 13, 0, 0,
1146 14, 0, 0, 15, 0, 16, 17, 18, 19, 20,
1147 21, 0, 22, 23, 0, 0, 24, 0, 0, 25,
1148 26, 27, 28, 0, 29, 0, 30, 31, 32, 0,
1149 0, 0, 2, 3, 33, 34, 4, 5, 6, -183,
1150 7, 0, 8, 0, 0, 9, 0, 0, 0, 0,
1151 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1152 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1153 0, 0, 0, 0, 0, 0, 0, 12, 13, 0,
1154 0, 14, 0, 0, 15, 0, 16, 17, 18, 19,
1155 20, 21, 0, 22, 23, 0, 0, 24, 0, 0,
1156 25, 26, 27, 28, 0, 29, 0, 30, 31, 32,
1157 274, 0, 0, 2, 3, 33, 34, 4, 5, 6,
1158 -183, 7, 0, 8, 0, 0, 9, 0, 0, 0,
1159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1160 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1161 0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
1162 0, 0, 14, 0, 0, 15, 0, 16, 17, 18,
1163 19, 20, 21, 0, 22, 23, 0, 0, 24, 0,
1164 0, 25, 26, 27, 28, 0, 29, 0, 30, 31,
1165 32, 0, 0, 0, 294, 0, 33, 34, 2, 3,
1166 0, -183, 4, 5, 6, 0, 7, 0, 8, 0,
1167 0, 9, 83, 2, 3, 0, 0, 84, 5, 6,
1168 0, 7, 0, 8, 0, 0, 9, 85, 0, 0,
1169 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1170 0, 0, 0, 12, 13, 0, 0, 14, 0, 0,
1171 15, 0, 16, 17, 0, 0, 0, 0, 12, 13,
1172 0, 0, 14, 0, 0, 15, 0, 16, 17, 0,
1173 0, 0, 0, 0, 0, 32, 0, 0, 83, 2,
1174 3, 33, 34, 84, 5, 6, 228, 7, 0, 8,
1175 32, 0, 9, 83, 2, 3, 33, 34, 84, 5,
1176 6, 0, 7, 0, 8, 230, 0, 9, 0, 0,
1177 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1178 0, 0, 0, 0, 12, 13, 0, 0, 14, 0,
1179 0, 15, 0, 16, 17, 0, 0, 0, 0, 12,
1180 13, 0, 0, 14, 0, 0, 15, 0, 16, 17,
1181 0, 0, 0, 0, 0, 0, 32, 0, 0, 83,
1182 2, 3, 33, 34, 84, 5, 6, 359, 7, 0,
1183 8, 32, 0, 9, 83, 2, 3, 33, 34, 84,
1184 5, 6, 0, 7, 0, 8, 361, 0, 9, 0,
1185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1186 0, 0, 0, 0, 0, 12, 13, 0, 0, 14,
1187 0, 0, 15, 0, 16, 17, 0, 0, 0, 0,
1188 12, 13, 0, 0, 14, 0, 0, 15, 0, 16,
1189 17, 0, 0, 0, 0, 0, 0, 32, 0, 0,
1190 83, 2, 3, 33, 34, 84, 5, 6, 0, 7,
1191 0, 8, 32, 0, 9, 0, 2, 3, 33, 34,
1192 4, 5, 6, 0, 7, 0, 8, 2, 3, 9,
1193 0, 4, 5, 6, 0, 7, 0, 8, 0, 0,
1194 0, 0, 0, 0, 0, 0, 12, 13, 0, 0,
1195 14, 0, 0, 15, 0, 16, 17, 0, 0, 0,
1196 0, 12, 13, 0, 0, 14, 0, 0, 15, 0,
1197 16, 17, 12, 13, 0, 0, 14, 0, 32, 15,
1198 0, 16, 17, 0, 33, 34, 2, 3, 0, 0,
1199 4, 5, 99, 32, 7, 0, 8, 2, 3, 33,
1200 34, 4, 5, 102, 32, 7, 0, 8, 0, 0,
1201 33, 34, 236, 237, 0, 0, 238, 239, 6, 0,
1202 7, 0, 8, 0, 0, 0, 0, 0, 0, 0,
1203 0, 12, 13, 0, 0, 14, 0, 0, 15, 0,
1204 16, 17, 12, 13, 0, 0, 14, 0, 0, 15,
1205 0, 16, 17, 0, 0, 0, 0, 240, 241, 0,
1206 0, 14, 0, 32, 15, 0, 16, 17, 0, 33,
1207 34, 0, 0, 0, 32, 127, 128, 129, 130, 131,
1208 33, 34, 132, 0, 0, 0, 133, 0, 134, 32,
1209 314, 128, 129, 130, 131, 33, 34, 132, 0, 0,
1210 0, 133, 0, 134, 130, 131, 0, 0, 132, 0,
1211 0, 0, 133, 0, 134, 135, 136, 137, 138, 139,
1212 140, 141, 142, 143, 144, 0, 0, 0, 0, 0,
1213 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1214 0, 135, 136, 137, 138, 139, 140, 141, 142, 143,
1215 144
1216};
1217
1218static const yytype_int16 yycheck[] =
1219{
1220 0, 9, 85, 0, 0, 211, 8, 95, 9, 6,
1221 2, 3, 4, 5, 95, 214, 373, 11, 21, 58,
1222 12, 13, 189, 20, 41, 18, 19, 24, 11, 1,
1223 30, 31, 14, 13, 9, 10, 117, 9, 119, 58,
1224 12, 11, 19, 20, 21, 13, 12, 59, 60, 132,
1225 133, 3, 13, 19, 21, 22, 57, 96, 57, 11,
1226 79, 28, 29, 420, 19, 20, 21, 12, 0, 12,
1227 97, 12, 72, 56, 19, 57, 19, 57, 19, 14,
1228 57, 36, 57, 23, 19, 57, 56, 143, 144, 57,
1229 58, 12, 84, 96, 57, 95, 57, 58, 297, 474,
1230 299, 189, 99, 70, 479, 102, 99, 93, 125, 102,
1231 110, 91, 92, 110, 471, 112, 14, 117, 285, 119,
1232 19, 144, 20, 123, 18, 19, 123, 123, 91, 92,
1233 70, 330, 19, 20, 21, 127, 128, 129, 130, 131,
1234 19, 20, 21, 135, 136, 137, 138, 16, 3, 316,
1235 3, 20, 16, 510, 65, 19, 243, 244, 58, 156,
1236 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
1237 167, 168, 16, 113, 77, 19, 176, 177, 58, 176,
1238 236, 237, 238, 239, 240, 241, 188, 11, 387, 191,
1239 3, 15, 189, 17, 19, 20, 17, 285, 84, 85,
1240 86, 87, 199, 170, 201, 293, 203, 16, 205, 17,
1241 19, 96, 293, 236, 237, 238, 239, 240, 241, 68,
1242 69, 3, 219, 19, 20, 3, 50, 51, 316, 169,
1243 19, 318, 319, 320, 321, 322, 323, 204, 71, 72,
1244 12, 324, 325, 449, 454, 455, 456, 457, 245, 216,
1245 19, 11, 146, 147, 148, 149, 150, 151, 152, 153,
1246 154, 155, 36, 37, 38, 39, 40, 41, 42, 43,
1247 58, 211, 58, 270, 58, 481, 12, 12, 218, 19,
1248 280, 281, 282, 58, 3, 58, 11, 93, 285, 12,
1249 15, 58, 17, 293, 38, 96, 11, 58, 12, 296,
1250 90, 298, 302, 58, 12, 302, 302, 11, 58, 58,
1251 15, 58, 312, 58, 3, 312, 58, 11, 3, 316,
1252 58, 12, 314, 48, 49, 50, 51, 52, 53, 31,
1253 308, 331, 332, 312, 308, 335, 293, 304, 72, 306,
1254 282, 339, 342, 283, 34, 342, 36, 37, 38, 39,
1255 40, 41, 42, 43, 351, 34, 35, 36, 37, 38,
1256 39, 40, 41, 42, 43, 305, 363, 367, 368, 36,
1257 403, 38, 39, 40, 41, 42, 43, 405, 345, 462,
1258 347, 38, 39, 40, 41, 42, 43, 375, 385, 460,
1259 397, 444, 453, 333, 505, 453, 519, 397, 395, 366,
1260 510, 453, 453, 512, 38, 405, 38, 515, 405, -1,
1261 -1, -1, -1, 380, -1, -1, 383, -1, 501, -1,
1262 -1, -1, -1, 423, 424, -1, -1, -1, -1, -1,
1263 -1, -1, 372, -1, -1, 375, -1, -1, -1, -1,
1264 380, -1, 382, -1, 411, 5, 6, 7, 8, -1,
1265 -1, 11, -1, -1, -1, 15, 396, 17, -1, 426,
1266 460, 401, -1, -1, 464, -1, -1, -1, -1, -1,
1267 470, 471, 472, 473, -1, 483, -1, -1, 418, -1,
1268 -1, -1, -1, -1, 44, 45, 46, 47, 48, 49,
1269 50, 51, 52, 53, -1, 435, -1, 437, -1, 439,
1270 -1, 441, -1, 443, -1, 505, -1, -1, -1, 449,
1271 510, -1, 512, -1, -1, 515, 513, 1, 526, 519,
1272 517, 5, 6, -1, -1, 9, 10, 11, -1, 13,
1273 -1, 15, -1, -1, 18, 19, 20, 21, -1, -1,
1274 -1, 481, -1, -1, -1, -1, -1, -1, -1, -1,
1275 490, -1, -1, 493, -1, -1, -1, 497, -1, -1,
1276 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1277 54, -1, -1, 57, -1, 59, 60, 61, 62, 63,
1278 64, -1, 66, 67, -1, -1, 70, -1, -1, 73,
1279 74, 75, 76, -1, 78, -1, 80, 81, 82, -1,
1280 -1, -1, -1, -1, 88, 89, -1, -1, -1, 93,
1281 3, 95, 96, 97, 5, 6, -1, -1, 9, 10,
1282 11, -1, 13, -1, 15, -1, -1, 18, -1, 22,
1283 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1284 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
1285 43, -1, -1, -1, -1, -1, -1, -1, -1, 50,
1286 51, -1, -1, 54, -1, -1, 57, -1, 59, 60,
1287 61, 62, 63, 64, -1, 66, 67, -1, -1, 70,
1288 -1, -1, 73, 74, 75, 76, -1, 78, -1, 80,
1289 81, 82, -1, -1, -1, -1, -1, 88, 89, 3,
1290 5, 6, 93, 94, 9, 10, 11, -1, 13, -1,
1291 15, 3, -1, 18, 19, 20, 21, -1, 22, 23,
1292 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1293 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1294 32, 33, -1, -1, -1, 50, 51, -1, -1, 54,
1295 -1, -1, 57, -1, 59, 60, 61, 62, 63, 64,
1296 -1, 66, 67, -1, -1, 70, -1, -1, 73, 74,
1297 75, 76, -1, 78, -1, 80, 81, 82, 3, -1,
1298 -1, 5, 6, 88, 89, 9, 10, 11, 93, 13,
1299 -1, 15, -1, -1, 18, 19, 20, 22, 23, 24,
1300 25, 26, 27, 28, 29, 30, 31, 32, 33, -1,
1301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1302 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1303 54, -1, -1, 57, -1, 59, 60, 61, 62, 63,
1304 64, -1, 66, 67, -1, -1, 70, -1, -1, 73,
1305 74, 75, 76, -1, 78, -1, 80, 81, 82, -1,
1306 -1, -1, 5, 6, 88, 89, 9, 10, 11, 93,
1307 13, -1, 15, -1, -1, 18, -1, -1, -1, -1,
1308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1310 -1, -1, -1, -1, -1, -1, -1, 50, 51, -1,
1311 -1, 54, -1, -1, 57, -1, 59, 60, 61, 62,
1312 63, 64, -1, 66, 67, -1, -1, 70, -1, -1,
1313 73, 74, 75, 76, -1, 78, -1, 80, 81, 82,
1314 83, -1, -1, 5, 6, 88, 89, 9, 10, 11,
1315 93, 13, -1, 15, -1, -1, 18, -1, -1, -1,
1316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1318 -1, -1, -1, -1, -1, -1, -1, -1, 50, 51,
1319 -1, -1, 54, -1, -1, 57, -1, 59, 60, 61,
1320 62, 63, 64, -1, 66, 67, -1, -1, 70, -1,
1321 -1, 73, 74, 75, 76, -1, 78, -1, 80, 81,
1322 82, -1, -1, -1, 1, -1, 88, 89, 5, 6,
1323 -1, 93, 9, 10, 11, -1, 13, -1, 15, -1,
1324 -1, 18, 4, 5, 6, -1, -1, 9, 10, 11,
1325 -1, 13, -1, 15, -1, -1, 18, 19, -1, -1,
1326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1327 -1, -1, -1, 50, 51, -1, -1, 54, -1, -1,
1328 57, -1, 59, 60, -1, -1, -1, -1, 50, 51,
1329 -1, -1, 54, -1, -1, 57, -1, 59, 60, -1,
1330 -1, -1, -1, -1, -1, 82, -1, -1, 4, 5,
1331 6, 88, 89, 9, 10, 11, 12, 13, -1, 15,
1332 82, -1, 18, 4, 5, 6, 88, 89, 9, 10,
1333 11, -1, 13, -1, 15, 16, -1, 18, -1, -1,
1334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1335 -1, -1, -1, -1, 50, 51, -1, -1, 54, -1,
1336 -1, 57, -1, 59, 60, -1, -1, -1, -1, 50,
1337 51, -1, -1, 54, -1, -1, 57, -1, 59, 60,
1338 -1, -1, -1, -1, -1, -1, 82, -1, -1, 4,
1339 5, 6, 88, 89, 9, 10, 11, 12, 13, -1,
1340 15, 82, -1, 18, 4, 5, 6, 88, 89, 9,
1341 10, 11, -1, 13, -1, 15, 16, -1, 18, -1,
1342 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1343 -1, -1, -1, -1, -1, 50, 51, -1, -1, 54,
1344 -1, -1, 57, -1, 59, 60, -1, -1, -1, -1,
1345 50, 51, -1, -1, 54, -1, -1, 57, -1, 59,
1346 60, -1, -1, -1, -1, -1, -1, 82, -1, -1,
1347 4, 5, 6, 88, 89, 9, 10, 11, -1, 13,
1348 -1, 15, 82, -1, 18, -1, 5, 6, 88, 89,
1349 9, 10, 11, -1, 13, -1, 15, 5, 6, 18,
1350 -1, 9, 10, 11, -1, 13, -1, 15, -1, -1,
1351 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1352 54, -1, -1, 57, -1, 59, 60, -1, -1, -1,
1353 -1, 50, 51, -1, -1, 54, -1, -1, 57, -1,
1354 59, 60, 50, 51, -1, -1, 54, -1, 82, 57,
1355 -1, 59, 60, -1, 88, 89, 5, 6, -1, -1,
1356 9, 10, 11, 82, 13, -1, 15, 5, 6, 88,
1357 89, 9, 10, 11, 82, 13, -1, 15, -1, -1,
1358 88, 89, 5, 6, -1, -1, 9, 10, 11, -1,
1359 13, -1, 15, -1, -1, -1, -1, -1, -1, -1,
1360 -1, 50, 51, -1, -1, 54, -1, -1, 57, -1,
1361 59, 60, 50, 51, -1, -1, 54, -1, -1, 57,
1362 -1, 59, 60, -1, -1, -1, -1, 50, 51, -1,
1363 -1, 54, -1, 82, 57, -1, 59, 60, -1, 88,
1364 89, -1, -1, -1, 82, 4, 5, 6, 7, 8,
1365 88, 89, 11, -1, -1, -1, 15, -1, 17, 82,
1366 4, 5, 6, 7, 8, 88, 89, 11, -1, -1,
1367 -1, 15, -1, 17, 7, 8, -1, -1, 11, -1,
1368 -1, -1, 15, -1, 17, 44, 45, 46, 47, 48,
1369 49, 50, 51, 52, 53, -1, -1, -1, -1, -1,
1370 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1371 -1, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1372 53
1373};
1374
1375/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1376 state STATE-NUM. */
1377static const yytype_uint8 yystos[] =
1378{
1379 0, 1, 5, 6, 9, 10, 11, 13, 15, 18,
1380 19, 20, 50, 51, 54, 57, 59, 60, 61, 62,
1381 63, 64, 66, 67, 70, 73, 74, 75, 76, 78,
1382 80, 81, 82, 88, 89, 95, 100, 101, 102, 110,
1383 111, 113, 114, 115, 116, 117, 118, 120, 123, 124,
1384 125, 130, 132, 133, 134, 135, 136, 137, 138, 141,
1385 142, 143, 144, 147, 152, 153, 154, 155, 156, 167,
1386 168, 169, 170, 173, 220, 221, 222, 113, 130, 130,
1387 130, 130, 136, 4, 9, 19, 119, 122, 126, 127,
1388 128, 136, 121, 122, 11, 157, 160, 130, 130, 11,
1389 133, 134, 11, 134, 136, 19, 20, 21, 103, 223,
1390 224, 103, 224, 136, 103, 103, 113, 139, 140, 139,
1391 0, 21, 96, 221, 222, 112, 116, 4, 5, 6,
1392 7, 8, 11, 15, 17, 44, 45, 46, 47, 48,
1393 49, 50, 51, 52, 53, 129, 34, 35, 36, 37,
1394 38, 39, 40, 41, 42, 43, 3, 22, 23, 24,
1395 25, 26, 27, 28, 29, 30, 31, 32, 33, 68,
1396 69, 145, 146, 93, 97, 103, 224, 13, 91, 92,
1397 113, 164, 171, 19, 20, 12, 128, 14, 20, 19,
1398 16, 20, 1, 9, 127, 140, 161, 162, 163, 219,
1399 134, 3, 134, 3, 218, 65, 19, 20, 21, 104,
1400 105, 106, 110, 58, 136, 224, 77, 58, 79, 3,
1401 140, 110, 116, 130, 130, 130, 130, 130, 12, 128,
1402 16, 128, 130, 130, 130, 130, 5, 6, 9, 10,
1403 50, 51, 125, 131, 131, 11, 56, 133, 133, 133,
1404 133, 133, 133, 133, 133, 133, 133, 136, 136, 136,
1405 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1406 224, 103, 58, 96, 83, 185, 186, 14, 113, 165,
1407 17, 17, 3, 159, 160, 19, 122, 126, 127, 136,
1408 122, 12, 158, 19, 1, 136, 3, 136, 3, 136,
1409 103, 136, 223, 224, 218, 71, 72, 148, 149, 150,
1410 151, 103, 224, 136, 4, 12, 19, 16, 131, 131,
1411 131, 131, 131, 131, 11, 15, 50, 51, 129, 136,
1412 136, 11, 187, 166, 14, 19, 113, 113, 113, 171,
1413 103, 174, 224, 163, 136, 218, 136, 218, 58, 110,
1414 103, 224, 103, 58, 150, 151, 58, 104, 130, 12,
1415 128, 16, 128, 11, 56, 12, 218, 9, 10, 113,
1416 188, 189, 113, 224, 113, 159, 58, 96, 172, 94,
1417 175, 176, 177, 12, 103, 19, 103, 136, 58, 12,
1418 16, 136, 103, 113, 113, 3, 12, 19, 224, 107,
1419 108, 109, 173, 174, 103, 224, 224, 103, 58, 136,
1420 58, 218, 12, 136, 224, 189, 38, 190, 191, 96,
1421 224, 172, 176, 11, 178, 58, 12, 103, 90, 192,
1422 84, 85, 86, 87, 193, 194, 195, 196, 200, 201,
1423 208, 209, 213, 214, 36, 224, 173, 113, 113, 179,
1424 180, 103, 58, 224, 224, 224, 224, 224, 192, 12,
1425 223, 224, 11, 181, 182, 58, 195, 200, 208, 213,
1426 187, 187, 187, 187, 180, 58, 128, 113, 183, 113,
1427 197, 198, 199, 113, 164, 173, 202, 203, 205, 206,
1428 207, 113, 210, 211, 212, 113, 215, 216, 217, 181,
1429 12, 15, 184, 181, 58, 223, 224, 160, 3, 58,
1430 224, 58, 224, 11, 58, 224, 128, 3, 199, 204,
1431 205, 212, 136, 217, 16, 136, 113, 202, 12
1432};
1433
1434/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1435static const yytype_uint8 yyr1[] =
1436{
1437 0, 99, 100, 100, 100, 100, 101, 101, 102, 102,
1438 103, 104, 104, 105, 106, 106, 107, 107, 108, 109,
1439 109, 110, 110, 110, 111, 112, 112, 113, 114, 115,
1440 116, 116, 117, 117, 118, 119, 119, 120, 121, 121,
1441 122, 122, 122, 122, 122, 122, 123, 124, 124, 125,
1442 125, 125, 125, 125, 125, 125, 125, 126, 127, 128,
1443 128, 128, 128, 128, 128, 129, 130, 130, 130, 130,
1444 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
1445 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
1446 130, 130, 130, 131, 131, 131, 131, 131, 131, 131,
1447 131, 131, 131, 131, 131, 131, 131, 131, 132, 132,
1448 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
1449 133, 133, 134, 135, 135, 135, 135, 135, 135, 135,
1450 135, 135, 135, 135, 135, 135, 136, 136, 136, 137,
1451 137, 137, 137, 137, 137, 137, 138, 138, 139, 139,
1452 140, 140, 141, 141, 142, 143, 143, 144, 145, 146,
1453 146, 147, 148, 148, 148, 148, 149, 149, 150, 151,
1454 152, 152, 152, 152, 152, 152, 153, 153, 153, 154,
1455 155, 155, 155, 156, 157, 158, 159, 159, 160, 160,
1456 161, 161, 162, 162, 163, 163, 164, 164, 164, 165,
1457 165, 166, 167, 168, 169, 169, 170, 171, 171, 171,
1458 172, 172, 173, 173, 174, 174, 175, 175, 176, 177,
1459 178, 178, 179, 179, 180, 181, 181, 182, 182, 183,
1460 183, 184, 184, 185, 186, 187, 187, 188, 188, 189,
1461 189, 189, 189, 190, 190, 191, 191, 192, 193, 193,
1462 194, 194, 194, 194, 194, 194, 194, 194, 195, 196,
1463 197, 197, 198, 198, 199, 200, 201, 202, 202, 203,
1464 204, 203, 205, 205, 206, 206, 207, 207, 208, 209,
1465 210, 210, 211, 211, 212, 213, 214, 215, 215, 216,
1466 216, 217, 218, 219, 220, 220, 221, 221, 221, 221,
1467 222, 222, 223, 223, 223, 223, 223, 223, 224, 224
1468};
1469
1470/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1471static const yytype_int8 yyr2[] =
1472{
1473 0, 2, 2, 2, 1, 1, 1, 2, 1, 3,
1474 2, 0, 1, 2, 1, 3, 0, 1, 2, 1,
1475 3, 1, 1, 1, 2, 1, 2, 1, 1, 1,
1476 1, 1, 1, 1, 3, 1, 3, 3, 1, 3,
1477 0, 1, 1, 2, 2, 3, 1, 4, 4, 1,
1478 1, 1, 1, 1, 1, 1, 3, 1, 1, 1,
1479 1, 1, 3, 3, 3, 1, 1, 2, 2, 3,
1480 4, 3, 4, 2, 2, 3, 5, 2, 2, 2,
1481 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
1482 3, 3, 3, 1, 2, 2, 3, 4, 3, 4,
1483 3, 5, 2, 2, 2, 2, 2, 2, 3, 5,
1484 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1485 3, 3, 1, 3, 3, 3, 3, 3, 3, 3,
1486 3, 3, 3, 3, 3, 3, 1, 1, 1, 1,
1487 1, 1, 1, 1, 1, 1, 2, 2, 1, 2,
1488 1, 3, 1, 1, 3, 1, 2, 5, 5, 0,
1489 2, 5, 0, 1, 1, 2, 1, 2, 5, 2,
1490 5, 4, 7, 8, 7, 10, 1, 1, 1, 3,
1491 5, 6, 3, 0, 1, 1, 0, 1, 3, 2,
1492 0, 1, 1, 3, 1, 1, 2, 1, 3, 1,
1493 3, 0, 0, 2, 3, 7, 2, 1, 3, 3,
1494 1, 1, 5, 7, 1, 3, 1, 3, 6, 1,
1495 0, 3, 2, 4, 1, 3, 5, 0, 3, 0,
1496 1, 0, 3, 1, 7, 0, 4, 1, 3, 1,
1497 3, 2, 2, 0, 2, 2, 3, 1, 0, 2,
1498 1, 1, 1, 1, 3, 3, 3, 3, 5, 1,
1499 0, 2, 1, 3, 2, 5, 1, 1, 2, 1,
1500 0, 4, 1, 1, 0, 2, 1, 3, 5, 1,
1501 0, 2, 1, 3, 1, 5, 1, 0, 2, 1,
1502 3, 4, 0, 0, 1, 1, 1, 1, 2, 2,
1503 0, 1, 1, 1, 1, 2, 2, 2, 0, 1
1504};
1505
1506
1507enum { YYENOMEM = -2 };
1508
1509#define yyerrok (yyerrstatus = 0)
1510#define yyclearin (yychar = OCTAVE_EMPTY)
1511
1512#define YYACCEPT goto yyacceptlab
1513#define YYABORT goto yyabortlab
1514#define YYERROR goto yyerrorlab
1515#define YYNOMEM goto yyexhaustedlab
1516
1517
1518#define YYRECOVERING() (!!yyerrstatus)
1519
1520#define YYBACKUP(Token, Value) \
1521 do \
1522 if (yychar == OCTAVE_EMPTY) \
1523 { \
1524 yychar = (Token); \
1525 yylval = (Value); \
1526 YYPOPSTACK (yylen); \
1527 yystate = *yyssp; \
1528 goto yybackup; \
1529 } \
1530 else \
1531 { \
1532 yyerror (parser, YY_("syntax error: cannot back up")); \
1533 YYERROR; \
1534 } \
1535 while (0)
1536
1537/* Backward compatibility with an undocumented macro.
1538 Use OCTAVE_error or OCTAVE_UNDEF. */
1539#define YYERRCODE OCTAVE_UNDEF
1540
1541
1542/* Enable debugging if requested. */
1543#if OCTAVE_DEBUG
1544
1545# ifndef YYFPRINTF
1546# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1547# define YYFPRINTF fprintf
1548# endif
1549
1550# define YYDPRINTF(Args) \
1551do { \
1552 if (yydebug) \
1553 YYFPRINTF Args; \
1554} while (0)
1555
1556
1557
1558
1559# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1560do { \
1561 if (yydebug) \
1562 { \
1563 YYFPRINTF (stderr, "%s ", Title); \
1564 yy_symbol_print (stderr, \
1565 Kind, Value, parser); \
1566 YYFPRINTF (stderr, "\n"); \
1567 } \
1568} while (0)
1569
1570
1571/*-----------------------------------.
1572| Print this symbol's value on YYO. |
1573`-----------------------------------*/
1574
1575static void
1576yy_symbol_value_print (FILE *yyo,
1577 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, octave::base_parser& parser)
1578{
1579 FILE *yyoutput = yyo;
1580 YY_USE (yyoutput);
1581 YY_USE (parser);
1582 if (!yyvaluep)
1583 return;
1585 YY_USE (yykind);
1587}
1588
1589
1590/*---------------------------.
1591| Print this symbol on YYO. |
1592`---------------------------*/
1593
1594static void
1595yy_symbol_print (FILE *yyo,
1596 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, octave::base_parser& parser)
1597{
1598 YYFPRINTF (yyo, "%s %s (",
1599 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1600
1601 yy_symbol_value_print (yyo, yykind, yyvaluep, parser);
1602 YYFPRINTF (yyo, ")");
1603}
1604
1605/*------------------------------------------------------------------.
1606| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1607| TOP (included). |
1608`------------------------------------------------------------------*/
1609
1610static void
1611yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1612{
1613 YYFPRINTF (stderr, "Stack now");
1614 for (; yybottom <= yytop; yybottom++)
1615 {
1616 int yybot = *yybottom;
1617 YYFPRINTF (stderr, " %d", yybot);
1618 }
1619 YYFPRINTF (stderr, "\n");
1620}
1621
1622# define YY_STACK_PRINT(Bottom, Top) \
1623do { \
1624 if (yydebug) \
1625 yy_stack_print ((Bottom), (Top)); \
1626} while (0)
1627
1628
1629/*------------------------------------------------.
1630| Report that the YYRULE is going to be reduced. |
1631`------------------------------------------------*/
1632
1633static void
1634yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1635 int yyrule, octave::base_parser& parser)
1636{
1637 int yylno = yyrline[yyrule];
1638 int yynrhs = yyr2[yyrule];
1639 int yyi;
1640 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1641 yyrule - 1, yylno);
1642 /* The symbols being reduced. */
1643 for (yyi = 0; yyi < yynrhs; yyi++)
1644 {
1645 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1646 yy_symbol_print (stderr,
1647 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1648 &yyvsp[(yyi + 1) - (yynrhs)], parser);
1649 YYFPRINTF (stderr, "\n");
1650 }
1651}
1652
1653# define YY_REDUCE_PRINT(Rule) \
1654do { \
1655 if (yydebug) \
1656 yy_reduce_print (yyssp, yyvsp, Rule, parser); \
1657} while (0)
1658
1659/* Nonzero means print parse trace. It is left uninitialized so that
1660 multiple parsers can coexist. */
1661int yydebug;
1662#else /* !OCTAVE_DEBUG */
1663# define YYDPRINTF(Args) ((void) 0)
1664# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1665# define YY_STACK_PRINT(Bottom, Top)
1666# define YY_REDUCE_PRINT(Rule)
1667#endif /* !OCTAVE_DEBUG */
1668
1669
1670/* YYINITDEPTH -- initial size of the parser's stacks. */
1671#ifndef YYINITDEPTH
1672# define YYINITDEPTH 200
1673#endif
1674
1675/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1676 if the built-in stack extension method is used).
1677
1678 Do not make this value too large; the results are undefined if
1679 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1680 evaluated with infinite-precision integer arithmetic. */
1681
1682#ifndef YYMAXDEPTH
1683# define YYMAXDEPTH 10000
1684#endif
1685/* Parser data structure. */
1686struct yypstate
1687 {
1688 /* Number of syntax errors so far. */
1689 int yynerrs;
1690
1692 /* Number of tokens to shift before error messages enabled. */
1693 int yyerrstatus;
1694
1695 /* Refer to the stacks through separate pointers, to allow yyoverflow
1696 to reallocate them elsewhere. */
1697
1698 /* Their size. */
1700
1701 /* The state stack: array, bottom, top. */
1705
1706 /* The semantic value stack: array, bottom, top. */
1708 YYSTYPE *yyvs;
1709 YYSTYPE *yyvsp;
1710 /* Whether this instance has not started parsing yet.
1711 * If 2, it corresponds to a finished parsing. */
1712 int yynew;
1713 };
1714
1715
1716
1717
1718
1719
1720/*-----------------------------------------------.
1721| Release the memory associated to this symbol. |
1722`-----------------------------------------------*/
1723
1724static void
1725yydestruct (const char *yymsg,
1726 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, octave::base_parser& parser)
1727{
1728 YY_USE (yyvaluep);
1729 YY_USE (parser);
1730 if (!yymsg)
1731 yymsg = "Deleting";
1732 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1733
1735 switch (yykind)
1736 {
1737 case YYSYMBOL_3_: /* '=' */
1738#line 345 "../libinterp/parse-tree/oct-parse.yy"
1739 { }
1740#line 1741 "libinterp/parse-tree/oct-parse.cc"
1741 break;
1742
1743 case YYSYMBOL_4_: /* ':' */
1744#line 345 "../libinterp/parse-tree/oct-parse.yy"
1745 { }
1746#line 1747 "libinterp/parse-tree/oct-parse.cc"
1747 break;
1748
1749 case YYSYMBOL_5_: /* '-' */
1750#line 345 "../libinterp/parse-tree/oct-parse.yy"
1751 { }
1752#line 1753 "libinterp/parse-tree/oct-parse.cc"
1753 break;
1754
1755 case YYSYMBOL_6_: /* '+' */
1756#line 345 "../libinterp/parse-tree/oct-parse.yy"
1757 { }
1758#line 1759 "libinterp/parse-tree/oct-parse.cc"
1759 break;
1760
1761 case YYSYMBOL_7_: /* '*' */
1762#line 345 "../libinterp/parse-tree/oct-parse.yy"
1763 { }
1764#line 1765 "libinterp/parse-tree/oct-parse.cc"
1765 break;
1766
1767 case YYSYMBOL_8_: /* '/' */
1768#line 345 "../libinterp/parse-tree/oct-parse.yy"
1769 { }
1770#line 1771 "libinterp/parse-tree/oct-parse.cc"
1771 break;
1772
1773 case YYSYMBOL_9_: /* '~' */
1774#line 345 "../libinterp/parse-tree/oct-parse.yy"
1775 { }
1776#line 1777 "libinterp/parse-tree/oct-parse.cc"
1777 break;
1778
1779 case YYSYMBOL_10_: /* '!' */
1780#line 345 "../libinterp/parse-tree/oct-parse.yy"
1781 { }
1782#line 1783 "libinterp/parse-tree/oct-parse.cc"
1783 break;
1784
1785 case YYSYMBOL_11_: /* '(' */
1786#line 345 "../libinterp/parse-tree/oct-parse.yy"
1787 { }
1788#line 1789 "libinterp/parse-tree/oct-parse.cc"
1789 break;
1790
1791 case YYSYMBOL_12_: /* ')' */
1792#line 345 "../libinterp/parse-tree/oct-parse.yy"
1793 { }
1794#line 1795 "libinterp/parse-tree/oct-parse.cc"
1795 break;
1796
1797 case YYSYMBOL_13_: /* '[' */
1798#line 345 "../libinterp/parse-tree/oct-parse.yy"
1799 { }
1800#line 1801 "libinterp/parse-tree/oct-parse.cc"
1801 break;
1802
1803 case YYSYMBOL_14_: /* ']' */
1804#line 345 "../libinterp/parse-tree/oct-parse.yy"
1805 { }
1806#line 1807 "libinterp/parse-tree/oct-parse.cc"
1807 break;
1808
1809 case YYSYMBOL_15_: /* '{' */
1810#line 345 "../libinterp/parse-tree/oct-parse.yy"
1811 { }
1812#line 1813 "libinterp/parse-tree/oct-parse.cc"
1813 break;
1814
1815 case YYSYMBOL_16_: /* '}' */
1816#line 345 "../libinterp/parse-tree/oct-parse.yy"
1817 { }
1818#line 1819 "libinterp/parse-tree/oct-parse.cc"
1819 break;
1820
1821 case YYSYMBOL_17_: /* '.' */
1822#line 345 "../libinterp/parse-tree/oct-parse.yy"
1823 { }
1824#line 1825 "libinterp/parse-tree/oct-parse.cc"
1825 break;
1826
1827 case YYSYMBOL_18_: /* '@' */
1828#line 345 "../libinterp/parse-tree/oct-parse.yy"
1829 { }
1830#line 1831 "libinterp/parse-tree/oct-parse.cc"
1831 break;
1832
1833 case YYSYMBOL_19_: /* ',' */
1834#line 345 "../libinterp/parse-tree/oct-parse.yy"
1835 { }
1836#line 1837 "libinterp/parse-tree/oct-parse.cc"
1837 break;
1838
1839 case YYSYMBOL_20_: /* ';' */
1840#line 345 "../libinterp/parse-tree/oct-parse.yy"
1841 { }
1842#line 1843 "libinterp/parse-tree/oct-parse.cc"
1843 break;
1844
1845 case YYSYMBOL_21_n_: /* '\n' */
1846#line 345 "../libinterp/parse-tree/oct-parse.yy"
1847 { }
1848#line 1849 "libinterp/parse-tree/oct-parse.cc"
1849 break;
1850
1851 case YYSYMBOL_ADD_EQ: /* ADD_EQ */
1852#line 345 "../libinterp/parse-tree/oct-parse.yy"
1853 { }
1854#line 1855 "libinterp/parse-tree/oct-parse.cc"
1855 break;
1856
1857 case YYSYMBOL_SUB_EQ: /* SUB_EQ */
1858#line 345 "../libinterp/parse-tree/oct-parse.yy"
1859 { }
1860#line 1861 "libinterp/parse-tree/oct-parse.cc"
1861 break;
1862
1863 case YYSYMBOL_MUL_EQ: /* MUL_EQ */
1864#line 345 "../libinterp/parse-tree/oct-parse.yy"
1865 { }
1866#line 1867 "libinterp/parse-tree/oct-parse.cc"
1867 break;
1868
1869 case YYSYMBOL_DIV_EQ: /* DIV_EQ */
1870#line 345 "../libinterp/parse-tree/oct-parse.yy"
1871 { }
1872#line 1873 "libinterp/parse-tree/oct-parse.cc"
1873 break;
1874
1875 case YYSYMBOL_LEFTDIV_EQ: /* LEFTDIV_EQ */
1876#line 345 "../libinterp/parse-tree/oct-parse.yy"
1877 { }
1878#line 1879 "libinterp/parse-tree/oct-parse.cc"
1879 break;
1880
1881 case YYSYMBOL_POW_EQ: /* POW_EQ */
1882#line 345 "../libinterp/parse-tree/oct-parse.yy"
1883 { }
1884#line 1885 "libinterp/parse-tree/oct-parse.cc"
1885 break;
1886
1887 case YYSYMBOL_EMUL_EQ: /* EMUL_EQ */
1888#line 345 "../libinterp/parse-tree/oct-parse.yy"
1889 { }
1890#line 1891 "libinterp/parse-tree/oct-parse.cc"
1891 break;
1892
1893 case YYSYMBOL_EDIV_EQ: /* EDIV_EQ */
1894#line 345 "../libinterp/parse-tree/oct-parse.yy"
1895 { }
1896#line 1897 "libinterp/parse-tree/oct-parse.cc"
1897 break;
1898
1899 case YYSYMBOL_ELEFTDIV_EQ: /* ELEFTDIV_EQ */
1900#line 345 "../libinterp/parse-tree/oct-parse.yy"
1901 { }
1902#line 1903 "libinterp/parse-tree/oct-parse.cc"
1903 break;
1904
1905 case YYSYMBOL_EPOW_EQ: /* EPOW_EQ */
1906#line 345 "../libinterp/parse-tree/oct-parse.yy"
1907 { }
1908#line 1909 "libinterp/parse-tree/oct-parse.cc"
1909 break;
1910
1911 case YYSYMBOL_AND_EQ: /* AND_EQ */
1912#line 345 "../libinterp/parse-tree/oct-parse.yy"
1913 { }
1914#line 1915 "libinterp/parse-tree/oct-parse.cc"
1915 break;
1916
1917 case YYSYMBOL_OR_EQ: /* OR_EQ */
1918#line 345 "../libinterp/parse-tree/oct-parse.yy"
1919 { }
1920#line 1921 "libinterp/parse-tree/oct-parse.cc"
1921 break;
1922
1923 case YYSYMBOL_EXPR_AND_AND: /* EXPR_AND_AND */
1924#line 345 "../libinterp/parse-tree/oct-parse.yy"
1925 { }
1926#line 1927 "libinterp/parse-tree/oct-parse.cc"
1927 break;
1928
1929 case YYSYMBOL_EXPR_OR_OR: /* EXPR_OR_OR */
1930#line 345 "../libinterp/parse-tree/oct-parse.yy"
1931 { }
1932#line 1933 "libinterp/parse-tree/oct-parse.cc"
1933 break;
1934
1935 case YYSYMBOL_EXPR_AND: /* EXPR_AND */
1936#line 345 "../libinterp/parse-tree/oct-parse.yy"
1937 { }
1938#line 1939 "libinterp/parse-tree/oct-parse.cc"
1939 break;
1940
1941 case YYSYMBOL_EXPR_OR: /* EXPR_OR */
1942#line 345 "../libinterp/parse-tree/oct-parse.yy"
1943 { }
1944#line 1945 "libinterp/parse-tree/oct-parse.cc"
1945 break;
1946
1947 case YYSYMBOL_EXPR_LT: /* EXPR_LT */
1948#line 345 "../libinterp/parse-tree/oct-parse.yy"
1949 { }
1950#line 1951 "libinterp/parse-tree/oct-parse.cc"
1951 break;
1952
1953 case YYSYMBOL_EXPR_LE: /* EXPR_LE */
1954#line 345 "../libinterp/parse-tree/oct-parse.yy"
1955 { }
1956#line 1957 "libinterp/parse-tree/oct-parse.cc"
1957 break;
1958
1959 case YYSYMBOL_EXPR_EQ: /* EXPR_EQ */
1960#line 345 "../libinterp/parse-tree/oct-parse.yy"
1961 { }
1962#line 1963 "libinterp/parse-tree/oct-parse.cc"
1963 break;
1964
1965 case YYSYMBOL_EXPR_NE: /* EXPR_NE */
1966#line 345 "../libinterp/parse-tree/oct-parse.yy"
1967 { }
1968#line 1969 "libinterp/parse-tree/oct-parse.cc"
1969 break;
1970
1971 case YYSYMBOL_EXPR_GE: /* EXPR_GE */
1972#line 345 "../libinterp/parse-tree/oct-parse.yy"
1973 { }
1974#line 1975 "libinterp/parse-tree/oct-parse.cc"
1975 break;
1976
1977 case YYSYMBOL_EXPR_GT: /* EXPR_GT */
1978#line 345 "../libinterp/parse-tree/oct-parse.yy"
1979 { }
1980#line 1981 "libinterp/parse-tree/oct-parse.cc"
1981 break;
1982
1983 case YYSYMBOL_LEFTDIV: /* LEFTDIV */
1984#line 345 "../libinterp/parse-tree/oct-parse.yy"
1985 { }
1986#line 1987 "libinterp/parse-tree/oct-parse.cc"
1987 break;
1988
1989 case YYSYMBOL_EMUL: /* EMUL */
1990#line 345 "../libinterp/parse-tree/oct-parse.yy"
1991 { }
1992#line 1993 "libinterp/parse-tree/oct-parse.cc"
1993 break;
1994
1995 case YYSYMBOL_EDIV: /* EDIV */
1996#line 345 "../libinterp/parse-tree/oct-parse.yy"
1997 { }
1998#line 1999 "libinterp/parse-tree/oct-parse.cc"
1999 break;
2000
2001 case YYSYMBOL_ELEFTDIV: /* ELEFTDIV */
2002#line 345 "../libinterp/parse-tree/oct-parse.yy"
2003 { }
2004#line 2005 "libinterp/parse-tree/oct-parse.cc"
2005 break;
2006
2007 case YYSYMBOL_HERMITIAN: /* HERMITIAN */
2008#line 345 "../libinterp/parse-tree/oct-parse.yy"
2009 { }
2010#line 2011 "libinterp/parse-tree/oct-parse.cc"
2011 break;
2012
2013 case YYSYMBOL_TRANSPOSE: /* TRANSPOSE */
2014#line 345 "../libinterp/parse-tree/oct-parse.yy"
2015 { }
2016#line 2017 "libinterp/parse-tree/oct-parse.cc"
2017 break;
2018
2019 case YYSYMBOL_PLUS_PLUS: /* PLUS_PLUS */
2020#line 345 "../libinterp/parse-tree/oct-parse.yy"
2021 { }
2022#line 2023 "libinterp/parse-tree/oct-parse.cc"
2023 break;
2024
2025 case YYSYMBOL_MINUS_MINUS: /* MINUS_MINUS */
2026#line 345 "../libinterp/parse-tree/oct-parse.yy"
2027 { }
2028#line 2029 "libinterp/parse-tree/oct-parse.cc"
2029 break;
2030
2031 case YYSYMBOL_POW: /* POW */
2032#line 345 "../libinterp/parse-tree/oct-parse.yy"
2033 { }
2034#line 2035 "libinterp/parse-tree/oct-parse.cc"
2035 break;
2036
2037 case YYSYMBOL_EPOW: /* EPOW */
2038#line 345 "../libinterp/parse-tree/oct-parse.yy"
2039 { }
2040#line 2041 "libinterp/parse-tree/oct-parse.cc"
2041 break;
2042
2043 case YYSYMBOL_NUMBER: /* NUMBER */
2044#line 345 "../libinterp/parse-tree/oct-parse.yy"
2045 { }
2046#line 2047 "libinterp/parse-tree/oct-parse.cc"
2047 break;
2048
2049 case YYSYMBOL_CONSTANT: /* CONSTANT */
2050#line 345 "../libinterp/parse-tree/oct-parse.yy"
2051 { }
2052#line 2053 "libinterp/parse-tree/oct-parse.cc"
2053 break;
2054
2055 case YYSYMBOL_STRUCT_ELT: /* STRUCT_ELT */
2056#line 345 "../libinterp/parse-tree/oct-parse.yy"
2057 { }
2058#line 2059 "libinterp/parse-tree/oct-parse.cc"
2059 break;
2060
2061 case YYSYMBOL_NAME: /* NAME */
2062#line 345 "../libinterp/parse-tree/oct-parse.yy"
2063 { }
2064#line 2065 "libinterp/parse-tree/oct-parse.cc"
2065 break;
2066
2067 case YYSYMBOL_END: /* END */
2068#line 345 "../libinterp/parse-tree/oct-parse.yy"
2069 { }
2070#line 2071 "libinterp/parse-tree/oct-parse.cc"
2071 break;
2072
2073 case YYSYMBOL_DQ_STRING: /* DQ_STRING */
2074#line 345 "../libinterp/parse-tree/oct-parse.yy"
2075 { }
2076#line 2077 "libinterp/parse-tree/oct-parse.cc"
2077 break;
2078
2079 case YYSYMBOL_SQ_STRING: /* SQ_STRING */
2080#line 345 "../libinterp/parse-tree/oct-parse.yy"
2081 { }
2082#line 2083 "libinterp/parse-tree/oct-parse.cc"
2083 break;
2084
2085 case YYSYMBOL_FOR: /* FOR */
2086#line 345 "../libinterp/parse-tree/oct-parse.yy"
2087 { }
2088#line 2089 "libinterp/parse-tree/oct-parse.cc"
2089 break;
2090
2091 case YYSYMBOL_PARFOR: /* PARFOR */
2092#line 345 "../libinterp/parse-tree/oct-parse.yy"
2093 { }
2094#line 2095 "libinterp/parse-tree/oct-parse.cc"
2095 break;
2096
2097 case YYSYMBOL_WHILE: /* WHILE */
2098#line 345 "../libinterp/parse-tree/oct-parse.yy"
2099 { }
2100#line 2101 "libinterp/parse-tree/oct-parse.cc"
2101 break;
2102
2103 case YYSYMBOL_DO: /* DO */
2104#line 345 "../libinterp/parse-tree/oct-parse.yy"
2105 { }
2106#line 2107 "libinterp/parse-tree/oct-parse.cc"
2107 break;
2108
2109 case YYSYMBOL_UNTIL: /* UNTIL */
2110#line 345 "../libinterp/parse-tree/oct-parse.yy"
2111 { }
2112#line 2113 "libinterp/parse-tree/oct-parse.cc"
2113 break;
2114
2115 case YYSYMBOL_SPMD: /* SPMD */
2116#line 345 "../libinterp/parse-tree/oct-parse.yy"
2117 { }
2118#line 2119 "libinterp/parse-tree/oct-parse.cc"
2119 break;
2120
2121 case YYSYMBOL_IF: /* IF */
2122#line 345 "../libinterp/parse-tree/oct-parse.yy"
2123 { }
2124#line 2125 "libinterp/parse-tree/oct-parse.cc"
2125 break;
2126
2127 case YYSYMBOL_ELSEIF: /* ELSEIF */
2128#line 345 "../libinterp/parse-tree/oct-parse.yy"
2129 { }
2130#line 2131 "libinterp/parse-tree/oct-parse.cc"
2131 break;
2132
2133 case YYSYMBOL_ELSE: /* ELSE */
2134#line 345 "../libinterp/parse-tree/oct-parse.yy"
2135 { }
2136#line 2137 "libinterp/parse-tree/oct-parse.cc"
2137 break;
2138
2139 case YYSYMBOL_SWITCH: /* SWITCH */
2140#line 345 "../libinterp/parse-tree/oct-parse.yy"
2141 { }
2142#line 2143 "libinterp/parse-tree/oct-parse.cc"
2143 break;
2144
2145 case YYSYMBOL_CASE: /* CASE */
2146#line 345 "../libinterp/parse-tree/oct-parse.yy"
2147 { }
2148#line 2149 "libinterp/parse-tree/oct-parse.cc"
2149 break;
2150
2151 case YYSYMBOL_OTHERWISE: /* OTHERWISE */
2152#line 345 "../libinterp/parse-tree/oct-parse.yy"
2153 { }
2154#line 2155 "libinterp/parse-tree/oct-parse.cc"
2155 break;
2156
2157 case YYSYMBOL_BREAK: /* BREAK */
2158#line 345 "../libinterp/parse-tree/oct-parse.yy"
2159 { }
2160#line 2161 "libinterp/parse-tree/oct-parse.cc"
2161 break;
2162
2163 case YYSYMBOL_CONTINUE: /* CONTINUE */
2164#line 345 "../libinterp/parse-tree/oct-parse.yy"
2165 { }
2166#line 2167 "libinterp/parse-tree/oct-parse.cc"
2167 break;
2168
2169 case YYSYMBOL_RETURN: /* RETURN */
2170#line 345 "../libinterp/parse-tree/oct-parse.yy"
2171 { }
2172#line 2173 "libinterp/parse-tree/oct-parse.cc"
2173 break;
2174
2175 case YYSYMBOL_UNWIND: /* UNWIND */
2176#line 345 "../libinterp/parse-tree/oct-parse.yy"
2177 { }
2178#line 2179 "libinterp/parse-tree/oct-parse.cc"
2179 break;
2180
2181 case YYSYMBOL_CLEANUP: /* CLEANUP */
2182#line 345 "../libinterp/parse-tree/oct-parse.yy"
2183 { }
2184#line 2185 "libinterp/parse-tree/oct-parse.cc"
2185 break;
2186
2187 case YYSYMBOL_TRY: /* TRY */
2188#line 345 "../libinterp/parse-tree/oct-parse.yy"
2189 { }
2190#line 2191 "libinterp/parse-tree/oct-parse.cc"
2191 break;
2192
2193 case YYSYMBOL_CATCH: /* CATCH */
2194#line 345 "../libinterp/parse-tree/oct-parse.yy"
2195 { }
2196#line 2197 "libinterp/parse-tree/oct-parse.cc"
2197 break;
2198
2199 case YYSYMBOL_GLOBAL: /* GLOBAL */
2200#line 345 "../libinterp/parse-tree/oct-parse.yy"
2201 { }
2202#line 2203 "libinterp/parse-tree/oct-parse.cc"
2203 break;
2204
2205 case YYSYMBOL_PERSISTENT: /* PERSISTENT */
2206#line 345 "../libinterp/parse-tree/oct-parse.yy"
2207 { }
2208#line 2209 "libinterp/parse-tree/oct-parse.cc"
2209 break;
2210
2211 case YYSYMBOL_FCN_HANDLE: /* FCN_HANDLE */
2212#line 345 "../libinterp/parse-tree/oct-parse.yy"
2213 { }
2214#line 2215 "libinterp/parse-tree/oct-parse.cc"
2215 break;
2216
2217 case YYSYMBOL_CLASSDEF: /* CLASSDEF */
2218#line 345 "../libinterp/parse-tree/oct-parse.yy"
2219 { }
2220#line 2221 "libinterp/parse-tree/oct-parse.cc"
2221 break;
2222
2223 case YYSYMBOL_PROPERTIES: /* PROPERTIES */
2224#line 345 "../libinterp/parse-tree/oct-parse.yy"
2225 { }
2226#line 2227 "libinterp/parse-tree/oct-parse.cc"
2227 break;
2228
2229 case YYSYMBOL_METHODS: /* METHODS */
2230#line 345 "../libinterp/parse-tree/oct-parse.yy"
2231 { }
2232#line 2233 "libinterp/parse-tree/oct-parse.cc"
2233 break;
2234
2235 case YYSYMBOL_EVENTS: /* EVENTS */
2236#line 345 "../libinterp/parse-tree/oct-parse.yy"
2237 { }
2238#line 2239 "libinterp/parse-tree/oct-parse.cc"
2239 break;
2240
2241 case YYSYMBOL_ENUMERATION: /* ENUMERATION */
2242#line 345 "../libinterp/parse-tree/oct-parse.yy"
2243 { }
2244#line 2245 "libinterp/parse-tree/oct-parse.cc"
2245 break;
2246
2247 case YYSYMBOL_METAQUERY: /* METAQUERY */
2248#line 345 "../libinterp/parse-tree/oct-parse.yy"
2249 { }
2250#line 2251 "libinterp/parse-tree/oct-parse.cc"
2251 break;
2252
2253 case YYSYMBOL_SUPERCLASSREF: /* SUPERCLASSREF */
2254#line 345 "../libinterp/parse-tree/oct-parse.yy"
2255 { }
2256#line 2257 "libinterp/parse-tree/oct-parse.cc"
2257 break;
2258
2259 case YYSYMBOL_FQ_IDENT: /* FQ_IDENT */
2260#line 345 "../libinterp/parse-tree/oct-parse.yy"
2261 { }
2262#line 2263 "libinterp/parse-tree/oct-parse.cc"
2263 break;
2264
2265 case YYSYMBOL_GET: /* GET */
2266#line 345 "../libinterp/parse-tree/oct-parse.yy"
2267 { }
2268#line 2269 "libinterp/parse-tree/oct-parse.cc"
2269 break;
2270
2271 case YYSYMBOL_SET: /* SET */
2272#line 345 "../libinterp/parse-tree/oct-parse.yy"
2273 { }
2274#line 2275 "libinterp/parse-tree/oct-parse.cc"
2275 break;
2276
2277 case YYSYMBOL_FUNCTION: /* FUNCTION */
2278#line 345 "../libinterp/parse-tree/oct-parse.yy"
2279 { }
2280#line 2281 "libinterp/parse-tree/oct-parse.cc"
2281 break;
2282
2283 case YYSYMBOL_ARGUMENTS: /* ARGUMENTS */
2284#line 345 "../libinterp/parse-tree/oct-parse.yy"
2285 { }
2286#line 2287 "libinterp/parse-tree/oct-parse.cc"
2287 break;
2288
2289 case YYSYMBOL_LEXICAL_ERROR: /* LEXICAL_ERROR */
2290#line 345 "../libinterp/parse-tree/oct-parse.yy"
2291 { }
2292#line 2293 "libinterp/parse-tree/oct-parse.cc"
2293 break;
2294
2295 case YYSYMBOL_END_OF_INPUT: /* END_OF_INPUT */
2296#line 345 "../libinterp/parse-tree/oct-parse.yy"
2297 { }
2298#line 2299 "libinterp/parse-tree/oct-parse.cc"
2299 break;
2300
2301 case YYSYMBOL_UNARY: /* UNARY */
2302#line 346 "../libinterp/parse-tree/oct-parse.yy"
2303 { }
2304#line 2305 "libinterp/parse-tree/oct-parse.cc"
2305 break;
2306
2307 case YYSYMBOL_input: /* input */
2308#line 350 "../libinterp/parse-tree/oct-parse.yy"
2309 { delete ((*yyvaluep).tree_type); }
2310#line 2311 "libinterp/parse-tree/oct-parse.cc"
2311 break;
2312
2313 case YYSYMBOL_simple_list: /* simple_list */
2314#line 375 "../libinterp/parse-tree/oct-parse.yy"
2315 { delete ((*yyvaluep).tree_statement_list_type); }
2316#line 2317 "libinterp/parse-tree/oct-parse.cc"
2317 break;
2318
2319 case YYSYMBOL_simple_list1: /* simple_list1 */
2320#line 375 "../libinterp/parse-tree/oct-parse.yy"
2321 { delete ((*yyvaluep).tree_statement_list_type); }
2322#line 2323 "libinterp/parse-tree/oct-parse.cc"
2323 break;
2324
2325 case YYSYMBOL_statement_list: /* statement_list */
2326#line 375 "../libinterp/parse-tree/oct-parse.yy"
2327 { delete ((*yyvaluep).tree_statement_list_type); }
2328#line 2329 "libinterp/parse-tree/oct-parse.cc"
2329 break;
2330
2331 case YYSYMBOL_opt_list: /* opt_list */
2332#line 375 "../libinterp/parse-tree/oct-parse.yy"
2333 { delete ((*yyvaluep).tree_statement_list_type); }
2334#line 2335 "libinterp/parse-tree/oct-parse.cc"
2335 break;
2336
2337 case YYSYMBOL_list: /* list */
2338#line 375 "../libinterp/parse-tree/oct-parse.yy"
2339 { delete ((*yyvaluep).tree_statement_list_type); }
2340#line 2341 "libinterp/parse-tree/oct-parse.cc"
2341 break;
2342
2343 case YYSYMBOL_list1: /* list1 */
2344#line 375 "../libinterp/parse-tree/oct-parse.yy"
2345 { delete ((*yyvaluep).tree_statement_list_type); }
2346#line 2347 "libinterp/parse-tree/oct-parse.cc"
2347 break;
2348
2349 case YYSYMBOL_opt_fcn_list: /* opt_fcn_list */
2350#line 375 "../libinterp/parse-tree/oct-parse.yy"
2351 { delete ((*yyvaluep).tree_statement_list_type); }
2352#line 2353 "libinterp/parse-tree/oct-parse.cc"
2353 break;
2354
2355 case YYSYMBOL_fcn_list: /* fcn_list */
2356#line 375 "../libinterp/parse-tree/oct-parse.yy"
2357 { delete ((*yyvaluep).tree_statement_list_type); }
2358#line 2359 "libinterp/parse-tree/oct-parse.cc"
2359 break;
2360
2361 case YYSYMBOL_fcn_list1: /* fcn_list1 */
2362#line 375 "../libinterp/parse-tree/oct-parse.yy"
2363 { delete ((*yyvaluep).tree_statement_list_type); }
2364#line 2365 "libinterp/parse-tree/oct-parse.cc"
2365 break;
2366
2367 case YYSYMBOL_statement: /* statement */
2368#line 374 "../libinterp/parse-tree/oct-parse.yy"
2369 { delete ((*yyvaluep).tree_statement_type); }
2370#line 2371 "libinterp/parse-tree/oct-parse.cc"
2371 break;
2372
2373 case YYSYMBOL_word_list_cmd: /* word_list_cmd */
2374#line 361 "../libinterp/parse-tree/oct-parse.yy"
2375 { delete ((*yyvaluep).tree_index_expression_type); }
2376#line 2377 "libinterp/parse-tree/oct-parse.cc"
2377 break;
2378
2379 case YYSYMBOL_word_list: /* word_list */
2380#line 362 "../libinterp/parse-tree/oct-parse.yy"
2381 { delete ((*yyvaluep).tree_argument_list_type); }
2382#line 2383 "libinterp/parse-tree/oct-parse.cc"
2383 break;
2384
2385 case YYSYMBOL_identifier: /* identifier */
2386#line 360 "../libinterp/parse-tree/oct-parse.yy"
2387 { delete ((*yyvaluep).tree_identifier_type); }
2388#line 2389 "libinterp/parse-tree/oct-parse.cc"
2389 break;
2390
2391 case YYSYMBOL_superclass_identifier: /* superclass_identifier */
2392#line 356 "../libinterp/parse-tree/oct-parse.yy"
2393 { delete ((*yyvaluep).tree_superclass_ref_type); }
2394#line 2395 "libinterp/parse-tree/oct-parse.cc"
2395 break;
2396
2397 case YYSYMBOL_meta_identifier: /* meta_identifier */
2398#line 357 "../libinterp/parse-tree/oct-parse.yy"
2399 { delete ((*yyvaluep).tree_metaclass_query_type); }
2400#line 2401 "libinterp/parse-tree/oct-parse.cc"
2401 break;
2402
2403 case YYSYMBOL_string: /* string */
2404#line 354 "../libinterp/parse-tree/oct-parse.yy"
2405 { delete ((*yyvaluep).tree_constant_type); }
2406#line 2407 "libinterp/parse-tree/oct-parse.cc"
2407 break;
2408
2409 case YYSYMBOL_constant: /* constant */
2410#line 354 "../libinterp/parse-tree/oct-parse.yy"
2411 { delete ((*yyvaluep).tree_constant_type); }
2412#line 2413 "libinterp/parse-tree/oct-parse.cc"
2413 break;
2414
2415 case YYSYMBOL_matrix: /* matrix */
2416#line 353 "../libinterp/parse-tree/oct-parse.yy"
2417 { delete ((*yyvaluep).tree_expression_type); }
2418#line 2419 "libinterp/parse-tree/oct-parse.cc"
2419 break;
2420
2421 case YYSYMBOL_matrix_rows: /* matrix_rows */
2422#line 351 "../libinterp/parse-tree/oct-parse.yy"
2423 { delete ((*yyvaluep).tree_matrix_type); }
2424#line 2425 "libinterp/parse-tree/oct-parse.cc"
2425 break;
2426
2427 case YYSYMBOL_cell: /* cell */
2428#line 353 "../libinterp/parse-tree/oct-parse.yy"
2429 { delete ((*yyvaluep).tree_expression_type); }
2430#line 2431 "libinterp/parse-tree/oct-parse.cc"
2431 break;
2432
2433 case YYSYMBOL_cell_rows: /* cell_rows */
2434#line 352 "../libinterp/parse-tree/oct-parse.yy"
2435 { delete ((*yyvaluep).tree_cell_type); }
2436#line 2437 "libinterp/parse-tree/oct-parse.cc"
2437 break;
2438
2439 case YYSYMBOL_cell_or_matrix_row: /* cell_or_matrix_row */
2440#line 362 "../libinterp/parse-tree/oct-parse.yy"
2441 { delete ((*yyvaluep).tree_argument_list_type); }
2442#line 2443 "libinterp/parse-tree/oct-parse.cc"
2443 break;
2444
2445 case YYSYMBOL_fcn_handle: /* fcn_handle */
2446#line 355 "../libinterp/parse-tree/oct-parse.yy"
2447 { delete ((*yyvaluep).tree_fcn_handle_type); }
2448#line 2449 "libinterp/parse-tree/oct-parse.cc"
2449 break;
2450
2451 case YYSYMBOL_anon_fcn_handle: /* anon_fcn_handle */
2452#line 359 "../libinterp/parse-tree/oct-parse.yy"
2453 { delete ((*yyvaluep).tree_anon_fcn_handle_type); }
2454#line 2455 "libinterp/parse-tree/oct-parse.cc"
2455 break;
2456
2457 case YYSYMBOL_primary_expr: /* primary_expr */
2458#line 353 "../libinterp/parse-tree/oct-parse.yy"
2459 { delete ((*yyvaluep).tree_expression_type); }
2460#line 2461 "libinterp/parse-tree/oct-parse.cc"
2461 break;
2462
2463 case YYSYMBOL_magic_colon: /* magic_colon */
2464#line 354 "../libinterp/parse-tree/oct-parse.yy"
2465 { delete ((*yyvaluep).tree_constant_type); }
2466#line 2467 "libinterp/parse-tree/oct-parse.cc"
2467 break;
2468
2469 case YYSYMBOL_magic_tilde: /* magic_tilde */
2470#line 360 "../libinterp/parse-tree/oct-parse.yy"
2471 { delete ((*yyvaluep).tree_identifier_type); }
2472#line 2473 "libinterp/parse-tree/oct-parse.cc"
2473 break;
2474
2475 case YYSYMBOL_arg_list: /* arg_list */
2476#line 362 "../libinterp/parse-tree/oct-parse.yy"
2477 { delete ((*yyvaluep).tree_argument_list_type); }
2478#line 2479 "libinterp/parse-tree/oct-parse.cc"
2479 break;
2480
2481 case YYSYMBOL_indirect_ref_op: /* indirect_ref_op */
2482#line 345 "../libinterp/parse-tree/oct-parse.yy"
2483 { }
2484#line 2485 "libinterp/parse-tree/oct-parse.cc"
2485 break;
2486
2487 case YYSYMBOL_oper_expr: /* oper_expr */
2488#line 353 "../libinterp/parse-tree/oct-parse.yy"
2489 { delete ((*yyvaluep).tree_expression_type); }
2490#line 2491 "libinterp/parse-tree/oct-parse.cc"
2491 break;
2492
2493 case YYSYMBOL_power_expr: /* power_expr */
2494#line 353 "../libinterp/parse-tree/oct-parse.yy"
2495 { delete ((*yyvaluep).tree_expression_type); }
2496#line 2497 "libinterp/parse-tree/oct-parse.cc"
2497 break;
2498
2499 case YYSYMBOL_colon_expr: /* colon_expr */
2500#line 353 "../libinterp/parse-tree/oct-parse.yy"
2501 { delete ((*yyvaluep).tree_expression_type); }
2502#line 2503 "libinterp/parse-tree/oct-parse.cc"
2503 break;
2504
2505 case YYSYMBOL_simple_expr: /* simple_expr */
2506#line 353 "../libinterp/parse-tree/oct-parse.yy"
2507 { delete ((*yyvaluep).tree_expression_type); }
2508#line 2509 "libinterp/parse-tree/oct-parse.cc"
2509 break;
2510
2511 case YYSYMBOL_assign_lhs: /* assign_lhs */
2512#line 362 "../libinterp/parse-tree/oct-parse.yy"
2513 { delete ((*yyvaluep).tree_argument_list_type); }
2514#line 2515 "libinterp/parse-tree/oct-parse.cc"
2515 break;
2516
2517 case YYSYMBOL_assign_expr: /* assign_expr */
2518#line 353 "../libinterp/parse-tree/oct-parse.yy"
2519 { delete ((*yyvaluep).tree_expression_type); }
2520#line 2521 "libinterp/parse-tree/oct-parse.cc"
2521 break;
2522
2523 case YYSYMBOL_expression: /* expression */
2524#line 353 "../libinterp/parse-tree/oct-parse.yy"
2525 { delete ((*yyvaluep).tree_expression_type); }
2526#line 2527 "libinterp/parse-tree/oct-parse.cc"
2527 break;
2528
2529 case YYSYMBOL_command: /* command */
2530#line 364 "../libinterp/parse-tree/oct-parse.yy"
2531 { delete ((*yyvaluep).tree_command_type); }
2532#line 2533 "libinterp/parse-tree/oct-parse.cc"
2533 break;
2534
2535 case YYSYMBOL_declaration: /* declaration */
2536#line 373 "../libinterp/parse-tree/oct-parse.yy"
2537 { delete ((*yyvaluep).tree_decl_command_type); }
2538#line 2539 "libinterp/parse-tree/oct-parse.cc"
2539 break;
2540
2541 case YYSYMBOL_decl_init_list: /* decl_init_list */
2542#line 372 "../libinterp/parse-tree/oct-parse.yy"
2543 { delete ((*yyvaluep).tree_decl_init_list_type); }
2544#line 2545 "libinterp/parse-tree/oct-parse.cc"
2545 break;
2546
2547 case YYSYMBOL_decl_elt: /* decl_elt */
2548#line 371 "../libinterp/parse-tree/oct-parse.yy"
2549 { delete ((*yyvaluep).tree_decl_elt_type); }
2550#line 2551 "libinterp/parse-tree/oct-parse.cc"
2551 break;
2552
2553 case YYSYMBOL_select_command: /* select_command */
2554#line 364 "../libinterp/parse-tree/oct-parse.yy"
2555 { delete ((*yyvaluep).tree_command_type); }
2556#line 2557 "libinterp/parse-tree/oct-parse.cc"
2557 break;
2558
2559 case YYSYMBOL_if_command: /* if_command */
2560#line 365 "../libinterp/parse-tree/oct-parse.yy"
2561 { delete ((*yyvaluep).tree_if_command_type); }
2562#line 2563 "libinterp/parse-tree/oct-parse.cc"
2563 break;
2564
2565 case YYSYMBOL_if_clause_list: /* if_clause_list */
2566#line 367 "../libinterp/parse-tree/oct-parse.yy"
2567 { delete ((*yyvaluep).tree_if_command_list_type); }
2568#line 2569 "libinterp/parse-tree/oct-parse.cc"
2569 break;
2570
2571 case YYSYMBOL_if_clause: /* if_clause */
2572#line 366 "../libinterp/parse-tree/oct-parse.yy"
2573 { delete ((*yyvaluep).tree_if_clause_type); }
2574#line 2575 "libinterp/parse-tree/oct-parse.cc"
2575 break;
2576
2577 case YYSYMBOL_elseif_clause: /* elseif_clause */
2578#line 366 "../libinterp/parse-tree/oct-parse.yy"
2579 { delete ((*yyvaluep).tree_if_clause_type); }
2580#line 2581 "libinterp/parse-tree/oct-parse.cc"
2581 break;
2582
2583 case YYSYMBOL_else_clause: /* else_clause */
2584#line 366 "../libinterp/parse-tree/oct-parse.yy"
2585 { delete ((*yyvaluep).tree_if_clause_type); }
2586#line 2587 "libinterp/parse-tree/oct-parse.cc"
2587 break;
2588
2589 case YYSYMBOL_switch_command: /* switch_command */
2590#line 368 "../libinterp/parse-tree/oct-parse.yy"
2591 { delete ((*yyvaluep).tree_switch_command_type); }
2592#line 2593 "libinterp/parse-tree/oct-parse.cc"
2593 break;
2594
2595 case YYSYMBOL_case_list: /* case_list */
2596#line 370 "../libinterp/parse-tree/oct-parse.yy"
2597 { delete ((*yyvaluep).tree_switch_case_list_type); }
2598#line 2599 "libinterp/parse-tree/oct-parse.cc"
2599 break;
2600
2601 case YYSYMBOL_case_list1: /* case_list1 */
2602#line 370 "../libinterp/parse-tree/oct-parse.yy"
2603 { delete ((*yyvaluep).tree_switch_case_list_type); }
2604#line 2605 "libinterp/parse-tree/oct-parse.cc"
2605 break;
2606
2607 case YYSYMBOL_switch_case: /* switch_case */
2608#line 369 "../libinterp/parse-tree/oct-parse.yy"
2609 { delete ((*yyvaluep).tree_switch_case_type); }
2610#line 2611 "libinterp/parse-tree/oct-parse.cc"
2611 break;
2612
2613 case YYSYMBOL_default_case: /* default_case */
2614#line 369 "../libinterp/parse-tree/oct-parse.yy"
2615 { delete ((*yyvaluep).tree_switch_case_type); }
2616#line 2617 "libinterp/parse-tree/oct-parse.cc"
2617 break;
2618
2619 case YYSYMBOL_loop_command: /* loop_command */
2620#line 364 "../libinterp/parse-tree/oct-parse.yy"
2621 { delete ((*yyvaluep).tree_command_type); }
2622#line 2623 "libinterp/parse-tree/oct-parse.cc"
2623 break;
2624
2625 case YYSYMBOL_jump_command: /* jump_command */
2626#line 364 "../libinterp/parse-tree/oct-parse.yy"
2627 { delete ((*yyvaluep).tree_command_type); }
2628#line 2629 "libinterp/parse-tree/oct-parse.cc"
2629 break;
2630
2631 case YYSYMBOL_spmd_command: /* spmd_command */
2632#line 364 "../libinterp/parse-tree/oct-parse.yy"
2633 { delete ((*yyvaluep).tree_command_type); }
2634#line 2635 "libinterp/parse-tree/oct-parse.cc"
2635 break;
2636
2637 case YYSYMBOL_except_command: /* except_command */
2638#line 364 "../libinterp/parse-tree/oct-parse.yy"
2639 { delete ((*yyvaluep).tree_command_type); }
2640#line 2641 "libinterp/parse-tree/oct-parse.cc"
2641 break;
2642
2643 case YYSYMBOL_param_list_beg: /* param_list_beg */
2644#line 345 "../libinterp/parse-tree/oct-parse.yy"
2645 { }
2646#line 2647 "libinterp/parse-tree/oct-parse.cc"
2647 break;
2648
2649 case YYSYMBOL_param_list_end: /* param_list_end */
2650#line 345 "../libinterp/parse-tree/oct-parse.yy"
2651 { }
2652#line 2653 "libinterp/parse-tree/oct-parse.cc"
2653 break;
2654
2655 case YYSYMBOL_opt_param_list: /* opt_param_list */
2656#line 363 "../libinterp/parse-tree/oct-parse.yy"
2657 { delete ((*yyvaluep).tree_parameter_list_type); }
2658#line 2659 "libinterp/parse-tree/oct-parse.cc"
2659 break;
2660
2661 case YYSYMBOL_param_list: /* param_list */
2662#line 363 "../libinterp/parse-tree/oct-parse.yy"
2663 { delete ((*yyvaluep).tree_parameter_list_type); }
2664#line 2665 "libinterp/parse-tree/oct-parse.cc"
2665 break;
2666
2667 case YYSYMBOL_param_list1: /* param_list1 */
2668#line 363 "../libinterp/parse-tree/oct-parse.yy"
2669 { delete ((*yyvaluep).tree_parameter_list_type); }
2670#line 2671 "libinterp/parse-tree/oct-parse.cc"
2671 break;
2672
2673 case YYSYMBOL_param_list2: /* param_list2 */
2674#line 363 "../libinterp/parse-tree/oct-parse.yy"
2675 { delete ((*yyvaluep).tree_parameter_list_type); }
2676#line 2677 "libinterp/parse-tree/oct-parse.cc"
2677 break;
2678
2679 case YYSYMBOL_param_list_elt: /* param_list_elt */
2680#line 371 "../libinterp/parse-tree/oct-parse.yy"
2681 { delete ((*yyvaluep).tree_decl_elt_type); }
2682#line 2683 "libinterp/parse-tree/oct-parse.cc"
2683 break;
2684
2685 case YYSYMBOL_return_list: /* return_list */
2686#line 363 "../libinterp/parse-tree/oct-parse.yy"
2687 { delete ((*yyvaluep).tree_parameter_list_type); }
2688#line 2689 "libinterp/parse-tree/oct-parse.cc"
2689 break;
2690
2691 case YYSYMBOL_return_list1: /* return_list1 */
2692#line 363 "../libinterp/parse-tree/oct-parse.yy"
2693 { delete ((*yyvaluep).tree_parameter_list_type); }
2694#line 2695 "libinterp/parse-tree/oct-parse.cc"
2695 break;
2696
2697 case YYSYMBOL_file: /* file */
2698#line 364 "../libinterp/parse-tree/oct-parse.yy"
2699 { delete ((*yyvaluep).tree_command_type); }
2700#line 2701 "libinterp/parse-tree/oct-parse.cc"
2701 break;
2702
2703 case YYSYMBOL_function_beg: /* function_beg */
2704#line 345 "../libinterp/parse-tree/oct-parse.yy"
2705 { }
2706#line 2707 "libinterp/parse-tree/oct-parse.cc"
2707 break;
2708
2709 case YYSYMBOL_fcn_name: /* fcn_name */
2710#line 360 "../libinterp/parse-tree/oct-parse.yy"
2711 { delete ((*yyvaluep).tree_identifier_type); }
2712#line 2713 "libinterp/parse-tree/oct-parse.cc"
2713 break;
2714
2715 case YYSYMBOL_function_end: /* function_end */
2716#line 374 "../libinterp/parse-tree/oct-parse.yy"
2717 { delete ((*yyvaluep).tree_statement_type); }
2718#line 2719 "libinterp/parse-tree/oct-parse.cc"
2719 break;
2720
2721 case YYSYMBOL_function: /* function */
2722#line 358 "../libinterp/parse-tree/oct-parse.yy"
2723 { delete ((*yyvaluep).tree_function_def_type); }
2724#line 2725 "libinterp/parse-tree/oct-parse.cc"
2725 break;
2726
2727 case YYSYMBOL_function_body: /* function_body */
2728#line 375 "../libinterp/parse-tree/oct-parse.yy"
2729 { delete ((*yyvaluep).tree_statement_list_type); }
2730#line 2731 "libinterp/parse-tree/oct-parse.cc"
2731 break;
2732
2733 case YYSYMBOL_arguments_block_list: /* arguments_block_list */
2734#line 375 "../libinterp/parse-tree/oct-parse.yy"
2735 { delete ((*yyvaluep).tree_statement_list_type); }
2736#line 2737 "libinterp/parse-tree/oct-parse.cc"
2737 break;
2738
2739 case YYSYMBOL_arguments_block: /* arguments_block */
2740#line 376 "../libinterp/parse-tree/oct-parse.yy"
2741 { delete ((*yyvaluep).tree_arguments_block_type); }
2742#line 2743 "libinterp/parse-tree/oct-parse.cc"
2743 break;
2744
2745 case YYSYMBOL_arguments_beg: /* arguments_beg */
2746#line 345 "../libinterp/parse-tree/oct-parse.yy"
2747 { }
2748#line 2749 "libinterp/parse-tree/oct-parse.cc"
2749 break;
2750
2751 case YYSYMBOL_args_attr_list: /* args_attr_list */
2752#line 377 "../libinterp/parse-tree/oct-parse.yy"
2753 { delete ((*yyvaluep).tree_args_block_attribute_list_type); }
2754#line 2755 "libinterp/parse-tree/oct-parse.cc"
2755 break;
2756
2757 case YYSYMBOL_args_validation_list: /* args_validation_list */
2758#line 378 "../libinterp/parse-tree/oct-parse.yy"
2759 { delete ((*yyvaluep).tree_args_block_validation_list_type); }
2760#line 2761 "libinterp/parse-tree/oct-parse.cc"
2761 break;
2762
2763 case YYSYMBOL_arg_name: /* arg_name */
2764#line 353 "../libinterp/parse-tree/oct-parse.yy"
2765 { delete ((*yyvaluep).tree_expression_type); }
2766#line 2767 "libinterp/parse-tree/oct-parse.cc"
2767 break;
2768
2769 case YYSYMBOL_arg_validation: /* arg_validation */
2770#line 379 "../libinterp/parse-tree/oct-parse.yy"
2771 { delete ((*yyvaluep).tree_arg_validation_type); }
2772#line 2773 "libinterp/parse-tree/oct-parse.cc"
2773 break;
2774
2775 case YYSYMBOL_size_spec: /* size_spec */
2776#line 380 "../libinterp/parse-tree/oct-parse.yy"
2777 { delete ((*yyvaluep).tree_arg_size_spec_type); }
2778#line 2779 "libinterp/parse-tree/oct-parse.cc"
2779 break;
2780
2781 case YYSYMBOL_class_name: /* class_name */
2782#line 360 "../libinterp/parse-tree/oct-parse.yy"
2783 { delete ((*yyvaluep).tree_identifier_type); }
2784#line 2785 "libinterp/parse-tree/oct-parse.cc"
2785 break;
2786
2787 case YYSYMBOL_validation_fcns: /* validation_fcns */
2788#line 381 "../libinterp/parse-tree/oct-parse.yy"
2789 { delete ((*yyvaluep).tree_arg_validation_fcns_type); }
2790#line 2791 "libinterp/parse-tree/oct-parse.cc"
2791 break;
2792
2793 case YYSYMBOL_classdef_beg: /* classdef_beg */
2794#line 345 "../libinterp/parse-tree/oct-parse.yy"
2795 { }
2796#line 2797 "libinterp/parse-tree/oct-parse.cc"
2797 break;
2798
2799 case YYSYMBOL_classdef: /* classdef */
2800#line 384 "../libinterp/parse-tree/oct-parse.yy"
2801 { delete ((*yyvaluep).tree_classdef_type); }
2802#line 2803 "libinterp/parse-tree/oct-parse.cc"
2803 break;
2804
2805 case YYSYMBOL_attr_list: /* attr_list */
2806#line 386 "../libinterp/parse-tree/oct-parse.yy"
2807 { delete ((*yyvaluep).tree_classdef_attribute_list_type); }
2808#line 2809 "libinterp/parse-tree/oct-parse.cc"
2809 break;
2810
2811 case YYSYMBOL_attr_list1: /* attr_list1 */
2812#line 386 "../libinterp/parse-tree/oct-parse.yy"
2813 { delete ((*yyvaluep).tree_classdef_attribute_list_type); }
2814#line 2815 "libinterp/parse-tree/oct-parse.cc"
2815 break;
2816
2817 case YYSYMBOL_attr: /* attr */
2818#line 385 "../libinterp/parse-tree/oct-parse.yy"
2819 { delete ((*yyvaluep).tree_classdef_attribute_type); }
2820#line 2821 "libinterp/parse-tree/oct-parse.cc"
2821 break;
2822
2823 case YYSYMBOL_superclass_list: /* superclass_list */
2824#line 388 "../libinterp/parse-tree/oct-parse.yy"
2825 { delete ((*yyvaluep).tree_classdef_superclass_list_type); }
2826#line 2827 "libinterp/parse-tree/oct-parse.cc"
2827 break;
2828
2829 case YYSYMBOL_superclass_list1: /* superclass_list1 */
2830#line 388 "../libinterp/parse-tree/oct-parse.yy"
2831 { delete ((*yyvaluep).tree_classdef_superclass_list_type); }
2832#line 2833 "libinterp/parse-tree/oct-parse.cc"
2833 break;
2834
2835 case YYSYMBOL_superclass: /* superclass */
2836#line 387 "../libinterp/parse-tree/oct-parse.yy"
2837 { delete ((*yyvaluep).tree_classdef_superclass_type); }
2838#line 2839 "libinterp/parse-tree/oct-parse.cc"
2839 break;
2840
2841 case YYSYMBOL_class_body: /* class_body */
2842#line 389 "../libinterp/parse-tree/oct-parse.yy"
2843 { delete ((*yyvaluep).tree_classdef_body_type); }
2844#line 2845 "libinterp/parse-tree/oct-parse.cc"
2845 break;
2846
2847 case YYSYMBOL_class_body1: /* class_body1 */
2848#line 389 "../libinterp/parse-tree/oct-parse.yy"
2849 { delete ((*yyvaluep).tree_classdef_body_type); }
2850#line 2851 "libinterp/parse-tree/oct-parse.cc"
2851 break;
2852
2853 case YYSYMBOL_properties_block: /* properties_block */
2854#line 392 "../libinterp/parse-tree/oct-parse.yy"
2855 { delete ((*yyvaluep).tree_classdef_properties_block_type); }
2856#line 2857 "libinterp/parse-tree/oct-parse.cc"
2857 break;
2858
2859 case YYSYMBOL_properties_beg: /* properties_beg */
2860#line 345 "../libinterp/parse-tree/oct-parse.yy"
2861 { }
2862#line 2863 "libinterp/parse-tree/oct-parse.cc"
2863 break;
2864
2865 case YYSYMBOL_property_list: /* property_list */
2866#line 391 "../libinterp/parse-tree/oct-parse.yy"
2867 { delete ((*yyvaluep).tree_classdef_property_list_type); }
2868#line 2869 "libinterp/parse-tree/oct-parse.cc"
2869 break;
2870
2871 case YYSYMBOL_property_list1: /* property_list1 */
2872#line 391 "../libinterp/parse-tree/oct-parse.yy"
2873 { delete ((*yyvaluep).tree_classdef_property_list_type); }
2874#line 2875 "libinterp/parse-tree/oct-parse.cc"
2875 break;
2876
2877 case YYSYMBOL_class_property: /* class_property */
2878#line 390 "../libinterp/parse-tree/oct-parse.yy"
2879 { delete ((*yyvaluep).tree_classdef_property_type); }
2880#line 2881 "libinterp/parse-tree/oct-parse.cc"
2881 break;
2882
2883 case YYSYMBOL_methods_block: /* methods_block */
2884#line 394 "../libinterp/parse-tree/oct-parse.yy"
2885 { delete ((*yyvaluep).tree_classdef_methods_block_type); }
2886#line 2887 "libinterp/parse-tree/oct-parse.cc"
2887 break;
2888
2889 case YYSYMBOL_methods_beg: /* methods_beg */
2890#line 345 "../libinterp/parse-tree/oct-parse.yy"
2891 { }
2892#line 2893 "libinterp/parse-tree/oct-parse.cc"
2893 break;
2894
2895 case YYSYMBOL_method_decl1: /* method_decl1 */
2896#line 382 "../libinterp/parse-tree/oct-parse.yy"
2897 { delete ((*yyvaluep).octave_user_function_type); }
2898#line 2899 "libinterp/parse-tree/oct-parse.cc"
2899 break;
2900
2901 case YYSYMBOL_method_decl: /* method_decl */
2902#line 358 "../libinterp/parse-tree/oct-parse.yy"
2903 { delete ((*yyvaluep).tree_function_def_type); }
2904#line 2905 "libinterp/parse-tree/oct-parse.cc"
2905 break;
2906
2907 case YYSYMBOL_method: /* method */
2908#line 358 "../libinterp/parse-tree/oct-parse.yy"
2909 { delete ((*yyvaluep).tree_function_def_type); }
2910#line 2911 "libinterp/parse-tree/oct-parse.cc"
2911 break;
2912
2913 case YYSYMBOL_method_list: /* method_list */
2914#line 393 "../libinterp/parse-tree/oct-parse.yy"
2915 { delete ((*yyvaluep).tree_classdef_method_list_type); }
2916#line 2917 "libinterp/parse-tree/oct-parse.cc"
2917 break;
2918
2919 case YYSYMBOL_method_list1: /* method_list1 */
2920#line 393 "../libinterp/parse-tree/oct-parse.yy"
2921 { delete ((*yyvaluep).tree_classdef_method_list_type); }
2922#line 2923 "libinterp/parse-tree/oct-parse.cc"
2923 break;
2924
2925 case YYSYMBOL_events_block: /* events_block */
2926#line 397 "../libinterp/parse-tree/oct-parse.yy"
2927 { delete ((*yyvaluep).tree_classdef_events_block_type); }
2928#line 2929 "libinterp/parse-tree/oct-parse.cc"
2929 break;
2930
2931 case YYSYMBOL_events_beg: /* events_beg */
2932#line 345 "../libinterp/parse-tree/oct-parse.yy"
2933 { }
2934#line 2935 "libinterp/parse-tree/oct-parse.cc"
2935 break;
2936
2937 case YYSYMBOL_event_list: /* event_list */
2938#line 396 "../libinterp/parse-tree/oct-parse.yy"
2939 { delete ((*yyvaluep).tree_classdef_event_list_type); }
2940#line 2941 "libinterp/parse-tree/oct-parse.cc"
2941 break;
2942
2943 case YYSYMBOL_event_list1: /* event_list1 */
2944#line 396 "../libinterp/parse-tree/oct-parse.yy"
2945 { delete ((*yyvaluep).tree_classdef_event_list_type); }
2946#line 2947 "libinterp/parse-tree/oct-parse.cc"
2947 break;
2948
2949 case YYSYMBOL_class_event: /* class_event */
2950#line 395 "../libinterp/parse-tree/oct-parse.yy"
2951 { delete ((*yyvaluep).tree_classdef_event_type); }
2952#line 2953 "libinterp/parse-tree/oct-parse.cc"
2953 break;
2954
2955 case YYSYMBOL_enum_block: /* enum_block */
2956#line 400 "../libinterp/parse-tree/oct-parse.yy"
2957 { delete ((*yyvaluep).tree_classdef_enum_block_type); }
2958#line 2959 "libinterp/parse-tree/oct-parse.cc"
2959 break;
2960
2961 case YYSYMBOL_enumeration_beg: /* enumeration_beg */
2962#line 345 "../libinterp/parse-tree/oct-parse.yy"
2963 { }
2964#line 2965 "libinterp/parse-tree/oct-parse.cc"
2965 break;
2966
2967 case YYSYMBOL_enum_list: /* enum_list */
2968#line 399 "../libinterp/parse-tree/oct-parse.yy"
2969 { delete ((*yyvaluep).tree_classdef_enum_list_type); }
2970#line 2971 "libinterp/parse-tree/oct-parse.cc"
2971 break;
2972
2973 case YYSYMBOL_enum_list1: /* enum_list1 */
2974#line 399 "../libinterp/parse-tree/oct-parse.yy"
2975 { delete ((*yyvaluep).tree_classdef_enum_list_type); }
2976#line 2977 "libinterp/parse-tree/oct-parse.cc"
2977 break;
2978
2979 case YYSYMBOL_class_enum: /* class_enum */
2980#line 398 "../libinterp/parse-tree/oct-parse.yy"
2981 { delete ((*yyvaluep).tree_classdef_enum_type); }
2982#line 2983 "libinterp/parse-tree/oct-parse.cc"
2983 break;
2984
2985 case YYSYMBOL_sep_no_nl: /* sep_no_nl */
2986#line 348 "../libinterp/parse-tree/oct-parse.yy"
2987 { delete ((*yyvaluep).sep_list_type); }
2988#line 2989 "libinterp/parse-tree/oct-parse.cc"
2989 break;
2990
2991 case YYSYMBOL_opt_sep_no_nl: /* opt_sep_no_nl */
2992#line 348 "../libinterp/parse-tree/oct-parse.yy"
2993 { delete ((*yyvaluep).sep_list_type); }
2994#line 2995 "libinterp/parse-tree/oct-parse.cc"
2995 break;
2996
2997 case YYSYMBOL_sep: /* sep */
2998#line 348 "../libinterp/parse-tree/oct-parse.yy"
2999 { delete ((*yyvaluep).sep_list_type); }
3000#line 3001 "libinterp/parse-tree/oct-parse.cc"
3001 break;
3002
3003 case YYSYMBOL_opt_sep: /* opt_sep */
3004#line 348 "../libinterp/parse-tree/oct-parse.yy"
3005 { delete ((*yyvaluep).sep_list_type); }
3006#line 3007 "libinterp/parse-tree/oct-parse.cc"
3007 break;
3008
3009 default:
3010 break;
3011 }
3013}
3014
3015
3016
3017
3018
3019int
3020yyparse (octave::base_parser& parser)
3021{
3022 yypstate *yyps = yypstate_new ();
3023 if (!yyps)
3024 {
3025 yyerror (parser, YY_("memory exhausted"));
3026 return 2;
3027 }
3028 int yystatus = yypull_parse (yyps, parser);
3029 yypstate_delete (yyps);
3030 return yystatus;
3031}
3032
3033int
3034yypull_parse (yypstate *yyps, octave::base_parser& parser)
3035{
3036 YY_ASSERT (yyps);
3037 int yystatus;
3038 do {
3040 int yychar = yylex (&yylval, scanner);
3041 yystatus = yypush_parse (yyps, yychar, &yylval, parser);
3042 } while (yystatus == YYPUSH_MORE);
3043 return yystatus;
3044}
3045
3046#define octave_nerrs yyps->octave_nerrs
3047#define yystate yyps->yystate
3048#define yyerrstatus yyps->yyerrstatus
3049#define yyssa yyps->yyssa
3050#define yyss yyps->yyss
3051#define yyssp yyps->yyssp
3052#define yyvsa yyps->yyvsa
3053#define yyvs yyps->yyvs
3054#define yyvsp yyps->yyvsp
3055#define yystacksize yyps->yystacksize
3056
3057/* Initialize the parser data structure. */
3058static void
3060{
3061 yynerrs = 0;
3062 yystate = 0;
3063 yyerrstatus = 0;
3064
3065 yyssp = yyss;
3066 yyvsp = yyvs;
3067
3068 /* Initialize the state stack, in case yypcontext_expected_tokens is
3069 called before the first call to yyparse. */
3070 *yyssp = 0;
3071 yyps->yynew = 1;
3072}
3073
3074/* Initialize the parser data structure. */
3075yypstate *
3077{
3078 yypstate *yyps;
3079 yyps = YY_CAST (yypstate *, YYMALLOC (sizeof *yyps));
3080 if (!yyps)
3081 return YY_NULLPTR;
3083 yyss = yyssa;
3084 yyvs = yyvsa;
3085 yypstate_clear (yyps);
3086 return yyps;
3087}
3088
3089void
3091{
3092 if (yyps)
3093 {
3094#ifndef yyoverflow
3095 /* If the stack was reallocated but the parse did not complete, then the
3096 stack still needs to be freed. */
3097 if (yyss != yyssa)
3099#endif
3100 YYFREE (yyps);
3101 }
3102}
3103
3104
3105
3106/*---------------.
3107| yypush_parse. |
3108`---------------*/
3109
3110int
3112 int yypushed_char, YYSTYPE const *yypushed_val, octave::base_parser& parser)
3113{
3114/* Lookahead token kind. */
3115int yychar;
3116
3117
3118/* The semantic value of the lookahead symbol. */
3119/* Default value used for initialization, for pacifying older GCCs
3120 or non-GCC compilers. */
3121YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
3122YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
3123
3124 int yyn;
3125 /* The return value of yyparse. */
3126 int yyresult;
3127 /* Lookahead symbol kind. */
3129 /* The variables used to return semantic value and location from the
3130 action routines. */
3131 YYSTYPE yyval;
3132
3133
3134
3135#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3136
3137 /* The number of symbols on the RHS of the reduced rule.
3138 Keep to zero when no symbol should be popped. */
3139 int yylen = 0;
3140
3141 switch (yyps->yynew)
3142 {
3143 case 0:
3144 yyn = yypact[yystate];
3145 goto yyread_pushed_token;
3146
3147 case 2:
3148 yypstate_clear (yyps);
3149 break;
3150
3151 default:
3152 break;
3153 }
3154
3155 YYDPRINTF ((stderr, "Starting parse\n"));
3156
3157 yychar = OCTAVE_EMPTY; /* Cause a token to be read. */
3158
3159 goto yysetstate;
3160
3161
3162/*------------------------------------------------------------.
3163| yynewstate -- push a new state, which is found in yystate. |
3164`------------------------------------------------------------*/
3165yynewstate:
3166 /* In all cases, when you get here, the value and location stacks
3167 have just been pushed. So pushing a state here evens the stacks. */
3168 yyssp++;
3169
3170
3171/*--------------------------------------------------------------------.
3172| yysetstate -- set current state (the top of the stack) to yystate. |
3173`--------------------------------------------------------------------*/
3174yysetstate:
3175 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3176 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
3181
3182 if (yyss + yystacksize - 1 <= yyssp)
3183#if !defined yyoverflow && !defined YYSTACK_RELOCATE
3184 YYNOMEM;
3185#else
3186 {
3187 /* Get the current used size of the three stacks, in elements. */
3188 YYPTRDIFF_T yysize = yyssp - yyss + 1;
3189
3190# if defined yyoverflow
3191 {
3192 /* Give user a chance to reallocate the stack. Use copies of
3193 these so that the &'s don't force the real ones into
3194 memory. */
3195 yy_state_t *yyss1 = yyss;
3196 YYSTYPE *yyvs1 = yyvs;
3197
3198 /* Each stack pointer address is followed by the size of the
3199 data in use in that stack, in bytes. This used to be a
3200 conditional around just the two extra args, but that might
3201 be undefined if yyoverflow is a macro. */
3202 yyoverflow (YY_("memory exhausted"),
3203 &yyss1, yysize * YYSIZEOF (*yyssp),
3204 &yyvs1, yysize * YYSIZEOF (*yyvsp),
3205 &yystacksize);
3206 yyss = yyss1;
3207 yyvs = yyvs1;
3208 }
3209# else /* defined YYSTACK_RELOCATE */
3210 /* Extend the stack our own way. */
3211 if (YYMAXDEPTH <= yystacksize)
3212 YYNOMEM;
3213 yystacksize *= 2;
3214 if (YYMAXDEPTH < yystacksize)
3216
3217 {
3218 yy_state_t *yyss1 = yyss;
3219 union yyalloc *yyptr =
3220 YY_CAST (union yyalloc *,
3222 if (! yyptr)
3223 YYNOMEM;
3224 YYSTACK_RELOCATE (yyss_alloc, yyss);
3225 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3226# undef YYSTACK_RELOCATE
3227 if (yyss1 != yyssa)
3228 YYSTACK_FREE (yyss1);
3229 }
3230# endif
3231
3232 yyssp = yyss + yysize - 1;
3233 yyvsp = yyvs + yysize - 1;
3234
3236 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
3237 YY_CAST (long, yystacksize)));
3239
3240 if (yyss + yystacksize - 1 <= yyssp)
3241 YYABORT;
3242 }
3243#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
3244
3245
3246 if (yystate == YYFINAL)
3247 YYACCEPT;
3248
3249 goto yybackup;
3250
3251
3252/*-----------.
3253| yybackup. |
3254`-----------*/
3255yybackup:
3256 /* Do appropriate processing given the current state. Read a
3257 lookahead token if we need one and don't already have one. */
3258
3259 /* First try to decide what to do without reference to lookahead token. */
3260 yyn = yypact[yystate];
3261 if (yypact_value_is_default (yyn))
3262 goto yydefault;
3263
3264 /* Not known => get a lookahead token if don't already have one. */
3265
3266 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
3267 if (yychar == OCTAVE_EMPTY)
3268 {
3269 if (!yyps->yynew)
3270 {
3271 YYDPRINTF ((stderr, "Return for a new token:\n"));
3272 yyresult = YYPUSH_MORE;
3273 goto yypushreturn;
3274 }
3275 yyps->yynew = 0;
3276yyread_pushed_token:
3277 YYDPRINTF ((stderr, "Reading a token\n"));
3278 yychar = yypushed_char;
3279 if (yypushed_val)
3280 yylval = *yypushed_val;
3281 }
3282
3283 if (yychar <= OCTAVE_EOF)
3284 {
3285 yychar = OCTAVE_EOF;
3286 yytoken = YYSYMBOL_YYEOF;
3287 YYDPRINTF ((stderr, "Now at end of input.\n"));
3288 }
3289 else if (yychar == OCTAVE_error)
3290 {
3291 /* The scanner already issued an error message, process directly
3292 to error recovery. But do not keep the error token as
3293 lookahead, it is too special and may lead us to an endless
3294 loop in error recovery. */
3295 yychar = OCTAVE_UNDEF;
3296 yytoken = YYSYMBOL_YYerror;
3297 goto yyerrlab1;
3298 }
3299 else
3300 {
3301 yytoken = YYTRANSLATE (yychar);
3302 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3303 }
3304
3305 /* If the proper action on seeing token YYTOKEN is to reduce or to
3306 detect an error, take that action. */
3307 yyn += yytoken;
3308 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3309 goto yydefault;
3310 yyn = yytable[yyn];
3311 if (yyn <= 0)
3312 {
3313 if (yytable_value_is_error (yyn))
3314 goto yyerrlab;
3315 yyn = -yyn;
3316 goto yyreduce;
3317 }
3318
3319 /* Count tokens shifted since error; after three, turn off error
3320 status. */
3321 if (yyerrstatus)
3322 yyerrstatus--;
3323
3324 /* Shift the lookahead token. */
3325 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3326 yystate = yyn;
3328 *++yyvsp = yylval;
3330
3331 /* Discard the shifted token. */
3332 yychar = OCTAVE_EMPTY;
3333 goto yynewstate;
3334
3335
3336/*-----------------------------------------------------------.
3337| yydefault -- do the default action for the current state. |
3338`-----------------------------------------------------------*/
3339yydefault:
3340 yyn = yydefact[yystate];
3341 if (yyn == 0)
3342 goto yyerrlab;
3343 goto yyreduce;
3344
3345
3346/*-----------------------------.
3347| yyreduce -- do a reduction. |
3348`-----------------------------*/
3349yyreduce:
3350 /* yyn is the number of a rule to reduce with. */
3351 yylen = yyr2[yyn];
3352
3353 /* If YYLEN is nonzero, implement the default value of the action:
3354 '$$ = $1'.
3355
3356 Otherwise, the following line sets YYVAL to garbage.
3357 This behavior is undocumented and Bison
3358 users should not rely upon it. Assigning to YYVAL
3359 unconditionally makes the parser a bit smaller, and it avoids a
3360 GCC warning that YYVAL may be used uninitialized. */
3361 yyval = yyvsp[1-yylen];
3362
3363
3364 YY_REDUCE_PRINT (yyn);
3365 switch (yyn)
3366 {
3367 case 2: /* input: simple_list '\n' */
3368#line 419 "../libinterp/parse-tree/oct-parse.yy"
3369 {
3370 OCTAVE_YYUSE ((yyvsp[0].tok));
3371
3372 (yyval.tree_type) = nullptr;
3373
3374 if (! parser.finish_input ((yyvsp[-1].tree_statement_list_type)))
3375 YYABORT;
3376 else
3377 YYACCEPT;
3378 }
3379#line 3380 "libinterp/parse-tree/oct-parse.cc"
3380 break;
3381
3382 case 3: /* input: simple_list END_OF_INPUT */
3383#line 430 "../libinterp/parse-tree/oct-parse.yy"
3384 {
3385 OCTAVE_YYUSE ((yyvsp[0].tok));
3386
3387 (yyval.tree_type) = nullptr;
3388
3389 if (! parser.finish_input ((yyvsp[-1].tree_statement_list_type), true))
3390 YYABORT;
3391 else
3392 YYACCEPT;
3393 }
3394#line 3395 "libinterp/parse-tree/oct-parse.cc"
3395 break;
3396
3397 case 4: /* input: file */
3398#line 441 "../libinterp/parse-tree/oct-parse.yy"
3399 {
3400 lexer.m_end_of_input = true;
3401
3402 (yyval.tree_type) = (yyvsp[0].tree_command_type);
3403 YYACCEPT;
3404 }
3405#line 3406 "libinterp/parse-tree/oct-parse.cc"
3406 break;
3407
3408 case 5: /* input: parse_error */
3409#line 448 "../libinterp/parse-tree/oct-parse.yy"
3410 {
3411 (yyval.tree_type) = nullptr;
3412 YYABORT;
3413 }
3414#line 3415 "libinterp/parse-tree/oct-parse.cc"
3415 break;
3416
3417 case 6: /* simple_list: opt_sep_no_nl */
3418#line 455 "../libinterp/parse-tree/oct-parse.yy"
3419 {
3420 // FIXME: should we return an empty statement list
3421 // with the separators attached? For now, delete
3422 // the unused list.
3423 delete (yyvsp[0].sep_list_type);
3424
3425 (yyval.tree_statement_list_type) = nullptr;
3426 }
3427#line 3428 "libinterp/parse-tree/oct-parse.cc"
3428 break;
3429
3430 case 7: /* simple_list: simple_list1 opt_sep_no_nl */
3431#line 464 "../libinterp/parse-tree/oct-parse.yy"
3432 {
3433 (yyval.tree_statement_list_type) = parser.set_stmt_print_flag ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].sep_list_type), false);
3434
3435 // FIXME: Need to capture separator list here.
3436 // For now, delete the unused list.
3437 delete (yyvsp[0].sep_list_type);
3438 }
3439#line 3440 "libinterp/parse-tree/oct-parse.cc"
3440 break;
3441
3442 case 8: /* simple_list1: statement */
3443#line 474 "../libinterp/parse-tree/oct-parse.yy"
3444 { (yyval.tree_statement_list_type) = parser.make_statement_list ((yyvsp[0].tree_statement_type)); }
3445#line 3446 "libinterp/parse-tree/oct-parse.cc"
3446 break;
3447
3448 case 9: /* simple_list1: simple_list1 sep_no_nl statement */
3449#line 476 "../libinterp/parse-tree/oct-parse.yy"
3450 { (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), (yyvsp[0].tree_statement_type), false); }
3451#line 3452 "libinterp/parse-tree/oct-parse.cc"
3452 break;
3453
3454 case 10: /* statement_list: opt_sep opt_list */
3455#line 480 "../libinterp/parse-tree/oct-parse.yy"
3456 {
3457 // FIXME: Need to capture separator list here.
3458 // For now, delete the unused list.
3459 delete (yyvsp[-1].sep_list_type);
3460
3461 (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type);
3462 }
3463#line 3464 "libinterp/parse-tree/oct-parse.cc"
3464 break;
3465
3466 case 11: /* opt_list: %empty */
3467#line 490 "../libinterp/parse-tree/oct-parse.yy"
3468 { (yyval.tree_statement_list_type) = nullptr; }
3469#line 3470 "libinterp/parse-tree/oct-parse.cc"
3470 break;
3471
3472 case 12: /* opt_list: list */
3473#line 492 "../libinterp/parse-tree/oct-parse.yy"
3474 { (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type); }
3475#line 3476 "libinterp/parse-tree/oct-parse.cc"
3476 break;
3477
3478 case 13: /* list: list1 opt_sep */
3479#line 496 "../libinterp/parse-tree/oct-parse.yy"
3480 {
3481 (yyval.tree_statement_list_type) = parser.set_stmt_print_flag ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].sep_list_type), true);
3482
3483 // FIXME: Need to capture separator list here.
3484 // For now, delete the unused list.
3485 delete (yyvsp[0].sep_list_type);
3486 }
3487#line 3488 "libinterp/parse-tree/oct-parse.cc"
3488 break;
3489
3490 case 14: /* list1: statement */
3491#line 506 "../libinterp/parse-tree/oct-parse.yy"
3492 { (yyval.tree_statement_list_type) = parser.make_statement_list ((yyvsp[0].tree_statement_type)); }
3493#line 3494 "libinterp/parse-tree/oct-parse.cc"
3494 break;
3495
3496 case 15: /* list1: list1 sep statement */
3497#line 508 "../libinterp/parse-tree/oct-parse.yy"
3498 { (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), (yyvsp[0].tree_statement_type), true); }
3499#line 3500 "libinterp/parse-tree/oct-parse.cc"
3500 break;
3501
3502 case 16: /* opt_fcn_list: %empty */
3503#line 512 "../libinterp/parse-tree/oct-parse.yy"
3504 { (yyval.tree_statement_list_type) = nullptr; }
3505#line 3506 "libinterp/parse-tree/oct-parse.cc"
3506 break;
3507
3508 case 17: /* opt_fcn_list: fcn_list */
3509#line 514 "../libinterp/parse-tree/oct-parse.yy"
3510 { (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type); }
3511#line 3512 "libinterp/parse-tree/oct-parse.cc"
3512 break;
3513
3514 case 18: /* fcn_list: fcn_list1 opt_sep */
3515#line 518 "../libinterp/parse-tree/oct-parse.yy"
3516 {
3517 // FIXME: Need to capture separator list here.
3518 // For now, delete the unused list.
3519 delete (yyvsp[0].sep_list_type);
3520
3521 (yyval.tree_statement_list_type) = (yyvsp[-1].tree_statement_list_type);
3522 }
3523#line 3524 "libinterp/parse-tree/oct-parse.cc"
3524 break;
3525
3526 case 19: /* fcn_list1: function */
3527#line 528 "../libinterp/parse-tree/oct-parse.yy"
3528 { (yyval.tree_statement_list_type) = parser.make_function_def_list ((yyvsp[0].tree_function_def_type)); }
3529#line 3530 "libinterp/parse-tree/oct-parse.cc"
3530 break;
3531
3532 case 20: /* fcn_list1: fcn_list1 opt_sep function */
3533#line 530 "../libinterp/parse-tree/oct-parse.yy"
3534 { (yyval.tree_statement_list_type) = parser.append_function_def_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), (yyvsp[0].tree_function_def_type)); }
3535#line 3536 "libinterp/parse-tree/oct-parse.cc"
3536 break;
3537
3538 case 21: /* statement: expression */
3539#line 534 "../libinterp/parse-tree/oct-parse.yy"
3540 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_expression_type)); }
3541#line 3542 "libinterp/parse-tree/oct-parse.cc"
3542 break;
3543
3544 case 22: /* statement: command */
3545#line 536 "../libinterp/parse-tree/oct-parse.yy"
3546 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_command_type)); }
3547#line 3548 "libinterp/parse-tree/oct-parse.cc"
3548 break;
3549
3550 case 23: /* statement: word_list_cmd */
3551#line 538 "../libinterp/parse-tree/oct-parse.yy"
3552 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_index_expression_type)); }
3553#line 3554 "libinterp/parse-tree/oct-parse.cc"
3554 break;
3555
3556 case 24: /* word_list_cmd: identifier word_list */
3557#line 550 "../libinterp/parse-tree/oct-parse.yy"
3558 {
3559 if (! ((yyval.tree_index_expression_type) = parser.make_word_list_command ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_argument_list_type))))
3560 {
3561 // make_index_expression deleted $1 and $2.
3562 YYABORT;
3563 }
3564 }
3565#line 3566 "libinterp/parse-tree/oct-parse.cc"
3566 break;
3567
3568 case 25: /* word_list: string */
3569#line 560 "../libinterp/parse-tree/oct-parse.yy"
3570 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_constant_type)); }
3571#line 3572 "libinterp/parse-tree/oct-parse.cc"
3572 break;
3573
3574 case 26: /* word_list: word_list string */
3575#line 562 "../libinterp/parse-tree/oct-parse.yy"
3576 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-1].tree_argument_list_type), (yyvsp[0].tree_constant_type)); }
3577#line 3578 "libinterp/parse-tree/oct-parse.cc"
3578 break;
3579
3580 case 27: /* identifier: NAME */
3581#line 570 "../libinterp/parse-tree/oct-parse.yy"
3582 { (yyval.tree_identifier_type) = parser.make_identifier ((yyvsp[0].tok)); }
3583#line 3584 "libinterp/parse-tree/oct-parse.cc"
3584 break;
3585
3586 case 28: /* superclass_identifier: SUPERCLASSREF */
3587#line 575 "../libinterp/parse-tree/oct-parse.yy"
3588 { (yyval.tree_superclass_ref_type) = parser.make_superclass_ref ((yyvsp[0].tok)); }
3589#line 3590 "libinterp/parse-tree/oct-parse.cc"
3590 break;
3591
3592 case 29: /* meta_identifier: METAQUERY */
3593#line 579 "../libinterp/parse-tree/oct-parse.yy"
3594 { (yyval.tree_metaclass_query_type) = parser.make_metaclass_query ((yyvsp[0].tok)); }
3595#line 3596 "libinterp/parse-tree/oct-parse.cc"
3596 break;
3597
3598 case 30: /* string: DQ_STRING */
3599#line 583 "../libinterp/parse-tree/oct-parse.yy"
3600 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3601#line 3602 "libinterp/parse-tree/oct-parse.cc"
3602 break;
3603
3604 case 31: /* string: SQ_STRING */
3605#line 585 "../libinterp/parse-tree/oct-parse.yy"
3606 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3607#line 3608 "libinterp/parse-tree/oct-parse.cc"
3608 break;
3609
3610 case 32: /* constant: NUMBER */
3611#line 589 "../libinterp/parse-tree/oct-parse.yy"
3612 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3613#line 3614 "libinterp/parse-tree/oct-parse.cc"
3614 break;
3615
3616 case 33: /* constant: string */
3617#line 591 "../libinterp/parse-tree/oct-parse.yy"
3618 { (yyval.tree_constant_type) = (yyvsp[0].tree_constant_type); }
3619#line 3620 "libinterp/parse-tree/oct-parse.cc"
3620 break;
3621
3622 case 34: /* matrix: '[' matrix_rows ']' */
3623#line 595 "../libinterp/parse-tree/oct-parse.yy"
3624 { (yyval.tree_expression_type) = parser.finish_matrix ((yyvsp[-2].tok), (yyvsp[-1].tree_matrix_type), (yyvsp[0].tok)); }
3625#line 3626 "libinterp/parse-tree/oct-parse.cc"
3626 break;
3627
3628 case 35: /* matrix_rows: cell_or_matrix_row */
3629#line 599 "../libinterp/parse-tree/oct-parse.yy"
3630 { (yyval.tree_matrix_type) = parser.make_matrix ((yyvsp[0].tree_argument_list_type)); }
3631#line 3632 "libinterp/parse-tree/oct-parse.cc"
3632 break;
3633
3634 case 36: /* matrix_rows: matrix_rows ';' cell_or_matrix_row */
3635#line 601 "../libinterp/parse-tree/oct-parse.yy"
3636 { (yyval.tree_matrix_type) = parser.append_matrix_row ((yyvsp[-2].tree_matrix_type), (yyvsp[-1].tok), (yyvsp[0].tree_argument_list_type)); }
3637#line 3638 "libinterp/parse-tree/oct-parse.cc"
3638 break;
3639
3640 case 37: /* cell: '{' cell_rows '}' */
3641#line 605 "../libinterp/parse-tree/oct-parse.yy"
3642 { (yyval.tree_expression_type) = parser.finish_cell ((yyvsp[-2].tok), (yyvsp[-1].tree_cell_type), (yyvsp[0].tok)); }
3643#line 3644 "libinterp/parse-tree/oct-parse.cc"
3644 break;
3645
3646 case 38: /* cell_rows: cell_or_matrix_row */
3647#line 609 "../libinterp/parse-tree/oct-parse.yy"
3648 { (yyval.tree_cell_type) = parser.make_cell ((yyvsp[0].tree_argument_list_type)); }
3649#line 3650 "libinterp/parse-tree/oct-parse.cc"
3650 break;
3651
3652 case 39: /* cell_rows: cell_rows ';' cell_or_matrix_row */
3653#line 611 "../libinterp/parse-tree/oct-parse.yy"
3654 { (yyval.tree_cell_type) = parser.append_cell_row ((yyvsp[-2].tree_cell_type), (yyvsp[-1].tok), (yyvsp[0].tree_argument_list_type)); }
3655#line 3656 "libinterp/parse-tree/oct-parse.cc"
3656 break;
3657
3658 case 40: /* cell_or_matrix_row: %empty */
3659#line 623 "../libinterp/parse-tree/oct-parse.yy"
3660 { (yyval.tree_argument_list_type) = nullptr; }
3661#line 3662 "libinterp/parse-tree/oct-parse.cc"
3662 break;
3663
3664 case 41: /* cell_or_matrix_row: ',' */
3665#line 625 "../libinterp/parse-tree/oct-parse.yy"
3666 {
3667 // FIXME: Need to capture separator token info here.
3668 OCTAVE_YYUSE ((yyvsp[0].tok));
3669
3670 (yyval.tree_argument_list_type) = nullptr;
3671 }
3672#line 3673 "libinterp/parse-tree/oct-parse.cc"
3673 break;
3674
3675 case 42: /* cell_or_matrix_row: arg_list */
3676#line 632 "../libinterp/parse-tree/oct-parse.yy"
3677 { (yyval.tree_argument_list_type) = (yyvsp[0].tree_argument_list_type); }
3678#line 3679 "libinterp/parse-tree/oct-parse.cc"
3679 break;
3680
3681 case 43: /* cell_or_matrix_row: arg_list ',' */
3682#line 634 "../libinterp/parse-tree/oct-parse.yy"
3683 {
3684 // FIXME: Need to capture separator token info here.
3685 OCTAVE_YYUSE ((yyvsp[0].tok));
3686
3687 (yyval.tree_argument_list_type) = (yyvsp[-1].tree_argument_list_type);
3688 }
3689#line 3690 "libinterp/parse-tree/oct-parse.cc"
3690 break;
3691
3692 case 44: /* cell_or_matrix_row: ',' arg_list */
3693#line 641 "../libinterp/parse-tree/oct-parse.yy"
3694 {
3695 // FIXME: Need to capture separator token info here.
3696 OCTAVE_YYUSE ((yyvsp[-1].tok));
3697
3698 (yyval.tree_argument_list_type) = (yyvsp[0].tree_argument_list_type);
3699 }
3700#line 3701 "libinterp/parse-tree/oct-parse.cc"
3701 break;
3702
3703 case 45: /* cell_or_matrix_row: ',' arg_list ',' */
3704#line 648 "../libinterp/parse-tree/oct-parse.yy"
3705 {
3706 // FIXME: Need to capture separator token info here.
3707 OCTAVE_YYUSE ((yyvsp[-2].tok), (yyvsp[0].tok));
3708
3709 (yyval.tree_argument_list_type) = (yyvsp[-1].tree_argument_list_type);
3710 }
3711#line 3712 "libinterp/parse-tree/oct-parse.cc"
3712 break;
3713
3714 case 46: /* fcn_handle: FCN_HANDLE */
3715#line 657 "../libinterp/parse-tree/oct-parse.yy"
3716 { (yyval.tree_fcn_handle_type) = parser.make_fcn_handle ((yyvsp[0].tok)); }
3717#line 3718 "libinterp/parse-tree/oct-parse.cc"
3718 break;
3719
3720 case 47: /* anon_fcn_handle: '@' param_list anon_fcn_begin expression */
3721#line 665 "../libinterp/parse-tree/oct-parse.yy"
3722 {
3723 if (! ((yyval.tree_anon_fcn_handle_type) = parser.make_anon_fcn_handle ((yyvsp[-3].tok), (yyvsp[-2].tree_parameter_list_type), (yyvsp[0].tree_expression_type))))
3724 {
3725 // make_anon_fcn_handle deleted $2 and $4.
3726 YYABORT;
3727 }
3728
3731 }
3732#line 3733 "libinterp/parse-tree/oct-parse.cc"
3733 break;
3734
3735 case 48: /* anon_fcn_handle: '@' param_list anon_fcn_begin error */
3736#line 676 "../libinterp/parse-tree/oct-parse.yy"
3737 {
3738 OCTAVE_YYUSE ((yyvsp[-3].tok), (yyvsp[-2].tree_parameter_list_type));
3739
3741
3742 (yyval.tree_anon_fcn_handle_type) = nullptr;
3743
3744 parser.bison_error ("anonymous function bodies must be single expressions");
3745 YYABORT;
3746 }
3747#line 3748 "libinterp/parse-tree/oct-parse.cc"
3748 break;
3749
3750 case 49: /* primary_expr: identifier */
3751#line 689 "../libinterp/parse-tree/oct-parse.yy"
3752 { (yyval.tree_expression_type) = (yyvsp[0].tree_identifier_type); }
3753#line 3754 "libinterp/parse-tree/oct-parse.cc"
3754 break;
3755
3756 case 50: /* primary_expr: constant */
3757#line 691 "../libinterp/parse-tree/oct-parse.yy"
3758 { (yyval.tree_expression_type) = (yyvsp[0].tree_constant_type); }
3759#line 3760 "libinterp/parse-tree/oct-parse.cc"
3760 break;
3761
3762 case 51: /* primary_expr: fcn_handle */
3763#line 693 "../libinterp/parse-tree/oct-parse.yy"
3764 { (yyval.tree_expression_type) = (yyvsp[0].tree_fcn_handle_type); }
3765#line 3766 "libinterp/parse-tree/oct-parse.cc"
3766 break;
3767
3768 case 52: /* primary_expr: matrix */
3769#line 695 "../libinterp/parse-tree/oct-parse.yy"
3770 {
3772 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
3773 }
3774#line 3775 "libinterp/parse-tree/oct-parse.cc"
3775 break;
3776
3777 case 53: /* primary_expr: cell */
3778#line 700 "../libinterp/parse-tree/oct-parse.yy"
3779 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
3780#line 3781 "libinterp/parse-tree/oct-parse.cc"
3781 break;
3782
3783 case 54: /* primary_expr: meta_identifier */
3784#line 702 "../libinterp/parse-tree/oct-parse.yy"
3785 { (yyval.tree_expression_type) = (yyvsp[0].tree_metaclass_query_type); }
3786#line 3787 "libinterp/parse-tree/oct-parse.cc"
3787 break;
3788
3789 case 55: /* primary_expr: superclass_identifier */
3790#line 704 "../libinterp/parse-tree/oct-parse.yy"
3791 { (yyval.tree_expression_type) = (yyvsp[0].tree_superclass_ref_type); }
3792#line 3793 "libinterp/parse-tree/oct-parse.cc"
3793 break;
3794
3795 case 56: /* primary_expr: '(' expression ')' */
3796#line 706 "../libinterp/parse-tree/oct-parse.yy"
3797 { (yyval.tree_expression_type) = (yyvsp[-1].tree_expression_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok))); }
3798#line 3799 "libinterp/parse-tree/oct-parse.cc"
3799 break;
3800
3801 case 57: /* magic_colon: ':' */
3802#line 710 "../libinterp/parse-tree/oct-parse.yy"
3803 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3804#line 3805 "libinterp/parse-tree/oct-parse.cc"
3805 break;
3806
3807 case 58: /* magic_tilde: '~' */
3808#line 714 "../libinterp/parse-tree/oct-parse.yy"
3809 { (yyval.tree_identifier_type) = parser.make_black_hole ((yyvsp[0].tok)); }
3810#line 3811 "libinterp/parse-tree/oct-parse.cc"
3811 break;
3812
3813 case 59: /* arg_list: expression */
3814#line 718 "../libinterp/parse-tree/oct-parse.yy"
3815 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_expression_type)); }
3816#line 3817 "libinterp/parse-tree/oct-parse.cc"
3817 break;
3818
3819 case 60: /* arg_list: magic_colon */
3820#line 720 "../libinterp/parse-tree/oct-parse.yy"
3821 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_constant_type)); }
3822#line 3823 "libinterp/parse-tree/oct-parse.cc"
3823 break;
3824
3825 case 61: /* arg_list: magic_tilde */
3826#line 722 "../libinterp/parse-tree/oct-parse.yy"
3827 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_identifier_type)); }
3828#line 3829 "libinterp/parse-tree/oct-parse.cc"
3829 break;
3830
3831 case 62: /* arg_list: arg_list ',' magic_colon */
3832#line 724 "../libinterp/parse-tree/oct-parse.yy"
3833 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_constant_type)); }
3834#line 3835 "libinterp/parse-tree/oct-parse.cc"
3835 break;
3836
3837 case 63: /* arg_list: arg_list ',' magic_tilde */
3838#line 726 "../libinterp/parse-tree/oct-parse.yy"
3839 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
3840#line 3841 "libinterp/parse-tree/oct-parse.cc"
3841 break;
3842
3843 case 64: /* arg_list: arg_list ',' expression */
3844#line 728 "../libinterp/parse-tree/oct-parse.yy"
3845 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3846#line 3847 "libinterp/parse-tree/oct-parse.cc"
3847 break;
3848
3849 case 65: /* indirect_ref_op: '.' */
3850#line 732 "../libinterp/parse-tree/oct-parse.yy"
3851 {
3853 (yyval.tok) = (yyvsp[0].tok);
3854 }
3855#line 3856 "libinterp/parse-tree/oct-parse.cc"
3856 break;
3857
3858 case 66: /* oper_expr: primary_expr */
3859#line 739 "../libinterp/parse-tree/oct-parse.yy"
3860 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
3861#line 3862 "libinterp/parse-tree/oct-parse.cc"
3862 break;
3863
3864 case 67: /* oper_expr: oper_expr PLUS_PLUS */
3865#line 741 "../libinterp/parse-tree/oct-parse.yy"
3866 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3867#line 3868 "libinterp/parse-tree/oct-parse.cc"
3868 break;
3869
3870 case 68: /* oper_expr: oper_expr MINUS_MINUS */
3871#line 743 "../libinterp/parse-tree/oct-parse.yy"
3872 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3873#line 3874 "libinterp/parse-tree/oct-parse.cc"
3874 break;
3875
3876 case 69: /* oper_expr: oper_expr '(' ')' */
3877#line 745 "../libinterp/parse-tree/oct-parse.yy"
3878 {
3879 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '(')))
3880 {
3881 // make_index_expression deleted $1.
3882 YYABORT;
3883 }
3884 }
3885#line 3886 "libinterp/parse-tree/oct-parse.cc"
3886 break;
3887
3888 case 70: /* oper_expr: oper_expr '(' arg_list ')' */
3889#line 753 "../libinterp/parse-tree/oct-parse.yy"
3890 {
3891 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '(')))
3892 {
3893 // make_index_expression deleted $1 and $3.
3894 YYABORT;
3895 }
3896 }
3897#line 3898 "libinterp/parse-tree/oct-parse.cc"
3898 break;
3899
3900 case 71: /* oper_expr: oper_expr '{' '}' */
3901#line 761 "../libinterp/parse-tree/oct-parse.yy"
3902 {
3903 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '{')))
3904 {
3905 // make_index_expression deleted $1.
3906 YYABORT;
3907 }
3908 }
3909#line 3910 "libinterp/parse-tree/oct-parse.cc"
3910 break;
3911
3912 case 72: /* oper_expr: oper_expr '{' arg_list '}' */
3913#line 769 "../libinterp/parse-tree/oct-parse.yy"
3914 {
3915 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '{')))
3916 {
3917 // make_index_expression deleted $1 and $3.
3918 YYABORT;
3919 }
3920 }
3921#line 3922 "libinterp/parse-tree/oct-parse.cc"
3922 break;
3923
3924 case 73: /* oper_expr: oper_expr HERMITIAN */
3925#line 777 "../libinterp/parse-tree/oct-parse.yy"
3926 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3927#line 3928 "libinterp/parse-tree/oct-parse.cc"
3928 break;
3929
3930 case 74: /* oper_expr: oper_expr TRANSPOSE */
3931#line 779 "../libinterp/parse-tree/oct-parse.yy"
3932 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3933#line 3934 "libinterp/parse-tree/oct-parse.cc"
3934 break;
3935
3936 case 75: /* oper_expr: oper_expr indirect_ref_op STRUCT_ELT */
3937#line 781 "../libinterp/parse-tree/oct-parse.yy"
3938 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tok)); }
3939#line 3940 "libinterp/parse-tree/oct-parse.cc"
3940 break;
3941
3942 case 76: /* oper_expr: oper_expr indirect_ref_op '(' expression ')' */
3943#line 783 "../libinterp/parse-tree/oct-parse.yy"
3944 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-4].tree_expression_type), (yyvsp[-3].tok), (yyvsp[-2].tok), (yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3945#line 3946 "libinterp/parse-tree/oct-parse.cc"
3946 break;
3947
3948 case 77: /* oper_expr: PLUS_PLUS oper_expr */
3949#line 785 "../libinterp/parse-tree/oct-parse.yy"
3950 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3951#line 3952 "libinterp/parse-tree/oct-parse.cc"
3952 break;
3953
3954 case 78: /* oper_expr: MINUS_MINUS oper_expr */
3955#line 787 "../libinterp/parse-tree/oct-parse.yy"
3956 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3957#line 3958 "libinterp/parse-tree/oct-parse.cc"
3958 break;
3959
3960 case 79: /* oper_expr: '~' oper_expr */
3961#line 789 "../libinterp/parse-tree/oct-parse.yy"
3962 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3963#line 3964 "libinterp/parse-tree/oct-parse.cc"
3964 break;
3965
3966 case 80: /* oper_expr: '!' oper_expr */
3967#line 791 "../libinterp/parse-tree/oct-parse.yy"
3968 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3969#line 3970 "libinterp/parse-tree/oct-parse.cc"
3970 break;
3971
3972 case 81: /* oper_expr: '+' oper_expr */
3973#line 793 "../libinterp/parse-tree/oct-parse.yy"
3974 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3975#line 3976 "libinterp/parse-tree/oct-parse.cc"
3976 break;
3977
3978 case 82: /* oper_expr: '-' oper_expr */
3979#line 795 "../libinterp/parse-tree/oct-parse.yy"
3980 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3981#line 3982 "libinterp/parse-tree/oct-parse.cc"
3982 break;
3983
3984 case 83: /* oper_expr: oper_expr POW power_expr */
3985#line 797 "../libinterp/parse-tree/oct-parse.yy"
3986 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3987#line 3988 "libinterp/parse-tree/oct-parse.cc"
3988 break;
3989
3990 case 84: /* oper_expr: oper_expr EPOW power_expr */
3991#line 799 "../libinterp/parse-tree/oct-parse.yy"
3992 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3993#line 3994 "libinterp/parse-tree/oct-parse.cc"
3994 break;
3995
3996 case 85: /* oper_expr: oper_expr '+' oper_expr */
3997#line 801 "../libinterp/parse-tree/oct-parse.yy"
3998 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3999#line 4000 "libinterp/parse-tree/oct-parse.cc"
4000 break;
4001
4002 case 86: /* oper_expr: oper_expr '-' oper_expr */
4003#line 803 "../libinterp/parse-tree/oct-parse.yy"
4004 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4005#line 4006 "libinterp/parse-tree/oct-parse.cc"
4006 break;
4007
4008 case 87: /* oper_expr: oper_expr '*' oper_expr */
4009#line 805 "../libinterp/parse-tree/oct-parse.yy"
4010 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4011#line 4012 "libinterp/parse-tree/oct-parse.cc"
4012 break;
4013
4014 case 88: /* oper_expr: oper_expr '/' oper_expr */
4015#line 807 "../libinterp/parse-tree/oct-parse.yy"
4016 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4017#line 4018 "libinterp/parse-tree/oct-parse.cc"
4018 break;
4019
4020 case 89: /* oper_expr: oper_expr EMUL oper_expr */
4021#line 809 "../libinterp/parse-tree/oct-parse.yy"
4022 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4023#line 4024 "libinterp/parse-tree/oct-parse.cc"
4024 break;
4025
4026 case 90: /* oper_expr: oper_expr EDIV oper_expr */
4027#line 811 "../libinterp/parse-tree/oct-parse.yy"
4028 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4029#line 4030 "libinterp/parse-tree/oct-parse.cc"
4030 break;
4031
4032 case 91: /* oper_expr: oper_expr LEFTDIV oper_expr */
4033#line 813 "../libinterp/parse-tree/oct-parse.yy"
4034 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4035#line 4036 "libinterp/parse-tree/oct-parse.cc"
4036 break;
4037
4038 case 92: /* oper_expr: oper_expr ELEFTDIV oper_expr */
4039#line 815 "../libinterp/parse-tree/oct-parse.yy"
4040 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4041#line 4042 "libinterp/parse-tree/oct-parse.cc"
4042 break;
4043
4044 case 93: /* power_expr: primary_expr */
4045#line 819 "../libinterp/parse-tree/oct-parse.yy"
4046 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4047#line 4048 "libinterp/parse-tree/oct-parse.cc"
4048 break;
4049
4050 case 94: /* power_expr: power_expr PLUS_PLUS */
4051#line 821 "../libinterp/parse-tree/oct-parse.yy"
4052 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
4053#line 4054 "libinterp/parse-tree/oct-parse.cc"
4054 break;
4055
4056 case 95: /* power_expr: power_expr MINUS_MINUS */
4057#line 823 "../libinterp/parse-tree/oct-parse.yy"
4058 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
4059#line 4060 "libinterp/parse-tree/oct-parse.cc"
4060 break;
4061
4062 case 96: /* power_expr: power_expr '(' ')' */
4063#line 825 "../libinterp/parse-tree/oct-parse.yy"
4064 {
4065 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '(')))
4066 {
4067 // make_index_expression deleted $1.
4068 YYABORT;
4069 }
4070 }
4071#line 4072 "libinterp/parse-tree/oct-parse.cc"
4072 break;
4073
4074 case 97: /* power_expr: power_expr '(' arg_list ')' */
4075#line 833 "../libinterp/parse-tree/oct-parse.yy"
4076 {
4077 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '(')))
4078 {
4079 // make_index_expression deleted $1 and $3.
4080 YYABORT;
4081 }
4082 }
4083#line 4084 "libinterp/parse-tree/oct-parse.cc"
4084 break;
4085
4086 case 98: /* power_expr: power_expr '{' '}' */
4087#line 841 "../libinterp/parse-tree/oct-parse.yy"
4088 {
4089 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '{')))
4090 {
4091 // make_index_expression deleted $1.
4092 YYABORT;
4093 }
4094 }
4095#line 4096 "libinterp/parse-tree/oct-parse.cc"
4096 break;
4097
4098 case 99: /* power_expr: power_expr '{' arg_list '}' */
4099#line 849 "../libinterp/parse-tree/oct-parse.yy"
4100 {
4101 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '{')))
4102 {
4103 // make_index_expression deleted $1 and $3.
4104 YYABORT;
4105 }
4106 }
4107#line 4108 "libinterp/parse-tree/oct-parse.cc"
4108 break;
4109
4110 case 100: /* power_expr: power_expr indirect_ref_op STRUCT_ELT */
4111#line 857 "../libinterp/parse-tree/oct-parse.yy"
4112 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tok)); }
4113#line 4114 "libinterp/parse-tree/oct-parse.cc"
4114 break;
4115
4116 case 101: /* power_expr: power_expr indirect_ref_op '(' expression ')' */
4117#line 859 "../libinterp/parse-tree/oct-parse.yy"
4118 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-4].tree_expression_type), (yyvsp[-3].tok), (yyvsp[-2].tok), (yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
4119#line 4120 "libinterp/parse-tree/oct-parse.cc"
4120 break;
4121
4122 case 102: /* power_expr: PLUS_PLUS power_expr */
4123#line 861 "../libinterp/parse-tree/oct-parse.yy"
4124 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4125#line 4126 "libinterp/parse-tree/oct-parse.cc"
4126 break;
4127
4128 case 103: /* power_expr: MINUS_MINUS power_expr */
4129#line 863 "../libinterp/parse-tree/oct-parse.yy"
4130 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4131#line 4132 "libinterp/parse-tree/oct-parse.cc"
4132 break;
4133
4134 case 104: /* power_expr: '~' power_expr */
4135#line 865 "../libinterp/parse-tree/oct-parse.yy"
4136 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4137#line 4138 "libinterp/parse-tree/oct-parse.cc"
4138 break;
4139
4140 case 105: /* power_expr: '!' power_expr */
4141#line 867 "../libinterp/parse-tree/oct-parse.yy"
4142 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4143#line 4144 "libinterp/parse-tree/oct-parse.cc"
4144 break;
4145
4146 case 106: /* power_expr: '+' power_expr */
4147#line 869 "../libinterp/parse-tree/oct-parse.yy"
4148 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4149#line 4150 "libinterp/parse-tree/oct-parse.cc"
4150 break;
4151
4152 case 107: /* power_expr: '-' power_expr */
4153#line 871 "../libinterp/parse-tree/oct-parse.yy"
4154 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4155#line 4156 "libinterp/parse-tree/oct-parse.cc"
4156 break;
4157
4158 case 108: /* colon_expr: oper_expr ':' oper_expr */
4159#line 875 "../libinterp/parse-tree/oct-parse.yy"
4160 {
4161 if (! ((yyval.tree_expression_type) = parser.make_colon_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type))))
4162 {
4163 // make_colon_expression deleted $1 and $3.
4164 YYABORT;
4165 }
4166 }
4167#line 4168 "libinterp/parse-tree/oct-parse.cc"
4168 break;
4169
4170 case 109: /* colon_expr: oper_expr ':' oper_expr ':' oper_expr */
4171#line 883 "../libinterp/parse-tree/oct-parse.yy"
4172 {
4173 if (! ((yyval.tree_expression_type) = parser.make_colon_expression ((yyvsp[-4].tree_expression_type), (yyvsp[-3].tok), (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type))))
4174 {
4175 // make_colon_expression deleted $1, $3, and $5.
4176 YYABORT;
4177 }
4178 }
4179#line 4180 "libinterp/parse-tree/oct-parse.cc"
4180 break;
4181
4182 case 110: /* simple_expr: oper_expr */
4183#line 893 "../libinterp/parse-tree/oct-parse.yy"
4184 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4185#line 4186 "libinterp/parse-tree/oct-parse.cc"
4186 break;
4187
4188 case 111: /* simple_expr: colon_expr */
4189#line 895 "../libinterp/parse-tree/oct-parse.yy"
4190 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4191#line 4192 "libinterp/parse-tree/oct-parse.cc"
4192 break;
4193
4194 case 112: /* simple_expr: simple_expr EXPR_LT simple_expr */
4195#line 897 "../libinterp/parse-tree/oct-parse.yy"
4196 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4197#line 4198 "libinterp/parse-tree/oct-parse.cc"
4198 break;
4199
4200 case 113: /* simple_expr: simple_expr EXPR_LE simple_expr */
4201#line 899 "../libinterp/parse-tree/oct-parse.yy"
4202 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4203#line 4204 "libinterp/parse-tree/oct-parse.cc"
4204 break;
4205
4206 case 114: /* simple_expr: simple_expr EXPR_EQ simple_expr */
4207#line 901 "../libinterp/parse-tree/oct-parse.yy"
4208 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4209#line 4210 "libinterp/parse-tree/oct-parse.cc"
4210 break;
4211
4212 case 115: /* simple_expr: simple_expr EXPR_GE simple_expr */
4213#line 903 "../libinterp/parse-tree/oct-parse.yy"
4214 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4215#line 4216 "libinterp/parse-tree/oct-parse.cc"
4216 break;
4217
4218 case 116: /* simple_expr: simple_expr EXPR_GT simple_expr */
4219#line 905 "../libinterp/parse-tree/oct-parse.yy"
4220 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4221#line 4222 "libinterp/parse-tree/oct-parse.cc"
4222 break;
4223
4224 case 117: /* simple_expr: simple_expr EXPR_NE simple_expr */
4225#line 907 "../libinterp/parse-tree/oct-parse.yy"
4226 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4227#line 4228 "libinterp/parse-tree/oct-parse.cc"
4228 break;
4229
4230 case 118: /* simple_expr: simple_expr EXPR_AND simple_expr */
4231#line 909 "../libinterp/parse-tree/oct-parse.yy"
4232 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4233#line 4234 "libinterp/parse-tree/oct-parse.cc"
4234 break;
4235
4236 case 119: /* simple_expr: simple_expr EXPR_OR simple_expr */
4237#line 911 "../libinterp/parse-tree/oct-parse.yy"
4238 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4239#line 4240 "libinterp/parse-tree/oct-parse.cc"
4240 break;
4241
4242 case 120: /* simple_expr: simple_expr EXPR_AND_AND simple_expr */
4243#line 913 "../libinterp/parse-tree/oct-parse.yy"
4244 { (yyval.tree_expression_type) = parser.make_boolean_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4245#line 4246 "libinterp/parse-tree/oct-parse.cc"
4246 break;
4247
4248 case 121: /* simple_expr: simple_expr EXPR_OR_OR simple_expr */
4249#line 915 "../libinterp/parse-tree/oct-parse.yy"
4250 { (yyval.tree_expression_type) = parser.make_boolean_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4251#line 4252 "libinterp/parse-tree/oct-parse.cc"
4252 break;
4253
4254 case 122: /* assign_lhs: simple_expr */
4255#line 919 "../libinterp/parse-tree/oct-parse.yy"
4256 {
4257 if (! ((yyval.tree_argument_list_type) = parser.validate_matrix_for_assignment ((yyvsp[0].tree_expression_type))))
4258 {
4259 // validate_matrix_for_assignment deleted $1.
4260 YYABORT;
4261 }
4262
4264 }
4265#line 4266 "libinterp/parse-tree/oct-parse.cc"
4266 break;
4267
4268 case 123: /* assign_expr: assign_lhs '=' expression */
4269#line 931 "../libinterp/parse-tree/oct-parse.yy"
4270 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4271#line 4272 "libinterp/parse-tree/oct-parse.cc"
4272 break;
4273
4274 case 124: /* assign_expr: assign_lhs ADD_EQ expression */
4275#line 933 "../libinterp/parse-tree/oct-parse.yy"
4276 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4277#line 4278 "libinterp/parse-tree/oct-parse.cc"
4278 break;
4279
4280 case 125: /* assign_expr: assign_lhs SUB_EQ expression */
4281#line 935 "../libinterp/parse-tree/oct-parse.yy"
4282 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4283#line 4284 "libinterp/parse-tree/oct-parse.cc"
4284 break;
4285
4286 case 126: /* assign_expr: assign_lhs MUL_EQ expression */
4287#line 937 "../libinterp/parse-tree/oct-parse.yy"
4288 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4289#line 4290 "libinterp/parse-tree/oct-parse.cc"
4290 break;
4291
4292 case 127: /* assign_expr: assign_lhs DIV_EQ expression */
4293#line 939 "../libinterp/parse-tree/oct-parse.yy"
4294 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4295#line 4296 "libinterp/parse-tree/oct-parse.cc"
4296 break;
4297
4298 case 128: /* assign_expr: assign_lhs LEFTDIV_EQ expression */
4299#line 941 "../libinterp/parse-tree/oct-parse.yy"
4300 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4301#line 4302 "libinterp/parse-tree/oct-parse.cc"
4302 break;
4303
4304 case 129: /* assign_expr: assign_lhs POW_EQ expression */
4305#line 943 "../libinterp/parse-tree/oct-parse.yy"
4306 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4307#line 4308 "libinterp/parse-tree/oct-parse.cc"
4308 break;
4309
4310 case 130: /* assign_expr: assign_lhs EMUL_EQ expression */
4311#line 945 "../libinterp/parse-tree/oct-parse.yy"
4312 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4313#line 4314 "libinterp/parse-tree/oct-parse.cc"
4314 break;
4315
4316 case 131: /* assign_expr: assign_lhs EDIV_EQ expression */
4317#line 947 "../libinterp/parse-tree/oct-parse.yy"
4318 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4319#line 4320 "libinterp/parse-tree/oct-parse.cc"
4320 break;
4321
4322 case 132: /* assign_expr: assign_lhs ELEFTDIV_EQ expression */
4323#line 949 "../libinterp/parse-tree/oct-parse.yy"
4324 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4325#line 4326 "libinterp/parse-tree/oct-parse.cc"
4326 break;
4327
4328 case 133: /* assign_expr: assign_lhs EPOW_EQ expression */
4329#line 951 "../libinterp/parse-tree/oct-parse.yy"
4330 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4331#line 4332 "libinterp/parse-tree/oct-parse.cc"
4332 break;
4333
4334 case 134: /* assign_expr: assign_lhs AND_EQ expression */
4335#line 953 "../libinterp/parse-tree/oct-parse.yy"
4336 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4337#line 4338 "libinterp/parse-tree/oct-parse.cc"
4338 break;
4339
4340 case 135: /* assign_expr: assign_lhs OR_EQ expression */
4341#line 955 "../libinterp/parse-tree/oct-parse.yy"
4342 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4343#line 4344 "libinterp/parse-tree/oct-parse.cc"
4344 break;
4345
4346 case 136: /* expression: simple_expr */
4347#line 959 "../libinterp/parse-tree/oct-parse.yy"
4348 {
4349 if ((yyvsp[0].tree_expression_type) && ((yyvsp[0].tree_expression_type)->is_matrix () || (yyvsp[0].tree_expression_type)->iscell ()))
4350 {
4351 if (parser.validate_array_list ((yyvsp[0].tree_expression_type)))
4352 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4353 else
4354 {
4355 delete (yyvsp[0].tree_expression_type);
4356 YYABORT;
4357 }
4358 }
4359 else
4360 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4361 }
4362#line 4363 "libinterp/parse-tree/oct-parse.cc"
4363 break;
4364
4365 case 137: /* expression: assign_expr */
4366#line 974 "../libinterp/parse-tree/oct-parse.yy"
4367 {
4368 if (! (yyvsp[0].tree_expression_type))
4369 YYABORT;
4370
4371 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4372 }
4373#line 4374 "libinterp/parse-tree/oct-parse.cc"
4374 break;
4375
4376 case 138: /* expression: anon_fcn_handle */
4377#line 981 "../libinterp/parse-tree/oct-parse.yy"
4378 { (yyval.tree_expression_type) = (yyvsp[0].tree_anon_fcn_handle_type); }
4379#line 4380 "libinterp/parse-tree/oct-parse.cc"
4380 break;
4381
4382 case 139: /* command: declaration */
4383#line 989 "../libinterp/parse-tree/oct-parse.yy"
4384 { (yyval.tree_command_type) = (yyvsp[0].tree_decl_command_type); }
4385#line 4386 "libinterp/parse-tree/oct-parse.cc"
4386 break;
4387
4388 case 140: /* command: select_command */
4389#line 991 "../libinterp/parse-tree/oct-parse.yy"
4390 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4391#line 4392 "libinterp/parse-tree/oct-parse.cc"
4392 break;
4393
4394 case 141: /* command: loop_command */
4395#line 993 "../libinterp/parse-tree/oct-parse.yy"
4396 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4397#line 4398 "libinterp/parse-tree/oct-parse.cc"
4398 break;
4399
4400 case 142: /* command: jump_command */
4401#line 995 "../libinterp/parse-tree/oct-parse.yy"
4402 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4403#line 4404 "libinterp/parse-tree/oct-parse.cc"
4404 break;
4405
4406 case 143: /* command: spmd_command */
4407#line 997 "../libinterp/parse-tree/oct-parse.yy"
4408 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4409#line 4410 "libinterp/parse-tree/oct-parse.cc"
4410 break;
4411
4412 case 144: /* command: except_command */
4413#line 999 "../libinterp/parse-tree/oct-parse.yy"
4414 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4415#line 4416 "libinterp/parse-tree/oct-parse.cc"
4416 break;
4417
4418 case 145: /* command: function */
4419#line 1001 "../libinterp/parse-tree/oct-parse.yy"
4420 { (yyval.tree_command_type) = (yyvsp[0].tree_function_def_type); }
4421#line 4422 "libinterp/parse-tree/oct-parse.cc"
4422 break;
4423
4424 case 146: /* declaration: GLOBAL decl_init_list */
4425#line 1009 "../libinterp/parse-tree/oct-parse.yy"
4426 {
4427 (yyval.tree_decl_command_type) = parser.make_decl_command ((yyvsp[-1].tok), (yyvsp[0].tree_decl_init_list_type));
4429 }
4430#line 4431 "libinterp/parse-tree/oct-parse.cc"
4431 break;
4432
4433 case 147: /* declaration: PERSISTENT decl_init_list */
4434#line 1014 "../libinterp/parse-tree/oct-parse.yy"
4435 {
4436 (yyval.tree_decl_command_type) = parser.make_decl_command ((yyvsp[-1].tok), (yyvsp[0].tree_decl_init_list_type));
4438 }
4439#line 4440 "libinterp/parse-tree/oct-parse.cc"
4440 break;
4441
4442 case 148: /* decl_init_list: decl_elt */
4443#line 1021 "../libinterp/parse-tree/oct-parse.yy"
4444 { (yyval.tree_decl_init_list_type) = parser.make_decl_init_list ((yyvsp[0].tree_decl_elt_type)); }
4445#line 4446 "libinterp/parse-tree/oct-parse.cc"
4446 break;
4447
4448 case 149: /* decl_init_list: decl_init_list decl_elt */
4449#line 1023 "../libinterp/parse-tree/oct-parse.yy"
4450 { (yyval.tree_decl_init_list_type) = parser.append_decl_init_list ((yyvsp[-1].tree_decl_init_list_type), (yyvsp[0].tree_decl_elt_type)); }
4451#line 4452 "libinterp/parse-tree/oct-parse.cc"
4452 break;
4453
4454 case 150: /* decl_elt: identifier */
4455#line 1027 "../libinterp/parse-tree/oct-parse.yy"
4456 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[0].tree_identifier_type)); }
4457#line 4458 "libinterp/parse-tree/oct-parse.cc"
4458 break;
4459
4460 case 151: /* decl_elt: identifier '=' expression */
4461#line 1029 "../libinterp/parse-tree/oct-parse.yy"
4462 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[-2].tree_identifier_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4463#line 4464 "libinterp/parse-tree/oct-parse.cc"
4464 break;
4465
4466 case 152: /* select_command: if_command */
4467#line 1037 "../libinterp/parse-tree/oct-parse.yy"
4468 { (yyval.tree_command_type) = (yyvsp[0].tree_if_command_type); }
4469#line 4470 "libinterp/parse-tree/oct-parse.cc"
4470 break;
4471
4472 case 153: /* select_command: switch_command */
4473#line 1039 "../libinterp/parse-tree/oct-parse.yy"
4474 { (yyval.tree_command_type) = (yyvsp[0].tree_switch_command_type); }
4475#line 4476 "libinterp/parse-tree/oct-parse.cc"
4476 break;
4477
4478 case 154: /* if_command: if_clause_list else_clause END */
4479#line 1047 "../libinterp/parse-tree/oct-parse.yy"
4480 {
4481 if (! ((yyval.tree_if_command_type) = parser.finish_if_command ((yyvsp[-2].tree_if_command_list_type), (yyvsp[-1].tree_if_clause_type), (yyvsp[0].tok))))
4482 {
4483 // finish_if_command deleted $1 and $2.
4484 YYABORT;
4485 }
4486 }
4487#line 4488 "libinterp/parse-tree/oct-parse.cc"
4488 break;
4489
4490 case 155: /* if_clause_list: if_clause */
4491#line 1057 "../libinterp/parse-tree/oct-parse.yy"
4492 { (yyval.tree_if_command_list_type) = parser.start_if_command ((yyvsp[0].tree_if_clause_type)); }
4493#line 4494 "libinterp/parse-tree/oct-parse.cc"
4494 break;
4495
4496 case 156: /* if_clause_list: if_clause_list elseif_clause */
4497#line 1059 "../libinterp/parse-tree/oct-parse.yy"
4498 { (yyval.tree_if_command_list_type) = parser.append_if_clause ((yyvsp[-1].tree_if_command_list_type), (yyvsp[0].tree_if_clause_type)); }
4499#line 4500 "libinterp/parse-tree/oct-parse.cc"
4500 break;
4501
4502 case 157: /* if_clause: IF opt_sep expression stmt_begin statement_list */
4503#line 1063 "../libinterp/parse-tree/oct-parse.yy"
4504 { (yyval.tree_if_clause_type) = parser.make_if_clause ((yyvsp[-4].tok), (yyvsp[-3].sep_list_type), (yyvsp[-2].tree_expression_type), (yyvsp[0].tree_statement_list_type)); }
4505#line 4506 "libinterp/parse-tree/oct-parse.cc"
4506 break;
4507
4508 case 158: /* elseif_clause: ELSEIF opt_sep expression stmt_begin statement_list */
4509#line 1067 "../libinterp/parse-tree/oct-parse.yy"
4510 { (yyval.tree_if_clause_type) = parser.make_if_clause ((yyvsp[-4].tok), (yyvsp[-3].sep_list_type), (yyvsp[-2].tree_expression_type), (yyvsp[0].tree_statement_list_type)); }
4511#line 4512 "libinterp/parse-tree/oct-parse.cc"
4512 break;
4513
4514 case 159: /* else_clause: %empty */
4515#line 1071 "../libinterp/parse-tree/oct-parse.yy"
4516 { (yyval.tree_if_clause_type) = nullptr; }
4517#line 4518 "libinterp/parse-tree/oct-parse.cc"
4518 break;
4519
4520 case 160: /* else_clause: ELSE statement_list */
4521#line 1073 "../libinterp/parse-tree/oct-parse.yy"
4522 { (yyval.tree_if_clause_type) = parser.make_if_clause ((yyvsp[-1].tok), nullptr, nullptr, (yyvsp[0].tree_statement_list_type)); }
4523#line 4524 "libinterp/parse-tree/oct-parse.cc"
4524 break;
4525
4526 case 161: /* switch_command: SWITCH expression opt_sep case_list END */
4527#line 1081 "../libinterp/parse-tree/oct-parse.yy"
4528 {
4529 // FIXME: Need to capture separator list here.
4530 // For now, delete the unused list.
4531 delete (yyvsp[-2].sep_list_type);
4532
4533 if (! ((yyval.tree_switch_command_type) = parser.finish_switch_command ((yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tok))))
4534 {
4535 // finish_switch_command deleted $2 and $4.
4536 YYABORT;
4537 }
4538 }
4539#line 4540 "libinterp/parse-tree/oct-parse.cc"
4540 break;
4541
4542 case 162: /* case_list: %empty */
4543#line 1095 "../libinterp/parse-tree/oct-parse.yy"
4544 { (yyval.tree_switch_case_list_type) = nullptr; }
4545#line 4546 "libinterp/parse-tree/oct-parse.cc"
4546 break;
4547
4548 case 163: /* case_list: default_case */
4549#line 1097 "../libinterp/parse-tree/oct-parse.yy"
4550 { (yyval.tree_switch_case_list_type) = parser.make_switch_case_list ((yyvsp[0].tree_switch_case_type)); }
4551#line 4552 "libinterp/parse-tree/oct-parse.cc"
4552 break;
4553
4554 case 164: /* case_list: case_list1 */
4555#line 1099 "../libinterp/parse-tree/oct-parse.yy"
4556 { (yyval.tree_switch_case_list_type) = (yyvsp[0].tree_switch_case_list_type); }
4557#line 4558 "libinterp/parse-tree/oct-parse.cc"
4558 break;
4559
4560 case 165: /* case_list: case_list1 default_case */
4561#line 1101 "../libinterp/parse-tree/oct-parse.yy"
4562 { (yyval.tree_switch_case_list_type) = parser.append_switch_case ((yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tree_switch_case_type)); }
4563#line 4564 "libinterp/parse-tree/oct-parse.cc"
4564 break;
4565
4566 case 166: /* case_list1: switch_case */
4567#line 1105 "../libinterp/parse-tree/oct-parse.yy"
4568 { (yyval.tree_switch_case_list_type) = parser.make_switch_case_list ((yyvsp[0].tree_switch_case_type)); }
4569#line 4570 "libinterp/parse-tree/oct-parse.cc"
4570 break;
4571
4572 case 167: /* case_list1: case_list1 switch_case */
4573#line 1107 "../libinterp/parse-tree/oct-parse.yy"
4574 { (yyval.tree_switch_case_list_type) = parser.append_switch_case ((yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tree_switch_case_type)); }
4575#line 4576 "libinterp/parse-tree/oct-parse.cc"
4576 break;
4577
4578 case 168: /* switch_case: CASE opt_sep expression stmt_begin statement_list */
4579#line 1111 "../libinterp/parse-tree/oct-parse.yy"
4580 {
4581 // FIXME: Need to capture separator list here.
4582 // For now, delete the unused list.
4583 delete (yyvsp[-3].sep_list_type);
4584
4585 (yyval.tree_switch_case_type) = parser.make_switch_case ((yyvsp[-4].tok), (yyvsp[-2].tree_expression_type), (yyvsp[0].tree_statement_list_type));
4586 }
4587#line 4588 "libinterp/parse-tree/oct-parse.cc"
4588 break;
4589
4590 case 169: /* default_case: OTHERWISE statement_list */
4591#line 1121 "../libinterp/parse-tree/oct-parse.yy"
4592 { (yyval.tree_switch_case_type) = parser.make_default_switch_case ((yyvsp[-1].tok), (yyvsp[0].tree_statement_list_type)); }
4593#line 4594 "libinterp/parse-tree/oct-parse.cc"
4594 break;
4595
4596 case 170: /* loop_command: WHILE expression stmt_begin statement_list END */
4597#line 1129 "../libinterp/parse-tree/oct-parse.yy"
4598 {
4599 parser.maybe_convert_to_braindead_shortcircuit ((yyvsp[-3].tree_expression_type));
4600
4601 if (! ((yyval.tree_command_type) = parser.make_while_command ((yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4602 {
4603 // make_while_command deleted $2 and $4.
4604 YYABORT;
4605 }
4606 }
4607#line 4608 "libinterp/parse-tree/oct-parse.cc"
4608 break;
4609
4610 case 171: /* loop_command: DO statement_list UNTIL expression */
4611#line 1139 "../libinterp/parse-tree/oct-parse.yy"
4612 {
4613 (yyval.tree_command_type) = parser.make_do_until_command ((yyvsp[-3].tok), (yyvsp[-2].tree_statement_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type));
4614 }
4615#line 4616 "libinterp/parse-tree/oct-parse.cc"
4616 break;
4617
4618 case 172: /* loop_command: FOR assign_lhs '=' expression stmt_begin statement_list END */
4619#line 1143 "../libinterp/parse-tree/oct-parse.yy"
4620 {
4621 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-6].tok), nullptr, (yyvsp[-5].tree_argument_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), nullptr, nullptr, nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4622 {
4623 // make_for_command deleted $2, $4, and $6.
4624 YYABORT;
4625 }
4626 }
4627#line 4628 "libinterp/parse-tree/oct-parse.cc"
4628 break;
4629
4630 case 173: /* loop_command: FOR '(' assign_lhs '=' expression ')' statement_list END */
4631#line 1151 "../libinterp/parse-tree/oct-parse.yy"
4632 {
4633 // FIXME: Need to capture token info here.
4634 OCTAVE_YYUSE ((yyvsp[-6].tok), (yyvsp[-4].tok), (yyvsp[-2].tok));
4635
4636 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-7].tok), (yyvsp[-6].tok), (yyvsp[-5].tree_argument_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), nullptr, nullptr, (yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4637 {
4638 // make_for_command deleted $3, $5, and $7.
4639 YYABORT;
4640 }
4641 }
4642#line 4643 "libinterp/parse-tree/oct-parse.cc"
4643 break;
4644
4645 case 174: /* loop_command: PARFOR assign_lhs '=' expression stmt_begin statement_list END */
4646#line 1162 "../libinterp/parse-tree/oct-parse.yy"
4647 {
4648 // FIXME: Need to capture token info here.
4649 OCTAVE_YYUSE ((yyvsp[-4].tok));
4650
4651 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-6].tok), nullptr, (yyvsp[-5].tree_argument_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), nullptr, nullptr, nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4652 {
4653 // make_for_command deleted $2, $4, and $6.
4654 YYABORT;
4655 }
4656 }
4657#line 4658 "libinterp/parse-tree/oct-parse.cc"
4658 break;
4659
4660 case 175: /* loop_command: PARFOR '(' assign_lhs '=' expression ',' expression ')' statement_list END */
4661#line 1173 "../libinterp/parse-tree/oct-parse.yy"
4662 {
4663 // FIXME: Need to capture token info here.
4664 OCTAVE_YYUSE ((yyvsp[-8].tok), (yyvsp[-6].tok), (yyvsp[-4].tok), (yyvsp[-2].tok));
4665
4666 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-9].tok), (yyvsp[-8].tok), (yyvsp[-7].tree_argument_list_type), (yyvsp[-6].tok), (yyvsp[-5].tree_expression_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4667 {
4668 // make_for_command deleted $3, $5, $7, and $9.
4669 YYABORT;
4670 }
4671 }
4672#line 4673 "libinterp/parse-tree/oct-parse.cc"
4673 break;
4674
4675 case 176: /* jump_command: BREAK */
4676#line 1190 "../libinterp/parse-tree/oct-parse.yy"
4677 {
4678 if (! ((yyval.tree_command_type) = parser.make_break_command ((yyvsp[0].tok))))
4679 YYABORT;
4680 }
4681#line 4682 "libinterp/parse-tree/oct-parse.cc"
4682 break;
4683
4684 case 177: /* jump_command: CONTINUE */
4685#line 1195 "../libinterp/parse-tree/oct-parse.yy"
4686 {
4687 if (! ((yyval.tree_command_type) = parser.make_continue_command ((yyvsp[0].tok))))
4688 YYABORT;
4689 }
4690#line 4691 "libinterp/parse-tree/oct-parse.cc"
4691 break;
4692
4693 case 178: /* jump_command: RETURN */
4694#line 1200 "../libinterp/parse-tree/oct-parse.yy"
4695 { (yyval.tree_command_type) = parser.make_return_command ((yyvsp[0].tok)); }
4696#line 4697 "libinterp/parse-tree/oct-parse.cc"
4697 break;
4698
4699 case 179: /* spmd_command: SPMD statement_list END */
4700#line 1208 "../libinterp/parse-tree/oct-parse.yy"
4701 {
4702 if (! ((yyval.tree_command_type) = parser.make_spmd_command ((yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4703 {
4704 // make_spmd_command deleted $2.
4705 YYABORT;
4706 }
4707 }
4708#line 4709 "libinterp/parse-tree/oct-parse.cc"
4709 break;
4710
4711 case 180: /* except_command: UNWIND statement_list CLEANUP statement_list END */
4712#line 1222 "../libinterp/parse-tree/oct-parse.yy"
4713 {
4714 if (! ((yyval.tree_command_type) = parser.make_unwind_command ((yyvsp[-4].tok), (yyvsp[-3].tree_statement_list_type), (yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4715 {
4716 // make_unwind_command deleted $2 and $4.
4717 YYABORT;
4718 }
4719 }
4720#line 4721 "libinterp/parse-tree/oct-parse.cc"
4721 break;
4722
4723 case 181: /* except_command: TRY statement_list CATCH opt_sep opt_list END */
4724#line 1230 "../libinterp/parse-tree/oct-parse.yy"
4725 {
4726 if (! ((yyval.tree_command_type) = parser.make_try_command ((yyvsp[-5].tok), (yyvsp[-4].tree_statement_list_type), (yyvsp[-3].tok), (yyvsp[-2].sep_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4727 {
4728 // make_try_command deleted $2, $4, and $5.
4729 YYABORT;
4730 }
4731 }
4732#line 4733 "libinterp/parse-tree/oct-parse.cc"
4733 break;
4734
4735 case 182: /* except_command: TRY statement_list END */
4736#line 1238 "../libinterp/parse-tree/oct-parse.yy"
4737 {
4738 if (! ((yyval.tree_command_type) = parser.make_try_command ((yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), nullptr, nullptr, nullptr, (yyvsp[0].tok))))
4739 {
4740 // make_try_command deleted $2.
4741 YYABORT;
4742 }
4743 }
4744#line 4745 "libinterp/parse-tree/oct-parse.cc"
4745 break;
4746
4747 case 183: /* push_fcn_symtab: %empty */
4748#line 1252 "../libinterp/parse-tree/oct-parse.yy"
4749 {
4750 if (! parser.push_fcn_symtab ())
4751 YYABORT;
4752
4753 (yyval.dummy_type) = 0;
4754 }
4755#line 4756 "libinterp/parse-tree/oct-parse.cc"
4756 break;
4757
4758 case 184: /* param_list_beg: '(' */
4759#line 1265 "../libinterp/parse-tree/oct-parse.yy"
4760 {
4763
4765 {
4766 // Will get a real name later.
4767 lexer.m_symtab_context.push (octave::symbol_scope ("parser:param_list_beg"));
4770 }
4771
4772 (yyval.tok) = (yyvsp[0].tok);
4773 }
4774#line 4775 "libinterp/parse-tree/oct-parse.cc"
4775 break;
4776
4777 case 185: /* param_list_end: ')' */
4778#line 1282 "../libinterp/parse-tree/oct-parse.yy"
4779 {
4783 (yyval.tok) = (yyvsp[0].tok);
4784 }
4785#line 4786 "libinterp/parse-tree/oct-parse.cc"
4786 break;
4787
4788 case 186: /* opt_param_list: %empty */
4789#line 1291 "../libinterp/parse-tree/oct-parse.yy"
4790 { (yyval.tree_parameter_list_type) = nullptr; }
4791#line 4792 "libinterp/parse-tree/oct-parse.cc"
4792 break;
4793
4794 case 187: /* opt_param_list: param_list */
4795#line 1293 "../libinterp/parse-tree/oct-parse.yy"
4796 { (yyval.tree_parameter_list_type) = (yyvsp[0].tree_parameter_list_type); }
4797#line 4798 "libinterp/parse-tree/oct-parse.cc"
4798 break;
4799
4800 case 188: /* param_list: param_list_beg param_list1 param_list_end */
4801#line 1297 "../libinterp/parse-tree/oct-parse.yy"
4802 {
4803 if ((yyvsp[-1].tree_parameter_list_type))
4804 lexer.mark_as_variables ((yyvsp[-1].tree_parameter_list_type)->variable_names ());
4805
4806 (yyval.tree_parameter_list_type) = (yyvsp[-1].tree_parameter_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
4807 }
4808#line 4809 "libinterp/parse-tree/oct-parse.cc"
4809 break;
4810
4811 case 189: /* param_list: param_list_beg error */
4812#line 1304 "../libinterp/parse-tree/oct-parse.yy"
4813 {
4814 OCTAVE_YYUSE ((yyvsp[-1].tok));
4815
4816 (yyval.tree_parameter_list_type) = nullptr;
4817
4818 parser.bison_error ("invalid parameter list");
4819 YYABORT;
4820 }
4821#line 4822 "libinterp/parse-tree/oct-parse.cc"
4822 break;
4823
4824 case 190: /* param_list1: %empty */
4825#line 1315 "../libinterp/parse-tree/oct-parse.yy"
4826 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::in); }
4827#line 4828 "libinterp/parse-tree/oct-parse.cc"
4828 break;
4829
4830 case 191: /* param_list1: param_list2 */
4831#line 1317 "../libinterp/parse-tree/oct-parse.yy"
4832 {
4833 (yyvsp[0].tree_parameter_list_type)->mark_as_formal_parameters ();
4834
4835 if (parser.validate_param_list ((yyvsp[0].tree_parameter_list_type), octave::tree_parameter_list::in))
4836 {
4837 lexer.mark_as_variables ((yyvsp[0].tree_parameter_list_type)->variable_names ());
4838 (yyval.tree_parameter_list_type) = (yyvsp[0].tree_parameter_list_type);
4839 }
4840 else
4841 {
4842 delete (yyvsp[0].tree_parameter_list_type);
4843 YYABORT;
4844 }
4845 }
4846#line 4847 "libinterp/parse-tree/oct-parse.cc"
4847 break;
4848
4849 case 192: /* param_list2: param_list_elt */
4850#line 1334 "../libinterp/parse-tree/oct-parse.yy"
4851 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::in, (yyvsp[0].tree_decl_elt_type)); }
4852#line 4853 "libinterp/parse-tree/oct-parse.cc"
4853 break;
4854
4855 case 193: /* param_list2: param_list2 ',' param_list_elt */
4856#line 1336 "../libinterp/parse-tree/oct-parse.yy"
4857 { (yyval.tree_parameter_list_type) = parser.append_parameter_list ((yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_decl_elt_type)); }
4858#line 4859 "libinterp/parse-tree/oct-parse.cc"
4859 break;
4860
4861 case 194: /* param_list_elt: decl_elt */
4862#line 1340 "../libinterp/parse-tree/oct-parse.yy"
4863 { (yyval.tree_decl_elt_type) = (yyvsp[0].tree_decl_elt_type); }
4864#line 4865 "libinterp/parse-tree/oct-parse.cc"
4865 break;
4866
4867 case 195: /* param_list_elt: magic_tilde */
4868#line 1342 "../libinterp/parse-tree/oct-parse.yy"
4869 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[0].tree_identifier_type)); }
4870#line 4871 "libinterp/parse-tree/oct-parse.cc"
4871 break;
4872
4873 case 196: /* return_list: '[' ']' */
4874#line 1350 "../libinterp/parse-tree/oct-parse.yy"
4875 {
4877
4878 octave::tree_parameter_list *tmp = parser.make_parameter_list (octave::tree_parameter_list::out);
4879
4880 (yyval.tree_parameter_list_type) = tmp->mark_in_delims (*((yyvsp[-1].tok)), *((yyvsp[0].tok)));
4881 }
4882#line 4883 "libinterp/parse-tree/oct-parse.cc"
4883 break;
4884
4885 case 197: /* return_list: identifier */
4886#line 1358 "../libinterp/parse-tree/oct-parse.yy"
4887 {
4889
4890 octave::tree_parameter_list *tmp = parser.make_parameter_list (octave::tree_parameter_list::out, (yyvsp[0].tree_identifier_type));
4891
4892 // Even though this parameter list can contain only
4893 // a single identifier, we still need to validate it
4894 // to check for varargin or varargout.
4895
4896 if (parser.validate_param_list (tmp, octave::tree_parameter_list::out))
4897 (yyval.tree_parameter_list_type) = tmp;
4898 else
4899 {
4900 delete tmp;
4901 YYABORT;
4902 }
4903 }
4904#line 4905 "libinterp/parse-tree/oct-parse.cc"
4905 break;
4906
4907 case 198: /* return_list: '[' return_list1 ']' */
4908#line 1376 "../libinterp/parse-tree/oct-parse.yy"
4909 {
4911
4912 // Check for duplicate parameter names, varargin,
4913 // or varargout.
4914
4915 if (parser.validate_param_list ((yyvsp[-1].tree_parameter_list_type), octave::tree_parameter_list::out))
4916 (yyval.tree_parameter_list_type) = (yyvsp[-1].tree_parameter_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
4917 else
4918 {
4919 delete (yyvsp[-1].tree_parameter_list_type);
4920 YYABORT;
4921 }
4922 }
4923#line 4924 "libinterp/parse-tree/oct-parse.cc"
4924 break;
4925
4926 case 199: /* return_list1: identifier */
4927#line 1393 "../libinterp/parse-tree/oct-parse.yy"
4928 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::out, (yyvsp[0].tree_identifier_type)); }
4929#line 4930 "libinterp/parse-tree/oct-parse.cc"
4930 break;
4931
4932 case 200: /* return_list1: return_list1 ',' identifier */
4933#line 1395 "../libinterp/parse-tree/oct-parse.yy"
4934 { (yyval.tree_parameter_list_type) = parser.append_parameter_list ((yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
4935#line 4936 "libinterp/parse-tree/oct-parse.cc"
4936 break;
4937
4938 case 201: /* parsing_local_fcns: %empty */
4939#line 1404 "../libinterp/parse-tree/oct-parse.yy"
4941#line 4942 "libinterp/parse-tree/oct-parse.cc"
4942 break;
4943
4944 case 202: /* push_script_symtab: %empty */
4945#line 1408 "../libinterp/parse-tree/oct-parse.yy"
4946 {
4947 (yyval.dummy_type) = 0;
4948
4949 // This scope may serve as the parent scope for local
4950 // functions in classdef files..
4951 lexer.m_symtab_context.push (octave::symbol_scope ("parser:push_script_symtab"));
4952 }
4953#line 4954 "libinterp/parse-tree/oct-parse.cc"
4954 break;
4955
4956 case 203: /* begin_file: push_script_symtab INPUT_FILE */
4957#line 1418 "../libinterp/parse-tree/oct-parse.yy"
4958 { (yyval.dummy_type) = 0; }
4959#line 4960 "libinterp/parse-tree/oct-parse.cc"
4960 break;
4961
4962 case 204: /* file: begin_file statement_list END_OF_INPUT */
4963#line 1422 "../libinterp/parse-tree/oct-parse.yy"
4964 {
4966 {
4967 // Delete the dummy statement_list we created
4968 // after parsing the function. Any function
4969 // definitions found in the file have already
4970 // been stored in the symbol table or in
4971 // base_parser::m_primary_fcn.
4972
4973 // Unused symbol table context.
4975
4976 delete (yyvsp[-1].tree_statement_list_type);
4977 }
4978 else
4979 {
4980 octave::tree_statement *end_of_script = parser.make_end ("endscript", true, (yyvsp[0].tok));
4981
4982 parser.make_script ((yyvsp[-1].tree_statement_list_type), end_of_script);
4983 }
4984
4986 YYABORT;
4987
4988 (yyval.tree_command_type) = nullptr;
4989 }
4990#line 4991 "libinterp/parse-tree/oct-parse.cc"
4991 break;
4992
4993 case 205: /* file: begin_file opt_sep classdef parsing_local_fcns opt_sep opt_fcn_list END_OF_INPUT */
4994#line 1449 "../libinterp/parse-tree/oct-parse.yy"
4995 {
4996 // We need to skip whitespace before the classdef
4997 // keyword. The opt_sep rule is more liberal than
4998 // we need to be because it accepts ';' and ',' in
4999 // addition to '\n', but we need to use it to avoid
5000 // creating a reduce/reduce conflict with the rule
5001 // above. Matching the extra ';' and ',' characters
5002 // doesn't cause trouble because the lexer ensures
5003 // that classdef is the first token in the file.
5004
5005 // FIXME: Need to capture separator lists here.
5006 // For now, delete the unused lists.
5007 delete (yyvsp[-5].sep_list_type);
5008 delete (yyvsp[-2].sep_list_type);
5009
5010 // Unused symbol table context.
5012
5013 if (! parser.finish_classdef_file ((yyvsp[-4].tree_classdef_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok)))
5014 YYABORT;
5015
5016 (yyval.tree_command_type) = nullptr;
5017 }
5018#line 5019 "libinterp/parse-tree/oct-parse.cc"
5019 break;
5020
5021 case 206: /* function_beg: push_fcn_symtab FUNCTION */
5022#line 1479 "../libinterp/parse-tree/oct-parse.yy"
5023 {
5026
5027 (yyval.tok) = (yyvsp[0].tok);
5028 }
5029#line 5030 "libinterp/parse-tree/oct-parse.cc"
5030 break;
5031
5032 case 207: /* fcn_name: identifier */
5033#line 1488 "../libinterp/parse-tree/oct-parse.yy"
5034 {
5035 if (! ((yyval.tree_identifier_type) = parser.make_fcn_name ((yyvsp[0].tree_identifier_type))))
5036 {
5037 // make_fcn_name deleted $1.
5038 YYABORT;
5039 }
5040
5042 }
5043#line 5044 "libinterp/parse-tree/oct-parse.cc"
5044 break;
5045
5046 case 208: /* fcn_name: GET '.' identifier */
5047#line 1498 "../libinterp/parse-tree/oct-parse.yy"
5048 {
5049 (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type)->mark_get_set (*((yyvsp[-2].tok)), *((yyvsp[-1].tok)));
5050
5051 lexer.m_parsed_function_name.top () = true;
5055 }
5056#line 5057 "libinterp/parse-tree/oct-parse.cc"
5057 break;
5058
5059 case 209: /* fcn_name: SET '.' identifier */
5060#line 1507 "../libinterp/parse-tree/oct-parse.yy"
5061 {
5062 (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type)->mark_get_set (*((yyvsp[-2].tok)), *((yyvsp[-1].tok)));
5063
5064 lexer.m_parsed_function_name.top () = true;
5068 }
5069#line 5070 "libinterp/parse-tree/oct-parse.cc"
5070 break;
5071
5072 case 210: /* function_end: END */
5073#line 1518 "../libinterp/parse-tree/oct-parse.yy"
5074 {
5076
5077 if (parser.end_token_ok ((yyvsp[0].tok), octave::token::function_end))
5078 (yyval.tree_statement_type) = parser.make_end ("endfunction", false, (yyvsp[0].tok));
5079 else
5080 {
5081 parser.end_token_error ((yyvsp[0].tok), octave::token::function_end);
5082 YYABORT;
5083 }
5084 }
5085#line 5086 "libinterp/parse-tree/oct-parse.cc"
5086 break;
5087
5088 case 211: /* function_end: END_OF_INPUT */
5089#line 1530 "../libinterp/parse-tree/oct-parse.yy"
5090 {
5091// A lot of tests are based on the assumption that this is OK
5092// if (lexer.m_reading_script_file)
5093// {
5094// parser.bison_error ("function body open at end of script");
5095// YYABORT;
5096// }
5097
5099 {
5100 parser.bison_error ("inconsistent function endings -- "
5101 "if one function is explicitly ended, "
5102 "so must all the others");
5103 YYABORT;
5104 }
5105
5108 {
5109 parser.bison_error ("function body open at end of input");
5110 YYABORT;
5111 }
5112
5114 {
5115 parser.bison_error ("classdef body open at end of input");
5116 YYABORT;
5117 }
5118
5119 (yyval.tree_statement_type) = parser.make_end ("endfunction", true, (yyvsp[0].tok));
5120 }
5121#line 5122 "libinterp/parse-tree/oct-parse.cc"
5122 break;
5123
5124 case 212: /* function: function_beg fcn_name opt_param_list function_body function_end */
5125#line 1564 "../libinterp/parse-tree/oct-parse.yy"
5126 {
5127 (yyval.tree_function_def_type) = parser.make_function ((yyvsp[-4].tok), nullptr, nullptr, (yyvsp[-3].tree_identifier_type), (yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_type));
5128 }
5129#line 5130 "libinterp/parse-tree/oct-parse.cc"
5130 break;
5131
5132 case 213: /* function: function_beg return_list '=' fcn_name opt_param_list function_body function_end */
5133#line 1568 "../libinterp/parse-tree/oct-parse.yy"
5134 {
5135 (yyval.tree_function_def_type) = parser.make_function ((yyvsp[-6].tok), (yyvsp[-5].tree_parameter_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_identifier_type), (yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_type));
5136 }
5137#line 5138 "libinterp/parse-tree/oct-parse.cc"
5138 break;
5139
5140 case 214: /* function_body: statement_list */
5141#line 1574 "../libinterp/parse-tree/oct-parse.yy"
5142 {
5143 (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type);
5144 }
5145#line 5146 "libinterp/parse-tree/oct-parse.cc"
5146 break;
5147
5148 case 215: /* function_body: opt_sep arguments_block_list statement_list */
5149#line 1578 "../libinterp/parse-tree/oct-parse.yy"
5150 {
5151 // FIXME: Need to capture separator list here.
5152 // For now, delete the unused list.
5153 delete (yyvsp[-2].sep_list_type);
5154
5155 (yyval.tree_statement_list_type) = parser.append_function_body ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_list_type));
5156 }
5157#line 5158 "libinterp/parse-tree/oct-parse.cc"
5158 break;
5159
5160 case 216: /* arguments_block_list: arguments_block */
5161#line 1589 "../libinterp/parse-tree/oct-parse.yy"
5162 {
5163 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_arguments_block_type));
5164
5165 (yyval.tree_statement_list_type) = parser.make_statement_list (stmt);
5166 }
5167#line 5168 "libinterp/parse-tree/oct-parse.cc"
5168 break;
5169
5170 case 217: /* arguments_block_list: arguments_block_list opt_sep arguments_block */
5171#line 1595 "../libinterp/parse-tree/oct-parse.yy"
5172 {
5173 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_arguments_block_type));
5174
5175 (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), stmt, false);
5176 }
5177#line 5178 "libinterp/parse-tree/oct-parse.cc"
5178 break;
5179
5180 case 218: /* arguments_block: arguments_beg opt_sep args_attr_list args_validation_list opt_sep END */
5181#line 1603 "../libinterp/parse-tree/oct-parse.yy"
5182 {
5183 // FIXME: Need to capture separator list here.
5184 // For now, delete the unused lists.
5185 delete (yyvsp[-4].sep_list_type);
5186 delete (yyvsp[-1].sep_list_type);
5187
5188 if (! ((yyval.tree_arguments_block_type) = parser.make_arguments_block ((yyvsp[-5].tok), (yyvsp[-3].tree_args_block_attribute_list_type), (yyvsp[-2].tree_args_block_validation_list_type), (yyvsp[0].tok))))
5189 {
5190 // make_arguments_block deleted $3, and $4.
5191 YYABORT;
5192 }
5193
5195 }
5196#line 5197 "libinterp/parse-tree/oct-parse.cc"
5197 break;
5198
5199 case 219: /* arguments_beg: ARGUMENTS */
5200#line 1620 "../libinterp/parse-tree/oct-parse.yy"
5201 {
5202 (yyval.tok) = (yyvsp[0].tok);
5203
5205 }
5206#line 5207 "libinterp/parse-tree/oct-parse.cc"
5207 break;
5208
5209 case 220: /* args_attr_list: %empty */
5210#line 1628 "../libinterp/parse-tree/oct-parse.yy"
5211 { (yyval.tree_args_block_attribute_list_type) = nullptr; }
5212#line 5213 "libinterp/parse-tree/oct-parse.cc"
5213 break;
5214
5215 case 221: /* args_attr_list: '(' identifier ')' */
5216#line 1630 "../libinterp/parse-tree/oct-parse.yy"
5217 {
5218 (yyvsp[-1].tree_identifier_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
5219
5220 // Error if $$ is nullptr.
5221 if (! ((yyval.tree_args_block_attribute_list_type) = parser.make_args_attribute_list ((yyvsp[-1].tree_identifier_type))))
5222 {
5223 // make_args_attribute_list deleted $2.
5224 YYABORT;
5225 }
5226 }
5227#line 5228 "libinterp/parse-tree/oct-parse.cc"
5228 break;
5229
5230 case 222: /* args_validation_list: arg_name arg_validation */
5231#line 1644 "../libinterp/parse-tree/oct-parse.yy"
5232 {
5233 (yyvsp[0].tree_arg_validation_type)->arg_name ((yyvsp[-1].tree_expression_type));
5234 (yyval.tree_args_block_validation_list_type) = parser.make_args_validation_list ((yyvsp[0].tree_arg_validation_type));
5235 }
5236#line 5237 "libinterp/parse-tree/oct-parse.cc"
5237 break;
5238
5239 case 223: /* args_validation_list: args_validation_list sep arg_name arg_validation */
5240#line 1649 "../libinterp/parse-tree/oct-parse.yy"
5241 {
5242 // FIXME: Need to capture SEP here.
5243 // For now, delete the unused list.
5244 delete (yyvsp[-2].sep_list_type);
5245
5246 (yyvsp[0].tree_arg_validation_type)->arg_name ((yyvsp[-1].tree_expression_type));
5247 (yyval.tree_args_block_validation_list_type) = parser.append_args_validation_list ((yyvsp[-3].tree_args_block_validation_list_type), (yyvsp[0].tree_arg_validation_type));
5248 }
5249#line 5250 "libinterp/parse-tree/oct-parse.cc"
5250 break;
5251
5252 case 224: /* arg_name: identifier */
5253#line 1664 "../libinterp/parse-tree/oct-parse.yy"
5254 { (yyval.tree_expression_type) = (yyvsp[0].tree_identifier_type); }
5255#line 5256 "libinterp/parse-tree/oct-parse.cc"
5256 break;
5257
5258 case 225: /* arg_validation: size_spec class_name validation_fcns */
5259#line 1668 "../libinterp/parse-tree/oct-parse.yy"
5260 {
5261 if (! ((yyval.tree_arg_validation_type) = parser.make_arg_validation ((yyvsp[-2].tree_arg_size_spec_type), (yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_arg_validation_fcns_type))))
5262 {
5263 // make_arg_validation deleted ...
5264 YYABORT;
5265 }
5266 }
5267#line 5268 "libinterp/parse-tree/oct-parse.cc"
5268 break;
5269
5270 case 226: /* arg_validation: size_spec class_name validation_fcns '=' expression */
5271#line 1676 "../libinterp/parse-tree/oct-parse.yy"
5272 {
5273 if (! ((yyval.tree_arg_validation_type) = parser.make_arg_validation ((yyvsp[-4].tree_arg_size_spec_type), (yyvsp[-3].tree_identifier_type), (yyvsp[-2].tree_arg_validation_fcns_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type))))
5274 {
5275 // make_arg_validation deleted ...
5276 YYABORT;
5277 }
5278 }
5279#line 5280 "libinterp/parse-tree/oct-parse.cc"
5280 break;
5281
5282 case 227: /* size_spec: %empty */
5283#line 1686 "../libinterp/parse-tree/oct-parse.yy"
5284 { (yyval.tree_arg_size_spec_type) = nullptr; }
5285#line 5286 "libinterp/parse-tree/oct-parse.cc"
5286 break;
5287
5288 case 228: /* size_spec: '(' arg_list ')' */
5289#line 1688 "../libinterp/parse-tree/oct-parse.yy"
5290 {
5291 (yyvsp[-1].tree_argument_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
5292
5293 if (! ((yyval.tree_arg_size_spec_type) = parser.make_arg_size_spec ((yyvsp[-1].tree_argument_list_type))))
5294 {
5295 // make_arg_size_spec deleted $2.
5296 YYABORT;
5297 }
5298 }
5299#line 5300 "libinterp/parse-tree/oct-parse.cc"
5300 break;
5301
5302 case 229: /* class_name: %empty */
5303#line 1700 "../libinterp/parse-tree/oct-parse.yy"
5304 { (yyval.tree_identifier_type) = nullptr; }
5305#line 5306 "libinterp/parse-tree/oct-parse.cc"
5306 break;
5307
5308 case 230: /* class_name: identifier */
5309#line 1702 "../libinterp/parse-tree/oct-parse.yy"
5310 { (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type); }
5311#line 5312 "libinterp/parse-tree/oct-parse.cc"
5312 break;
5313
5314 case 231: /* validation_fcns: %empty */
5315#line 1707 "../libinterp/parse-tree/oct-parse.yy"
5316 { (yyval.tree_arg_validation_fcns_type) = nullptr; }
5317#line 5318 "libinterp/parse-tree/oct-parse.cc"
5318 break;
5319
5320 case 232: /* validation_fcns: '{' arg_list '}' */
5321#line 1709 "../libinterp/parse-tree/oct-parse.yy"
5322 {
5323 (yyvsp[-1].tree_argument_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
5324
5325 if (! ((yyval.tree_arg_validation_fcns_type) = parser.make_arg_validation_fcns ((yyvsp[-1].tree_argument_list_type))))
5326 {
5327 // make_arg_validation_fcns deleted $2.
5328 YYABORT;
5329 }
5330 }
5331#line 5332 "libinterp/parse-tree/oct-parse.cc"
5332 break;
5333
5334 case 233: /* classdef_beg: CLASSDEF */
5335#line 1725 "../libinterp/parse-tree/oct-parse.yy"
5336 {
5338 {
5339 parser.bison_error ("classdef must appear inside a file containing only a class definition");
5340 YYABORT;
5341 }
5342
5343 // Create invalid parent scope.
5344 lexer.m_symtab_context.push (octave::symbol_scope::anonymous ());
5348
5349 (yyval.tok) = (yyvsp[0].tok);
5350 }
5351#line 5352 "libinterp/parse-tree/oct-parse.cc"
5352 break;
5353
5354 case 234: /* classdef: classdef_beg attr_list identifier opt_sep superclass_list class_body END */
5355#line 1743 "../libinterp/parse-tree/oct-parse.yy"
5356 {
5357 // FIXME: Need to capture separator list here.
5358 // For now, delete the unused list.
5359 delete (yyvsp[-3].sep_list_type);
5360
5361 lexer.m_parsing_classdef = false;
5362
5363 if (! ((yyval.tree_classdef_type) = parser.make_classdef ((yyvsp[-6].tok), (yyvsp[-5].tree_classdef_attribute_list_type), (yyvsp[-4].tree_identifier_type), (yyvsp[-2].tree_classdef_superclass_list_type), (yyvsp[-1].tree_classdef_body_type), (yyvsp[0].tok))))
5364 {
5365 // make_classdef deleted $2, $3, $5, $6
5366 YYABORT;
5367 }
5368 }
5369#line 5370 "libinterp/parse-tree/oct-parse.cc"
5370 break;
5371
5372 case 235: /* attr_list: %empty */
5373#line 1759 "../libinterp/parse-tree/oct-parse.yy"
5374 { (yyval.tree_classdef_attribute_list_type) = nullptr; }
5375#line 5376 "libinterp/parse-tree/oct-parse.cc"
5376 break;
5377
5378 case 236: /* attr_list: '(' attr_list1 ')' opt_sep */
5379#line 1761 "../libinterp/parse-tree/oct-parse.yy"
5380 {
5381 // FIXME: Need to capture separator list here.
5382 // For now, delete the unused list.
5383 delete (yyvsp[0].sep_list_type);
5384
5385 (yyval.tree_classdef_attribute_list_type) = (yyvsp[-2].tree_classdef_attribute_list_type)->mark_in_delims (*((yyvsp[-3].tok)), *((yyvsp[-1].tok)));
5386 }
5387#line 5388 "libinterp/parse-tree/oct-parse.cc"
5388 break;
5389
5390 case 237: /* attr_list1: attr */
5391#line 1771 "../libinterp/parse-tree/oct-parse.yy"
5392 { (yyval.tree_classdef_attribute_list_type) = parser.make_classdef_attribute_list ((yyvsp[0].tree_classdef_attribute_type)); }
5393#line 5394 "libinterp/parse-tree/oct-parse.cc"
5394 break;
5395
5396 case 238: /* attr_list1: attr_list1 ',' attr */
5397#line 1773 "../libinterp/parse-tree/oct-parse.yy"
5398 { (yyval.tree_classdef_attribute_list_type) = parser.append_classdef_attribute ((yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_classdef_attribute_type)); }
5399#line 5400 "libinterp/parse-tree/oct-parse.cc"
5400 break;
5401
5402 case 239: /* attr: identifier */
5403#line 1777 "../libinterp/parse-tree/oct-parse.yy"
5404 { (yyval.tree_classdef_attribute_type) = parser.make_classdef_attribute ((yyvsp[0].tree_identifier_type)); }
5405#line 5406 "libinterp/parse-tree/oct-parse.cc"
5406 break;
5407
5408 case 240: /* attr: identifier '=' expression */
5409#line 1779 "../libinterp/parse-tree/oct-parse.yy"
5410 { (yyval.tree_classdef_attribute_type) = parser.make_classdef_attribute ((yyvsp[-2].tree_identifier_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
5411#line 5412 "libinterp/parse-tree/oct-parse.cc"
5412 break;
5413
5414 case 241: /* attr: '~' identifier */
5415#line 1781 "../libinterp/parse-tree/oct-parse.yy"
5416 { (yyval.tree_classdef_attribute_type) = parser.make_not_classdef_attribute ((yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
5417#line 5418 "libinterp/parse-tree/oct-parse.cc"
5418 break;
5419
5420 case 242: /* attr: '!' identifier */
5421#line 1783 "../libinterp/parse-tree/oct-parse.yy"
5422 { (yyval.tree_classdef_attribute_type) = parser.make_not_classdef_attribute ((yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
5423#line 5424 "libinterp/parse-tree/oct-parse.cc"
5424 break;
5425
5426 case 243: /* superclass_list: %empty */
5427#line 1787 "../libinterp/parse-tree/oct-parse.yy"
5428 {
5431 (yyval.tree_classdef_superclass_list_type) = nullptr;
5432 }
5433#line 5434 "libinterp/parse-tree/oct-parse.cc"
5434 break;
5435
5436 case 244: /* superclass_list: superclass_list1 opt_sep */
5437#line 1793 "../libinterp/parse-tree/oct-parse.yy"
5438 {
5439 // FIXME: Need to capture separator list here.
5440 // For now, delete the unused list.
5441 delete (yyvsp[0].sep_list_type);
5442
5445 (yyval.tree_classdef_superclass_list_type) = (yyvsp[-1].tree_classdef_superclass_list_type);
5446 }
5447#line 5448 "libinterp/parse-tree/oct-parse.cc"
5448 break;
5449
5450 case 245: /* superclass_list1: EXPR_LT superclass */
5451#line 1806 "../libinterp/parse-tree/oct-parse.yy"
5452 { (yyval.tree_classdef_superclass_list_type) = parser.make_classdef_superclass_list ((yyvsp[-1].tok), (yyvsp[0].tree_classdef_superclass_type)); }
5453#line 5454 "libinterp/parse-tree/oct-parse.cc"
5454 break;
5455
5456 case 246: /* superclass_list1: superclass_list1 EXPR_AND superclass */
5457#line 1808 "../libinterp/parse-tree/oct-parse.yy"
5458 { (yyval.tree_classdef_superclass_list_type) = parser.append_classdef_superclass ((yyvsp[-2].tree_classdef_superclass_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_classdef_superclass_type)); }
5459#line 5460 "libinterp/parse-tree/oct-parse.cc"
5460 break;
5461
5462 case 247: /* superclass: FQ_IDENT */
5463#line 1812 "../libinterp/parse-tree/oct-parse.yy"
5464 { (yyval.tree_classdef_superclass_type) = parser.make_classdef_superclass ((yyvsp[0].tok)); }
5465#line 5466 "libinterp/parse-tree/oct-parse.cc"
5466 break;
5467
5468 case 248: /* class_body: %empty */
5469#line 1816 "../libinterp/parse-tree/oct-parse.yy"
5470 {
5472 (yyval.tree_classdef_body_type) = nullptr;
5473 }
5474#line 5475 "libinterp/parse-tree/oct-parse.cc"
5475 break;
5476
5477 case 249: /* class_body: class_body1 opt_sep */
5478#line 1821 "../libinterp/parse-tree/oct-parse.yy"
5479 {
5480 // FIXME: Need to capture separator list here.
5481 // For now, delete the unused list.
5482 delete (yyvsp[0].sep_list_type);
5483
5485 (yyval.tree_classdef_body_type) = (yyvsp[-1].tree_classdef_body_type);
5486 }
5487#line 5488 "libinterp/parse-tree/oct-parse.cc"
5488 break;
5489
5490 case 250: /* class_body1: properties_block */
5491#line 1832 "../libinterp/parse-tree/oct-parse.yy"
5492 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_properties_block_type)); }
5493#line 5494 "libinterp/parse-tree/oct-parse.cc"
5494 break;
5495
5496 case 251: /* class_body1: methods_block */
5497#line 1834 "../libinterp/parse-tree/oct-parse.yy"
5498 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_methods_block_type)); }
5499#line 5500 "libinterp/parse-tree/oct-parse.cc"
5500 break;
5501
5502 case 252: /* class_body1: events_block */
5503#line 1836 "../libinterp/parse-tree/oct-parse.yy"
5504 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_events_block_type)); }
5505#line 5506 "libinterp/parse-tree/oct-parse.cc"
5506 break;
5507
5508 case 253: /* class_body1: enum_block */
5509#line 1838 "../libinterp/parse-tree/oct-parse.yy"
5510 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_enum_block_type)); }
5511#line 5512 "libinterp/parse-tree/oct-parse.cc"
5512 break;
5513
5514 case 254: /* class_body1: class_body1 opt_sep properties_block */
5515#line 1840 "../libinterp/parse-tree/oct-parse.yy"
5516 {
5517 // FIXME: Need to capture separator list here.
5518 // For now, delete the unused list.
5519 delete (yyvsp[-1].sep_list_type);
5520
5521 (yyval.tree_classdef_body_type) = parser.append_classdef_properties_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_properties_block_type));
5522 }
5523#line 5524 "libinterp/parse-tree/oct-parse.cc"
5524 break;
5525
5526 case 255: /* class_body1: class_body1 opt_sep methods_block */
5527#line 1848 "../libinterp/parse-tree/oct-parse.yy"
5528 {
5529 // FIXME: Need to capture separator list here.
5530 // For now, delete the unused list.
5531 delete (yyvsp[-1].sep_list_type);
5532
5533 (yyval.tree_classdef_body_type) = parser.append_classdef_methods_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_methods_block_type));
5534 }
5535#line 5536 "libinterp/parse-tree/oct-parse.cc"
5536 break;
5537
5538 case 256: /* class_body1: class_body1 opt_sep events_block */
5539#line 1856 "../libinterp/parse-tree/oct-parse.yy"
5540 {
5541 // FIXME: Need to capture separator list here.
5542 // For now, delete the unused list.
5543 delete (yyvsp[-1].sep_list_type);
5544
5545 (yyval.tree_classdef_body_type) = parser.append_classdef_events_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_events_block_type));
5546 }
5547#line 5548 "libinterp/parse-tree/oct-parse.cc"
5548 break;
5549
5550 case 257: /* class_body1: class_body1 opt_sep enum_block */
5551#line 1864 "../libinterp/parse-tree/oct-parse.yy"
5552 {
5553 // FIXME: Need to capture separator list here.
5554 // For now, delete the unused list.
5555 delete (yyvsp[-1].sep_list_type);
5556
5557 (yyval.tree_classdef_body_type) = parser.append_classdef_enum_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_enum_block_type));
5558 }
5559#line 5560 "libinterp/parse-tree/oct-parse.cc"
5560 break;
5561
5562 case 258: /* properties_block: properties_beg opt_sep attr_list property_list END */
5563#line 1875 "../libinterp/parse-tree/oct-parse.yy"
5564 {
5565 // FIXME: Need to capture separator list here.
5566 // For now, delete the unused list.
5567 delete (yyvsp[-3].sep_list_type);
5568
5569 if (! ((yyval.tree_classdef_properties_block_type) = parser.make_classdef_properties_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_property_list_type), (yyvsp[0].tok))))
5570 {
5571 // make_classdef_properties_block deleted $3 and $4.
5572 YYABORT;
5573 }
5574 }
5575#line 5576 "libinterp/parse-tree/oct-parse.cc"
5576 break;
5577
5578 case 259: /* properties_beg: PROPERTIES */
5579#line 1889 "../libinterp/parse-tree/oct-parse.yy"
5580 {
5582 (yyval.tok) = (yyvsp[0].tok);
5583 }
5584#line 5585 "libinterp/parse-tree/oct-parse.cc"
5585 break;
5586
5587 case 260: /* property_list: %empty */
5588#line 1896 "../libinterp/parse-tree/oct-parse.yy"
5589 {
5591 (yyval.tree_classdef_property_list_type) = nullptr;
5592 }
5593#line 5594 "libinterp/parse-tree/oct-parse.cc"
5594 break;
5595
5596 case 261: /* property_list: property_list1 opt_sep */
5597#line 1901 "../libinterp/parse-tree/oct-parse.yy"
5598 {
5599 // FIXME: Need to capture separator list here.
5600 // For now, delete the unused list.
5601 delete (yyvsp[0].sep_list_type);
5602
5604 (yyval.tree_classdef_property_list_type) = (yyvsp[-1].tree_classdef_property_list_type);
5605 }
5606#line 5607 "libinterp/parse-tree/oct-parse.cc"
5607 break;
5608
5609 case 262: /* property_list1: class_property */
5610#line 1913 "../libinterp/parse-tree/oct-parse.yy"
5611 { (yyval.tree_classdef_property_list_type) = parser.make_classdef_property_list ((yyvsp[0].tree_classdef_property_type)); }
5612#line 5613 "libinterp/parse-tree/oct-parse.cc"
5613 break;
5614
5615 case 263: /* property_list1: property_list1 sep class_property */
5616#line 1915 "../libinterp/parse-tree/oct-parse.yy"
5617 {
5618 // FIXME: Need to capture SEP here.
5619 // For now, delete the unused list.
5620 delete (yyvsp[-1].sep_list_type);
5621
5622 // We don't look ahead to grab end-of-line comments.
5623 // Instead, they are grabbed when we see the
5624 // identifier that becomes the next element in the
5625 // list. If the element at the end of the list
5626 // doesn't have a doc string, see whether the
5627 // element we are adding is storing an end-of-line
5628 // comment for us to use.
5629
5630 octave::tree_classdef_property *last_elt = (yyvsp[-2].tree_classdef_property_list_type)->back ();
5631
5632 if (! last_elt->have_doc_string ())
5633 {
5634 octave::comment_list comments = (yyvsp[0].tree_classdef_property_type)->leading_comments ();
5635
5636 if (! comments.empty ())
5637 {
5638 octave::comment_elt elt = comments.front ();
5639
5640 if (elt.is_end_of_line ())
5641 last_elt->doc_string (elt.text ());
5642 }
5643 }
5644
5645 (yyval.tree_classdef_property_list_type) = parser.append_classdef_property ((yyvsp[-2].tree_classdef_property_list_type), (yyvsp[0].tree_classdef_property_type));
5646 }
5647#line 5648 "libinterp/parse-tree/oct-parse.cc"
5648 break;
5649
5650 case 264: /* class_property: identifier arg_validation */
5651#line 1948 "../libinterp/parse-tree/oct-parse.yy"
5652 { (yyval.tree_classdef_property_type) = parser.make_classdef_property ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_arg_validation_type)); }
5653#line 5654 "libinterp/parse-tree/oct-parse.cc"
5654 break;
5655
5656 case 265: /* methods_block: methods_beg opt_sep attr_list method_list END */
5657#line 1952 "../libinterp/parse-tree/oct-parse.yy"
5658 {
5659 // FIXME: Need to capture separator list here.
5660 // For now, delete the unused list.
5661 delete (yyvsp[-3].sep_list_type);
5662
5663 if (! ((yyval.tree_classdef_methods_block_type) = parser.make_classdef_methods_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_method_list_type), (yyvsp[0].tok))))
5664 {
5665 // make_classdef_methods_block deleted $3 and $4.
5666 YYABORT;
5667 }
5668 }
5669#line 5670 "libinterp/parse-tree/oct-parse.cc"
5670 break;
5671
5672 case 266: /* methods_beg: METHODS */
5673#line 1966 "../libinterp/parse-tree/oct-parse.yy"
5674 {
5676 (yyval.tok) = (yyvsp[0].tok);
5677 }
5678#line 5679 "libinterp/parse-tree/oct-parse.cc"
5679 break;
5680
5681 case 267: /* method_decl1: identifier */
5682#line 1973 "../libinterp/parse-tree/oct-parse.yy"
5683 {
5684 if (! ((yyval.octave_user_function_type) = parser.start_classdef_external_method ((yyvsp[0].tree_identifier_type))))
5685 YYABORT;
5686 }
5687#line 5688 "libinterp/parse-tree/oct-parse.cc"
5688 break;
5689
5690 case 268: /* method_decl1: identifier param_list */
5691#line 1978 "../libinterp/parse-tree/oct-parse.yy"
5692 {
5693 if (! ((yyval.octave_user_function_type) = parser.start_classdef_external_method ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_parameter_list_type))))
5694 YYABORT;
5695 }
5696#line 5697 "libinterp/parse-tree/oct-parse.cc"
5697 break;
5698
5699 case 269: /* method_decl: method_decl1 */
5700#line 1985 "../libinterp/parse-tree/oct-parse.yy"
5701 { (yyval.tree_function_def_type) = parser.finish_classdef_external_method ((yyvsp[0].octave_user_function_type)); }
5702#line 5703 "libinterp/parse-tree/oct-parse.cc"
5703 break;
5704
5705 case 270: /* $@1: %empty */
5706#line 1987 "../libinterp/parse-tree/oct-parse.yy"
5707 {
5709 lexer.m_parsed_function_name.push (false);
5710 }
5711#line 5712 "libinterp/parse-tree/oct-parse.cc"
5712 break;
5713
5714 case 271: /* method_decl: return_list '=' $@1 method_decl1 */
5715#line 1992 "../libinterp/parse-tree/oct-parse.yy"
5716 {
5719
5720 (yyval.tree_function_def_type) = parser.finish_classdef_external_method ((yyvsp[0].octave_user_function_type), (yyvsp[-3].tree_parameter_list_type), (yyvsp[-2].tok));
5721 }
5722#line 5723 "libinterp/parse-tree/oct-parse.cc"
5723 break;
5724
5725 case 272: /* method: method_decl */
5726#line 2001 "../libinterp/parse-tree/oct-parse.yy"
5727 { (yyval.tree_function_def_type) = (yyvsp[0].tree_function_def_type); }
5728#line 5729 "libinterp/parse-tree/oct-parse.cc"
5729 break;
5730
5731 case 273: /* method: function */
5732#line 2003 "../libinterp/parse-tree/oct-parse.yy"
5733 { (yyval.tree_function_def_type) = (yyvsp[0].tree_function_def_type); }
5734#line 5735 "libinterp/parse-tree/oct-parse.cc"
5735 break;
5736
5737 case 274: /* method_list: %empty */
5738#line 2007 "../libinterp/parse-tree/oct-parse.yy"
5739 {
5741 (yyval.tree_classdef_method_list_type) = nullptr;
5742 }
5743#line 5744 "libinterp/parse-tree/oct-parse.cc"
5744 break;
5745
5746 case 275: /* method_list: method_list1 opt_sep */
5747#line 2012 "../libinterp/parse-tree/oct-parse.yy"
5748 {
5749 // FIXME: Need to capture separator list here.
5750 // For now, delete the unused list.
5751 delete (yyvsp[0].sep_list_type);
5752
5754 (yyval.tree_classdef_method_list_type) = (yyvsp[-1].tree_classdef_method_list_type);
5755 }
5756#line 5757 "libinterp/parse-tree/oct-parse.cc"
5757 break;
5758
5759 case 276: /* method_list1: method */
5760#line 2023 "../libinterp/parse-tree/oct-parse.yy"
5761 { (yyval.tree_classdef_method_list_type) = parser.make_classdef_method_list ((yyvsp[0].tree_function_def_type)); }
5762#line 5763 "libinterp/parse-tree/oct-parse.cc"
5763 break;
5764
5765 case 277: /* method_list1: method_list1 opt_sep method */
5766#line 2025 "../libinterp/parse-tree/oct-parse.yy"
5767 {
5768 // FIXME: Need to capture separator list here.
5769 // For now, delete the unused list.
5770 delete (yyvsp[-1].sep_list_type);
5771
5772 (yyval.tree_classdef_method_list_type) = parser.append_classdef_method ((yyvsp[-2].tree_classdef_method_list_type), (yyvsp[0].tree_function_def_type));
5773 }
5774#line 5775 "libinterp/parse-tree/oct-parse.cc"
5775 break;
5776
5777 case 278: /* events_block: events_beg opt_sep attr_list event_list END */
5778#line 2035 "../libinterp/parse-tree/oct-parse.yy"
5779 {
5780 // FIXME: Need to capture separator list here.
5781 // For now, delete the unused list.
5782 delete (yyvsp[-3].sep_list_type);
5783
5784 if (! ((yyval.tree_classdef_events_block_type) = parser.make_classdef_events_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_event_list_type), (yyvsp[0].tok))))
5785 {
5786 // make_classdef_events_block deleted $4 and $5.
5787 YYABORT;
5788 }
5789 }
5790#line 5791 "libinterp/parse-tree/oct-parse.cc"
5791 break;
5792
5793 case 279: /* events_beg: EVENTS */
5794#line 2049 "../libinterp/parse-tree/oct-parse.yy"
5795 {
5797 (yyval.tok) = (yyvsp[0].tok);
5798 }
5799#line 5800 "libinterp/parse-tree/oct-parse.cc"
5800 break;
5801
5802 case 280: /* event_list: %empty */
5803#line 2056 "../libinterp/parse-tree/oct-parse.yy"
5804 {
5806 (yyval.tree_classdef_event_list_type) = nullptr;
5807 }
5808#line 5809 "libinterp/parse-tree/oct-parse.cc"
5809 break;
5810
5811 case 281: /* event_list: event_list1 opt_sep */
5812#line 2061 "../libinterp/parse-tree/oct-parse.yy"
5813 {
5814 // FIXME: Need to capture separator list here.
5815 // For now, delete the unused list.
5816 delete (yyvsp[0].sep_list_type);
5817
5819 (yyval.tree_classdef_event_list_type) = (yyvsp[-1].tree_classdef_event_list_type);
5820 }
5821#line 5822 "libinterp/parse-tree/oct-parse.cc"
5822 break;
5823
5824 case 282: /* event_list1: class_event */
5825#line 2072 "../libinterp/parse-tree/oct-parse.yy"
5826 { (yyval.tree_classdef_event_list_type) = parser.make_classdef_event_list ((yyvsp[0].tree_classdef_event_type)); }
5827#line 5828 "libinterp/parse-tree/oct-parse.cc"
5828 break;
5829
5830 case 283: /* event_list1: event_list1 opt_sep class_event */
5831#line 2074 "../libinterp/parse-tree/oct-parse.yy"
5832 {
5833 // FIXME: Need to capture separator list here.
5834 // For now, delete the unused list.
5835 delete (yyvsp[-1].sep_list_type);
5836
5837 (yyval.tree_classdef_event_list_type) = parser.append_classdef_event ((yyvsp[-2].tree_classdef_event_list_type), (yyvsp[0].tree_classdef_event_type));
5838 }
5839#line 5840 "libinterp/parse-tree/oct-parse.cc"
5840 break;
5841
5842 case 284: /* class_event: identifier */
5843#line 2084 "../libinterp/parse-tree/oct-parse.yy"
5844 { (yyval.tree_classdef_event_type) = parser.make_classdef_event ((yyvsp[0].tree_identifier_type)); }
5845#line 5846 "libinterp/parse-tree/oct-parse.cc"
5846 break;
5847
5848 case 285: /* enum_block: enumeration_beg opt_sep attr_list enum_list END */
5849#line 2088 "../libinterp/parse-tree/oct-parse.yy"
5850 {
5851 // FIXME: Need to capture separator list here.
5852 // For now, delete the unused list.
5853 delete (yyvsp[-3].sep_list_type);
5854
5855 if (! ((yyval.tree_classdef_enum_block_type) = parser.make_classdef_enum_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_enum_list_type), (yyvsp[0].tok))))
5856 {
5857 // make_classdef_enum_block deleted $3 and $4.
5858 YYABORT;
5859 }
5860 }
5861#line 5862 "libinterp/parse-tree/oct-parse.cc"
5862 break;
5863
5864 case 286: /* enumeration_beg: ENUMERATION */
5865#line 2102 "../libinterp/parse-tree/oct-parse.yy"
5866 {
5868 (yyval.tok) = (yyvsp[0].tok);
5869 }
5870#line 5871 "libinterp/parse-tree/oct-parse.cc"
5871 break;
5872
5873 case 287: /* enum_list: %empty */
5874#line 2109 "../libinterp/parse-tree/oct-parse.yy"
5875 {
5877 (yyval.tree_classdef_enum_list_type) = nullptr;
5878 }
5879#line 5880 "libinterp/parse-tree/oct-parse.cc"
5880 break;
5881
5882 case 288: /* enum_list: enum_list1 opt_sep */
5883#line 2114 "../libinterp/parse-tree/oct-parse.yy"
5884 {
5885 // FIXME: Need to capture separator list here.
5886 // For now, delete the unused list.
5887 delete (yyvsp[0].sep_list_type);
5888
5890 (yyval.tree_classdef_enum_list_type) = (yyvsp[-1].tree_classdef_enum_list_type);
5891 }
5892#line 5893 "libinterp/parse-tree/oct-parse.cc"
5893 break;
5894
5895 case 289: /* enum_list1: class_enum */
5896#line 2125 "../libinterp/parse-tree/oct-parse.yy"
5897 { (yyval.tree_classdef_enum_list_type) = parser.make_classdef_enum_list ((yyvsp[0].tree_classdef_enum_type)); }
5898#line 5899 "libinterp/parse-tree/oct-parse.cc"
5899 break;
5900
5901 case 290: /* enum_list1: enum_list1 opt_sep class_enum */
5902#line 2127 "../libinterp/parse-tree/oct-parse.yy"
5903 {
5904 // FIXME: Need to capture separator list here.
5905 // For now, delete the unused list.
5906 delete (yyvsp[-1].sep_list_type);
5907
5908 (yyval.tree_classdef_enum_list_type) = parser.append_classdef_enum ((yyvsp[-2].tree_classdef_enum_list_type), (yyvsp[0].tree_classdef_enum_type));
5909 }
5910#line 5911 "libinterp/parse-tree/oct-parse.cc"
5911 break;
5912
5913 case 291: /* class_enum: identifier '(' expression ')' */
5914#line 2137 "../libinterp/parse-tree/oct-parse.yy"
5915 { (yyval.tree_classdef_enum_type) = parser.make_classdef_enum ((yyvsp[-3].tree_identifier_type), (yyvsp[-2].tok), (yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
5916#line 5917 "libinterp/parse-tree/oct-parse.cc"
5917 break;
5918
5919 case 292: /* stmt_begin: %empty */
5920#line 2145 "../libinterp/parse-tree/oct-parse.yy"
5921 {
5922 (yyval.dummy_type) = 0;
5924 }
5925#line 5926 "libinterp/parse-tree/oct-parse.cc"
5926 break;
5927
5928 case 293: /* anon_fcn_begin: %empty */
5929#line 2152 "../libinterp/parse-tree/oct-parse.yy"
5930 {
5931 (yyval.dummy_type) = 0;
5934 }
5935#line 5936 "libinterp/parse-tree/oct-parse.cc"
5936 break;
5937
5938 case 294: /* parse_error: LEXICAL_ERROR */
5939#line 2160 "../libinterp/parse-tree/oct-parse.yy"
5940 {
5941 (yyval.dummy_type) = 0;
5942 std::string msg = (yyvsp[0].tok)->text ();
5943 parser.bison_error (msg.c_str ());
5944 }
5945#line 5946 "libinterp/parse-tree/oct-parse.cc"
5946 break;
5947
5948 case 295: /* parse_error: error */
5949#line 2166 "../libinterp/parse-tree/oct-parse.yy"
5950 { (yyval.dummy_type) = 0; }
5951#line 5952 "libinterp/parse-tree/oct-parse.cc"
5952 break;
5953
5954 case 296: /* sep_no_nl: ',' */
5955#line 2170 "../libinterp/parse-tree/oct-parse.yy"
5956 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5957#line 5958 "libinterp/parse-tree/oct-parse.cc"
5958 break;
5959
5960 case 297: /* sep_no_nl: ';' */
5961#line 2172 "../libinterp/parse-tree/oct-parse.yy"
5962 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5963#line 5964 "libinterp/parse-tree/oct-parse.cc"
5964 break;
5965
5966 case 298: /* sep_no_nl: sep_no_nl ',' */
5967#line 2174 "../libinterp/parse-tree/oct-parse.yy"
5968 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5969#line 5970 "libinterp/parse-tree/oct-parse.cc"
5970 break;
5971
5972 case 299: /* sep_no_nl: sep_no_nl ';' */
5973#line 2176 "../libinterp/parse-tree/oct-parse.yy"
5974 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5975#line 5976 "libinterp/parse-tree/oct-parse.cc"
5976 break;
5977
5978 case 300: /* opt_sep_no_nl: %empty */
5979#line 2180 "../libinterp/parse-tree/oct-parse.yy"
5980 { (yyval.sep_list_type) = nullptr; }
5981#line 5982 "libinterp/parse-tree/oct-parse.cc"
5982 break;
5983
5984 case 301: /* opt_sep_no_nl: sep_no_nl */
5985#line 2182 "../libinterp/parse-tree/oct-parse.yy"
5986 { (yyval.sep_list_type) = (yyvsp[0].sep_list_type); }
5987#line 5988 "libinterp/parse-tree/oct-parse.cc"
5988 break;
5989
5990 case 302: /* sep: ',' */
5991#line 2186 "../libinterp/parse-tree/oct-parse.yy"
5992 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5993#line 5994 "libinterp/parse-tree/oct-parse.cc"
5994 break;
5995
5996 case 303: /* sep: ';' */
5997#line 2188 "../libinterp/parse-tree/oct-parse.yy"
5998 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5999#line 6000 "libinterp/parse-tree/oct-parse.cc"
6000 break;
6001
6002 case 304: /* sep: '\n' */
6003#line 2190 "../libinterp/parse-tree/oct-parse.yy"
6004 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
6005#line 6006 "libinterp/parse-tree/oct-parse.cc"
6006 break;
6007
6008 case 305: /* sep: sep ',' */
6009#line 2192 "../libinterp/parse-tree/oct-parse.yy"
6010 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
6011#line 6012 "libinterp/parse-tree/oct-parse.cc"
6012 break;
6013
6014 case 306: /* sep: sep ';' */
6015#line 2194 "../libinterp/parse-tree/oct-parse.yy"
6016 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
6017#line 6018 "libinterp/parse-tree/oct-parse.cc"
6018 break;
6019
6020 case 307: /* sep: sep '\n' */
6021#line 2196 "../libinterp/parse-tree/oct-parse.yy"
6022 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
6023#line 6024 "libinterp/parse-tree/oct-parse.cc"
6024 break;
6025
6026 case 308: /* opt_sep: %empty */
6027#line 2200 "../libinterp/parse-tree/oct-parse.yy"
6028 { (yyval.sep_list_type) = nullptr; }
6029#line 6030 "libinterp/parse-tree/oct-parse.cc"
6030 break;
6031
6032 case 309: /* opt_sep: sep */
6033#line 2202 "../libinterp/parse-tree/oct-parse.yy"
6034 { (yyval.sep_list_type) = (yyvsp[0].sep_list_type); }
6035#line 6036 "libinterp/parse-tree/oct-parse.cc"
6036 break;
6037
6038
6039#line 6040 "libinterp/parse-tree/oct-parse.cc"
6040
6041 default: break;
6042 }
6043 /* User semantic actions sometimes alter yychar, and that requires
6044 that yytoken be updated with the new translation. We take the
6045 approach of translating immediately before every use of yytoken.
6046 One alternative is translating here after every semantic action,
6047 but that translation would be missed if the semantic action invokes
6048 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
6049 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
6050 incorrect destructor might then be invoked immediately. In the
6051 case of YYERROR or YYBACKUP, subsequent parser actions might lead
6052 to an incorrect destructor call or verbose syntax error message
6053 before the lookahead is translated. */
6054 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
6055
6056 YYPOPSTACK (yylen);
6057 yylen = 0;
6058
6059 *++yyvsp = yyval;
6060
6061 /* Now 'shift' the result of the reduction. Determine what state
6062 that goes to, based on the state we popped back to and the rule
6063 number reduced by. */
6064 {
6065 const int yylhs = yyr1[yyn] - YYNTOKENS;
6066 const int yyi = yypgoto[yylhs] + *yyssp;
6067 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
6068 ? yytable[yyi]
6069 : yydefgoto[yylhs]);
6070 }
6071
6072 goto yynewstate;
6073
6074
6075/*--------------------------------------.
6076| yyerrlab -- here on detecting error. |
6077`--------------------------------------*/
6078yyerrlab:
6079 /* Make sure we have latest lookahead translation. See comments at
6080 user semantic actions for why this is necessary. */
6081 yytoken = yychar == OCTAVE_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
6082 /* If not already recovering from an error, report this error. */
6083 if (!yyerrstatus)
6084 {
6085 ++yynerrs;
6086 yyerror (parser, YY_("syntax error"));
6087 }
6088
6089 if (yyerrstatus == 3)
6090 {
6091 /* If just tried and failed to reuse lookahead token after an
6092 error, discard it. */
6093
6094 if (yychar <= OCTAVE_EOF)
6095 {
6096 /* Return failure if at end of input. */
6097 if (yychar == OCTAVE_EOF)
6098 YYABORT;
6099 }
6100 else
6101 {
6102 yydestruct ("Error: discarding",
6103 yytoken, &yylval, parser);
6104 yychar = OCTAVE_EMPTY;
6105 }
6106 }
6107
6108 /* Else will try to reuse lookahead token after shifting the error
6109 token. */
6110 goto yyerrlab1;
6111
6112
6113/*---------------------------------------------------.
6114| yyerrorlab -- error raised explicitly by YYERROR. |
6115`---------------------------------------------------*/
6116yyerrorlab:
6117 /* Pacify compilers when the user code never invokes YYERROR and the
6118 label yyerrorlab therefore never appears in user code. */
6119 if (0)
6120 YYERROR;
6121 ++yynerrs;
6122
6123 /* Do not reclaim the symbols of the rule whose action triggered
6124 this YYERROR. */
6125 YYPOPSTACK (yylen);
6126 yylen = 0;
6128 yystate = *yyssp;
6129 goto yyerrlab1;
6130
6131
6132/*-------------------------------------------------------------.
6133| yyerrlab1 -- common code for both syntax error and YYERROR. |
6134`-------------------------------------------------------------*/
6135yyerrlab1:
6136 yyerrstatus = 3; /* Each real token shifted decrements this. */
6137
6138 /* Pop stack until we find a state that shifts the error token. */
6139 for (;;)
6140 {
6141 yyn = yypact[yystate];
6142 if (!yypact_value_is_default (yyn))
6143 {
6144 yyn += YYSYMBOL_YYerror;
6145 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
6146 {
6147 yyn = yytable[yyn];
6148 if (0 < yyn)
6149 break;
6150 }
6151 }
6152
6153 /* Pop the current state because it cannot handle the error token. */
6154 if (yyssp == yyss)
6155 YYABORT;
6156
6157
6158 yydestruct ("Error: popping",
6160 YYPOPSTACK (1);
6161 yystate = *yyssp;
6163 }
6164
6166 *++yyvsp = yylval;
6168
6169
6170 /* Shift the error token. */
6171 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
6172
6173 yystate = yyn;
6174 goto yynewstate;
6175
6176
6177/*-------------------------------------.
6178| yyacceptlab -- YYACCEPT comes here. |
6179`-------------------------------------*/
6180yyacceptlab:
6181 yyresult = 0;
6182 goto yyreturnlab;
6183
6184
6185/*-----------------------------------.
6186| yyabortlab -- YYABORT comes here. |
6187`-----------------------------------*/
6188yyabortlab:
6189 yyresult = 1;
6190 goto yyreturnlab;
6191
6192
6193/*-----------------------------------------------------------.
6194| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
6195`-----------------------------------------------------------*/
6196yyexhaustedlab:
6197 yyerror (parser, YY_("memory exhausted"));
6198 yyresult = 2;
6199 goto yyreturnlab;
6200
6201
6202/*----------------------------------------------------------.
6203| yyreturnlab -- parsing is finished, clean up and return. |
6204`----------------------------------------------------------*/
6205yyreturnlab:
6206 if (yychar != OCTAVE_EMPTY)
6207 {
6208 /* Make sure we have latest lookahead translation. See comments at
6209 user semantic actions for why this is necessary. */
6210 yytoken = YYTRANSLATE (yychar);
6211 yydestruct ("Cleanup: discarding lookahead",
6212 yytoken, &yylval, parser);
6213 }
6214 /* Do not reclaim the symbols of the rule whose action triggered
6215 this YYABORT or YYACCEPT. */
6216 YYPOPSTACK (yylen);
6218 while (yyssp != yyss)
6219 {
6220 yydestruct ("Cleanup: popping",
6222 YYPOPSTACK (1);
6223 }
6224 yyps->yynew = 2;
6225 goto yypushreturn;
6226
6227
6228/*-------------------------.
6229| yypushreturn -- return. |
6230`-------------------------*/
6231yypushreturn:
6232
6233 return yyresult;
6234}
6235#undef octave_nerrs
6236#undef yystate
6237#undef yyerrstatus
6238#undef yyssa
6239#undef yyss
6240#undef yyssp
6241#undef yyvsa
6242#undef yyvs
6243#undef yyvsp
6244#undef yystacksize
6245#line 2205 "../libinterp/parse-tree/oct-parse.yy"
6246
6247
6248#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
6249 // Restore prevailing warning state for remainder of the file.
6250# pragma GCC diagnostic pop
6251#endif
6252
6253// Generic error messages.
6254
6255#undef lexer
6256#undef scanner
6257
6258static void
6259yyerror (octave::base_parser& parser, const char *s)
6260{
6261 parser.bison_error (s);
6262}
6263
6265
6266class OCTINTERP_EXCEPTION_API parse_exception : public std::runtime_error
6267{
6268public:
6269
6270 parse_exception () = delete;
6271
6272 parse_exception (const std::string& message, const std::string& fcn_name = "", const std::string& file_name = "", const filepos& pos = filepos ())
6273 : runtime_error (message), m_message (message), m_fcn_name (fcn_name), m_file_name (file_name), m_pos (pos)
6274 { }
6275
6276 OCTAVE_DEFAULT_COPY_MOVE_DELETE (parse_exception)
6277
6278 std::string message () const { return m_message; }
6279
6280 // Provided for std::exception interface.
6281 const char * what () const noexcept { return m_message.c_str (); }
6282
6283 std::string fcn_name () const { return m_fcn_name; }
6284 std::string file_name () const { return m_file_name; }
6285
6286 filepos pos () const { return m_pos; }
6287
6288 // virtual void display (std::ostream& os) const;
6289
6290private:
6291
6292 std::string m_message;
6293
6294 std::string m_fcn_name;
6295 std::string m_file_name;
6296 filepos m_pos;
6297};
6298
6299class parse_tree_validator : public tree_walker
6300{
6301public:
6302
6303 parse_tree_validator ()
6304 : m_scope (symbol_scope::anonymous ()), m_error_list ()
6305 { }
6306
6307 OCTAVE_DISABLE_COPY_MOVE (parse_tree_validator)
6308
6309 ~parse_tree_validator () = default;
6310
6311 symbol_scope get_scope () const { return m_scope; }
6312
6313 bool ok () const { return m_error_list.empty (); }
6314
6315 std::list<parse_exception> error_list () const
6316 {
6317 return m_error_list;
6318 }
6319
6321 {
6322 unwind_protect_var<symbol_scope> restore_var (m_scope, script.scope ());
6323
6324 tree_statement_list *stmt_list = script.body ();
6325
6326 if (stmt_list)
6327 stmt_list->accept (*this);
6328 }
6329
6331 {
6332 unwind_protect_var<symbol_scope> restore_var (m_scope, fcn.scope ());
6333
6334 tree_statement_list *stmt_list = fcn.body ();
6335
6336 if (stmt_list)
6337 stmt_list->accept (*this);
6338
6339 std::map<std::string, octave_value> subfcns = fcn.subfunctions ();
6340
6341 if (! subfcns.empty ())
6342 {
6343 for (auto& nm_val : subfcns)
6344 {
6345 octave_user_function *subfcn = nm_val.second.user_function_value ();
6346
6347 if (subfcn)
6348 subfcn->accept (*this);
6349 }
6350 }
6351 }
6352
6354 {
6355 if (idx_expr.is_word_list_cmd ())
6356 {
6357 std::string sym_nm = idx_expr.name ();
6358
6359 if (m_scope.is_variable (sym_nm))
6360 {
6361 std::string message = sym_nm + ": invalid use of symbol as both variable and command";
6362 parse_exception pe (message, m_scope.fcn_name (), m_scope.fcn_file_name (), idx_expr.beg_pos ());
6363
6364 m_error_list.push_back (pe);
6365 }
6366 }
6367 }
6368
6369private:
6370
6371 symbol_scope m_scope;
6372
6373 std::list<parse_exception> m_error_list;
6374};
6375
6376template <typename LIST_T, typename ELT_T>
6377static LIST_T *
6378list_append (LIST_T *list, ELT_T elt)
6379{
6380 list->push_back (elt);
6381 return list;
6382}
6383
6384template <typename LIST_T, typename ELT_T>
6385static LIST_T *
6386list_append (LIST_T *list, const token& /*sep_tok*/, ELT_T elt)
6387{
6388 // FIXME: Need to capture SEP_TOK here
6389 list->push_back (elt);
6390 return list;
6391}
6392
6393std::size_t
6394base_parser::parent_scope_info::size () const
6395{
6396 return m_info.size ();
6397}
6398
6399void
6400base_parser::parent_scope_info::push (const value_type& elt)
6401{
6402 m_info.push_back (elt);
6403}
6404
6405void
6406base_parser::parent_scope_info::push (const symbol_scope& scope)
6407{
6408 push (value_type (scope, ""));
6409}
6410
6411void
6412base_parser::parent_scope_info::pop ()
6413{
6414 m_info.pop_back ();
6415}
6416
6417bool
6418base_parser::parent_scope_info::name_ok (const std::string& name)
6419{
6420 // Name can't be the same as any parent function or any other
6421 // function we've already seen. We could maintain a complex
6422 // tree structure of names, or we can just store the set of
6423 // full names of all the functions, which must be unique.
6424
6425 std::string full_name;
6426
6427 for (std::size_t i = 0; i < size()-1; i++)
6428 {
6429 const value_type& elt = m_info[i];
6430
6431 if (name == elt.second)
6432 return false;
6433
6434 full_name += elt.second + ">";
6435 }
6436
6437 full_name += name;
6438
6439 if (m_all_names.find (full_name) != m_all_names.end ())
6440 {
6441 // Return false (failure) if we are parsing a subfunction, local
6442 // function, or nested function. Otherwise, it is OK to have a
6443 // duplicate name.
6444
6445 return ! (m_parser.parsing_subfunctions () || m_parser.parsing_local_functions () || m_parser.curr_fcn_depth () > 0);
6446 }
6447
6448 m_all_names.insert (full_name);
6449
6450 return true;
6451}
6452
6453bool
6454base_parser::parent_scope_info::name_current_scope (const std::string& name)
6455{
6456 if (! name_ok (name))
6457 return false;
6458
6459 if (size () > 0)
6460 m_info.back().second = name;
6461
6462 return true;
6463}
6464
6466base_parser::parent_scope_info::parent_scope () const
6467{
6468 return size () > 1 ? m_info[size()-2].first : symbol_scope::invalid ();
6469}
6470
6471std::string
6472base_parser::parent_scope_info::parent_name () const
6473{
6474 return m_info[size()-2].second;
6475}
6476
6477void base_parser::parent_scope_info::clear ()
6478{
6479 m_info.clear ();
6480 m_all_names.clear ();
6481}
6482
6484 : m_endfunction_found (false), m_autoloading (false),
6485 m_fcn_file_from_relative_lookup (false),
6486 m_parsing_subfunctions (false), m_parsing_local_functions (false),
6487 m_max_fcn_depth (-1), m_curr_fcn_depth (-1),
6488 m_primary_fcn_scope (symbol_scope::invalid ()),
6489 m_curr_class_name (), m_curr_package_name (), m_function_scopes (*this),
6490 m_primary_fcn (), m_subfunction_names (), m_classdef_object (),
6491 m_stmt_list (), m_lexer (lxr), m_parser_state (yypstate_new ())
6492{ }
6493
6495{
6496 delete &m_lexer;
6497
6498 // FIXME: Deleting the internal Bison parser state structure does
6499 // not clean up any partial parse trees in the event of an interrupt or
6500 // error. It's not clear how to safely do that with the C language
6501 // parser that Bison generates. The C++ language parser that Bison
6502 // generates would do it for us automatically whenever an exception
6503 // is thrown while parsing input, but there is currently no C++
6504 // interface for a push parser.
6505
6506 yypstate_delete (static_cast<yypstate *> (m_parser_state));
6507}
6508
6509void
6511{
6512 m_endfunction_found = false;
6513 m_autoloading = false;
6515 m_parsing_subfunctions = false;
6517 m_max_fcn_depth = -1;
6518 m_curr_fcn_depth = -1;
6520 m_curr_class_name = "";
6522 m_function_scopes.clear ();
6524 m_subfunction_names.clear ();
6525 m_classdef_object.reset ();
6526 m_stmt_list.reset ();
6527
6528 m_lexer.reset ();
6529
6530 yypstate_delete (static_cast<yypstate *> (m_parser_state));
6532}
6533
6534OCTAVE_NORETURN static void
6535unexpected_token (int tok_id, const char *where)
6536{
6537 error ("unexpected token (= %d) in %s - please report this bug", tok_id, where);
6538}
6539
6540// Error messages for mismatched end tokens.
6541
6542static std::string
6543end_token_as_string (token::end_tok_type ettype)
6544{
6545 std::string retval = "<unknown>";
6546
6547 switch (ettype)
6548 {
6549 case token::simple_end:
6550 retval = "end";
6551 break;
6552
6554 retval = "endarguments";
6555 break;
6556
6558 retval = "endclassdef";
6559 break;
6560
6562 retval = "endenumeration";
6563 break;
6564
6565 case token::events_end:
6566 retval = "endevents";
6567 break;
6568
6569 case token::for_end:
6570 retval = "endfor";
6571 break;
6572
6574 retval = "endfunction";
6575 break;
6576
6577 case token::if_end:
6578 retval = "endif";
6579 break;
6580
6581 case token::methods_end:
6582 retval = "endmethods";
6583 break;
6584
6585 case token::parfor_end:
6586 retval = "endparfor";
6587 break;
6588
6590 retval = "endproperties";
6591 break;
6592
6593 case token::spmd_end:
6594 retval = "endspmd";
6595 break;
6596
6597 case token::switch_end:
6598 retval = "endswitch";
6599 break;
6600
6602 retval = "end_try_catch";
6603 break;
6604
6606 retval = "end_unwind_protect";
6607 break;
6608
6609 case token::while_end:
6610 retval = "endwhile";
6611 break;
6612
6613 // We should have handled all possible enum values above. Rely on
6614 // compiler diagnostics to warn if we haven't. For example, GCC's
6615 // -Wswitch option, enabled by -Wall, will provide a warning.
6616 }
6617
6618 return retval;
6619}
6620
6621void
6622base_parser::statement_list (std::shared_ptr<tree_statement_list>& lst)
6623{
6624 if (! lst)
6625 return;
6626
6627 if (m_stmt_list)
6628 {
6629 // Append additional code to existing statement list.
6630
6631 while (! lst->empty ())
6632 {
6633 m_stmt_list->push_back (lst->front ());
6634 lst->pop_front ();
6635 }
6636 }
6637 else
6638 m_stmt_list = lst;
6639}
6640
6641void
6643{
6644 std::string msg = ("'" + end_token_as_string (expected) + "' command matched by '" + end_token_as_string (tok->ettype ()) + "'");
6645
6646 bison_error (msg, tok->beg_pos ());
6647}
6648
6649// Check to see that end tokens are properly matched.
6650
6651bool
6653{
6654 token::end_tok_type ettype = tok->ettype ();
6655
6656 return ettype == expected || ettype == token::simple_end;
6657}
6658
6659bool
6661{
6663
6666
6667 // Will get a real name later.
6668 m_lexer.m_symtab_context.push (symbol_scope ("parser:push_fcn_symtab"));
6670
6672 {
6675 }
6676
6678 {
6679 bison_error ("nested functions not implemented in this context");
6680
6681 return false;
6682 }
6683
6684 return true;
6685}
6686
6687// Make a constant.
6688
6691{
6692 int tok_id = tok->token_id ();
6693
6694 tree_constant *retval = nullptr;
6695
6696 switch (tok_id)
6697 {
6698 case ':':
6700 break;
6701
6702 case NUMBER:
6703 retval = new tree_constant (tok->number (), tok->text_rep (), *tok);
6704 break;
6705
6706 case DQ_STRING:
6707 case SQ_STRING:
6708 {
6709 std::string txt = tok->text ();
6710
6711 char delim = tok_id == DQ_STRING ? '"' : '\'';
6712 octave_value tmp (txt, delim);
6713
6714 if (txt.empty ())
6715 {
6716 if (tok_id == DQ_STRING)
6718 else
6720 }
6721
6722 if (tok_id == DQ_STRING)
6723 txt = undo_string_escapes (txt);
6724
6725 // FIXME: maybe the addition of delims should be handled by
6726 // tok->text_rep () for character strings?
6727
6728 retval = new tree_constant (tmp, delim + txt + delim, *tok);
6729 }
6730 break;
6731
6732 default:
6733 unexpected_token (tok_id, "base_parser::make_constant");
6734 break;
6735 }
6736
6737 return retval;
6738}
6739
6742{
6743 return new tree_black_hole (*tilde);
6744}
6745
6746// Make a function handle.
6747
6750{
6751 tree_fcn_handle *retval = new tree_fcn_handle (*tok);
6752
6753 return retval;
6754}
6755
6756// Make an anonymous function handle.
6757
6760{
6761 // FIXME: We need to examine EXPR and issue an error if any
6762 // sub-expression contains an assignment, compound assignment,
6763 // increment, or decrement operator.
6764
6765 anon_fcn_validator validator (param_list, expr);
6766
6767 if (! validator.ok ())
6768 {
6769 delete param_list;
6770 delete expr;
6771
6772 bison_error (validator.message (), validator.beg_pos ());
6773
6774 return nullptr;
6775 }
6776
6779
6781
6782 expr->set_print_flag (false);
6783
6784 fcn_scope.mark_static ();
6785
6786 tree_anon_fcn_handle *retval = new tree_anon_fcn_handle (*at_tok, param_list, expr, fcn_scope, parent_scope);
6787
6788 std::ostringstream buf;
6789
6790 tree_print_code tpc (buf);
6791
6792 retval->accept (tpc);
6793
6794 std::string file = m_lexer.m_fcn_file_full_name;
6795 if (! file.empty ())
6796 buf << ": file: " << file;
6797 else if (m_lexer.input_from_terminal ())
6798 buf << ": *terminal input*";
6799 else if (m_lexer.input_from_eval_string ())
6800 buf << ": *eval string*";
6801
6802 filepos at_pos = at_tok->beg_pos ();
6803 buf << ": line: " << at_pos.line () << " column: " << at_pos.column ();
6804
6805 std::string scope_name = buf.str ();
6806
6807 fcn_scope.cache_name (scope_name);
6808
6809 // FIXME: Stash the filename. This does not work and produces
6810 // errors when executed.
6811 //retval->stash_file_name (m_lexer.m_fcn_file_name);
6812
6813 return retval;
6814}
6815
6816// Build a colon expression.
6817
6820{
6821 return make_colon_expression (base, colon_tok, nullptr, nullptr, limit);
6822}
6823
6826{
6827 tree_expression *retval = nullptr;
6828
6829 if (! base || ! limit)
6830 {
6831 delete base;
6832 delete limit;
6833 delete incr;
6834
6835 return retval;
6836 }
6837
6838 token tmp_colon_2_tok = colon_2_tok ? *colon_2_tok : token ();
6839
6840 tree_colon_expression *expr = new tree_colon_expression (base, *colon_1_tok, incr, tmp_colon_2_tok, limit);
6841
6842 retval = expr;
6843
6844 if (base->is_constant () && limit->is_constant () && (! incr || incr->is_constant ()))
6845 {
6847
6848 try
6849 {
6850 // If the evaluation generates a warning message, restore
6851 // the previous value of last_warning_message and skip the
6852 // conversion to a constant value.
6853
6854 error_system& es = interp.get_error_system ();
6855
6856 unwind_action restore_last_warning_message (&error_system::set_last_warning_message, &es, es.last_warning_message (""));
6857
6858 unwind_action restore_discard_warning_messages (&error_system::set_discard_warning_messages, &es, es.discard_warning_messages (true));
6859
6860 tree_evaluator& tw = interp.get_evaluator ();
6861
6862 octave_value tmp = expr->evaluate (tw);
6863
6864 std::string msg = es.last_warning_message ();
6865
6866 if (msg.empty ())
6867 {
6868 std::ostringstream buf;
6869
6870 tree_print_code tpc (buf);
6871
6872 expr->accept (tpc);
6873
6874 std::string orig_text = buf.str ();
6875
6876 token tok (CONSTANT, tmp, orig_text, expr->beg_pos (), expr->end_pos ());
6877
6878 tree_constant *tc_retval = new tree_constant (tmp, orig_text, tok);
6879
6880 delete expr;
6881
6882 retval = tc_retval;
6883 }
6884 }
6885 catch (const execution_exception&)
6886 {
6887 interp.recover_from_exception ();
6888 }
6889 }
6890
6891 return retval;
6892}
6893
6894// Build a binary expression.
6895
6898{
6900
6901 int tok_id = op_tok->token_id ();
6902
6903 switch (tok_id)
6904 {
6905 case POW:
6907 break;
6908
6909 case EPOW:
6911 break;
6912
6913 case '+':
6915 break;
6916
6917 case '-':
6919 break;
6920
6921 case '*':
6923 break;
6924
6925 case '/':
6927 break;
6928
6929 case EMUL:
6931 break;
6932
6933 case EDIV:
6935 break;
6936
6937 case LEFTDIV:
6939 break;
6940
6941 case ELEFTDIV:
6943 break;
6944
6945 case EXPR_LT:
6947 break;
6948
6949 case EXPR_LE:
6951 break;
6952
6953 case EXPR_EQ:
6955 break;
6956
6957 case EXPR_GE:
6959 break;
6960
6961 case EXPR_GT:
6963 break;
6964
6965 case EXPR_NE:
6967 break;
6968
6969 case EXPR_AND:
6971 break;
6972
6973 case EXPR_OR:
6975 break;
6976
6977 default:
6978 unexpected_token (tok_id, "base_parser::make_binary_op");
6979 break;
6980 }
6981
6982 return maybe_compound_binary_expression (op1, *op_tok, op2, t);
6983}
6984
6985void
6987{
6988 if (expr->is_binary_expression ())
6989 {
6990 tree_binary_expression *binexp = dynamic_cast<tree_binary_expression *> (expr);
6991
6992 token op_tok = binexp->op_token ();
6993
6994 tree_expression *lhs = binexp->lhs ();
6995 tree_expression *rhs = binexp->rhs ();
6996
6999
7000 // Operands may have changed.
7001 binexp->lhs (lhs);
7002 binexp->rhs (rhs);
7003
7004 octave_value::binary_op op_type = binexp->op_type ();
7005 if (op_type == octave_value::op_el_and || op_type == octave_value::op_el_or)
7006 {
7007 binexp->preserve_operands ();
7008
7009 delete expr;
7010
7011 expr = new tree_braindead_shortcircuit_binary_expression (lhs, op_tok, rhs, op_type);
7012 }
7013 }
7014}
7015
7016// Build a boolean expression.
7017
7020{
7022
7023 int tok_id = op_tok->token_id ();
7024
7025 switch (tok_id)
7026 {
7027 case EXPR_AND_AND:
7029 break;
7030
7031 case EXPR_OR_OR:
7033 break;
7034
7035 default:
7036 unexpected_token (tok_id, "base_parser::make_boolean_op");
7037 break;
7038 }
7039
7040 return new tree_boolean_expression (op1, *op_tok, op2, t);
7041}
7042
7043// Build a prefix expression.
7044
7047{
7049
7050 int tok_id = op_tok->token_id ();
7051
7052 switch (tok_id)
7053 {
7054 case '~':
7055 case '!':
7057 break;
7058
7059 case '+':
7061 break;
7062
7063 case '-':
7065 break;
7066
7067 case PLUS_PLUS:
7069 break;
7070
7071 case MINUS_MINUS:
7073 break;
7074
7075 default:
7076 unexpected_token (tok_id, "base_parser::make_prefix_op");
7077 break;
7078 }
7079
7080 return new tree_prefix_expression (*op_tok, op1, t);
7081}
7082
7083// Build a postfix expression.
7084
7087{
7089
7090 int tok_id = op_tok->token_id ();
7091
7092 switch (tok_id)
7093 {
7094 case HERMITIAN:
7096 break;
7097
7098 case TRANSPOSE:
7100 break;
7101
7102 case PLUS_PLUS:
7104 break;
7105
7106 case MINUS_MINUS:
7108 break;
7109
7110 default:
7111 unexpected_token (tok_id, "base_parser::make_postfix_op");
7112 break;
7113 }
7114
7115 return new tree_postfix_expression (op1, *op_tok, t);
7116}
7117
7118// Build an unwind-protect command.
7119
7121base_parser::make_unwind_command (token *unwind_tok, tree_statement_list *body, token *cleanup_tok, tree_statement_list *cleanup_stmts, token *end_tok)
7122{
7123 tree_command *retval = nullptr;
7124
7126 {
7127 retval = new tree_unwind_protect_command (*unwind_tok, body, *cleanup_tok, cleanup_stmts, *end_tok);
7128 }
7129 else
7130 {
7131 delete body;
7132 delete cleanup_stmts;
7133
7135 }
7136
7137 return retval;
7138}
7139
7140// Build a try-catch command.
7141
7143base_parser::make_try_command (token *try_tok, tree_statement_list *body, token *catch_tok, separator_list *catch_sep_list, tree_statement_list *cleanup_stmts, token *end_tok)
7144{
7145 tree_command *retval = nullptr;
7146
7147 if (end_token_ok (end_tok, token::try_catch_end))
7148 {
7149 tree_identifier *id = nullptr;
7150
7151 // Look for exception ID. Note that adding a separate rule to
7152 // match
7153 //
7154 // try
7155 // try-body
7156 // catch IDENTIFIER
7157 // catch-body
7158 // end
7159 //
7160 // in the grammar leads to yet another shift-reduce conflict, so
7161 // instead we only match
7162 //
7163 // try
7164 // try-body
7165 // catch
7166 // catch-body
7167 // end
7168 //
7169 // and then recognize the first form above by checking that the
7170 // first element of CATCH-BODY is an identifier and that there is
7171 // is no separator (comma, semicolon, or newline) between the
7172 // CATCH token and the identifier.
7173
7174 if (! catch_sep_list && cleanup_stmts && ! cleanup_stmts->empty ())
7175 {
7176 tree_statement *stmt = cleanup_stmts->front ();
7177
7178 if (stmt)
7179 {
7180 tree_expression *expr = stmt->expression ();
7181
7182 if (expr && expr->is_identifier ())
7183 {
7184 id = dynamic_cast<tree_identifier *> (expr);
7185
7186 cleanup_stmts->pop_front ();
7187
7188 stmt->set_expression (nullptr);
7189 delete stmt;
7190 }
7191 }
7192 }
7193
7194 token tmp_catch_tok = catch_tok ? *catch_tok : token ();
7195
7196 // FIXME: Need to capture separator list here.
7197 // For now, delete the unused list.
7198 delete catch_sep_list;
7199
7200 retval = new tree_try_catch_command (*try_tok, body, tmp_catch_tok, id, cleanup_stmts, *end_tok);
7201 }
7202 else
7203 {
7204 delete body;
7205 delete catch_sep_list;
7206 delete cleanup_stmts;
7207
7209 }
7210
7211 return retval;
7212}
7213
7214// Build a while command.
7215
7218{
7219 tree_command *retval = nullptr;
7220
7221 maybe_warn_assign_as_truth_value (expr);
7222
7223 if (end_token_ok (end_tok, token::while_end))
7224 {
7226
7227 retval = new tree_while_command (*while_tok, expr, body, *end_tok);
7228 }
7229 else
7230 {
7231 delete expr;
7232 delete body;
7233
7235 }
7236
7237 return retval;
7238}
7239
7240// Build a do-until command.
7241
7244{
7245 maybe_warn_assign_as_truth_value (expr);
7246
7248
7249 return new tree_do_until_command (*do_tok, body, *until_tok, expr);
7250}
7251
7252// Build a for command.
7253
7255base_parser::make_for_command (token *for_tok, token *open_paren, tree_argument_list *lhs, token *eq_tok, tree_expression *expr, token *sep_tok, tree_expression *maxproc, token *close_paren, tree_statement_list *body, token *end_tok)
7256{
7257 tree_command *retval = nullptr;
7258
7259 bool parfor = for_tok->token_id () == PARFOR;
7260
7261 token tmp_open_paren = open_paren ? *open_paren : token ();
7262 token tmp_close_paren = close_paren ? *close_paren : token ();
7263 token tmp_sep_tok = sep_tok ? *sep_tok : token ();
7264
7265 if (end_token_ok (end_tok, parfor ? token::parfor_end : token::for_end))
7266 {
7267 expr->mark_as_for_cmd_expr ();
7268
7270
7271 if (lhs->size () == 1)
7272 {
7273 tree_expression *tmp = lhs->remove_front ();
7274
7275 m_lexer.mark_as_variable (tmp->name ());
7276
7277 retval = new tree_simple_for_command (parfor, *for_tok, tmp_open_paren, tmp, *eq_tok, expr, tmp_sep_tok, maxproc, tmp_close_paren, body, *end_tok);
7278
7279 delete lhs;
7280 }
7281 else if (parfor)
7282 {
7283 delete lhs;
7284 delete expr;
7285 delete maxproc;
7286 delete body;
7287
7288 bison_error ("invalid syntax for parfor statement");
7289 }
7290 else
7291 {
7293
7294 retval = new tree_complex_for_command (*for_tok, lhs, *eq_tok, expr, body, *end_tok);
7295 }
7296 }
7297 else
7298 {
7299 delete lhs;
7300 delete expr;
7301 delete maxproc;
7302 delete body;
7303
7304 end_token_error (end_tok, parfor ? token::parfor_end : token::for_end);
7305 }
7306
7307 return retval;
7308}
7309
7310// Build a break command.
7311
7314{
7315 if (! m_lexer.m_looping)
7316 {
7317 bison_error ("break must appear within a loop");
7318 return nullptr;
7319 }
7320 else
7321 return new tree_break_command (*break_tok);
7322}
7323
7324// Build a continue command.
7325
7328{
7329 if (! m_lexer.m_looping)
7330 {
7331 bison_error ("continue must appear within a loop");
7332 return nullptr;
7333 }
7334 else
7335 return new tree_continue_command (*continue_tok);
7336}
7337
7338// Build a return command.
7339
7342{
7343 return new tree_return_command (*return_tok);
7344}
7345
7346// Build an spmd command.
7347
7350{
7351 tree_spmd_command *retval = nullptr;
7352
7353 if (end_token_ok (end_tok, token::spmd_end))
7354 retval = new tree_spmd_command (*spmd_tok, body, *end_tok);
7355 else
7356 {
7357 delete body;
7358
7360 }
7361
7362 return retval;
7363}
7364
7365// Start an if command.
7366
7369{
7370 return new tree_if_command_list (clause);
7371}
7372
7373// Finish an if command.
7374
7377{
7378 tree_if_command *retval = nullptr;
7379
7380 if (end_token_ok (end_tok, token::if_end))
7381 {
7382 if (else_clause)
7383 list_append (list, else_clause);
7384
7385 token if_tok = list->if_token ();
7386
7387 retval = new tree_if_command (if_tok, list, *end_tok);
7388 }
7389 else
7390 {
7391 delete list;
7392 delete else_clause;
7393
7394 end_token_error (end_tok, token::if_end);
7395 }
7396
7397 return retval;
7398}
7399
7400// Build an if, elseif, or else clause.
7401
7404{
7405 if (expr)
7406 {
7407 maybe_warn_assign_as_truth_value (expr);
7408
7410 }
7411
7412 // FIXME: Need to capture separator list here.
7413 // For now, delete the unused list.
7414 delete if_sep_list;
7415
7416 return new tree_if_clause (*if_tok, expr, list);
7417}
7418
7421{
7422 return list_append (list, clause);
7423}
7424
7425// Finish a switch command.
7426
7429{
7430 tree_switch_command *retval = nullptr;
7431
7432 if (end_token_ok (end_tok, token::switch_end))
7433 retval = new tree_switch_command (*switch_tok, expr, list, *end_tok);
7434 else
7435 {
7436 delete expr;
7437 delete list;
7438
7440 }
7441
7442 return retval;
7443}
7444
7447{
7448 return new tree_switch_case_list (switch_case);
7449}
7450
7451// Build a switch case.
7452
7455{
7456 maybe_warn_variable_switch_label (expr);
7457
7458 return new tree_switch_case (*case_tok, expr, list);
7459}
7460
7463{
7464 return new tree_switch_case (*default_tok, list);
7465}
7466
7469{
7470 return list_append (list, elt);
7471}
7472
7473// Build an assignment to a variable.
7474
7477{
7479
7480 int tok_id = eq_tok->token_id ();
7481
7482 switch (tok_id)
7483 {
7484 case '=':
7486 break;
7487
7488 case ADD_EQ:
7490 break;
7491
7492 case SUB_EQ:
7494 break;
7495
7496 case MUL_EQ:
7498 break;
7499
7500 case DIV_EQ:
7502 break;
7503
7504 case LEFTDIV_EQ:
7506 break;
7507
7508 case POW_EQ:
7510 break;
7511
7512 case EMUL_EQ:
7514 break;
7515
7516 case EDIV_EQ:
7518 break;
7519
7520 case ELEFTDIV_EQ:
7522 break;
7523
7524 case EPOW_EQ:
7526 break;
7527
7528 case AND_EQ:
7530 break;
7531
7532 case OR_EQ:
7534 break;
7535
7536 default:
7537 unexpected_token (tok_id, "base_parser::make_assign_op");
7538 break;
7539 }
7540
7541 if (! lhs->is_simple_assign_lhs () && t != octave_value::op_asn_eq)
7542 {
7543 // Multiple assignments like [x,y] OP= rhs are only valid for
7544 // '=', not '+=', etc.
7545
7546 delete lhs;
7547 delete rhs;
7548
7549 bison_error ("computed multiple assignment not allowed", eq_tok->beg_pos ());
7550
7551 return nullptr;
7552 }
7553
7554 if (lhs->is_simple_assign_lhs ())
7555 {
7556 // We are looking at a simple assignment statement like x = rhs;
7557
7558 tree_expression *tmp = lhs->remove_front ();
7559
7560 if ((tmp->is_identifier () || tmp->is_index_expression ()) && iskeyword (tmp->name ()))
7561 {
7562 std::string kw = tmp->name ();
7563
7564 delete tmp;
7565 delete lhs;
7566 delete rhs;
7567
7568 bison_error ("invalid assignment to keyword \"" + kw + "\"", eq_tok->beg_pos ());
7569
7570 return nullptr;
7571 }
7572
7573 delete lhs;
7574
7575 m_lexer.mark_as_variable (tmp->name ());
7576
7577 return new tree_simple_assignment (tmp, rhs, false, t);
7578 }
7579 else
7580 {
7581 std::list<std::string> names = lhs->variable_names ();
7582
7583 for (const auto& kw : names)
7584 {
7585 if (iskeyword (kw))
7586 {
7587 delete lhs;
7588 delete rhs;
7589
7590 bison_error ("invalid assignment to keyword \"" + kw + "\"", eq_tok->beg_pos ());
7591
7592 return nullptr;
7593 }
7594 }
7595
7596 m_lexer.mark_as_variables (names);
7597
7598 return new tree_multi_assignment (lhs, rhs, false);
7599 }
7600}
7601
7602void
7604{
7605 // Any comments at the beginning of a script file should be
7606 // attached to the first statement in the file or the END_SCRIPT
7607 // statement created by the parser.
7608
7609 if (! cmds)
7610 cmds = new tree_statement_list ();
7611
7612 cmds->push_back (end_script);
7613
7615
7618 script_scope.cache_dir_name (m_lexer.m_dir_name);
7619
7620 // First non-copyright comment in classdef body, before first
7621 // properties, methods, etc. block.
7622
7623 comment_list leading_comments = cmds->leading_comments ();
7624
7625 std::string doc_string = leading_comments.find_doc_string ();
7626
7627 octave_user_script *script = new octave_user_script (m_lexer.m_fcn_file_full_name, m_lexer.m_fcn_file_name, script_scope, cmds, doc_string);
7628
7630
7631 sys::time now;
7632
7633 script->stash_fcn_file_time (now);
7635
7636 m_primary_fcn = octave_value (script);
7637}
7638
7641{
7642 std::string id_name = id->name ();
7643
7644 // Make classdef local functions unique from classdef methods.
7645
7647 id_name = m_lexer.m_fcn_file_name + ">" + id_name;
7648
7649 if (! m_function_scopes.name_current_scope (id_name))
7650 {
7651 // FIXME: is this correct? Before using position, the column
7652 // was incremented. Hmm.
7653
7654 filepos id_pos = id->beg_pos ();
7655 id_pos.increment_column ();
7656
7657 bison_error ("duplicate subfunction or nested function name", id_pos);
7658
7659 delete id;
7660 return nullptr;
7661 }
7662
7664 curr_scope.cache_name (id_name);
7665
7666 m_lexer.m_parsed_function_name.top () = true;
7668
7669 return id;
7670}
7671
7672// Define a function.
7673
7674// FIXME: combining start_function, finish_function, and
7675// recover_from_parsing_function should be possible, but it makes
7676// for a large mess. Maybe this could be a bit better organized?
7677
7680{
7681 // First non-copyright comments found above and below function keyword.
7682 comment_elt leading_doc_comment;
7683 comment_elt body_doc_comment;
7684
7685 comment_list lc = fcn_tok->leading_comments ();
7686
7687 if (! lc.empty ())
7688 leading_doc_comment = lc.find_doc_comment ();
7689
7690 if (body)
7691 {
7692 comment_list bc = body->leading_comments ();
7693
7694 if (! bc.empty ())
7695 body_doc_comment = bc.find_doc_comment ();
7696 }
7697 else if (end_fcn_stmt)
7698 {
7699 comment_list ec = end_fcn_stmt->leading_comments ();
7700
7701 if (! ec.empty ())
7702 body_doc_comment = ec.find_doc_comment ();
7703 }
7704
7705 // Choose which comment to use for doc string.
7706
7707 // For ordinary functions, use the first comment that isn't empty.
7708
7709 // If we are looking at a classdef method and there is a comment
7710 // prior to the function keyword and another after, then
7711 //
7712 // * Choose the one outside the function definition if either of
7713 // the comments use hash '#' characters. This is the preferred
7714 // Octave style.
7715 //
7716 // * Choose the one inside the function definition if both
7717 // comments use percent '%' characters. This is
7718 // Matlab-compatible behavior.
7719
7720 // FIXME: maybe choose which comment to used by checking whether
7721 // any language extensions are noticed in the entire source file,
7722 // not just in the comments that are candidates to become the
7723 // function doc string.
7724
7725 std::string doc_string;
7726
7727 if (leading_doc_comment.empty ()
7728 || (m_lexer.m_parsing_classdef && ! body_doc_comment.empty ()
7729 && (! (leading_doc_comment.uses_hash_char () || body_doc_comment.uses_hash_char ()))))
7730 doc_string = body_doc_comment.text ();
7731 else
7732 doc_string = leading_doc_comment.text ();
7733
7734 octave_user_function *tmp_fcn = start_function (id, param_list, body, end_fcn_stmt, doc_string);
7735
7736 tree_function_def *retval = finish_function (fcn_tok, ret_list, eq_tok, tmp_fcn);
7737
7739
7740 return retval;
7741}
7742
7743// Begin defining a function.
7744
7746base_parser::start_function (tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_fcn_stmt, const std::string& doc_string)
7747{
7748 // We'll fill in the return list later.
7749
7750 std::string id_name = id->name ();
7751
7753 id_name.insert (0, "get.");
7755 id_name.insert (0, "set.");
7756
7759
7760 if (! body)
7761 body = new tree_statement_list ();
7762
7763 body->push_back (end_fcn_stmt);
7764
7765 octave_user_function *fcn = new octave_user_function (m_lexer.m_symtab_context.curr_scope (), id, param_list, nullptr, body);
7766
7767 // If input is coming from a file, issue a warning if the name of
7768 // the file does not match the name of the function stated in the
7769 // file. Matlab doesn't provide a diagnostic (it ignores the stated
7770 // name).
7772 {
7773 // FIXME: should m_lexer.m_fcn_file_name already be
7774 // preprocessed when we get here? It seems to only be a
7775 // problem with relative filenames.
7776
7777 std::string nm = m_lexer.m_fcn_file_name;
7778
7779 std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ());
7780
7781 if (pos != std::string::npos)
7782 nm = m_lexer.m_fcn_file_name.substr (pos+1);
7783
7784 if (nm != id_name)
7785 {
7786 warning_with_id ("Octave:function-name-clash", "function name '%s' does not agree with function filename '%s'", id_name.c_str (), m_lexer.m_fcn_file_full_name.c_str ());
7787
7788 id_name = nm;
7789 }
7790 }
7791
7792 sys::time now;
7793
7795 fcn->stash_fcn_file_time (now);
7799 fcn->stash_function_name (id_name);
7800
7802 {
7804 fcn->mark_relative ();
7805
7807 {
7809 {
7810 if (m_curr_class_name == id_name)
7812 else
7814 }
7815 else
7816 {
7817 if (m_curr_class_name == id_name)
7819 else
7820 fcn->mark_as_legacy_method ();
7821 }
7822
7824 }
7825
7826 std::string nm = fcn->fcn_file_name ();
7827
7828 sys::file_stat fs (nm);
7829
7830 if (fs && fs.is_newer (now))
7831 warning_with_id ("Octave:future-time-stamp", "time stamp for '%s' is in the future", nm.c_str ());
7832 }
7834 warning ("function '%s' defined within script file '%s'", id_name.c_str (), m_lexer.m_fcn_file_full_name.c_str ());
7835
7836 // Record doc string for functions other than nested functions.
7837 // We cannot currently record help for nested functions (bug #46008)
7838 // because the doc_string of the outermost function is read first,
7839 // whereas this function is called for the innermost function first.
7840 // We could have a stack of doc_string objects in lexer.
7841 if (! doc_string.empty () && m_curr_fcn_depth == 0)
7842 fcn->document (doc_string);
7843
7844
7847
7848 return fcn;
7849}
7850
7852base_parser::make_end (const std::string& type, bool eof, token *end_tok)
7853{
7854 return make_statement (new tree_no_op_command (type, eof, *end_tok));
7855}
7856
7859{
7860 tree_function_def *retval = nullptr;
7861
7862 if (! ret_list)
7864
7865 ret_list->mark_as_formal_parameters ();
7866
7867 if (fcn)
7868 {
7869 fcn->set_fcn_tok (*fcn_tok);
7870
7871 if (eq_tok)
7872 fcn->set_eq_tok (*eq_tok);
7873
7874 std::string fcn_nm = fcn->name ();
7875 std::string file = fcn->fcn_file_name ();
7876
7877 std::string tmp = fcn_nm;
7878 if (! file.empty ())
7879 tmp += ": " + file;
7880
7881 symbol_scope fcn_scope = fcn->scope ();
7882 fcn_scope.cache_name (tmp);
7883 fcn_scope.cache_fcn_name (fcn_nm);
7884 fcn_scope.cache_fcn_file_name (file);
7885 fcn_scope.cache_dir_name (m_lexer.m_dir_name);
7886
7887 fcn->define_ret_list (ret_list);
7888
7890 {
7891 octave_value ov_fcn (fcn);
7892
7893 if (m_endfunction_found && m_function_scopes.size () > 1)
7894 {
7897
7899 fcn_scope.set_parent (pscope);
7901
7902 pscope.install_nestfunction (fcn_nm, ov_fcn, fcn_scope);
7903
7904 // For nested functions, the list of parent functions is
7905 // set in symbol_scope::update_nest.
7906 }
7907 else
7908 {
7909 fcn->mark_as_subfunction ();
7910 m_subfunction_names.push_back (fcn_nm);
7911
7912 fcn_scope.set_parent (m_primary_fcn_scope);
7915
7917 }
7918 }
7919
7920 if (m_curr_fcn_depth == 0)
7921 fcn_scope.update_nest ();
7922
7924 {
7925 // We are either reading a script file or defining a function
7926 // at the command line, so this definition creates a
7927 // tree_function object that is placed in the parse tree.
7928 // Otherwise, it is just inserted in the symbol table,
7929 // either as a subfunction or nested function (see above),
7930 // or as the primary function for the file, via
7931 // m_primary_fcn (see also load_fcn_from_file,,
7932 // parse_fcn_file, and
7933 // fcn_info::fcn_info_rep::find_user_function).
7934
7936 {
7939 }
7940
7941 retval = new tree_function_def (fcn);
7942 }
7943 }
7944
7945 return retval;
7946}
7947
7950{
7951 if (list)
7952 {
7953 for (const auto& elt : *list)
7954 list_append (body, elt);
7955
7956 list->clear ();
7957 delete (list);
7958 }
7959
7960 return body;
7961}
7962
7965{
7966 tree_arguments_block *retval = nullptr;
7967
7968 if (end_token_ok (end_tok, token::arguments_end))
7969 retval = new tree_arguments_block (*arguments_tok, attr_list, validation_list, *end_tok);
7970 else
7971 {
7972 delete attr_list;
7973 delete validation_list;
7974 }
7975
7976 return retval;
7977}
7978
7981{
7982 // FIXME: Validate arguments and convert to more specific types
7983 // (std::string for arg_name and class_name, etc).
7984
7985 token tmp_eq_tok = eq_tok ? *eq_tok : token ();
7986
7987 return new tree_arg_validation (size_spec, class_name, validation_fcns, tmp_eq_tok, default_value);
7988}
7989
7992{
7993 // FIXME: Validate argument and convert to more specific type
7994 // (std::string for attribute_name).
7995
7996 return new tree_args_block_attribute_list (attribute_name);
7997}
7998
8001{
8002 return new tree_args_block_validation_list (arg_validation);
8003}
8004
8007{
8008 return list_append (list, arg_validation);
8009}
8010
8013{
8014 // FIXME: Validate argument.
8015
8016 return new tree_arg_size_spec (size_args);
8017}
8018
8021{
8022 // FIXME: Validate argument.
8023
8024 return new tree_arg_validation_fcns (fcn_args);
8025}
8026
8027void
8043
8044// A CLASSDEF block defines a class that has a constructor and other
8045// methods, but it is not an executable command. Parsing the block
8046// makes some changes in the symbol table (inserting the constructor
8047// and methods, and adding to the list of known objects) and creates
8048// a parse tree containing meta information about the class.
8049
8052{
8053 tree_classdef *retval = nullptr;
8054
8056
8057 std::string cls_name = id->name ();
8058
8059 std::string full_name = m_lexer.m_fcn_file_full_name;
8060 std::string short_name = m_lexer.m_fcn_file_name;
8061
8062 std::size_t pos = short_name.find_last_of (sys::file_ops::dir_sep_chars ());
8063
8064 if (pos != std::string::npos)
8065 short_name = short_name.substr (pos+1);
8066
8067 if (short_name != cls_name)
8068 {
8069 filepos f_pos = id->beg_pos ();
8070
8071 delete a;
8072 delete id;
8073 delete sc;
8074 delete body;
8075
8076 bison_error ("invalid classdef definition, the class name must match the filename", f_pos);
8077
8078 }
8079 else
8080 {
8081 if (end_token_ok (end_tok, token::classdef_end))
8082 {
8083 if (! body)
8084 body = new tree_classdef_body ();
8085
8086 retval = new tree_classdef (m_lexer.m_symtab_context.curr_scope (), *cdef_tok, a, id, sc, body, *end_tok, m_curr_package_name, full_name);
8087 }
8088 else
8089 {
8090 delete a;
8091 delete id;
8092 delete sc;
8093 delete body;
8094
8096 }
8097 }
8098
8099 return retval;
8100}
8101
8104{
8105 tree_classdef_properties_block *retval = nullptr;
8106
8107 if (end_token_ok (end_tok, token::properties_end))
8108 {
8109 if (plist)
8110 {
8111 // If the element at the end of the list doesn't have a doc
8112 // string, see whether the first element of the comments
8113 // attached to the end token is an end-of-line comment for
8114 // us to use.
8115
8116 tree_classdef_property *last_elt = plist->back ();
8117
8118 if (last_elt && ! last_elt->have_doc_string ())
8119 {
8120 comment_list comments = end_tok->leading_comments ();
8121
8122 if (! comments.empty ())
8123 {
8124 comment_elt elt = comments.front ();
8125
8126 if (elt.is_end_of_line ())
8127 last_elt->doc_string (elt.text ());
8128 }
8129 }
8130 }
8131 else
8132 plist = new tree_classdef_property_list ();
8133
8134 retval = new tree_classdef_properties_block (*tok, a, plist, *end_tok);
8135 }
8136 else
8137 {
8138 delete a;
8139 delete plist;
8140
8142 }
8143
8144 return retval;
8145}
8146
8152
8155{
8156 av->arg_name (id);
8157
8158 if (av->size_spec () || av->class_name () || av->validation_fcns ())
8159 warning ("size, class, and validation function specifications are not yet supported for classdef properties; INCORRECT RESULTS ARE POSSIBLE!");
8160
8161 return new tree_classdef_property (av);
8162}
8163
8166{
8167 tree_classdef_methods_block *retval = nullptr;
8168
8169 if (end_token_ok (end_tok, token::methods_end))
8170 {
8171 if (! mlist)
8172 mlist = new tree_classdef_method_list ();
8173
8174 retval = new tree_classdef_methods_block (*tok, a, mlist, *end_tok);
8175 }
8176 else
8177 {
8178 delete a;
8179 delete mlist;
8180
8182 }
8183
8184 return retval;
8185}
8186
8189{
8190 tree_classdef_events_block *retval = nullptr;
8191
8192 if (end_token_ok (end_tok, token::events_end))
8193 {
8194 if (! elist)
8195 elist = new tree_classdef_event_list ();
8196
8197 retval = new tree_classdef_events_block (*tok, a, elist, *end_tok);
8198 }
8199 else
8200 {
8201 delete a;
8202 delete elist;
8203
8205 }
8206
8207 return retval;
8208}
8209
8215
8221
8224{
8225 tree_classdef_enum_block *retval = nullptr;
8226
8227 if (end_token_ok (end_tok, token::enumeration_end))
8228 {
8229 if (! elist)
8230 elist = new tree_classdef_enum_list ();
8231
8232 retval = new tree_classdef_enum_block (*tok, a, elist, *end_tok);
8233 }
8234 else
8235 {
8236 delete a;
8237 delete elist;
8238
8240 }
8241
8242 return retval;
8243}
8244
8250
8253{
8254 return new tree_classdef_enum (id, *open_paren, expr, *close_paren);
8255}
8256
8259{
8260 return list_append (list, elt);
8261}
8262
8265{
8266 return list_append (list, elt);
8267}
8268
8271{
8272 return list_append (list, elt);
8273}
8274
8277{
8278 sc->set_separator (*lt_tok);
8279
8280 return new tree_classdef_superclass_list (sc);
8281}
8282
8285{
8286 return new tree_classdef_superclass (*fqident);
8287}
8288
8291{
8292 elt->set_separator (*and_tok);
8293
8294 return list_append (list, elt);
8295}
8296
8302
8305{
8306 return make_classdef_attribute (id, nullptr, nullptr);
8307}
8308
8311{
8312 return (expr ? new tree_classdef_attribute (id, *eq_tok, expr) : new tree_classdef_attribute (id));
8313}
8314
8317{
8318 return new tree_classdef_attribute (*not_tok, id, false);
8319}
8320
8323{
8324 return list_append (list, *sep_tok, elt);
8325}
8326
8332
8338
8344
8350
8356
8362
8368
8374
8377{
8378 octave_user_function* retval = nullptr;
8379
8380 // External methods are only allowed within @-folders. In this case,
8381 // m_curr_class_name will be non-empty.
8382
8383 if (! m_curr_class_name.empty ())
8384 {
8385 std::string mname = id->name ();
8386
8387 // Methods that cannot be declared outside the classdef file:
8388 // - methods with '.' character (e.g. property accessors)
8389 // - class constructor
8390 // - 'delete'
8391
8392 if (mname.find_first_of (".") == std::string::npos && mname != "delete" && mname != m_curr_class_name)
8393 {
8394 // Create a dummy function that is used until the real method
8395 // is loaded.
8396
8397 retval = new octave_user_function (symbol_scope::anonymous (), id, pl);
8398
8399 retval->stash_function_name (mname);
8400 }
8401 else
8402 bison_error ("invalid external method declaration, an external method cannot be the class constructor, 'delete' or have a dot (.) character in its name");
8403 }
8404 else
8405 bison_error ("external methods are only allowed in @-folders");
8406
8407 return retval;
8408}
8409
8412{
8413 if (! ret_list)
8415
8416 fcn->define_ret_list (ret_list);
8417
8418 if (eq_tok)
8419 fcn->set_eq_tok (*eq_tok);
8420
8421 return new tree_function_def (fcn);
8422}
8423
8426{
8427 octave_value fcn;
8428
8429 if (fcn_def)
8430 fcn = fcn_def->function ();
8431
8432 delete fcn_def;
8433
8434 return new tree_classdef_method_list (fcn);
8435}
8436
8439{
8440 octave_value fcn;
8441
8442 if (fcn_def)
8443 {
8444 fcn = fcn_def->function ();
8445
8446 delete fcn_def;
8447 }
8448
8449 return list_append (list, fcn);
8450}
8451
8452bool
8454{
8455 parse_tree_validator validator;
8456
8457 cls->accept (validator);
8458
8459 if (local_fcns)
8460 {
8461 for (tree_statement *elt : *local_fcns)
8462 {
8463 tree_command *cmd = elt->command ();
8464
8465 tree_function_def *fcn_def = dynamic_cast<tree_function_def *> (cmd);
8466
8467 fcn_def->accept (validator);
8468 }
8469 }
8470
8471 if (! validator.ok ())
8472 {
8473 delete cls;
8474 delete local_fcns;
8475
8476 bison_error (validator.error_list ());
8477
8478 return false;
8479 }
8480
8481 // Require all validations to succeed before installing any local
8482 // functions or defining the classdef object for later use.
8483
8484 if (local_fcns)
8485 {
8487
8488 symbol_table& symtab = interp.get_symbol_table ();
8489
8490 for (tree_statement *elt : *local_fcns)
8491 {
8492 tree_command *cmd = elt->command ();
8493
8494 tree_function_def *fcn_def = dynamic_cast<tree_function_def *> (cmd);
8495
8496 octave_value ov_fcn = fcn_def->function ();
8498
8499 std::string nm = fcn->name ();
8500 std::string file = fcn->fcn_file_name ();
8501
8502 fcn->attach_trailing_comments (eof_tok->leading_comments ());
8503
8504 symtab.install_local_function (nm, ov_fcn, file);
8505 }
8506
8507 delete local_fcns;
8508 }
8509
8510 // FIXME: Is it possible for the following condition to be false?
8512 m_classdef_object = std::shared_ptr<tree_classdef> (cls);
8513
8514 return true;
8515}
8516
8517// Make a word list command.
8520{
8521 tree_index_expression *retval = make_index_expression (expr, nullptr, args, nullptr, '(');
8522
8523 if (retval)
8524 retval->mark_word_list_cmd ();
8525
8526 return retval;
8527}
8528
8529// Make an index expression.
8530
8532base_parser::make_index_expression (tree_expression *expr, token *open_delim, tree_argument_list *args, token *close_delim, char type)
8533{
8534 tree_index_expression *retval = nullptr;
8535
8536 if (! args)
8537 args = new tree_argument_list ();
8538
8539 if (args->has_magic_tilde ())
8540 {
8541 delete expr;
8542 delete args;
8543
8544 bison_error ("invalid use of empty argument (~) in index expression");
8545 }
8546 else
8547 {
8548 if (! expr->is_postfix_indexed ())
8549 expr->set_postfix_index (type);
8550
8551 token tmp_open_delim = open_delim ? *open_delim : token ();
8552 token tmp_close_delim = close_delim ? *close_delim : token ();
8553
8554 if (expr->is_index_expression ())
8555 {
8556 retval = dynamic_cast<tree_index_expression *> (expr);
8557
8558 retval->append (tmp_open_delim, args, tmp_close_delim, type);
8559 }
8560 else
8561 retval = new tree_index_expression (expr, tmp_open_delim, args, tmp_close_delim, type);
8562 }
8563
8564 return retval;
8565}
8566
8567// Make an indirect reference expression.
8568
8571{
8572 tree_index_expression *retval = nullptr;
8573
8574 if (! expr->is_postfix_indexed ())
8575 expr->set_postfix_index ('.');
8576
8577 if (expr->is_index_expression ())
8578 {
8579 retval = dynamic_cast<tree_index_expression *> (expr);
8580
8581 retval->append (*dot_tok, *struct_elt_tok);
8582 }
8583 else
8584 retval = new tree_index_expression (expr, *dot_tok, *struct_elt_tok);
8585
8587
8588 return retval;
8589}
8590
8591// Make an indirect reference expression with dynamic field name.
8592
8594base_parser::make_indirect_ref (tree_expression *expr, token *dot_tok, token *open_paren, tree_expression *elt, token *close_paren)
8595{
8596 tree_index_expression *retval = nullptr;
8597
8598 if (! expr->is_postfix_indexed ())
8599 expr->set_postfix_index ('.');
8600
8601 if (expr->is_index_expression ())
8602 {
8603 retval = dynamic_cast<tree_index_expression *> (expr);
8604
8605 retval->append (*dot_tok, *open_paren, elt, *close_paren);
8606 }
8607 else
8608 retval = new tree_index_expression (expr, *dot_tok, *open_paren, elt, *close_paren);
8609
8611
8612 return retval;
8613}
8614
8615// Make a declaration command.
8616
8619{
8620 tree_decl_command *retval = nullptr;
8621
8622 if (lst)
8624
8625 int tok_id = tok->token_id ();
8626
8627 switch (tok->token_id ())
8628 {
8629 case GLOBAL:
8630 {
8631 retval = new tree_decl_command ("global", *tok, lst);
8632 retval->mark_global ();
8633 }
8634 break;
8635
8636 case PERSISTENT:
8637 if (m_curr_fcn_depth >= 0)
8638 {
8639 retval = new tree_decl_command ("persistent", *tok, lst);
8640 retval->mark_persistent ();
8641 }
8642 else
8643 {
8644 filepos pos = tok->beg_pos ();
8645 int line = pos.line ();
8646
8648 warning ("ignoring persistent declaration near line %d of file '%s'", line, m_lexer.m_fcn_file_full_name.c_str ());
8649 else
8650 warning ("ignoring persistent declaration near line %d", line);
8651 }
8652 break;
8653
8654 default:
8655 unexpected_token (tok_id, "base_parser::make_decl_command");
8656 break;
8657 }
8658
8659 return retval;
8660}
8661
8667
8670{
8671 return list_append (list, elt);
8672}
8673
8676{
8677 // FIXME: Need to capture EQ_OP here.
8678 return expr ? new tree_decl_elt (id, expr) : new tree_decl_elt (id);
8679}
8680
8681bool
8683{
8684 std::set<std::string> dict;
8685
8686 for (tree_decl_elt *elt : *lst)
8687 {
8688 tree_identifier *id = elt->ident ();
8689
8690 if (id)
8691 {
8692 std::string name = id->name ();
8693
8694 if (id->is_black_hole ())
8695 {
8696 if (type != tree_parameter_list::in)
8697 {
8698 bison_error ("invalid use of ~ in output list");
8699 return false;
8700 }
8701 }
8702 else if (iskeyword (name))
8703 {
8704 bison_error ("invalid use of keyword '" + name + "' in parameter list");
8705 return false;
8706 }
8707 else if (dict.find (name) != dict.end ())
8708 {
8709 bison_error ("'" + name + "' appears more than once in parameter list");
8710 return false;
8711 }
8712 else
8713 dict.insert (name);
8714 }
8715 }
8716
8717 std::string va_type = (type == tree_parameter_list::in ? "varargin" : "varargout");
8718
8719 std::size_t len = lst->size ();
8720
8721 if (len > 0)
8722 {
8723 tree_decl_elt *elt = lst->back ();
8724
8725 tree_identifier *id = elt->ident ();
8726
8727 if (id && id->name () == va_type)
8728 {
8729 if (len == 1)
8730 lst->mark_varargs_only ();
8731 else
8732 lst->mark_varargs ();
8733
8734 tree_parameter_list::iterator p = lst->end ();
8735 --p;
8736 delete *p;
8737 lst->erase (p);
8738 }
8739 }
8740
8741 return true;
8742}
8743
8744bool
8746{
8747 bool retval = true;
8748
8749 tree_array_list *al = dynamic_cast<tree_array_list *> (e);
8750
8751 for (tree_argument_list* row : *al)
8752 {
8753 if (row && row->has_magic_tilde ())
8754 {
8755 retval = false;
8756
8757 if (e->is_matrix ())
8758 bison_error ("invalid use of tilde (~) in matrix expression");
8759 else
8760 bison_error ("invalid use of tilde (~) in cell expression");
8761
8762 break;
8763 }
8764 }
8765
8766 return retval;
8767}
8768
8771{
8772 tree_argument_list *retval = nullptr;
8773
8774 if (e->is_constant ())
8775 {
8777
8778 tree_evaluator& tw = interp.get_evaluator ();
8779
8780 octave_value ov = e->evaluate (tw);
8781
8782 delete e;
8783
8784 if (ov.isempty ())
8785 bison_error ("invalid empty left hand side of assignment");
8786 else
8787 bison_error ("invalid constant left hand side of assignment");
8788 }
8789 else
8790 {
8791 bool is_simple_assign = true;
8792
8793 tree_argument_list *tmp = nullptr;
8794
8795 if (e->is_matrix ())
8796 {
8797 tree_matrix *mat = dynamic_cast<tree_matrix *> (e);
8798
8799 if (mat && mat->size () == 1)
8800 {
8801 tmp = mat->front ();
8802 mat->pop_front ();
8803 delete e;
8804 is_simple_assign = false;
8805 }
8806 }
8807 else
8808 tmp = new tree_argument_list (e);
8809
8810 if (tmp && tmp->is_valid_lvalue_list ())
8811 {
8813 retval = tmp;
8814 }
8815 else
8816 {
8817 delete tmp;
8818
8819 bison_error ("invalid left hand side of assignment");
8820 }
8821
8822 if (retval && is_simple_assign)
8823 retval->mark_as_simple_assign_lhs ();
8824 }
8825
8826 return retval;
8827}
8828
8829// Finish building an array_list.
8830
8832base_parser::finish_array_list (token *open_delim, tree_array_list *array_list, token *close_delim)
8833{
8834 tree_expression *retval = array_list;
8835
8836 array_list->mark_in_delims (*open_delim, *close_delim);
8837
8838 if (array_list->all_elements_are_constant ())
8839 {
8841
8842 try
8843 {
8844 // If the evaluation generates a warning message, restore
8845 // the previous value of last_warning_message and skip the
8846 // conversion to a constant value.
8847
8848 error_system& es = interp.get_error_system ();
8849
8850 unwind_action restore_last_warning_message (&error_system::set_last_warning_message, &es, es.last_warning_message (""));
8851
8852 unwind_action restore_discard_warning_messages (&error_system::set_discard_warning_messages, &es, es.discard_warning_messages (true));
8853
8854 tree_evaluator& tw = interp.get_evaluator ();
8855
8856 octave_value tmp = array_list->evaluate (tw);
8857
8858 std::string msg = es.last_warning_message ();
8859
8860 if (msg.empty ())
8861 {
8862 std::ostringstream buf;
8863
8864 tree_print_code tpc (buf);
8865
8866 array_list->accept (tpc);
8867
8868 std::string orig_text = buf.str ();
8869
8870 token tok (CONSTANT, tmp, orig_text, open_delim->beg_pos (), close_delim->end_pos ());
8871
8872 tree_constant *tc_retval = new tree_constant (tmp, orig_text, tok);
8873
8874 delete array_list;
8875
8876 retval = tc_retval;
8877 }
8878 }
8879 catch (const execution_exception&)
8880 {
8881 interp.recover_from_exception ();
8882 }
8883 }
8884
8885 return retval;
8886}
8887
8888// Finish building a matrix list.
8889
8891base_parser::finish_matrix (token *open_delim, tree_matrix *m, token *close_delim)
8892{
8893 if (m)
8894 return finish_array_list (open_delim, m, close_delim);
8895
8897 std::string orig_text {"{}"};
8898
8899 token tok (CONSTANT, tmp, orig_text, open_delim->beg_pos (), close_delim->end_pos ());
8900
8901 return new tree_constant (tmp, orig_text, tok);
8902}
8903
8906{
8907 return row ? new tree_matrix (row) : nullptr;
8908}
8909
8912{
8913 if (! matrix)
8914 return make_matrix (row);
8915
8916 return row ? list_append (matrix, *sep_tok, row) : matrix;
8917}
8918
8919// Finish building a cell list.
8920
8922base_parser::finish_cell (token *open_delim, tree_cell *c, token *close_delim)
8923{
8924 if (c)
8925 return finish_array_list (open_delim, c, close_delim);
8926
8927 octave_value tmp {Cell ()};
8928 std::string orig_text {"{}"};
8929
8930 token tok (CONSTANT, tmp, orig_text, open_delim->beg_pos (), close_delim->end_pos ());
8931
8932 return new tree_constant (tmp, orig_text, tok);
8933}
8934
8935tree_cell *
8937{
8938 return row ? new tree_cell (row) : nullptr;
8939}
8940
8941tree_cell *
8943{
8944 if (! cell)
8945 return make_cell (row);
8946
8947 return row ? list_append (cell, *sep_tok, row) : cell;
8948}
8949
8952{
8954
8955 return new tree_identifier (scope, *ident);
8956}
8957
8960{
8961 std::string meth = superclassref->superclass_method_name ();
8962 std::string cls = superclassref->superclass_class_name ();
8963
8964 return new tree_superclass_ref (meth, cls, *superclassref);
8965}
8966
8969{
8970 std::string cls = metaquery->text ();
8971
8972 return new tree_metaclass_query (cls, *metaquery);
8973}
8974
8976base_parser::set_stmt_print_flag (tree_statement_list *list, int sep_char, bool warn_missing_semi)
8977{
8978 tree_statement *tmp = list->back ();
8979
8980 switch (sep_char)
8981 {
8982 case ';':
8983 tmp->set_print_flag (false);
8984 break;
8985
8986 case '\0':
8987 case ',':
8988 case '\n':
8989 tmp->set_print_flag (true);
8990 if (warn_missing_semi)
8991 maybe_warn_missing_semi (list);
8992 break;
8993
8994 default:
8995 warning ("unrecognized separator type!");
8996 break;
8997 }
8998
8999 // Even if a statement is null, we add it to the list then remove it
9000 // here so that the print flag is applied to the correct statement.
9001
9002 if (tmp->is_null_statement ())
9003 {
9004 list->pop_back ();
9005 delete tmp;
9006 }
9007
9008 return list;
9009}
9010
9012base_parser::set_stmt_print_flag (tree_statement_list *list, const token& sep_tok, bool warn_missing_semi)
9013{
9014 return set_stmt_print_flag (list, sep_tok.token_id (), warn_missing_semi);
9015}
9016
9019{
9020 return (sep_list
9021 ? set_stmt_print_flag (list, sep_list->front (), warn_missing_semi)
9022 : set_stmt_print_flag (list, '\0', warn_missing_semi));
9023}
9024
9025// Finish building a statement.
9026template <typename T>
9029{
9030 return new tree_statement (arg);
9031}
9032
9035{
9036 return new tree_statement_list (stmt);
9037}
9038
9040base_parser::append_statement_list (tree_statement_list *list, int sep_char, tree_statement *stmt, bool warn_missing_semi)
9041{
9042 set_stmt_print_flag (list, sep_char, warn_missing_semi);
9043
9044 // FIXME: need to capture SEP_CHAR here.
9045 return list_append (list, stmt);
9046}
9047
9049base_parser::append_statement_list (tree_statement_list *list, token *sep_tok, tree_statement *stmt, bool warn_missing_semi)
9050{
9051 if (sep_tok)
9052 set_stmt_print_flag (list, *sep_tok, warn_missing_semi);
9053 else
9054 set_stmt_print_flag (list, '\0', warn_missing_semi);
9055
9056 // FIXME: need to capture SEP_TOK here.
9057 return list_append (list, stmt);
9058}
9059
9062{
9063 set_stmt_print_flag (list, sep_list, warn_missing_semi);
9064
9065 // FIXME: need to capture separator list here.
9066 // For now, delete the unused list.
9067 delete sep_list;
9068
9069 return list_append (list, stmt);
9070}
9071
9074{
9075 tree_statement *stmt = make_statement (fcn_def);
9076
9077 return new tree_statement_list (stmt);
9078}
9079
9082{
9083 tree_statement *stmt = make_statement (fcn_def);
9084
9085 // FIXME: Need to capture separator list here.
9086 // For now, delete the unused list.
9087 delete sep_list;
9088
9089 return list_append (list, stmt);
9090}
9091
9094{
9095 return new tree_argument_list (expr);
9096}
9097
9100{
9101 return list_append (list, expr);
9102}
9103
9106{
9107 return list_append (list, *sep_tok, expr);
9108}
9109
9115
9121
9127
9130{
9131 return list_append (list, *sep_tok, t);
9132}
9133
9136{
9137 return list_append (list, *sep_tok, new tree_decl_elt (id));
9138}
9139
9140void
9145
9146void
9147base_parser::bison_error (const std::string& str)
9148{
9150}
9151
9152void
9153base_parser::bison_error (const std::string& str, const filepos& pos)
9154{
9155 std::ostringstream output_buf;
9156
9157 int err_line = pos.line ();
9158 int err_col = pos.column ();
9159
9161
9162 // Adjust the error column for display because it is 1-based in the
9163 // lexer for easier reporting.
9164 err_col--;
9165
9166 if (in_file)
9167 output_buf << str << " near line " << err_line << ", column " << err_col << " in file " << m_lexer.m_fcn_file_full_name << "\n";
9168 else
9169 {
9170 // On command line, point directly to error
9171 output_buf << str << "\n\n";
9172 std::string curr_line = m_lexer.m_current_input_line;
9173
9174 if (! curr_line.empty ())
9175 {
9176 // FIXME: we could do better if we just cached lines from the
9177 // input file in a list. See also functions for managing input
9178 // buffers in lex.ll.
9179 std::size_t len = curr_line.length ();
9180
9181 if (curr_line[len-1] == '\n')
9182 curr_line.resize (len-1);
9183
9184 // Print the line, maybe with a pointer near the error token.
9185 output_buf << ">>> " << curr_line << "\n";
9186
9187 if (err_col == 0)
9188 err_col = len;
9189
9190 for (int i = 0; i < err_col + 3; i++)
9191 output_buf << " ";
9192
9193 output_buf << "^" << "\n";
9194 }
9195
9196 }
9197
9198 m_parse_error_msg = output_buf.str ();
9199}
9200
9201void
9202base_parser::bison_error (const parse_exception& pe)
9203{
9204 bison_error (pe.message (), pe.pos ());
9205}
9206
9207void
9208base_parser::bison_error (const std::list<parse_exception>& pe_list)
9209{
9210 // For now, we just report the first error found. Reporting all
9211 // errors will require a bit more refactoring.
9212
9213 parse_exception pe = pe_list.front ();
9214
9215 bison_error (pe.message (), pe.pos ());
9216}
9217
9218int
9220{
9221 int status = -1;
9222
9223 yypstate *pstate = static_cast<yypstate *> (m_parser_state);
9224
9225 try
9226 {
9227 status = octave_pull_parse (pstate, *this);
9228 }
9229 catch (const execution_exception&)
9230 {
9231 // FIXME: In previous versions, we emitted a parse error here
9232 // but that is not always correct because the error could have
9233 // happened inside a GUI callback functions executing in the
9234 // readline event_hook loop. Maybe we need a separate exception
9235 // class for parse errors?
9236
9237 throw;
9238 }
9239 catch (const exit_exception&)
9240 {
9241 throw;
9242 }
9243 catch (const interrupt_exception&)
9244 {
9245 throw;
9246 }
9247 catch (...)
9248 {
9249 std::string file = m_lexer.m_fcn_file_full_name;
9250
9251 if (file.empty ())
9252 error ("unexpected exception while parsing input");
9253 else
9254 error ("unexpected exception while parsing %s", file.c_str ());
9255 }
9256
9257 if (status != 0)
9258 parse_error_with_id ("Octave:parse-error", "%s", m_parse_error_msg.c_str ());
9259
9260 return status;
9261}
9262
9263// Parse input from INPUT. Pass TRUE for EOF if the end of INPUT should
9264// finish the parse.
9265
9266int
9267push_parser::run (const std::string& input, bool eof)
9268{
9269 int status = -1;
9270
9271 dynamic_cast<push_lexer&> (m_lexer).append_input (input, eof);
9272
9273 do
9274 {
9275 YYSTYPE lval;
9276
9277 int tok_id = octave_lex (&lval, m_lexer.m_scanner);
9278
9279 if (tok_id < 0)
9280 {
9281 // TOKEN == -2 means that the lexer recognized a comment
9282 // and we should be at the end of the buffer but not the
9283 // end of the file so we should return 0 to indicate
9284 // "complete input" instead of -1 to request more input.
9285
9286 status = (tok_id == -2 ? 0 : -1);
9287
9288 if (! eof && m_lexer.at_end_of_buffer ())
9289 return status;
9290
9291 break;
9292 }
9293
9294 yypstate *pstate = static_cast<yypstate *> (m_parser_state);
9295
9296 try
9297 {
9298 status = octave_push_parse (pstate, tok_id, &lval, *this);
9299 }
9300 catch (execution_exception& e)
9301 {
9302 std::string file = m_lexer.m_fcn_file_full_name;
9303
9304 if (file.empty ())
9305 error (e, "parse error");
9306 else
9307 error (e, "parse error in %s", file.c_str ());
9308 }
9309 catch (const exit_exception&)
9310 {
9311 throw;
9312 }
9313 catch (interrupt_exception &)
9314 {
9315 throw;
9316 }
9317 catch (...)
9318 {
9319 std::string file = m_lexer.m_fcn_file_full_name;
9320
9321 if (file.empty ())
9322 error ("unexpected exception while parsing input");
9323 else
9324 error ("unexpected exception while parsing %s", file.c_str ());
9325 }
9326 }
9327 while (status == YYPUSH_MORE || ! m_lexer.at_end_of_buffer ());
9328
9329 if (status != 0)
9330 parse_error_with_id ("Octave:parse-error", "%s", m_parse_error_msg.c_str ());
9331
9332 return status;
9333}
9334
9335int
9337{
9338 if (! m_reader)
9339 error ("push_parser::run requires valid input_reader");
9340
9341 int exit_status = 0;
9342
9343 std::string prompt = command_editor::decode_prompt_string (m_interpreter.PS1 ());
9344
9345 do
9346 {
9347 // Reset status each time through the read loop so that
9348 // it won't be set to -1 and cause us to exit the outer
9349 // loop early if there is an exception while reading
9350 // input or parsing.
9351
9352 exit_status = 0;
9353
9354 bool eof = false;
9355 std::string input_line = m_reader->get_input (prompt, eof);
9356
9357 if (eof)
9358 {
9359 exit_status = EOF;
9360 break;
9361 }
9362
9363 exit_status = run (input_line, false);
9364
9365 prompt = command_editor::decode_prompt_string (m_interpreter.PS2 ());
9366 }
9367 while (exit_status < 0);
9368
9369 return exit_status;
9370}
9371
9373parse_fcn_file (interpreter& interp, const std::string& full_file, const std::string& file, const std::string& dir_name, const std::string& dispatch_type, const std::string& package_name, bool require_file, bool force_script, bool autoload, bool relative_lookup)
9374{
9375 octave_value retval;
9376
9377 FILE *ffile = nullptr;
9378
9379 if (! full_file.empty ())
9380 {
9381 // Check that m-file is not overly large which can segfault interpreter.
9382 const int max_file_size = 512 * 1024 * 1024; // 512 MB
9383 sys::file_stat fs (full_file);
9384
9385 if (fs && fs.size () > max_file_size)
9386 {
9387 error ("file '%s' is too large, > 512 MB", full_file.c_str ());
9388
9389 return octave_value ();
9390 }
9391
9392 ffile = sys::fopen (full_file, "rb");
9393 }
9394
9395 if (! ffile)
9396 {
9397 if (require_file)
9398 error ("no such file, '%s'", full_file.c_str ());
9399
9400 return octave_value ();
9401 }
9402
9403 unwind_action act ([ffile] () { ::fclose (ffile); });
9404
9405 // get the encoding for this folder
9406 input_system& input_sys = interp.get_input_system ();
9407 parser parser (ffile, interp, input_sys.dir_encoding (dir_name));
9408
9409 parser.m_curr_class_name = dispatch_type;
9410 parser.m_curr_package_name = package_name;
9411 parser.m_autoloading = autoload;
9412 parser.m_fcn_file_from_relative_lookup = relative_lookup;
9413
9414 parser.m_lexer.m_force_script = force_script;
9416 parser.m_lexer.m_parsing_class_method = ! dispatch_type.empty ();
9417
9420 parser.m_lexer.m_dir_name = dir_name;
9421 parser.m_lexer.m_package_name = package_name;
9422
9423 int err = parser.run ();
9424
9425 if (err)
9426 error ("parse error while reading file %s", full_file.c_str ());
9427
9429
9431 {
9432 // Convert parse tree for classdef object to
9433 // meta.class info (and stash it in the symbol
9434 // table?). Return pointer to constructor?
9435
9436 if (ov_fcn.is_defined ())
9437 error ("unexpected: defining classdef object but primary_fcn is already defined - please report this bug");
9438
9439 bool is_at_folder = ! dispatch_type.empty ();
9440
9441 std::shared_ptr<tree_classdef> cdef_obj = parser.classdef_object();
9442
9443 return cdef_obj->make_meta_class (interp, is_at_folder);
9444 }
9445 else if (ov_fcn.is_defined ())
9446 {
9447 octave_function *fcn = ov_fcn.function_value ();
9448
9449 fcn->maybe_relocate_end ();
9450
9452 {
9454 parser.m_subfunction_names.reverse ();
9455
9457 }
9458
9459 return ov_fcn;
9460 }
9461
9462 return octave_value ();
9463}
9464
9465bool
9467{
9468 m_lexer.m_end_of_input = at_eof;
9469
9470 if (lst)
9471 {
9472 parse_tree_validator validator;
9473
9474 lst->accept (validator);
9475
9476 if (! validator.ok ())
9477 {
9478 delete lst;
9479
9480 bison_error (validator.error_list ());
9481
9482 return false;
9483 }
9484 }
9485
9486 std::shared_ptr<tree_statement_list> tmp_lst (lst);
9487
9488 statement_list (tmp_lst);
9489
9490 return true;
9491}
9492
9493// Check script or function for semantic errors.
9494bool
9496{
9498
9499 if (code)
9500 {
9501 parse_tree_validator validator;
9502
9503 code->accept (validator);
9504
9505 if (! validator.ok ())
9506 {
9507 bison_error (validator.error_list ());
9508
9509 return false;
9510 }
9511 }
9512
9513 return true;
9514}
9515
9516// Maybe print a warning if an assignment expression is used as the
9517// test in a logical expression.
9518
9519void
9520base_parser::maybe_warn_assign_as_truth_value (tree_expression *expr)
9521{
9522 if (expr->is_assignment_expression () && expr->delim_count () < 2)
9523 {
9524 if (m_lexer.m_fcn_file_full_name.empty ())
9525 warning_with_id ("Octave:assign-as-truth-value", "suggest parenthesis around assignment used as truth value");
9526 else
9527 warning_with_id ("Octave:assign-as-truth-value", "suggest parenthesis around assignment used as truth value near line %d, column %d in file '%s'", expr->line (), expr->column (), m_lexer.m_fcn_file_full_name.c_str ());
9528 }
9529}
9530
9531// Maybe print a warning about switch labels that aren't constants.
9532
9533void
9534base_parser::maybe_warn_variable_switch_label (tree_expression *expr)
9535{
9536 if (! expr->is_constant ())
9537 {
9538 if (m_lexer.m_fcn_file_full_name.empty ())
9539 warning_with_id ("Octave:variable-switch-label", "variable switch label");
9540 else
9541 warning_with_id ("Octave:variable-switch-label", "variable switch label near line %d, column %d in file '%s'", expr->line (), expr->column (), m_lexer.m_fcn_file_full_name.c_str ());
9542 }
9543}
9544
9545void
9546base_parser::maybe_warn_missing_semi (tree_statement_list *t)
9547{
9548 if (m_curr_fcn_depth >= 0)
9549 {
9550 tree_statement *tmp = t->back ();
9551
9552 if (tmp->is_expression ())
9553 warning_with_id ("Octave:missing-semicolon", "missing semicolon near line %d, column %d in file '%s'", tmp->line (), tmp->column (), m_lexer.m_fcn_file_full_name.c_str ());
9554 }
9555}
9556
9557std::string
9558get_help_from_file (const std::string& nm, bool& symbol_found, std::string& full_file)
9559{
9560 std::string retval;
9561
9562 full_file = fcn_file_in_path (nm);
9563
9564 std::string file = full_file;
9565
9566 std::size_t file_len = file.length ();
9567
9568 if ((file_len > 4 && file.substr (file_len-4) == ".oct")
9569 || (file_len > 4 && file.substr (file_len-4) == ".mex")
9570 || (file_len > 2 && file.substr (file_len-2) == ".m"))
9571 {
9572 file = sys::env::base_pathname (file);
9573 file = file.substr (0, file.find_last_of ('.'));
9574
9575 std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ());
9576 if (pos != std::string::npos)
9577 file = file.substr (pos+1);
9578 }
9579
9580 if (! file.empty ())
9581 {
9582 interpreter& interp = __get_interpreter__ ();
9583
9584 symbol_found = true;
9585
9586 octave_value ov_fcn = parse_fcn_file (interp, full_file, file, "", "", "", true, false, false, false);
9587
9588 if (ov_fcn.is_defined ())
9589 {
9590 octave_function *fcn = ov_fcn.function_value ();
9591
9592 if (fcn)
9593 retval = fcn->doc_string ();
9594 }
9595 }
9596
9597 return retval;
9598}
9599
9600std::string
9601get_help_from_file (const std::string& nm, bool& symbol_found)
9602{
9603 std::string file;
9604 return get_help_from_file (nm, symbol_found, file);
9605}
9606
9608load_fcn_from_file (const std::string& file_name, const std::string& dir_name, const std::string& dispatch_type, const std::string& package_name, const std::string& fcn_name, bool autoload)
9609{
9610 octave_value retval;
9611
9612 unwind_protect frame;
9613
9614 std::string nm = file_name;
9615
9616 std::size_t nm_len = nm.length ();
9617
9618 std::string file;
9619
9620 bool relative_lookup = false;
9621
9622 file = nm;
9623
9624 if ((nm_len > 4 && nm.substr (nm_len-4) == ".oct")
9625 || (nm_len > 4 && nm.substr (nm_len-4) == ".mex")
9626 || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))
9627 {
9628 nm = sys::env::base_pathname (file);
9629 nm = nm.substr (0, nm.find_last_of ('.'));
9630
9631 std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_str ());
9632 if (pos != std::string::npos)
9633 nm = nm.substr (pos+1);
9634 }
9635
9636 relative_lookup = ! sys::env::absolute_pathname (file);
9637
9638 file = sys::env::make_absolute (file);
9639
9640 int len = file.length ();
9641
9642 interpreter& interp = __get_interpreter__ ();
9643
9644 dynamic_loader& dyn_loader = interp.get_dynamic_loader ();
9645
9646 if (len > 4 && file.substr (len-4, len-1) == ".oct")
9647 {
9648 if (autoload && ! fcn_name.empty ())
9649 nm = fcn_name;
9650
9651 octave_function *tmpfcn = dyn_loader.load_oct (nm, file, relative_lookup);
9652
9653 if (tmpfcn)
9654 {
9655 tmpfcn->stash_package_name (package_name);
9656 retval = octave_value (tmpfcn);
9657 }
9658 }
9659 else if (len > 4 && file.substr (len-4, len-1) == ".mex")
9660 {
9661 // Temporarily load m-file version of mex-file, if it exists,
9662 // to get the help-string to use.
9663
9664 std::string doc_string;
9665
9666 octave_value ov_fcn = parse_fcn_file (interp, file.substr (0, len - 2), nm, dir_name, dispatch_type, package_name, false, autoload, autoload, relative_lookup);
9667
9668 if (ov_fcn.is_defined ())
9669 {
9670 octave_function *tmpfcn = ov_fcn.function_value ();
9671
9672 if (tmpfcn)
9673 doc_string = tmpfcn->doc_string ();
9674 }
9675
9676 octave_function *tmpfcn = dyn_loader.load_mex (nm, file, relative_lookup);
9677
9678 if (tmpfcn)
9679 {
9680 tmpfcn->document (doc_string);
9681 tmpfcn->stash_package_name (package_name);
9682
9683 retval = octave_value (tmpfcn);
9684 }
9685 }
9686 else if (len > 2)
9687 retval = parse_fcn_file (interp, file, nm, dir_name, dispatch_type, package_name, true, autoload, autoload, relative_lookup);
9688
9689 return retval;
9690}
9691
9692DEFMETHOD (autoload, interp, args, ,
9693 doc: /* -*- texinfo -*-
9694@deftypefn {} {@var{autoload_map} =} autoload ()
9695@deftypefnx {} {} autoload (@var{function}, @var{file})
9696@deftypefnx {} {} autoload (@dots{}, "remove")
9697Define @var{function} to autoload from @var{file}.
9698
9699The second argument, @var{file}, should be an absolute filename or a file
9700name in the same directory as the function or script from which the autoload
9701command was run. @var{file} @emph{should not} depend on the Octave load
9702path.
9703
9704Normally, calls to @code{autoload} appear in PKG_ADD script files that are
9705evaluated when a directory is added to Octave's load path. To avoid having
9706to hardcode directory names in @var{file}, if @var{file} is in the same
9707directory as the PKG_ADD script then
9708
9709@example
9710autoload ("foo", "bar.oct");
9711@end example
9712
9713@noindent
9714will load the function @code{foo} from the file @code{bar.oct}. The above
9715usage when @code{bar.oct} is not in the same directory, or usages such as
9716
9717@example
9718autoload ("foo", file_in_loadpath ("bar.oct"))
9719@end example
9720
9721@noindent
9722are strongly discouraged, as their behavior may be unpredictable.
9723
9724With no arguments, return a structure containing the current autoload map.
9725
9726If a third argument @qcode{"remove"} is given, the function is cleared and
9727not loaded anymore during the current Octave session.
9728
9729@seealso{PKG_ADD}
9730@end deftypefn */)
9731{
9732 int nargin = args.length ();
9733
9734 if (nargin == 1 || nargin > 3)
9735 print_usage ();
9736
9737 tree_evaluator& tw = interp.get_evaluator ();
9738
9739 if (nargin == 0)
9740 return octave_value (tw.get_autoload_map ());
9741 else
9742 {
9743 string_vector argv = args.make_argv ("autoload");
9744
9745 if (nargin == 2)
9746 tw.add_autoload (argv[1], argv[2]);
9747 else if (nargin == 3)
9748 {
9749 if (argv[3] != "remove")
9750 error_with_id ("Octave:invalid-input-arg", "autoload: third argument can only be 'remove'");
9751
9752 tw.remove_autoload (argv[1], argv[2]);
9753 }
9754 }
9755
9756 return octave_value_list ();
9757}
9758
9759DEFMETHOD (mfilename, interp, args, ,
9760 doc: /* -*- texinfo -*-
9761@deftypefn {} {} mfilename ()
9762@deftypefnx {} {} mfilename ("fullpath")
9763@deftypefnx {} {} mfilename ("fullpathext")
9764Return the name of the currently executing file.
9765
9766The base name of the currently executing script or function is returned without
9767any extension. If called from outside an m-file, such as the command line,
9768return the empty string.
9769
9770Given the argument @qcode{"fullpath"}, include the directory part of the
9771filename, but not the extension.
9772
9773Given the argument @qcode{"fullpathext"}, include the directory part of
9774the filename and the extension.
9775@seealso{inputname, dbstack}
9776@end deftypefn */)
9777{
9778 int nargin = args.length ();
9779
9780 if (nargin > 1)
9781 print_usage ();
9782
9783 std::string opt;
9784
9785 if (nargin == 1)
9786 opt = args(0).xstring_value ("mfilename: option argument must be a string");
9787
9788 return octave_value (interp.mfilename (opt));
9789}
9790
9791 // Execute the contents of a script file. For compatibility with
9792 // Matlab, also execute a function file by calling the function it
9793 // defines with no arguments and nargout = 0.
9794
9795 void
9796 source_file (const std::string& file_name, const std::string& context,
9797 bool verbose, bool require_file)
9798 {
9799 interpreter& interp = __get_interpreter__ ();
9800
9801 interp.source_file (file_name, context, verbose, require_file);
9802 }
9803
9804DEFMETHOD (source, interp, args, ,
9805 doc: /* -*- texinfo -*-
9806@deftypefn {} {} source (@var{file})
9807@deftypefnx {} {} source (@var{file}, @var{context})
9808Parse and execute the contents of @var{file}.
9809
9810Without specifying @var{context}, this is equivalent to executing commands
9811from a script file, but without requiring the file to be named
9812@file{@var{file}.m} or to be on the execution path.
9813
9814Instead of the current context, the script may be executed in either the
9815context of the function that called the present function
9816(@qcode{"caller"}), or the top-level context (@qcode{"base"}).
9817@seealso{run}
9818@end deftypefn */)
9819{
9820 int nargin = args.length ();
9821
9822 if (nargin < 1 || nargin > 2)
9823 print_usage ();
9824
9825 std::string file_name = args(0).xstring_value ("source: FILE must be a string");
9826
9827 std::string context;
9828 if (nargin == 2)
9829 context = args(1).xstring_value ("source: CONTEXT must be a string");
9830
9831 interp.source_file (file_name, context);
9832
9833 return octave_value_list ();
9834}
9835
9836 //! Evaluate an Octave function (built-in or interpreted) and return
9837 //! the list of result values.
9838 //!
9839 //! @param name The name of the function to call.
9840 //! @param args The arguments to the function.
9841 //! @param nargout The number of output arguments expected.
9842 //! @return A list of output values. The length of the list is not
9843 //! necessarily the same as @c nargout.
9844
9846 feval (const char *name, const octave_value_list& args, int nargout)
9847 {
9848 interpreter& interp = __get_interpreter__ ();
9849
9850 return interp.feval (name, args, nargout);
9851 }
9852
9854 feval (const std::string& name, const octave_value_list& args, int nargout)
9855 {
9856 interpreter& interp = __get_interpreter__ ();
9857
9858 return interp.feval (name, args, nargout);
9859 }
9860
9862 feval (octave_function *fcn, const octave_value_list& args, int nargout)
9863 {
9864 interpreter& interp = __get_interpreter__ ();
9865
9866 return interp.feval (fcn, args, nargout);
9867 }
9868
9870 feval (const octave_value& val, const octave_value_list& args, int nargout)
9871 {
9872 interpreter& interp = __get_interpreter__ ();
9873
9874 return interp.feval (val, args, nargout);
9875 }
9876
9878 feval (const octave_value_list& args, int nargout)
9879 {
9880 interpreter& interp = __get_interpreter__ ();
9881
9882 return interp.feval (args, nargout);
9883 }
9884
9885DEFMETHOD (feval, interp, args, nargout,
9886 doc: /* -*- texinfo -*-
9887@deftypefn {} {[@var{y1}, @var{y2}, @dots{}] =} feval ('@var{fcn}', @var{x1}, @var{x2}, @dots{})
9888@deftypefnx {} {[@var{y1}, @var{y2}, @dots{}] =} feval (@@@var{fcn}, @var{x1}, @var{x2}, @dots{})
9889Evaluate the function @var{fcn} with inputs @var{x1}, @var{x2}, @enddots{}
9890
9891The function @var{fcn} may be specified by name in a string or given as a
9892function handle. Any arguments after the first are passed as inputs to the
9893named function. For example,
9894
9895@example
9896@group
9897feval ("acos", -1)
9898 @xresult{} 3.1416
9899@end group
9900@end example
9901
9902@noindent
9903calls the function @code{acos} with the argument @samp{-1}.
9904
9905The function @code{feval} can also be used with function handles of any sort
9906(@pxref{Function Handles}). Historically, @code{feval} was the only way to
9907call user-supplied functions in strings, but function handles are now preferred
9908due to the cleaner syntax they offer. For example,
9909
9910@example
9911@group
9912@var{f} = @@exp;
9913feval (@var{f}, 1)
9914 @xresult{} 2.7183
9915@var{f} (1)
9916 @xresult{} 2.7183
9917@end group
9918@end example
9919
9920@noindent
9921are equivalent ways to call the function referred to by @var{f}. If it cannot
9922be predicted beforehand whether @var{f} is a function handle, function name in
9923a string, or inline function then @code{feval} can be used instead.
9924@seealso{builtin, eval, evalin}
9925@end deftypefn */)
9926{
9927 if (args.length () == 0)
9928 print_usage ();
9929
9930 return interp.feval (args, nargout);
9931}
9932
9933DEFMETHOD (builtin, interp, args, nargout,
9934 doc: /* -*- texinfo -*-
9935@deftypefn {} {[@dots{}] =} builtin (@var{f}, @dots{})
9936Call the base function @var{f} even if @var{f} is overloaded to another
9937function for the given type signature.
9938
9939This is normally useful when doing object-oriented programming and there is
9940a requirement to call one of Octave's base functions rather than the
9941overloaded one of a new class.
9942
9943A trivial example which redefines the @code{sin} function to be the
9944@code{cos} function shows how @code{builtin} works.
9945
9946@example
9947@group
9948sin (0)
9949 @xresult{} 0
9950function y = sin (x), y = cos (x); endfunction
9951sin (0)
9952 @xresult{} 1
9953builtin ("sin", 0)
9954 @xresult{} 0
9955@end group
9956@end example
9957@end deftypefn */)
9958{
9959 octave_value_list retval;
9960
9961 if (args.length () == 0)
9962 print_usage ();
9963
9964 const std::string name (args(0).xstring_value ("builtin: function name (F) must be a string"));
9965
9966 symbol_table& symtab = interp.get_symbol_table ();
9967
9968 octave_value fcn = symtab.builtin_find (name);
9969
9970 if (fcn.is_defined ())
9971 retval = interp.feval (fcn.function_value (), args.splice (0, 1), nargout);
9972 else
9973 error ("builtin: lookup for symbol '%s' failed", name.c_str ());
9974
9975 return retval;
9976}
9977
9978DEFMETHOD (eval, interp, args, nargout,
9979 doc: /* -*- texinfo -*-
9980@deftypefn {} {} eval (@var{try})
9981@deftypefnx {} {} eval (@var{try}, @var{catch})
9982@deftypefnx {} {[@var{var1}, @dots{}] =} eval (@dots{})
9983Parse the string @var{try} and evaluate it as if it were an Octave program.
9984
9985If execution fails, evaluate the optional string @var{catch}.
9986
9987The string @var{try} is evaluated in the current context, so any results remain
9988available after @code{eval} returns.
9989
9990The following example creates the variable @var{A} with the approximate value
9991of pi (3.1416) in the current workspace.
9992
9993@example
9994eval ('A = acos (-1);');
9995@end example
9996
9997If an error occurs during the evaluation of @var{try} then the @var{catch}
9998string is evaluated, as the following example shows:
9999
10000@example
10001@group
10002eval ('error ("This is a bad example");',
10003 'printf ("This error occurred:\n%s\n", lasterr ());');
10004 @print{} This error occurred:
10005 This is a bad example
10006@end group
10007@end example
10008
10009Rather than create variables as part of the code string @var{try}, it is
10010clearer and slightly faster to assign the results of evaluation to an output
10011variable(s). The first example can be re-written as
10012
10013@example
10014A = eval ('acos (-1);');
10015@end example
10016
10017Programming Note: if you are only using @code{eval} as an error-capturing
10018mechanism, rather than for the execution of arbitrary code strings, consider
10019using @code{try}/@code{catch} blocks or
10020@code{unwind_protect}/@code{unwind_protect_cleanup} blocks instead. These
10021techniques have higher performance and don't introduce the security
10022considerations that the evaluation of arbitrary code does.
10023@seealso{evalin, evalc, assignin, feval, try, unwind_protect}
10024@end deftypefn */)
10025{
10026 int nargin = args.length ();
10027
10028 if (nargin < 1 || nargin > 2)
10029 print_usage ();
10030
10031 if (! args(0).is_string () || args(0).rows () > 1 || args(0).ndims () != 2)
10032 error ("eval: TRY must be a string");
10033
10034 std::string try_code = args(0).string_value ();
10035
10036 if (nargin == 1)
10037 return interp.eval (try_code, nargout);
10038 else
10039 {
10040 if (! args(1).is_string () || args(1).rows () > 1 || args(1).ndims () != 2)
10041 error ("eval: CATCH must be a string");
10042
10043 std::string catch_code = args(1).string_value ();
10044
10045 return interp.eval (try_code, catch_code, nargout);
10046 }
10047}
10048
10049/*
10050
10051%!shared x
10052%! x = 1;
10053
10054%!assert (eval ("x"), 1)
10055%!assert (eval ("x;"))
10056%!assert (eval ("x;"), 1)
10057
10058%!test
10059%! y = eval ("x");
10060%! assert (y, 1);
10061
10062%!test
10063%! y = eval ("x;");
10064%! assert (y, 1);
10065
10066%!test
10067%! eval ("x = 1;");
10068%! assert (x,1);
10069
10070%!test
10071%! eval ("flipud = 2;");
10072%! assert (flipud, 2);
10073
10074%!function y = __f ()
10075%! eval ("flipud = 2;");
10076%! y = flipud;
10077%!endfunction
10078%!assert (__f(), 2)
10079
10080%!test <*35645>
10081%! [a,] = gcd (1,2);
10082%! [a,b,] = gcd (1, 2);
10083
10084## Can't assign to a keyword
10085%!error eval ("switch = 13;")
10086
10087%!shared str
10088%! str = "disp ('hello');";
10089%! str(:,:,2) = str(:,:,1);
10090
10091%!error <TRY must be a string> eval (1)
10092%!error <TRY must be a string> eval (['a';'b'])
10093%!error <TRY must be a string> eval (str)
10094
10095%!error <CATCH must be a string> eval (str(:,:,1), 1)
10096%!error <CATCH must be a string> eval (str(:,:,1), ['a';'b'])
10097%!error <CATCH must be a string> eval (str(:,:,1), str)
10098
10099*/
10100
10101DEFMETHOD (assignin, interp, args, ,
10102 doc: /* -*- texinfo -*-
10103@deftypefn {} {} assignin (@var{context}, @var{varname}, @var{value})
10104Assign @var{value} to @var{varname} in context @var{context}, which
10105may be either @qcode{"base"} or @qcode{"caller"}.
10106@seealso{evalin}
10107@end deftypefn */)
10108{
10109 if (args.length () != 3)
10110 print_usage ();
10111
10112 std::string context = args(0).xstring_value ("assignin: CONTEXT must be a string");
10113
10114 std::string varname = args(1).xstring_value ("assignin: VARNAME must be a string");
10115
10116 interp.assignin (context, varname, args(2));
10117
10118 return octave_value_list ();
10119}
10120
10121/*
10122
10123%!error assignin ("base", "switch", "13")
10124
10125*/
10126
10127DEFMETHOD (evalin, interp, args, nargout,
10128 doc: /* -*- texinfo -*-
10129@deftypefn {} {} evalin (@var{context}, @var{try})
10130@deftypefnx {} {} evalin (@var{context}, @var{try}, @var{catch})
10131@deftypefnx {} {[@var{var1}, @dots{}] =} evalin (@dots{})
10132Like @code{eval}, except that the expressions are evaluated in the context
10133@var{context}, which may be either @qcode{"caller"} or @qcode{"base"}.
10134@seealso{eval, assignin}
10135@end deftypefn */)
10136{
10137 int nargin = args.length ();
10138
10139 if (nargin < 2 || nargin > 3)
10140 print_usage ();
10141
10142 std::string context = args(0).xstring_value ("evalin: CONTEXT must be a string");
10143
10144 std::string try_code = args(1).xstring_value ("evalin: TRY must be a string");
10145
10146 if (nargin == 3)
10147 {
10148 std::string catch_code = args(2).xstring_value ("evalin: CATCH must be a string");
10149
10150 return interp.evalin (context, try_code, catch_code, nargout);
10151 }
10152
10153 return interp.evalin (context, try_code, nargout);
10154}
10155
10156DEFMETHOD (evalc, interp, args, nargout,
10157 doc: /* -*- texinfo -*-
10158@deftypefn {} {@var{s} =} evalc (@var{try})
10159@deftypefnx {} {@var{s} =} evalc (@var{try}, @var{catch})
10160@deftypefnx {} {[~, @var{var1}, @dots{}] =} evalc (@dots{})
10161Parse and evaluate the string @var{try} as if it were an Octave program,
10162while capturing the output into the return variable @var{s}.
10163
10164If execution fails, evaluate the optional string @var{catch}.
10165
10166This function behaves like @code{eval}, but any output or warning messages
10167which would normally be written to the console are captured and returned in
10168the string @var{s}.
10169
10170If the first output @var{s} is ignored with @code{~} then the actual results
10171of the code evaluation (not the string capture) will be assigned to output
10172variables @var{var1}, @var{var2}, etc.
10173
10174Example 1:
10175
10176@example
10177@group
10178s = evalc ("t = 42"), t
10179 @xresult{} s = t = 42
10180
10181 @xresult{} t = 42
10182@end group
10183@end example
10184
10185Example 2:
10186
10187@example
10188@group
10189[~, p] = evalc ("pi")
10190 @xresult{} p = 3.1416
10191@end group
10192@end example
10193
10194Programming Note: The @code{diary} is disabled during the execution of this
10195function. When @code{system} is used, any output produced by external programs
10196is @emph{not} captured, unless their output is captured by the @code{system}
10197function itself.
10198
10199@seealso{eval, diary}
10200@end deftypefn */)
10201{
10202 int nargin = args.length ();
10203
10204 if (nargin == 0 || nargin > 2)
10205 print_usage ();
10206
10207 // Flush pending output and redirect stdout/stderr to capturing
10208 // buffer.
10209
10210 octave_stdout.flush ();
10211 std::cerr.flush ();
10212
10213 std::stringbuf buffer;
10214
10215 std::streambuf *old_out_buf = octave_stdout.rdbuf (&buffer);
10216 std::streambuf *old_err_buf = std::cerr.rdbuf (&buffer);
10217
10218 // Restore previous output buffers no matter how control exits this
10219 // function. There's no need to flush here. That has already
10220 // happened for the normal execution path. If an error happens during
10221 // the eval, then the message is stored in the exception object and we
10222 // will display it later, after the buffers have been restored.
10223
10224 unwind_action act ([old_out_buf, old_err_buf] ()
10225 {
10226 octave_stdout.rdbuf (old_out_buf);
10227 std::cerr.rdbuf (old_err_buf);
10228 });
10229
10230 // Call standard eval function.
10231
10232 int eval_nargout = std::max (0, nargout - 1);
10233
10234 octave_value_list retval = Feval (interp, args, eval_nargout);
10235
10236 // Make sure we capture all pending output.
10237
10238 octave_stdout.flush ();
10239 std::cerr.flush ();
10240
10241 retval.prepend (buffer.str ());
10242
10243 return retval;
10244}
10245
10246/*
10247
10248%!test
10249%! [old_fmt, old_spacing] = format ();
10250%! unwind_protect
10251%! format short;
10252%! str = evalc ("1");
10253%! assert (str, "ans = 1\n");
10254%! unwind_protect_cleanup
10255%! format (old_fmt);
10256%! format (old_spacing);
10257%! end_unwind_protect
10258
10259%!assert (evalc ("1;"), "")
10260
10261%!test
10262%! [s, y] = evalc ("1");
10263%! assert (s, "");
10264%! assert (y, 1);
10265
10266%!test
10267%! [s, y] = evalc ("1;");
10268%! assert (s, "");
10269%! assert (y, 1);
10270
10271%!test
10272%! [old_fmt, old_spacing] = format ();
10273%! unwind_protect
10274%! format short;
10275%! str = evalc ("y = 2");
10276%! assert (str, "y = 2\n");
10277%! assert (y, 2);
10278%! unwind_protect_cleanup
10279%! format (old_fmt);
10280%! format (old_spacing);
10281%! end_unwind_protect
10282
10283%!test
10284%! assert (evalc ("y = 3;"), "");
10285%! assert (y, 3);
10286
10287%!test
10288%! [s, a, b] = evalc ("deal (1, 2)");
10289%! assert (s, "");
10290%! assert (a, 1);
10291%! assert (b, 2);
10292
10293%!function [a, b] = __f_evalc ()
10294%! printf ("foo");
10295%! fprintf (stdout, "bar ");
10296%! disp (pi);
10297%! a = 1;
10298%! b = 2;
10299%!endfunction
10300%!test
10301%! [old_fmt, old_spacing] = format ();
10302%! unwind_protect
10303%! format short;
10304%! [s, a, b] = evalc ("__f_evalc ()");
10305%! assert (s, "foobar 3.1416\n");
10306%! assert (a, 1);
10307%! assert (b, 2);
10308%! unwind_protect_cleanup
10309%! format (old_fmt);
10310%! format (old_spacing);
10311%! end_unwind_protect
10312
10313%!error <foo> (evalc ("error ('foo')"))
10314%!error <bar> (evalc ("error ('foo')", "error ('bar')"))
10315
10316%!test
10317%! warning ("off", "quiet", "local");
10318%! str = evalc ("warning ('foo')");
10319%! assert (str(1:13), "warning: foo\n");
10320
10321%!test
10322%! warning ("off", "quiet", "local");
10323%! str = evalc ("error ('foo')", "warning ('bar')");
10324%! assert (str(1:13), "warning: bar\n");
10325
10326%!error evalc ("switch = 13;")
10327
10328*/
10329
10330DEFUN (__parser_debug_flag__, args, nargout,
10331 doc: /* -*- texinfo -*-
10332@deftypefn {} {@var{val} =} __parser_debug_flag__ ()
10333@deftypefnx {} {@var{old_val} =} __parser_debug_flag__ (@var{new_val})
10334Query or set the internal flag that determines whether Octave's parser
10335prints debug information as it processes an expression.
10336@seealso{__lexer_debug_flag__}
10337@end deftypefn */)
10338{
10339#if defined (OCTAVE_PARSER_DEBUG)
10340 octave_value retval;
10341
10342 bool debug_flag = octave_debug;
10343
10344 retval = set_internal_variable (debug_flag, args, nargout,
10345 "__parser_debug_flag__");
10346
10347 octave_debug = debug_flag;
10348
10349 return retval;
10350#else
10351
10352 octave_unused_parameter (args);
10353 octave_unused_parameter (nargout);
10354
10355 error ("__parser_debug_flag__: support for debugging the parser was disabled when Octave was built");
10356
10357#endif
10358}
10359
10360DEFMETHOD (__parse_file__, interp, args, ,
10361 doc: /* -*- texinfo -*-
10362@deftypefn {} {} __parse_file__ (@var{file}, @var{verbose})
10363Undocumented internal function.
10364@end deftypefn */)
10365{
10366 octave_value retval;
10367
10368 int nargin = args.length ();
10369
10370 if (nargin < 1 || nargin > 2)
10371 print_usage ();
10372
10373 std::string file = args(0).xstring_value ("__parse_file__: expecting filename as argument");
10374
10375 std::string full_file = sys::file_ops::tilde_expand (file);
10376
10377 full_file = sys::env::make_absolute (full_file);
10378
10379 std::string dir_name;
10380
10381 std::size_t file_len = file.length ();
10382
10383 if ((file_len > 4 && file.substr (file_len-4) == ".oct")
10384 || (file_len > 4 && file.substr (file_len-4) == ".mex")
10385 || (file_len > 2 && file.substr (file_len-2) == ".m"))
10386 {
10387 file = sys::env::base_pathname (file);
10388 file = file.substr (0, file.find_last_of ('.'));
10389
10390 std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ());
10391 if (pos != std::string::npos)
10392 {
10393 dir_name = file.substr (0, pos);
10394 file = file.substr (pos+1);
10395 }
10396 }
10397
10398 if (nargin == 2)
10399 octave_stdout << "parsing " << full_file << std::endl;
10400
10401 octave_value ov_fcn = parse_fcn_file (interp, full_file, file, dir_name, "", "", true, false, false, false);
10402
10403 return retval;
10404}
10405
10406OCTAVE_END_NAMESPACE(octave)
Definition Cell.h:41
std::string message() const
filepos beg_pos() const
bool at_end_of_buffer() const
Definition lex.h:586
bool input_from_tmp_history_file()
Definition lex.cc:6789
virtual bool input_from_terminal() const
Definition lex.h:688
void * m_scanner
Definition lex.h:678
void prep_for_file()
Definition lex.cc:5426
virtual bool input_from_eval_string() const
Definition lex.h:692
virtual void reset()
Definition lex.cc:5403
tree_index_expression * make_word_list_command(tree_expression *expr, tree_argument_list *args)
tree_argument_list * append_argument_list(tree_argument_list *list, tree_expression *expr)
tree_function_def * make_function(token *fcn_tok, tree_parameter_list *ret_list, token *eq_tok, tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_fcn_stmt)
std::shared_ptr< tree_statement_list > m_stmt_list
Definition parse.h:737
tree_classdef_attribute * make_not_classdef_attribute(token *not_tok, tree_identifier *id)
tree_cell * make_cell(tree_argument_list *row)
tree_classdef_enum_block * make_classdef_enum_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_enum_list *elist, token *end_tok)
int m_max_fcn_depth
Definition parse.h:701
tree_expression * finish_cell(token *open_delim, tree_cell *c, token *close_delim)
tree_switch_case * make_switch_case(token *case_tok, tree_expression *expr, tree_statement_list *list)
tree_switch_case_list * make_switch_case_list(tree_switch_case *switch_case)
void recover_from_parsing_function()
tree_classdef_attribute_list * append_classdef_attribute(tree_classdef_attribute_list *list, token *sep_tok, tree_classdef_attribute *elt)
tree_expression * make_postfix_op(tree_expression *op1, token *op_tok)
tree_argument_list * validate_matrix_for_assignment(tree_expression *e)
octave_value m_primary_fcn
Definition parse.h:726
tree_classdef_attribute_list * make_classdef_attribute_list(tree_classdef_attribute *attr)
tree_classdef_body * make_classdef_body(tree_classdef_properties_block *pb)
parent_scope_info m_function_scopes
Definition parse.h:723
tree_statement_list * append_statement_list(tree_statement_list *list, int sep_char, tree_statement *stmt, bool warn_missing_semi)
bool validate_array_list(tree_expression *e)
base_parser(base_lexer &lxr)
tree_identifier * make_identifier(token *ident)
tree_classdef_superclass_list * append_classdef_superclass(tree_classdef_superclass_list *list, token *and_tok, tree_classdef_superclass *elt)
tree_statement_list * make_function_def_list(tree_function_def *fcn_def)
tree_classdef_events_block * make_classdef_events_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_event_list *elist, token *end_tok)
tree_command * make_unwind_command(token *unwind_tok, tree_statement_list *body, token *cleanup_tok, tree_statement_list *cleanup, token *end_tok)
bool finish_input(tree_statement_list *lst, bool at_eof=false)
tree_classdef_properties_block * make_classdef_properties_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_property_list *plist, token *end_tok)
tree_function_def * finish_classdef_external_method(octave_user_function *fcn, tree_parameter_list *ret_list=nullptr, token *eq_tok=nullptr)
tree_parameter_list * make_parameter_list(tree_parameter_list::in_or_out io)
tree_classdef_attribute * make_classdef_attribute(tree_identifier *id)
tree_function_def * finish_function(token *fcn_tok, tree_parameter_list *ret_list, token *eq_tok, octave_user_function *fcn)
tree_expression * finish_array_list(token *open_delim, tree_array_list *a, token *close_delim)
tree_index_expression * make_index_expression(tree_expression *expr, token *open_paren, tree_argument_list *args, token *close_paren, char type)
tree_classdef_property * make_classdef_property(tree_identifier *id, tree_arg_validation *av)
tree_if_command_list * append_if_clause(tree_if_command_list *list, tree_if_clause *clause)
tree_command * make_return_command(token *return_tok)
octave_user_function * start_function(tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_function, const std::string &doc_string)
bool m_endfunction_found
Definition parse.h:681
tree_identifier * make_fcn_name(tree_identifier *id)
tree_switch_command * finish_switch_command(token *switch_tok, tree_expression *expr, tree_switch_case_list *list, token *end_tok)
void disallow_command_syntax()
tree_matrix * make_matrix(tree_argument_list *row)
std::shared_ptr< tree_statement_list > statement_list() const
Definition parse.h:183
base_lexer & m_lexer
Definition parse.h:740
tree_if_clause * make_if_clause(token *if_tok, separator_list *if_sep_list, tree_expression *expr, tree_statement_list *list)
tree_decl_elt * make_decl_elt(tree_identifier *id, token *eq_op=nullptr, tree_expression *expr=nullptr)
tree_command * make_continue_command(token *continue_tok)
tree_if_command * finish_if_command(tree_if_command_list *list, tree_if_clause *else_clause, token *end_tok)
std::string m_curr_class_name
Definition parse.h:716
tree_switch_case_list * append_switch_case(tree_switch_case_list *list, tree_switch_case *elt)
tree_decl_command * make_decl_command(token *tok, tree_decl_init_list *lst)
tree_parameter_list * append_parameter_list(tree_parameter_list *list, token *sep_tok, tree_decl_elt *t)
tree_command * make_for_command(token *for_tok, token *open_paren, tree_argument_list *lhs, token *eq_tok, tree_expression *expr, token *sep_tok, tree_expression *maxproc, token *close_paren, tree_statement_list *body, token *end_tok)
tree_classdef_methods_block * make_classdef_methods_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_method_list *mlist, token *end_tok)
tree_spmd_command * make_spmd_command(token *spmd_tok, tree_statement_list *body, token *end_tok)
tree_black_hole * make_black_hole(token *tilde)
tree_classdef_property_list * append_classdef_property(tree_classdef_property_list *list, tree_classdef_property *elt)
tree_anon_fcn_handle * make_anon_fcn_handle(token *at_tok, tree_parameter_list *param_list, tree_expression *expr)
bool m_parsing_local_functions
Definition parse.h:697
tree_command * make_try_command(token *try_tok, tree_statement_list *body, token *catch_tok, separator_list *catch_sep_list, tree_statement_list *cleanup, token *end_tok)
tree_classdef_body * append_classdef_enum_block(tree_classdef_body *body, tree_classdef_enum_block *block)
std::string m_curr_package_name
Definition parse.h:720
bool m_fcn_file_from_relative_lookup
Definition parse.h:688
tree_args_block_attribute_list * make_args_attribute_list(tree_identifier *attribute_name)
symbol_scope m_primary_fcn_scope
Definition parse.h:712
tree_statement_list * make_statement_list(tree_statement *stmt)
tree_expression * make_boolean_op(tree_expression *op1, token *op_tok, tree_expression *op2)
tree_fcn_handle * make_fcn_handle(token *tok)
tree_classdef * make_classdef(token *tok, tree_classdef_attribute_list *a, tree_identifier *id, tree_classdef_superclass_list *sc, tree_classdef_body *body, token *end_tok)
tree_classdef_enum_list * append_classdef_enum(tree_classdef_enum_list *list, tree_classdef_enum *elt)
tree_expression * finish_matrix(token *open_delim, tree_matrix *m, token *close_delim)
tree_classdef_method_list * append_classdef_method(tree_classdef_method_list *list, tree_function_def *fcn_def)
void end_token_error(token *tok, token::end_tok_type expected)
void maybe_convert_to_braindead_shortcircuit(tree_expression *&expr)
tree_metaclass_query * make_metaclass_query(token *metaquery)
tree_classdef_event_list * append_classdef_event(tree_classdef_event_list *list, tree_classdef_event *elt)
tree_classdef_event_list * make_classdef_event_list(tree_classdef_event *e)
tree_classdef_body * append_classdef_properties_block(tree_classdef_body *body, tree_classdef_properties_block *block)
std::list< std::string > m_subfunction_names
Definition parse.h:731
tree_command * make_do_until_command(token *do_tok, tree_statement_list *body, token *until_tok, tree_expression *expr)
tree_classdef_superclass * make_classdef_superclass(token *fqident)
bool m_autoloading
Definition parse.h:684
void parsing_local_functions(bool flag)
Definition parse.h:198
tree_command * make_break_command(token *break_tok)
tree_statement_list * set_stmt_print_flag(tree_statement_list *list, int sep_char, bool warn_missing_semi)
tree_statement_list * append_function_body(tree_statement_list *body, tree_statement_list *list)
tree_arg_validation * make_arg_validation(tree_arg_size_spec *size_spec, tree_identifier *class_name, tree_arg_validation_fcns *validation_fcns, token *eq_tok=nullptr, tree_expression *default_value=nullptr)
virtual ~base_parser()
tree_expression * make_colon_expression(tree_expression *base, token *colon_tok, tree_expression *limit)
tree_constant * make_constant(token *tok)
bool m_parsing_subfunctions
Definition parse.h:692
bool validate_param_list(tree_parameter_list *lst, tree_parameter_list::in_or_out type)
tree_decl_init_list * make_decl_init_list(tree_decl_elt *elt)
bool finish_classdef_file(tree_classdef *cls, tree_statement_list *local_fcns, token *eof_tok)
bool validate_primary_fcn()
tree_classdef_enum * make_classdef_enum(tree_identifier *id, token *open_paren, tree_expression *expr, token *close_paren)
void endfunction_found(bool flag)
Definition parse.h:213
tree_decl_init_list * append_decl_init_list(tree_decl_init_list *list, tree_decl_elt *elt)
tree_expression * make_assign_op(tree_argument_list *lhs, token *eq_tok, tree_expression *rhs)
void bison_error(const std::string &s)
tree_classdef_method_list * make_classdef_method_list(tree_function_def *fcn_def)
tree_index_expression * make_indirect_ref(tree_expression *expr, token *dot_tok, token *struct_elt_tok)
tree_classdef_body * append_classdef_events_block(tree_classdef_body *body, tree_classdef_events_block *block)
tree_arguments_block * make_arguments_block(token *arguments_tok, tree_args_block_attribute_list *attr_list, tree_args_block_validation_list *validation_list, token *end_tok)
tree_args_block_validation_list * append_args_validation_list(tree_args_block_validation_list *list, tree_arg_validation *arg_validation)
tree_statement_list * append_function_def_list(tree_statement_list *list, separator_list *sep_list, tree_function_def *fcn_def)
tree_classdef_superclass_list * make_classdef_superclass_list(token *lt_tok, tree_classdef_superclass *sc)
tree_arg_size_spec * make_arg_size_spec(tree_argument_list *size_args)
tree_expression * make_prefix_op(token *op_tok, tree_expression *op1)
tree_expression * make_binary_op(tree_expression *op1, token *op_tok, tree_expression *op2)
tree_statement * make_end(const std::string &type, bool eof, token *tok)
void * m_parser_state
Definition parse.h:743
tree_cell * append_cell_row(tree_cell *cell, token *sep_tok, tree_argument_list *row)
std::shared_ptr< tree_classdef > m_classdef_object
Definition parse.h:734
int m_curr_fcn_depth
Definition parse.h:708
tree_matrix * append_matrix_row(tree_matrix *matrix, token *sep_tok, tree_argument_list *row)
tree_classdef_body * append_classdef_methods_block(tree_classdef_body *body, tree_classdef_methods_block *block)
tree_superclass_ref * make_superclass_ref(token *superclassref)
tree_command * make_while_command(token *while_tok, tree_expression *expr, tree_statement_list *body, token *end_tok)
tree_switch_case * make_default_switch_case(token *default_tok, tree_statement_list *list)
tree_classdef_enum_list * make_classdef_enum_list(tree_classdef_enum *e)
void make_script(tree_statement_list *cmds, tree_statement *end_script)
octave_user_function * start_classdef_external_method(tree_identifier *id, tree_parameter_list *pl=nullptr)
tree_argument_list * make_argument_list(tree_expression *expr)
void classdef_object(const std::shared_ptr< tree_classdef > &obj)
Definition parse.h:171
tree_args_block_validation_list * make_args_validation_list(tree_arg_validation *arg_validation)
bool push_fcn_symtab()
tree_classdef_property_list * make_classdef_property_list(tree_classdef_property *prop)
tree_arg_validation_fcns * make_arg_validation_fcns(tree_argument_list *fcn_args)
std::string m_parse_error_msg
Definition parse.h:678
bool end_token_ok(token *tok, token::end_tok_type expected)
tree_if_command_list * start_if_command(tree_if_clause *clause)
tree_statement * make_statement(T *arg)
tree_classdef_event * make_classdef_event(tree_identifier *id)
static std::string decode_prompt_string(const std::string &s)
Definition cmd-edit.cc:1273
bool is_end_of_line() const
std::string text() const
bool empty() const
bool uses_hash_char() const
reference front()
comment_elt find_doc_comment() const
std::string find_doc_string() const
bool empty() const
octave_function * load_oct(const std::string &fcn_name, const std::string &file_name="", bool relative=false)
octave_function * load_mex(const std::string &fcn_name, const std::string &file_name="", bool relative=false)
void set_discard_warning_messages(bool flag)
Definition error.h:104
void set_last_warning_message(const std::string &val)
Definition error.h:207
octave_value discard_warning_messages(const octave_value_list &args, int nargout)
Definition error.cc:300
octave_value last_warning_message(const octave_value_list &args, int nargout)
Definition error.cc:344
void increment_column(int val=1)
Definition filepos.h:56
void line(int l)
Definition filepos.h:49
void column(int c)
Definition filepos.h:50
error_system & get_error_system()
void source_file(const std::string &file_name, const std::string &context="", bool verbose=false, bool require_file=true)
dynamic_loader & get_dynamic_loader()
octave_value PS1(const octave_value_list &args, int nargout)
tree_evaluator & get_evaluator()
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
void recover_from_exception()
octave_value PS2(const octave_value_list &args, int nargout)
input_system & get_input_system()
symbol_table & get_symbol_table()
Definition lex.h:725
bool input_from_eval_string() const
Definition lex.h:772
symbol_scope curr_scope() const
Definition lex.cc:5093
symbol_scope parent_scope() const
Definition lex.cc:5102
void push(const symbol_scope &scope)
Definition lex.h:76
bool m_looking_at_parameter_list
Definition lex.h:369
bool m_reading_classdef_file
Definition lex.h:436
bool m_looking_at_anon_fcn_args
Definition lex.h:363
std::string m_package_name
Definition lex.h:504
void mark_as_variables(const std::list< std::string > &lst)
Definition lex.cc:5268
filepos m_filepos
Definition lex.h:472
bool m_arguments_is_keyword
Definition lex.h:387
std::string m_current_input_line
Definition lex.h:485
bool m_end_of_input
Definition lex.h:353
bool m_allow_command_syntax
Definition lex.h:356
int m_looping
Definition lex.h:453
bool m_parsing_classdef_set_method
Definition lex.h:420
bool m_parsing_anon_fcn_body
Definition lex.h:394
std::stack< bool > m_parsed_function_name
Definition lex.h:513
bool m_at_beginning_of_statement
Definition lex.h:360
std::string m_fcn_file_full_name
Definition lex.h:498
bool m_looking_at_return_list
Definition lex.h:366
bool m_parsing_classdef_get_method
Definition lex.h:417
bool m_parsing_classdef_decl
Definition lex.h:405
bool m_looking_at_matrix_or_assign_lhs
Definition lex.h:377
bool m_parsing_classdef_superclass
Definition lex.h:409
bool m_looking_for_object_index
Definition lex.h:380
interpreter & m_interpreter
Definition lex.h:350
bbp_nesting_level m_nesting_level
Definition lex.h:520
bool m_parsing_classdef
Definition lex.h:400
bool m_reading_script_file
Definition lex.h:433
bool m_classdef_element_names_are_keywords
Definition lex.h:391
bool m_reading_fcn_file
Definition lex.h:430
std::string m_function_text
Definition lex.h:492
std::string m_fcn_file_name
Definition lex.h:495
bool m_looking_at_decl_list
Definition lex.h:373
symbol_table_context m_symtab_context
Definition lex.h:516
bool m_parsing_class_method
Definition lex.h:397
bool m_buffer_function_text
Definition lex.h:440
bool m_force_script
Definition lex.h:427
void mark_as_variable(const std::string &nm)
Definition lex.cc:5259
std::string m_dir_name
Definition lex.h:501
bool m_maybe_classdef_get_set_method
Definition lex.h:414
bool m_looking_at_indirect_ref
Definition lex.h:384
int m_looking_at_function_handle
Definition lex.h:459
int m_defining_fcn
Definition lex.h:456
virtual std::string doc_string(const std::string &="") const
Definition ov-fcn.h:225
virtual void maybe_relocate_end()
Definition ov-fcn.h:198
void document(const std::string &ds)
Definition ov-fcn.h:222
void stash_dir_name(const std::string &dir)
Definition ov-fcn.h:178
void stash_dispatch_class(const std::string &nm)
Definition ov-fcn.h:152
std::string name() const
Definition ov-fcn.h:212
void stash_package_name(const std::string &pack)
Definition ov-fcn.h:156
virtual void accept(octave::tree_walker &)
Definition ov-fcn.h:229
void mark_relative()
Definition ov-fcn.h:208
virtual void stash_subfunction_names(const std::list< std::string > &)
Definition ov-fcn.h:203
static const octave_value instance
Definition ov-null-mat.h:50
static const octave_value instance
Definition ov-null-mat.h:92
static const octave_value instance
Definition ov-null-mat.h:70
void stash_fcn_file_name(const std::string &nm)
Definition ov-usr-fcn.h:104
octave::symbol_scope scope()
Definition ov-usr-fcn.h:100
std::string fcn_file_name() const
Definition ov-usr-fcn.h:115
void cache_function_text(const std::string &text, const octave::sys::time &timestamp)
void stash_fcn_file_time(const octave::sys::time &t)
Definition ov-usr-fcn.h:109
octave::sys::time time_parsed() const
Definition ov-usr-fcn.h:117
octave::tree_statement_list * body()
Definition ov-usr-fcn.h:128
void stash_function_name(const std::string &s)
Definition ov-usr-fcn.h:311
void set_fcn_tok(const octave::token &fcn_tok)
Definition ov-usr-fcn.h:243
octave_user_function * define_ret_list(octave::tree_parameter_list *t)
void mark_as_classdef_method()
Definition ov-usr-fcn.h:373
void set_eq_tok(const octave::token &eq_tok)
Definition ov-usr-fcn.h:244
octave_user_function * user_function_value(bool=false)
Definition ov-usr-fcn.h:233
void accept(octave::tree_walker &tw)
void mark_as_legacy_constructor()
Definition ov-usr-fcn.h:349
std::map< std::string, octave_value > subfunctions() const
void attach_trailing_comments(const octave::comment_list &lst)
void mark_as_classdef_constructor()
Definition ov-usr-fcn.h:357
void mark_as_nested_function()
Definition ov-usr-fcn.h:343
octave_idx_type length() const
Definition ovl.h:111
octave_value_list & prepend(const octave_value &val)
Definition ovl.cc:80
octave_function * function_value(bool silent=false) const
@ op_hermitian
Definition ov.h:84
@ op_uminus
Definition ov.h:82
@ op_not
Definition ov.h:80
@ op_transpose
Definition ov.h:83
@ unknown_unary_op
Definition ov.h:88
@ op_uplus
Definition ov.h:81
@ op_incr
Definition ov.h:85
@ op_decr
Definition ov.h:86
bool is_defined() const
Definition ov.h:590
bool isempty() const
Definition ov.h:599
@ op_pow_eq
Definition ov.h:141
@ op_asn_eq
Definition ov.h:135
@ op_add_eq
Definition ov.h:136
@ op_el_pow_eq
Definition ov.h:145
@ op_mul_eq
Definition ov.h:138
@ op_div_eq
Definition ov.h:139
@ op_el_and_eq
Definition ov.h:146
@ op_el_ldiv_eq
Definition ov.h:144
@ op_sub_eq
Definition ov.h:137
@ op_el_mul_eq
Definition ov.h:142
@ op_el_or_eq
Definition ov.h:147
@ unknown_assign_op
Definition ov.h:149
@ op_el_div_eq
Definition ov.h:143
@ op_ldiv_eq
Definition ov.h:140
@ magic_colon_t
Definition ov.h:170
binary_op
Definition ov.h:92
@ op_ldiv
Definition ov.h:98
@ op_ne
Definition ov.h:104
@ unknown_binary_op
Definition ov.h:113
@ op_el_or
Definition ov.h:110
@ op_el_ldiv
Definition ov.h:108
@ op_pow
Definition ov.h:97
@ op_ge
Definition ov.h:102
@ op_div
Definition ov.h:96
@ op_el_pow
Definition ov.h:107
@ op_mul
Definition ov.h:95
@ op_add
Definition ov.h:93
@ op_sub
Definition ov.h:94
@ op_el_mul
Definition ov.h:105
@ op_le
Definition ov.h:100
@ op_lt
Definition ov.h:99
@ op_gt
Definition ov.h:103
@ op_eq
Definition ov.h:101
@ op_el_and
Definition ov.h:109
@ op_el_div
Definition ov.h:106
octave_idx_type length() const
octave_user_function * user_function_value(bool silent=false) const
octave_user_code * user_code_value(bool silent=false) const
int run()
void cache_fcn_name(const std::string &name)
Definition symscope.h:602
static symbol_scope anonymous()
Definition symscope.h:405
void update_nest()
Definition symscope.h:691
void mark_primary_fcn_scope()
Definition symscope.h:658
static symbol_scope invalid()
Definition symscope.h:400
void set_parent(const symbol_scope &p)
Definition symscope.h:624
void install_subfunction(const std::string &name, const octave_value &fval)
Definition symscope.h:511
void mark_static()
Definition symscope.h:456
void cache_fcn_file_name(const std::string &name)
Definition symscope.h:636
void set_nesting_depth(std::size_t depth)
Definition symscope.h:440
void set_primary_parent(const symbol_scope &p)
Definition symscope.h:630
void cache_name(const std::string &name)
Definition symscope.h:591
std::shared_ptr< symbol_scope_rep > parent_scope() const
Definition symscope.h:462
void install_nestfunction(const std::string &name, const octave_value &fval, const symbol_scope &fcn_scope)
Definition symscope.h:518
void cache_dir_name(const std::string &name)
Definition symscope.h:642
octave_value builtin_find(const std::string &name, const symbol_scope &search_scope=symbol_scope::invalid())
Definition symtab.cc:195
void install_local_function(const std::string &name, const octave_value &fcn, const std::string &file_name)
Definition symtab.cc:364
Definition token.h:42
std::string text_rep() const
Definition token.h:157
std::string superclass_class_name() const
Definition token.h:155
filepos end_pos() const
Definition token.h:127
int token_id() const
Definition token.h:118
comment_list leading_comments() const
Definition token.h:132
std::string superclass_method_name() const
Definition token.h:154
end_tok_type ettype() const
Definition token.h:152
filepos beg_pos() const
Definition token.h:126
end_tok_type
Definition token.h:57
@ events_end
Definition token.h:62
@ methods_end
Definition token.h:66
@ enumeration_end
Definition token.h:61
@ unwind_protect_end
Definition token.h:71
@ try_catch_end
Definition token.h:70
@ properties_end
Definition token.h:68
@ switch_end
Definition token.h:69
@ simple_end
Definition token.h:58
@ classdef_end
Definition token.h:60
@ arguments_end
Definition token.h:59
@ if_end
Definition token.h:65
@ parfor_end
Definition token.h:67
@ for_end
Definition token.h:63
@ function_end
Definition token.h:64
@ while_end
Definition token.h:73
@ spmd_end
Definition token.h:72
std::string text() const
Definition token.h:149
octave_value number() const
Definition token.h:150
void accept(tree_walker &tw)
tree_arg_size_spec * size_spec()
tree_identifier * class_name()
void arg_name(tree_expression *name)
tree_arg_validation_fcns * validation_fcns()
tree_expression * remove_front()
std::list< std::string > variable_names() const
bool is_valid_lvalue_list() const
void mark_as_simple_assign_lhs()
bool has_magic_tilde() const
bool is_simple_assign_lhs()
void accept(tree_walker &tw)
bool all_elements_are_constant() const
token op_token() const
Definition pt-binop.h:90
octave_value::binary_op op_type() const
Definition pt-binop.h:86
tree_expression * lhs()
Definition pt-binop.h:88
tree_expression * rhs()
Definition pt-binop.h:92
tree_classdef_body * append(tree_classdef_properties_block *pb)
void doc_string(const std::string &s)
bool have_doc_string() const
void set_separator(const token &sep_tok)
void accept(tree_walker &tw)
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition pt-colon.cc:55
filepos beg_pos() const
Definition pt-colon.h:68
void accept(tree_walker &tw)
Definition pt-colon.h:101
filepos end_pos() const
Definition pt-colon.h:69
void mark_persistent()
Definition pt-decl.h:226
void mark_global()
Definition pt-decl.h:220
tree_identifier * ident()
Definition pt-decl.h:89
std::list< std::string > variable_names() const
Definition pt-decl.h:181
void add_autoload(const std::string &fcn, const std::string &nm)
Definition pt-eval.cc:4785
void remove_autoload(const std::string &fcn, const std::string &nm)
Definition pt-eval.cc:4792
octave_map get_autoload_map() const
Definition pt-eval.cc:4722
virtual octave_value evaluate(tree_evaluator &tw, int nargout=1)=0
virtual bool is_binary_expression() const
Definition pt-exp.h:78
virtual bool is_identifier() const
Definition pt-exp.h:68
bool is_postfix_indexed() const
Definition pt-exp.h:99
virtual bool is_constant() const
Definition pt-exp.h:62
void mark_as_for_cmd_expr()
Definition pt-exp.h:120
tree_expression * mark_in_delims(const token &open_delim, const token &close_delim)
Definition pt-exp.h:124
virtual bool is_index_expression() const
Definition pt-exp.h:70
size_t delim_count() const
Definition pt-exp.h:97
tree_expression * set_print_flag(bool print)
Definition pt-exp.h:136
tree_expression * set_postfix_index(char type)
Definition pt-exp.h:130
virtual std::string name() const
Definition pt-exp.h:114
virtual bool is_matrix() const
Definition pt-exp.h:64
virtual bool is_assignment_expression() const
Definition pt-exp.h:72
void accept(tree_walker &tw)
Definition pt-cmd.h:154
octave_value function()
Definition pt-cmd.h:159
virtual bool is_black_hole() const
Definition pt-id.h:79
std::string name() const
Definition pt-id.h:71
token if_token() const
Definition pt-select.h:145
void mark_word_list_cmd()
Definition pt-idx.h:94
std::string name() const
Definition pt-idx.cc:131
bool is_word_list_cmd() const
Definition pt-idx.h:96
filepos beg_pos() const
Definition pt-idx.h:76
tree_index_expression * append(const token &open_delim, tree_argument_list *lst, const token &close_delim, char t='(')
Definition pt-idx.cc:68
void mark_varargs_only()
Definition pt-misc.h:94
void mark_varargs()
Definition pt-misc.h:92
void mark_as_formal_parameters()
Definition pt-misc.cc:48
tree_parameter_list * mark_in_delims(const token &open_delim, const token &close_delim)
Definition pt-misc.h:76
void accept(tree_walker &tw)
Definition pt-stmt.h:230
comment_list leading_comments() const
Definition pt-stmt.h:184
tree_expression * expression()
Definition pt-stmt.h:105
int column() const
Definition pt-stmt.cc:159
void set_print_flag(bool print_flag)
Definition pt-stmt.cc:63
bool is_expression() const
Definition pt-stmt.h:78
void set_expression(tree_expression *e)
Definition pt-stmt.h:122
bool is_null_statement() const
Definition pt-stmt.h:107
comment_list leading_comments() const
Definition pt-stmt.cc:122
int line() const
Definition pt-stmt.cc:151
virtual void visit_index_expression(tree_index_expression &)
Definition pt-walk.cc:401
virtual void visit_octave_user_script(octave_user_script &)
Definition pt-walk.cc:287
virtual void visit_octave_user_function(octave_user_function &)
Definition pt-walk.cc:296
virtual int line() const
Definition pt.cc:45
virtual int column() const
Definition pt.cc:51
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void print_usage()
Definition defun-int.h:72
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
Definition defun.h:111
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
Definition defun.h:56
void error_with_id(const char *id, const char *fmt,...)
Definition error.cc:1053
void warning(const char *fmt,...)
Definition error.cc:1083
void warning_with_id(const char *id, const char *fmt,...)
Definition error.cc:1098
void parse_error_with_id(const char *id, const char *fmt,...)
Definition error.cc:1128
void error(const char *fmt,...)
Definition error.cc:1008
void message(const char *name, const char *fmt,...)
Definition error.cc:976
interpreter & __get_interpreter__()
int octave_lex(OCTAVE_STYPE *yylval_param, yyscan_t yyscanner)
The main scanner function which does all the work.
Definition lex.cc:1637
bool iskeyword(const std::string &s)
Definition lex.cc:1351
#define yyss
#define OCTAVE_YYUSE(...)
Definition oct-parse.cc:160
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition oct-parse.cc:600
#define YYMAXDEPTH
#define YYSTACK_FREE
Definition oct-parse.cc:638
yysymbol_kind_t
Definition oct-parse.cc:198
@ YYSYMBOL_END
Definition oct-parse.cc:258
@ YYSYMBOL_POW
Definition oct-parse.cc:252
@ YYSYMBOL_spmd_command
Definition oct-parse.cc:354
@ YYSYMBOL_INPUT_FILE
Definition oct-parse.cc:297
@ YYSYMBOL_statement_list
Definition oct-parse.cc:303
@ YYSYMBOL_param_list_beg
Definition oct-parse.cc:357
@ YYSYMBOL_CLASSDEF
Definition oct-parse.cc:283
@ YYSYMBOL_TRANSPOSE
Definition oct-parse.cc:249
@ YYSYMBOL_method_decl
Definition oct-parse.cc:403
@ YYSYMBOL_function_body
Definition oct-parse.cc:374
@ YYSYMBOL_opt_list
Definition oct-parse.cc:304
@ YYSYMBOL_class_name
Definition oct-parse.cc:383
@ YYSYMBOL_7_
Definition oct-parse.cc:207
@ YYSYMBOL_matrix
Definition oct-parse.cc:318
@ YYSYMBOL_3_
Definition oct-parse.cc:203
@ YYSYMBOL_EXPR_NE
Definition oct-parse.cc:241
@ YYSYMBOL_MINUS_MINUS
Definition oct-parse.cc:251
@ YYSYMBOL_power_expr
Definition oct-parse.cc:331
@ YYSYMBOL_param_list2
Definition oct-parse.cc:362
@ YYSYMBOL_YYUNDEF
Definition oct-parse.cc:202
@ YYSYMBOL_CONSTANT
Definition oct-parse.cc:255
@ YYSYMBOL_anon_fcn_begin
Definition oct-parse.cc:419
@ YYSYMBOL_EXPR_LT
Definition oct-parse.cc:238
@ YYSYMBOL_class_body1
Definition oct-parse.cc:394
@ YYSYMBOL_properties_block
Definition oct-parse.cc:395
@ YYSYMBOL_14_
Definition oct-parse.cc:214
@ YYSYMBOL_function_beg
Definition oct-parse.cc:370
@ YYSYMBOL_TRY
Definition oct-parse.cc:278
@ YYSYMBOL_parse_error
Definition oct-parse.cc:420
@ YYSYMBOL_19_
Definition oct-parse.cc:219
@ YYSYMBOL_class_property
Definition oct-parse.cc:399
@ YYSYMBOL_magic_tilde
Definition oct-parse.cc:327
@ YYSYMBOL_UNTIL
Definition oct-parse.cc:265
@ YYSYMBOL_classdef_beg
Definition oct-parse.cc:385
@ YYSYMBOL_204_1
Definition oct-parse.cc:404
@ YYSYMBOL_enumeration_beg
Definition oct-parse.cc:414
@ YYSYMBOL_begin_file
Definition oct-parse.cc:368
@ YYSYMBOL_jump_command
Definition oct-parse.cc:353
@ YYSYMBOL_HERMITIAN
Definition oct-parse.cc:248
@ YYSYMBOL_17_
Definition oct-parse.cc:217
@ YYSYMBOL_IF
Definition oct-parse.cc:267
@ YYSYMBOL_LEFTDIV
Definition oct-parse.cc:244
@ YYSYMBOL_enum_block
Definition oct-parse.cc:413
@ YYSYMBOL_PROPERTIES
Definition oct-parse.cc:284
@ YYSYMBOL_list1
Definition oct-parse.cc:306
@ YYSYMBOL_method
Definition oct-parse.cc:405
@ YYSYMBOL_ELSEIF
Definition oct-parse.cc:268
@ YYSYMBOL_simple_list
Definition oct-parse.cc:301
@ YYSYMBOL_property_list1
Definition oct-parse.cc:398
@ YYSYMBOL_classdef
Definition oct-parse.cc:386
@ YYSYMBOL_switch_case
Definition oct-parse.cc:350
@ YYSYMBOL_method_list1
Definition oct-parse.cc:407
@ YYSYMBOL_case_list1
Definition oct-parse.cc:349
@ YYSYMBOL_UNARY
Definition oct-parse.cc:298
@ YYSYMBOL_NUMBER
Definition oct-parse.cc:254
@ YYSYMBOL_superclass_list1
Definition oct-parse.cc:391
@ YYSYMBOL_file
Definition oct-parse.cc:369
@ YYSYMBOL_return_list
Definition oct-parse.cc:364
@ YYSYMBOL_YYerror
Definition oct-parse.cc:201
@ YYSYMBOL_BREAK
Definition oct-parse.cc:273
@ YYSYMBOL_SET
Definition oct-parse.cc:292
@ YYSYMBOL_arg_name
Definition oct-parse.cc:380
@ YYSYMBOL_OR_EQ
Definition oct-parse.cc:233
@ YYSYMBOL_12_
Definition oct-parse.cc:212
@ YYSYMBOL_constant
Definition oct-parse.cc:317
@ YYSYMBOL_opt_sep_no_nl
Definition oct-parse.cc:422
@ YYSYMBOL_push_fcn_symtab
Definition oct-parse.cc:356
@ YYSYMBOL_EXPR_AND
Definition oct-parse.cc:236
@ YYSYMBOL_property_list
Definition oct-parse.cc:397
@ YYSYMBOL_loop_command
Definition oct-parse.cc:352
@ YYSYMBOL_sep_no_nl
Definition oct-parse.cc:421
@ YYSYMBOL_21_n_
Definition oct-parse.cc:221
@ YYSYMBOL_methods_block
Definition oct-parse.cc:400
@ YYSYMBOL_10_
Definition oct-parse.cc:210
@ YYSYMBOL_LEXICAL_ERROR
Definition oct-parse.cc:295
@ YYSYMBOL_parsing_local_fcns
Definition oct-parse.cc:366
@ YYSYMBOL_attr_list1
Definition oct-parse.cc:388
@ YYSYMBOL_EXPR_LE
Definition oct-parse.cc:239
@ YYSYMBOL_assign_lhs
Definition oct-parse.cc:334
@ YYSYMBOL_EXPR_GT
Definition oct-parse.cc:243
@ YYSYMBOL_CATCH
Definition oct-parse.cc:279
@ YYSYMBOL_args_validation_list
Definition oct-parse.cc:379
@ YYSYMBOL_simple_expr
Definition oct-parse.cc:333
@ YYSYMBOL_magic_colon
Definition oct-parse.cc:326
@ YYSYMBOL_opt_fcn_list
Definition oct-parse.cc:307
@ YYSYMBOL_enum_list
Definition oct-parse.cc:415
@ YYSYMBOL_LEFTDIV_EQ
Definition oct-parse.cc:226
@ YYSYMBOL_events_beg
Definition oct-parse.cc:409
@ YYSYMBOL_8_
Definition oct-parse.cc:208
@ YYSYMBOL_EXPR_OR_OR
Definition oct-parse.cc:235
@ YYSYMBOL_indirect_ref_op
Definition oct-parse.cc:329
@ YYSYMBOL_function
Definition oct-parse.cc:373
@ YYSYMBOL_9_
Definition oct-parse.cc:209
@ YYSYMBOL_cell_or_matrix_row
Definition oct-parse.cc:322
@ YYSYMBOL_class_event
Definition oct-parse.cc:412
@ YYSYMBOL_function_end
Definition oct-parse.cc:372
@ YYSYMBOL_properties_beg
Definition oct-parse.cc:396
@ YYSYMBOL_fcn_list
Definition oct-parse.cc:308
@ YYSYMBOL_expression
Definition oct-parse.cc:336
@ YYSYMBOL_PARFOR
Definition oct-parse.cc:262
@ YYSYMBOL_METAQUERY
Definition oct-parse.cc:288
@ YYSYMBOL_args_attr_list
Definition oct-parse.cc:378
@ YYSYMBOL_DQ_STRING
Definition oct-parse.cc:259
@ YYSYMBOL_ELEFTDIV_EQ
Definition oct-parse.cc:230
@ YYSYMBOL_11_
Definition oct-parse.cc:211
@ YYSYMBOL_methods_beg
Definition oct-parse.cc:401
@ YYSYMBOL_ARGUMENTS
Definition oct-parse.cc:294
@ YYSYMBOL_param_list
Definition oct-parse.cc:360
@ YYSYMBOL_superclass_identifier
Definition oct-parse.cc:314
@ YYSYMBOL_method_list
Definition oct-parse.cc:406
@ YYSYMBOL_EMUL
Definition oct-parse.cc:245
@ YYSYMBOL_events_block
Definition oct-parse.cc:408
@ YYSYMBOL_simple_list1
Definition oct-parse.cc:302
@ YYSYMBOL_if_clause_list
Definition oct-parse.cc:343
@ YYSYMBOL_word_list_cmd
Definition oct-parse.cc:311
@ YYSYMBOL_ENUMERATION
Definition oct-parse.cc:287
@ YYSYMBOL_SUPERCLASSREF
Definition oct-parse.cc:289
@ YYSYMBOL_attr_list
Definition oct-parse.cc:387
@ YYSYMBOL_string
Definition oct-parse.cc:316
@ YYSYMBOL_superclass_list
Definition oct-parse.cc:390
@ YYSYMBOL_identifier
Definition oct-parse.cc:313
@ YYSYMBOL_15_
Definition oct-parse.cc:215
@ YYSYMBOL_6_
Definition oct-parse.cc:206
@ YYSYMBOL_ELSE
Definition oct-parse.cc:269
@ YYSYMBOL_primary_expr
Definition oct-parse.cc:325
@ YYSYMBOL_20_
Definition oct-parse.cc:220
@ YYSYMBOL_switch_command
Definition oct-parse.cc:347
@ YYSYMBOL_if_clause
Definition oct-parse.cc:344
@ YYSYMBOL_EXPR_GE
Definition oct-parse.cc:242
@ YYSYMBOL_cell_rows
Definition oct-parse.cc:321
@ YYSYMBOL_sep
Definition oct-parse.cc:423
@ YYSYMBOL_END_OF_INPUT
Definition oct-parse.cc:296
@ YYSYMBOL_CONTINUE
Definition oct-parse.cc:274
@ YYSYMBOL_EMUL_EQ
Definition oct-parse.cc:228
@ YYSYMBOL_MUL_EQ
Definition oct-parse.cc:224
@ YYSYMBOL_EPOW_EQ
Definition oct-parse.cc:231
@ YYSYMBOL_EPOW
Definition oct-parse.cc:253
@ YYSYMBOL_FCN_HANDLE
Definition oct-parse.cc:282
@ YYSYMBOL_opt_param_list
Definition oct-parse.cc:359
@ YYSYMBOL_attr
Definition oct-parse.cc:389
@ YYSYMBOL_arguments_block
Definition oct-parse.cc:376
@ YYSYMBOL_WHILE
Definition oct-parse.cc:263
@ YYSYMBOL_18_
Definition oct-parse.cc:218
@ YYSYMBOL_class_enum
Definition oct-parse.cc:417
@ YYSYMBOL_declaration
Definition oct-parse.cc:338
@ YYSYMBOL_arg_list
Definition oct-parse.cc:328
@ YYSYMBOL_UNWIND
Definition oct-parse.cc:276
@ YYSYMBOL_else_clause
Definition oct-parse.cc:346
@ YYSYMBOL_param_list_end
Definition oct-parse.cc:358
@ YYSYMBOL_GET
Definition oct-parse.cc:291
@ YYSYMBOL_matrix_rows
Definition oct-parse.cc:319
@ YYSYMBOL_SWITCH
Definition oct-parse.cc:270
@ YYSYMBOL_return_list1
Definition oct-parse.cc:365
@ YYSYMBOL_SUB_EQ
Definition oct-parse.cc:223
@ YYSYMBOL_opt_sep
Definition oct-parse.cc:424
@ YYSYMBOL_fcn_handle
Definition oct-parse.cc:323
@ YYSYMBOL_decl_init_list
Definition oct-parse.cc:339
@ YYSYMBOL_YYACCEPT
Definition oct-parse.cc:299
@ YYSYMBOL_statement
Definition oct-parse.cc:310
@ YYSYMBOL_EXPR_AND_AND
Definition oct-parse.cc:234
@ YYSYMBOL_4_
Definition oct-parse.cc:204
@ YYSYMBOL_EXPR_EQ
Definition oct-parse.cc:240
@ YYSYMBOL_assign_expr
Definition oct-parse.cc:335
@ YYSYMBOL_param_list_elt
Definition oct-parse.cc:363
@ YYSYMBOL_arguments_beg
Definition oct-parse.cc:377
@ YYSYMBOL_event_list
Definition oct-parse.cc:410
@ YYSYMBOL_EDIV
Definition oct-parse.cc:246
@ YYSYMBOL_select_command
Definition oct-parse.cc:341
@ YYSYMBOL_YYEOF
Definition oct-parse.cc:200
@ YYSYMBOL_list
Definition oct-parse.cc:305
@ YYSYMBOL_GLOBAL
Definition oct-parse.cc:280
@ YYSYMBOL_13_
Definition oct-parse.cc:213
@ YYSYMBOL_FUNCTION
Definition oct-parse.cc:293
@ YYSYMBOL_decl_elt
Definition oct-parse.cc:340
@ YYSYMBOL_SPMD
Definition oct-parse.cc:266
@ YYSYMBOL_AND_EQ
Definition oct-parse.cc:232
@ YYSYMBOL_size_spec
Definition oct-parse.cc:382
@ YYSYMBOL_push_script_symtab
Definition oct-parse.cc:367
@ YYSYMBOL_class_body
Definition oct-parse.cc:393
@ YYSYMBOL_input
Definition oct-parse.cc:300
@ YYSYMBOL_oper_expr
Definition oct-parse.cc:330
@ YYSYMBOL_DO
Definition oct-parse.cc:264
@ YYSYMBOL_POW_EQ
Definition oct-parse.cc:227
@ YYSYMBOL_colon_expr
Definition oct-parse.cc:332
@ YYSYMBOL_cell
Definition oct-parse.cc:320
@ YYSYMBOL_SQ_STRING
Definition oct-parse.cc:260
@ YYSYMBOL_case_list
Definition oct-parse.cc:348
@ YYSYMBOL_CASE
Definition oct-parse.cc:271
@ YYSYMBOL_default_case
Definition oct-parse.cc:351
@ YYSYMBOL_meta_identifier
Definition oct-parse.cc:315
@ YYSYMBOL_word_list
Definition oct-parse.cc:312
@ YYSYMBOL_YYEMPTY
Definition oct-parse.cc:199
@ YYSYMBOL_method_decl1
Definition oct-parse.cc:402
@ YYSYMBOL_event_list1
Definition oct-parse.cc:411
@ YYSYMBOL_arguments_block_list
Definition oct-parse.cc:375
@ YYSYMBOL_CLEANUP
Definition oct-parse.cc:277
@ YYSYMBOL_OTHERWISE
Definition oct-parse.cc:272
@ YYSYMBOL_PERSISTENT
Definition oct-parse.cc:281
@ YYSYMBOL_EDIV_EQ
Definition oct-parse.cc:229
@ YYSYMBOL_EXPR_OR
Definition oct-parse.cc:237
@ YYSYMBOL_STRUCT_ELT
Definition oct-parse.cc:256
@ YYSYMBOL_RETURN
Definition oct-parse.cc:275
@ YYSYMBOL_fcn_name
Definition oct-parse.cc:371
@ YYSYMBOL_except_command
Definition oct-parse.cc:355
@ YYSYMBOL_superclass
Definition oct-parse.cc:392
@ YYSYMBOL_DIV_EQ
Definition oct-parse.cc:225
@ YYSYMBOL_16_
Definition oct-parse.cc:216
@ YYSYMBOL_fcn_list1
Definition oct-parse.cc:309
@ YYSYMBOL_NAME
Definition oct-parse.cc:257
@ YYSYMBOL_5_
Definition oct-parse.cc:205
@ YYSYMBOL_ADD_EQ
Definition oct-parse.cc:222
@ YYSYMBOL_ELEFTDIV
Definition oct-parse.cc:247
@ YYSYMBOL_PLUS_PLUS
Definition oct-parse.cc:250
@ YYSYMBOL_FOR
Definition oct-parse.cc:261
@ YYSYMBOL_arg_validation
Definition oct-parse.cc:381
@ YYSYMBOL_enum_list1
Definition oct-parse.cc:416
@ YYSYMBOL_validation_fcns
Definition oct-parse.cc:384
@ YYSYMBOL_FQ_IDENT
Definition oct-parse.cc:290
@ YYSYMBOL_if_command
Definition oct-parse.cc:342
@ YYSYMBOL_param_list1
Definition oct-parse.cc:361
@ YYSYMBOL_command
Definition oct-parse.cc:337
@ YYSYMBOL_elseif_clause
Definition oct-parse.cc:345
@ YYSYMBOL_METHODS
Definition oct-parse.cc:285
@ YYSYMBOL_stmt_begin
Definition oct-parse.cc:418
@ YYSYMBOL_EVENTS
Definition oct-parse.cc:286
@ YYSYMBOL_anon_fcn_handle
Definition oct-parse.cc:324
octave_value load_fcn_from_file(const std::string &file_name, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, const std::string &fcn_name, bool autoload)
#define YY_ASSERT(E)
Definition oct-parse.cc:620
#define yyerrstatus
#define YY_(Msgid)
Definition oct-parse.cc:554
#define YYNOMEM
#define yypstate
Definition oct-parse.cc:75
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition oct-parse.cc:601
#define YYNSTATES
Definition oct-parse.cc:737
#define YYSTYPE
Definition oct-parse.cc:67
#define yypull_parse
Definition oct-parse.cc:71
#define yypstate_delete
Definition oct-parse.cc:74
#define YY_IGNORE_USELESS_CAST_END
Definition oct-parse.cc:616
#define yypstate_clear
Definition oct-parse.cc:73
#define yypstate_new
Definition oct-parse.cc:72
short yytype_int16
Definition oct-parse.cc:465
octave_value parse_fcn_file(interpreter &interp, const std::string &full_file, const std::string &file, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, bool require_file, bool force_script, bool autoload, bool relative_lookup)
#define YYABORT
#define YYSTACK_BYTES(N)
Definition oct-parse.cc:681
int octave_pull_parse(octave_pstate *yyps, octave::base_parser &parser)
yytype_int16 yy_state_t
Definition oct-parse.cc:541
int octave_push_parse(octave_pstate *yyps, int yypushed_char, OCTAVE_STYPE const *yypushed_val, octave::base_parser &parser)
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
Definition oct-parse.cc:179
#define yylex
Definition oct-parse.cc:76
#define YYMALLOC
Definition oct-parse.cc:651
#define YY_NULLPTR
Definition oct-parse.cc:191
#define YYFINAL
Definition oct-parse.cc:726
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition oct-parse.cc:829
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
#define YY_INITIAL_VALUE(Value)
Definition oct-parse.cc:597
#define yyparse
Definition oct-parse.cc:69
#define YYNTOKENS
Definition oct-parse.cc:731
unsigned char yytype_uint8
Definition oct-parse.cc:486
#define YY_STACK_PRINT(Bottom, Top)
#define YYSIZE_T
Definition oct-parse.cc:527
#define yydebug
Definition oct-parse.cc:78
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition oct-parse.cc:615
#define yyssa
std::string get_help_from_file(const std::string &nm, bool &symbol_found, std::string &full_file)
#define YYPTRDIFF_T
Definition oct-parse.cc:513
#define yynerrs
Definition oct-parse.cc:79
octave_value_list Feval(octave::interpreter &interp, const octave_value_list &args, int nargout)
#define yyvsp
#define scanner
Definition oct-parse.cc:152
#define YYACCEPT
#define yytable_value_is_error(Yyn)
Definition oct-parse.cc:900
#define YYTRANSLATE(YYX)
Definition oct-parse.cc:745
#define yyssp
@ YYENOMEM
void * malloc(unsigned)
#define yystacksize
#define YY_ATTRIBUTE_UNUSED
Definition oct-parse.cc:571
#define yyvs
#define yystate
#define YYFREE
Definition oct-parse.cc:657
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition oct-parse.cc:544
unsigned short yytype_uint16
Definition oct-parse.cc:497
int octave_lex(OCTAVE_STYPE *, void *)
The main scanner function which does all the work.
Definition lex.cc:1637
#define YYLAST
Definition oct-parse.cc:728
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition oct-parse.cc:692
#define yypact_value_is_default(Yyn)
Definition oct-parse.cc:895
#define YYINITDEPTH
#define yypush_parse
Definition oct-parse.cc:70
signed char yytype_int8
Definition oct-parse.cc:457
void free(void *)
void source_file(const std::string &file_name, const std::string &context, bool verbose, bool require_file)
#define YYERROR
#define YYSIZEOF(X)
Definition oct-parse.cc:537
#define YYSTACK_ALLOC
Definition oct-parse.cc:637
#define yyvsa
#define YYDPRINTF(Args)
#define YY_USE(E)
Definition oct-parse.cc:577
#define yyerror
Definition oct-parse.cc:77
@ LEFTDIV
Definition oct-parse.h:87
@ EDIV
Definition oct-parse.h:89
@ PLUS_PLUS
Definition oct-parse.h:93
@ OCTAVE_EOF
Definition oct-parse.h:62
@ DIV_EQ
Definition oct-parse.h:68
@ NUMBER
Definition oct-parse.h:97
@ ELEFTDIV
Definition oct-parse.h:90
@ EXPR_LT
Definition oct-parse.h:81
@ DQ_STRING
Definition oct-parse.h:102
@ MINUS_MINUS
Definition oct-parse.h:94
@ POW
Definition oct-parse.h:95
@ 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
@ EPOW_EQ
Definition oct-parse.h:74
@ OCTAVE_error
Definition oct-parse.h:63
@ EPOW
Definition oct-parse.h:96
@ SQ_STRING
Definition oct-parse.h:103
@ MUL_EQ
Definition oct-parse.h:67
@ AND_EQ
Definition oct-parse.h:75
@ EMUL_EQ
Definition oct-parse.h:71
@ CONSTANT
Definition oct-parse.h:98
@ POW_EQ
Definition oct-parse.h:70
@ OCTAVE_UNDEF
Definition oct-parse.h:64
@ ADD_EQ
Definition oct-parse.h:65
@ SUB_EQ
Definition oct-parse.h:66
@ PERSISTENT
Definition oct-parse.h:124
@ EXPR_LE
Definition oct-parse.h:82
@ PARFOR
Definition oct-parse.h:105
@ EXPR_GE
Definition oct-parse.h:85
@ OCTAVE_EMPTY
Definition oct-parse.h:61
@ EXPR_OR
Definition oct-parse.h:80
@ EMUL
Definition oct-parse.h:88
@ LEFTDIV_EQ
Definition oct-parse.h:69
@ 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
@ EXPR_EQ
Definition oct-parse.h:83
@ GLOBAL
Definition oct-parse.h:123
@ EXPR_AND
Definition oct-parse.h:79
#define YYSTYPE
#define yylval
#define yyalloc
#define yyss
yysymbol_kind_t
#define yyerrstatus
#define yypstate
#define yypstate_delete
#define yypstate_new
short yytype_int16
unsigned char yytype_uint8
#define yyssa
#define YYPTRDIFF_T
#define yynerrs
#define yyvsp
#define yyssp
#define yystacksize
#define yyvs
#define yystate
#define YYINITDEPTH
signed char yytype_int8
yytype_int8 yy_state_t
#define yyvsa
@ YYPUSH_MORE
#define octave_stdout
Definition pager.h:301
tree_binary_expression * maybe_compound_binary_expression(tree_expression *a, const token &op_tok, tree_expression *b, octave_value::binary_op t)
Definition pt-cbinop.cc:143
std::string undo_string_escapes(const std::string &s)
Definition utils.cc:1065
std::string fcn_file_in_path(const std::string &name)
Definition utils.cc:749
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)
Definition variables.cc:583
F77_RET_T len
Definition xerbla.cc:61