GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
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 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
83
84
85#define YYDEBUG 1
86
87#if defined (HAVE_CONFIG_H)
88# include "config.h"
89#endif
90
91#include <cassert>
92#include <cstdio>
93#include <cstdlib>
94
95#include <iostream>
96#include <map>
97#include <sstream>
98
99#include "Matrix.h"
100#include "cmd-edit.h"
101#include "cmd-hist.h"
102#include "file-ops.h"
103#include "file-stat.h"
104#include "oct-env.h"
105#include "oct-time.h"
106#include "quit.h"
107
108#include "Cell.h"
109#include "anon-fcn-validator.h"
110#include "builtin-defun-decls.h"
111#include "defun.h"
112#include "dynamic-ld.h"
113#include "error.h"
114#include "input.h"
115#include "interpreter-private.h"
116#include "interpreter.h"
117#include "lex.h"
118#include "load-path.h"
119#include "lo-sysdep.h"
120#include "oct-hist.h"
121#include "oct-map.h"
122#include "ov-classdef.h"
123#include "ov-fcn-handle.h"
124#include "ov-usr-fcn.h"
125#include "ov-null-mat.h"
126#include "pager.h"
127#include "parse.h"
128#include "pt-all.h"
129#include "pt-eval.h"
130#include "symtab.h"
131#include "token.h"
132#include "unwind-prot.h"
133#include "utils.h"
134#include "variables.h"
135
136// oct-parse.h must be included after pt-all.h
137#include "oct-parse.h"
138
139extern int octave_lex (YYSTYPE *, void *);
140
141// Forward declarations for some functions defined at the bottom of
142// the file.
143
144static void yyerror (octave::base_parser& parser, const char *s);
145
146#define lexer (parser.get_lexer ())
147#define scanner lexer.m_scanner
148
149// Previous versions of Octave used Bison's YYUSE macro to avoid
150// warnings about unused values in rules. But that Bison macro was
151// apparently never intended to be public. So define our own. All we
152// need to do is mention the symantic value somewhere in the rule. It
153// doesn't actually need to be used to avoid the Bison warning, so just
154// define this macro to discard its parameter.
155#define OCTAVE_YYUSE(X, ...)
156
157#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
158 // Disable this warning for code that is generated by Bison,
159 // including grammar rules. Push the current state so we can
160 // restore the warning state prior to functions we define at
161 // the bottom of the file.
162# pragma GCC diagnostic push
163# pragma GCC diagnostic ignored "-Wold-style-cast"
164#endif
165
166
167#line 168 "libinterp/parse-tree/oct-parse.cc"
168
169# ifndef YY_CAST
170# ifdef __cplusplus
171# define YY_CAST(Type, Val) static_cast<Type> (Val)
172# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
173# else
174# define YY_CAST(Type, Val) ((Type) (Val))
175# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
176# endif
177# endif
178# ifndef YY_NULLPTR
179# if defined __cplusplus
180# if 201103L <= __cplusplus
181# define YY_NULLPTR nullptr
182# else
183# define YY_NULLPTR 0
184# endif
185# else
186# define YY_NULLPTR ((void*)0)
187# endif
188# endif
189
190#include "oct-parse.h"
191/* Symbol kind. */
193{
195 YYSYMBOL_YYEOF = 0, /* "end of file" */
196 YYSYMBOL_YYerror = 1, /* error */
197 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
198 YYSYMBOL_3_ = 3, /* '=' */
199 YYSYMBOL_4_ = 4, /* ':' */
200 YYSYMBOL_5_ = 5, /* '-' */
201 YYSYMBOL_6_ = 6, /* '+' */
202 YYSYMBOL_7_ = 7, /* '*' */
203 YYSYMBOL_8_ = 8, /* '/' */
204 YYSYMBOL_9_ = 9, /* '(' */
205 YYSYMBOL_10_ = 10, /* ')' */
206 YYSYMBOL_11_ = 11, /* '[' */
207 YYSYMBOL_12_ = 12, /* ']' */
208 YYSYMBOL_13_ = 13, /* '{' */
209 YYSYMBOL_14_ = 14, /* '}' */
210 YYSYMBOL_15_ = 15, /* '.' */
211 YYSYMBOL_16_ = 16, /* '@' */
212 YYSYMBOL_17_ = 17, /* ',' */
213 YYSYMBOL_18_ = 18, /* ';' */
214 YYSYMBOL_19_n_ = 19, /* '\n' */
215 YYSYMBOL_ADD_EQ = 20, /* ADD_EQ */
216 YYSYMBOL_SUB_EQ = 21, /* SUB_EQ */
217 YYSYMBOL_MUL_EQ = 22, /* MUL_EQ */
218 YYSYMBOL_DIV_EQ = 23, /* DIV_EQ */
219 YYSYMBOL_LEFTDIV_EQ = 24, /* LEFTDIV_EQ */
220 YYSYMBOL_POW_EQ = 25, /* POW_EQ */
221 YYSYMBOL_EMUL_EQ = 26, /* EMUL_EQ */
222 YYSYMBOL_EDIV_EQ = 27, /* EDIV_EQ */
223 YYSYMBOL_ELEFTDIV_EQ = 28, /* ELEFTDIV_EQ */
224 YYSYMBOL_EPOW_EQ = 29, /* EPOW_EQ */
225 YYSYMBOL_AND_EQ = 30, /* AND_EQ */
226 YYSYMBOL_OR_EQ = 31, /* OR_EQ */
227 YYSYMBOL_EXPR_AND_AND = 32, /* EXPR_AND_AND */
228 YYSYMBOL_EXPR_OR_OR = 33, /* EXPR_OR_OR */
229 YYSYMBOL_EXPR_AND = 34, /* EXPR_AND */
230 YYSYMBOL_EXPR_OR = 35, /* EXPR_OR */
231 YYSYMBOL_EXPR_NOT = 36, /* EXPR_NOT */
232 YYSYMBOL_EXPR_LT = 37, /* EXPR_LT */
233 YYSYMBOL_EXPR_LE = 38, /* EXPR_LE */
234 YYSYMBOL_EXPR_EQ = 39, /* EXPR_EQ */
235 YYSYMBOL_EXPR_NE = 40, /* EXPR_NE */
236 YYSYMBOL_EXPR_GE = 41, /* EXPR_GE */
237 YYSYMBOL_EXPR_GT = 42, /* EXPR_GT */
238 YYSYMBOL_LEFTDIV = 43, /* LEFTDIV */
239 YYSYMBOL_EMUL = 44, /* EMUL */
240 YYSYMBOL_EDIV = 45, /* EDIV */
241 YYSYMBOL_ELEFTDIV = 46, /* ELEFTDIV */
242 YYSYMBOL_HERMITIAN = 47, /* HERMITIAN */
243 YYSYMBOL_TRANSPOSE = 48, /* TRANSPOSE */
244 YYSYMBOL_PLUS_PLUS = 49, /* PLUS_PLUS */
245 YYSYMBOL_MINUS_MINUS = 50, /* MINUS_MINUS */
246 YYSYMBOL_POW = 51, /* POW */
247 YYSYMBOL_EPOW = 52, /* EPOW */
248 YYSYMBOL_NUMBER = 53, /* NUMBER */
249 YYSYMBOL_STRUCT_ELT = 54, /* STRUCT_ELT */
250 YYSYMBOL_NAME = 55, /* NAME */
251 YYSYMBOL_END = 56, /* END */
252 YYSYMBOL_DQ_STRING = 57, /* DQ_STRING */
253 YYSYMBOL_SQ_STRING = 58, /* SQ_STRING */
254 YYSYMBOL_FOR = 59, /* FOR */
255 YYSYMBOL_PARFOR = 60, /* PARFOR */
256 YYSYMBOL_WHILE = 61, /* WHILE */
257 YYSYMBOL_DO = 62, /* DO */
258 YYSYMBOL_UNTIL = 63, /* UNTIL */
259 YYSYMBOL_SPMD = 64, /* SPMD */
260 YYSYMBOL_IF = 65, /* IF */
261 YYSYMBOL_ELSEIF = 66, /* ELSEIF */
262 YYSYMBOL_ELSE = 67, /* ELSE */
263 YYSYMBOL_SWITCH = 68, /* SWITCH */
264 YYSYMBOL_CASE = 69, /* CASE */
265 YYSYMBOL_OTHERWISE = 70, /* OTHERWISE */
266 YYSYMBOL_BREAK = 71, /* BREAK */
267 YYSYMBOL_CONTINUE = 72, /* CONTINUE */
268 YYSYMBOL_FUNC_RET = 73, /* FUNC_RET */
269 YYSYMBOL_UNWIND = 74, /* UNWIND */
270 YYSYMBOL_CLEANUP = 75, /* CLEANUP */
271 YYSYMBOL_TRY = 76, /* TRY */
272 YYSYMBOL_CATCH = 77, /* CATCH */
273 YYSYMBOL_GLOBAL = 78, /* GLOBAL */
274 YYSYMBOL_PERSISTENT = 79, /* PERSISTENT */
275 YYSYMBOL_FCN_HANDLE = 80, /* FCN_HANDLE */
276 YYSYMBOL_CLASSDEF = 81, /* CLASSDEF */
277 YYSYMBOL_PROPERTIES = 82, /* PROPERTIES */
278 YYSYMBOL_METHODS = 83, /* METHODS */
279 YYSYMBOL_EVENTS = 84, /* EVENTS */
280 YYSYMBOL_ENUMERATION = 85, /* ENUMERATION */
281 YYSYMBOL_METAQUERY = 86, /* METAQUERY */
282 YYSYMBOL_SUPERCLASSREF = 87, /* SUPERCLASSREF */
283 YYSYMBOL_FQ_IDENT = 88, /* FQ_IDENT */
284 YYSYMBOL_GET = 89, /* GET */
285 YYSYMBOL_SET = 90, /* SET */
286 YYSYMBOL_FCN = 91, /* FCN */
287 YYSYMBOL_ARGUMENTS = 92, /* ARGUMENTS */
288 YYSYMBOL_LEXICAL_ERROR = 93, /* LEXICAL_ERROR */
289 YYSYMBOL_END_OF_INPUT = 94, /* END_OF_INPUT */
290 YYSYMBOL_INPUT_FILE = 95, /* INPUT_FILE */
291 YYSYMBOL_UNARY = 96, /* UNARY */
292 YYSYMBOL_YYACCEPT = 97, /* $accept */
293 YYSYMBOL_input = 98, /* input */
294 YYSYMBOL_simple_list = 99, /* simple_list */
295 YYSYMBOL_simple_list1 = 100, /* simple_list1 */
296 YYSYMBOL_opt_list = 101, /* opt_list */
297 YYSYMBOL_list = 102, /* list */
298 YYSYMBOL_list1 = 103, /* list1 */
299 YYSYMBOL_opt_fcn_list = 104, /* opt_fcn_list */
300 YYSYMBOL_fcn_list = 105, /* fcn_list */
301 YYSYMBOL_fcn_list1 = 106, /* fcn_list1 */
302 YYSYMBOL_statement = 107, /* statement */
303 YYSYMBOL_word_list_cmd = 108, /* word_list_cmd */
304 YYSYMBOL_word_list = 109, /* word_list */
305 YYSYMBOL_identifier = 110, /* identifier */
306 YYSYMBOL_superclass_identifier = 111, /* superclass_identifier */
307 YYSYMBOL_meta_identifier = 112, /* meta_identifier */
308 YYSYMBOL_string = 113, /* string */
309 YYSYMBOL_constant = 114, /* constant */
310 YYSYMBOL_matrix = 115, /* matrix */
311 YYSYMBOL_matrix_rows = 116, /* matrix_rows */
312 YYSYMBOL_cell = 117, /* cell */
313 YYSYMBOL_cell_rows = 118, /* cell_rows */
314 YYSYMBOL_cell_or_matrix_row = 119, /* cell_or_matrix_row */
315 YYSYMBOL_fcn_handle = 120, /* fcn_handle */
316 YYSYMBOL_anon_fcn_handle = 121, /* anon_fcn_handle */
317 YYSYMBOL_primary_expr = 122, /* primary_expr */
318 YYSYMBOL_magic_colon = 123, /* magic_colon */
319 YYSYMBOL_magic_tilde = 124, /* magic_tilde */
320 YYSYMBOL_arg_list = 125, /* arg_list */
321 YYSYMBOL_indirect_ref_op = 126, /* indirect_ref_op */
322 YYSYMBOL_oper_expr = 127, /* oper_expr */
323 YYSYMBOL_power_expr = 128, /* power_expr */
324 YYSYMBOL_colon_expr = 129, /* colon_expr */
325 YYSYMBOL_simple_expr = 130, /* simple_expr */
326 YYSYMBOL_assign_lhs = 131, /* assign_lhs */
327 YYSYMBOL_assign_expr = 132, /* assign_expr */
328 YYSYMBOL_expression = 133, /* expression */
329 YYSYMBOL_command = 134, /* command */
330 YYSYMBOL_declaration = 135, /* declaration */
331 YYSYMBOL_decl_init_list = 136, /* decl_init_list */
332 YYSYMBOL_decl_elt = 137, /* decl_elt */
333 YYSYMBOL_select_command = 138, /* select_command */
334 YYSYMBOL_if_command = 139, /* if_command */
335 YYSYMBOL_if_cmd_list = 140, /* if_cmd_list */
336 YYSYMBOL_if_cmd_list1 = 141, /* if_cmd_list1 */
337 YYSYMBOL_elseif_clause = 142, /* elseif_clause */
338 YYSYMBOL_else_clause = 143, /* else_clause */
339 YYSYMBOL_switch_command = 144, /* switch_command */
340 YYSYMBOL_case_list = 145, /* case_list */
341 YYSYMBOL_case_list1 = 146, /* case_list1 */
342 YYSYMBOL_switch_case = 147, /* switch_case */
343 YYSYMBOL_default_case = 148, /* default_case */
344 YYSYMBOL_loop_command = 149, /* loop_command */
345 YYSYMBOL_jump_command = 150, /* jump_command */
346 YYSYMBOL_spmd_command = 151, /* spmd_command */
347 YYSYMBOL_except_command = 152, /* except_command */
348 YYSYMBOL_push_fcn_symtab = 153, /* push_fcn_symtab */
349 YYSYMBOL_param_list_beg = 154, /* param_list_beg */
350 YYSYMBOL_param_list_end = 155, /* param_list_end */
351 YYSYMBOL_opt_param_list = 156, /* opt_param_list */
352 YYSYMBOL_param_list = 157, /* param_list */
353 YYSYMBOL_param_list1 = 158, /* param_list1 */
354 YYSYMBOL_param_list2 = 159, /* param_list2 */
355 YYSYMBOL_param_list_elt = 160, /* param_list_elt */
356 YYSYMBOL_return_list = 161, /* return_list */
357 YYSYMBOL_return_list1 = 162, /* return_list1 */
358 YYSYMBOL_parsing_local_fcns = 163, /* parsing_local_fcns */
359 YYSYMBOL_push_script_symtab = 164, /* push_script_symtab */
360 YYSYMBOL_begin_file = 165, /* begin_file */
361 YYSYMBOL_file = 166, /* file */
362 YYSYMBOL_function_beg = 167, /* function_beg */
363 YYSYMBOL_fcn_name = 168, /* fcn_name */
364 YYSYMBOL_function_end = 169, /* function_end */
365 YYSYMBOL_function = 170, /* function */
366 YYSYMBOL_function_body = 171, /* function_body */
367 YYSYMBOL_at_first_executable_stmt = 172, /* at_first_executable_stmt */
368 YYSYMBOL_function_body1 = 173, /* function_body1 */
369 YYSYMBOL_arguments_block = 174, /* arguments_block */
370 YYSYMBOL_arguments_beg = 175, /* arguments_beg */
371 YYSYMBOL_args_attr_list = 176, /* args_attr_list */
372 YYSYMBOL_args_validation_list = 177, /* args_validation_list */
373 YYSYMBOL_arg_name = 178, /* arg_name */
374 YYSYMBOL_arg_validation = 179, /* arg_validation */
375 YYSYMBOL_size_spec = 180, /* size_spec */
376 YYSYMBOL_class_name = 181, /* class_name */
377 YYSYMBOL_validation_fcns = 182, /* validation_fcns */
378 YYSYMBOL_default_value = 183, /* default_value */
379 YYSYMBOL_classdef_beg = 184, /* classdef_beg */
380 YYSYMBOL_classdef = 185, /* classdef */
381 YYSYMBOL_attr_list = 186, /* attr_list */
382 YYSYMBOL_attr_list1 = 187, /* attr_list1 */
383 YYSYMBOL_attr = 188, /* attr */
384 YYSYMBOL_superclass_list = 189, /* superclass_list */
385 YYSYMBOL_superclass_list1 = 190, /* superclass_list1 */
386 YYSYMBOL_superclass = 191, /* superclass */
387 YYSYMBOL_class_body = 192, /* class_body */
388 YYSYMBOL_class_body1 = 193, /* class_body1 */
389 YYSYMBOL_properties_block = 194, /* properties_block */
390 YYSYMBOL_properties_beg = 195, /* properties_beg */
391 YYSYMBOL_property_list = 196, /* property_list */
392 YYSYMBOL_property_list1 = 197, /* property_list1 */
393 YYSYMBOL_class_property = 198, /* class_property */
394 YYSYMBOL_methods_block = 199, /* methods_block */
395 YYSYMBOL_methods_beg = 200, /* methods_beg */
396 YYSYMBOL_method_decl1 = 201, /* method_decl1 */
397 YYSYMBOL_method_decl = 202, /* method_decl */
398 YYSYMBOL_203_1 = 203, /* $@1 */
399 YYSYMBOL_method = 204, /* method */
400 YYSYMBOL_methods_list = 205, /* methods_list */
401 YYSYMBOL_methods_list1 = 206, /* methods_list1 */
402 YYSYMBOL_events_block = 207, /* events_block */
403 YYSYMBOL_events_beg = 208, /* events_beg */
404 YYSYMBOL_events_list = 209, /* events_list */
405 YYSYMBOL_events_list1 = 210, /* events_list1 */
406 YYSYMBOL_class_event = 211, /* class_event */
407 YYSYMBOL_enum_block = 212, /* enum_block */
408 YYSYMBOL_enumeration_beg = 213, /* enumeration_beg */
409 YYSYMBOL_enum_list = 214, /* enum_list */
410 YYSYMBOL_enum_list1 = 215, /* enum_list1 */
411 YYSYMBOL_class_enum = 216, /* class_enum */
412 YYSYMBOL_stmt_begin = 217, /* stmt_begin */
413 YYSYMBOL_anon_fcn_begin = 218, /* anon_fcn_begin */
414 YYSYMBOL_stash_comment = 219, /* stash_comment */
415 YYSYMBOL_parse_error = 220, /* parse_error */
416 YYSYMBOL_sep_no_nl = 221, /* sep_no_nl */
417 YYSYMBOL_opt_sep_no_nl = 222, /* opt_sep_no_nl */
418 YYSYMBOL_opt_nl = 223, /* opt_nl */
419 YYSYMBOL_nl = 224, /* nl */
420 YYSYMBOL_sep = 225, /* sep */
421 YYSYMBOL_opt_sep = 226 /* opt_sep */
424
425
426
427
428#ifdef short
429# undef short
430#endif
431
432/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
433 <limits.h> and (if available) <stdint.h> are included
434 so that the code can choose integer types of a good width. */
435
436#ifndef __PTRDIFF_MAX__
437# include <limits.h> /* INFRINGES ON USER NAME SPACE */
438# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
439# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
440# define YY_STDINT_H
441# endif
442#endif
443
444/* Narrow types that promote to a signed type and that can represent a
445 signed or unsigned integer of at least N bits. In tables they can
446 save space and decrease cache pressure. Promoting to a signed type
447 helps avoid bugs in integer arithmetic. */
448
449#ifdef __INT_LEAST8_MAX__
450typedef __INT_LEAST8_TYPE__ yytype_int8;
451#elif defined YY_STDINT_H
452typedef int_least8_t yytype_int8;
453#else
454typedef signed char yytype_int8;
455#endif
456
457#ifdef __INT_LEAST16_MAX__
458typedef __INT_LEAST16_TYPE__ yytype_int16;
459#elif defined YY_STDINT_H
460typedef int_least16_t yytype_int16;
461#else
462typedef short yytype_int16;
463#endif
464
465/* Work around bug in HP-UX 11.23, which defines these macros
466 incorrectly for preprocessor constants. This workaround can likely
467 be removed in 2023, as HPE has promised support for HP-UX 11.23
468 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
469 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
470#ifdef __hpux
471# undef UINT_LEAST8_MAX
472# undef UINT_LEAST16_MAX
473# define UINT_LEAST8_MAX 255
474# define UINT_LEAST16_MAX 65535
475#endif
476
477#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
478typedef __UINT_LEAST8_TYPE__ yytype_uint8;
479#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
480 && UINT_LEAST8_MAX <= INT_MAX)
481typedef uint_least8_t yytype_uint8;
482#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
483typedef unsigned char yytype_uint8;
484#else
485typedef short yytype_uint8;
486#endif
487
488#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
489typedef __UINT_LEAST16_TYPE__ yytype_uint16;
490#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
491 && UINT_LEAST16_MAX <= INT_MAX)
492typedef uint_least16_t yytype_uint16;
493#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
494typedef unsigned short yytype_uint16;
495#else
496typedef int yytype_uint16;
497#endif
498
499#ifndef YYPTRDIFF_T
500# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
501# define YYPTRDIFF_T __PTRDIFF_TYPE__
502# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
503# elif defined PTRDIFF_MAX
504# ifndef ptrdiff_t
505# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
506# endif
507# define YYPTRDIFF_T ptrdiff_t
508# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
509# else
510# define YYPTRDIFF_T long
511# define YYPTRDIFF_MAXIMUM LONG_MAX
512# endif
513#endif
514
515#ifndef YYSIZE_T
516# ifdef __SIZE_TYPE__
517# define YYSIZE_T __SIZE_TYPE__
518# elif defined size_t
519# define YYSIZE_T size_t
520# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
521# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
522# define YYSIZE_T size_t
523# else
524# define YYSIZE_T unsigned
525# endif
526#endif
527
528#define YYSIZE_MAXIMUM \
529 YY_CAST (YYPTRDIFF_T, \
530 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
531 ? YYPTRDIFF_MAXIMUM \
532 : YY_CAST (YYSIZE_T, -1)))
533
534#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
535
536
537/* Stored state numbers (used for stacks). */
539
540/* State numbers in computations. */
541typedef int yy_state_fast_t;
542
543#ifndef YY_
544# if defined YYENABLE_NLS && YYENABLE_NLS
545# if ENABLE_NLS
546# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
547# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
548# endif
549# endif
550# ifndef YY_
551# define YY_(Msgid) Msgid
552# endif
553#endif
554
555
556#ifndef YY_ATTRIBUTE_PURE
557# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
558# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
559# else
560# define YY_ATTRIBUTE_PURE
561# endif
562#endif
563
564#ifndef YY_ATTRIBUTE_UNUSED
565# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
566# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
567# else
568# define YY_ATTRIBUTE_UNUSED
569# endif
570#endif
571
572/* Suppress unused-variable warnings by "using" E. */
573#if ! defined lint || defined __GNUC__
574# define YY_USE(E) ((void) (E))
575#else
576# define YY_USE(E) /* empty */
577#endif
578
579/* Suppress an incorrect diagnostic about yylval being uninitialized. */
580#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
581# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
582# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
583 _Pragma ("GCC diagnostic push") \
584 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
585# else
586# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
587 _Pragma ("GCC diagnostic push") \
588 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
589 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
590# endif
591# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
592 _Pragma ("GCC diagnostic pop")
593#else
594# define YY_INITIAL_VALUE(Value) Value
595#endif
596#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
597# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
598# define YY_IGNORE_MAYBE_UNINITIALIZED_END
599#endif
600#ifndef YY_INITIAL_VALUE
601# define YY_INITIAL_VALUE(Value) /* Nothing. */
602#endif
603
604#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
605# define YY_IGNORE_USELESS_CAST_BEGIN \
606 _Pragma ("GCC diagnostic push") \
607 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
608# define YY_IGNORE_USELESS_CAST_END \
609 _Pragma ("GCC diagnostic pop")
610#endif
611#ifndef YY_IGNORE_USELESS_CAST_BEGIN
612# define YY_IGNORE_USELESS_CAST_BEGIN
613# define YY_IGNORE_USELESS_CAST_END
614#endif
615
616
617#define YY_ASSERT(E) ((void) (0 && (E)))
618
619#if !defined yyoverflow
620
621/* The parser invokes alloca or malloc; define the necessary symbols. */
622
623# ifdef YYSTACK_ALLOC
624 /* Pacify GCC's 'empty if-body' warning. */
625# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
626# ifndef YYSTACK_ALLOC_MAXIMUM
627 /* The OS might guarantee only one guard page at the bottom of the stack,
628 and a page size can be as small as 4096 bytes. So we cannot safely
629 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
630 to allow for a few compiler-allocated temporary stack slots. */
631# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
632# endif
633# else
634# define YYSTACK_ALLOC YYMALLOC
635# define YYSTACK_FREE YYFREE
636# ifndef YYSTACK_ALLOC_MAXIMUM
637# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
638# endif
639# if (defined __cplusplus && ! defined EXIT_SUCCESS \
640 && ! ((defined YYMALLOC || defined malloc) \
641 && (defined YYFREE || defined free)))
642# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
643# ifndef EXIT_SUCCESS
644# define EXIT_SUCCESS 0
645# endif
646# endif
647# ifndef YYMALLOC
648# define YYMALLOC malloc
649# if ! defined malloc && ! defined EXIT_SUCCESS
650void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
651# endif
652# endif
653# ifndef YYFREE
654# define YYFREE free
655# if ! defined free && ! defined EXIT_SUCCESS
656void free (void *); /* INFRINGES ON USER NAME SPACE */
657# endif
658# endif
659# endif
660#endif /* !defined yyoverflow */
661
662#if (! defined yyoverflow \
663 && (! defined __cplusplus \
664 || (defined OCTAVE_STYPE_IS_TRIVIAL && OCTAVE_STYPE_IS_TRIVIAL)))
665
666/* A type that is properly aligned for any stack member. */
668{
671};
672
673/* The size of the maximum gap between one aligned stack and the next. */
674# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
675
676/* The size of an array large to enough to hold all stacks, each with
677 N elements. */
678# define YYSTACK_BYTES(N) \
679 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
680 + YYSTACK_GAP_MAXIMUM)
681
682# define YYCOPY_NEEDED 1
683
684/* Relocate STACK from its old location to the new one. The
685 local variables YYSIZE and YYSTACKSIZE give the old and new number of
686 elements in the stack, and YYPTR gives the new location of the
687 stack. Advance YYPTR to a properly aligned location for the next
688 stack. */
689# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
690 do \
691 { \
692 YYPTRDIFF_T yynewbytes; \
693 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
694 Stack = &yyptr->Stack_alloc; \
695 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
696 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
697 } \
698 while (0)
699
700#endif
701
702#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
703/* Copy COUNT objects from SRC to DST. The source and destination do
704 not overlap. */
705# ifndef YYCOPY
706# if defined __GNUC__ && 1 < __GNUC__
707# define YYCOPY(Dst, Src, Count) \
708 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
709# else
710# define YYCOPY(Dst, Src, Count) \
711 do \
712 { \
713 YYPTRDIFF_T yyi; \
714 for (yyi = 0; yyi < (Count); yyi++) \
715 (Dst)[yyi] = (Src)[yyi]; \
716 } \
717 while (0)
718# endif
719# endif
720#endif /* !YYCOPY_NEEDED */
721
722/* YYFINAL -- State number of the termination state. */
723#define YYFINAL 108
724/* YYLAST -- Last index in YYTABLE. */
725#define YYLAST 1609
726
727/* YYNTOKENS -- Number of terminals. */
728#define YYNTOKENS 97
729/* YYNNTS -- Number of nonterminals. */
730#define YYNNTS 130
731/* YYNRULES -- Number of rules. */
732#define YYNRULES 312
733/* YYNSTATES -- Number of states. */
734#define YYNSTATES 568
735
736/* YYMAXUTOK -- Last valid token kind. */
737#define YYMAXUTOK 334
738
739
740/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
741 as returned by yylex, with out-of-bounds checking. */
742#define YYTRANSLATE(YYX) \
743 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
744 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
745 : YYSYMBOL_YYUNDEF)
746
747/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
748 as returned by yylex. */
749static const yytype_int8 yytranslate[] =
750{
751 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752 19, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
755 9, 10, 7, 6, 17, 5, 15, 8, 2, 2,
756 2, 2, 2, 2, 2, 2, 2, 2, 4, 18,
757 2, 3, 2, 2, 16, 2, 2, 2, 2, 2,
758 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760 2, 11, 2, 12, 2, 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, 2, 2, 13, 2, 14, 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, 2, 2, 2, 2, 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, 1, 2, 20, 21,
777 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
778 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
779 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
780 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
781 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
782 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
783 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
784 92, 93, 94, 95, 96
785};
786
787#if OCTAVE_DEBUG
788/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
789static const yytype_int16 yyrline[] =
790{
791 0, 415, 415, 426, 437, 444, 450, 454, 456, 461,
792 462, 466, 470, 472, 477, 478, 482, 490, 495, 502,
793 504, 506, 518, 530, 532, 540, 545, 549, 553, 555,
794 559, 561, 565, 569, 571, 579, 583, 585, 602, 603,
795 609, 611, 617, 623, 631, 639, 651, 663, 665, 667,
796 669, 674, 676, 678, 680, 688, 692, 700, 702, 704,
797 706, 712, 718, 726, 735, 737, 739, 741, 752, 763,
798 774, 785, 787, 789, 791, 797, 799, 801, 803, 805,
799 807, 809, 811, 813, 815, 817, 819, 821, 823, 825,
800 829, 831, 833, 835, 846, 857, 868, 879, 881, 887,
801 889, 891, 893, 895, 899, 911, 925, 927, 929, 931,
802 933, 935, 937, 939, 941, 943, 945, 947, 951, 965,
803 967, 969, 971, 973, 975, 977, 979, 981, 983, 985,
804 987, 989, 993, 1008, 1015, 1023, 1025, 1027, 1029, 1031,
805 1033, 1035, 1037, 1045, 1050, 1057, 1059, 1063, 1065, 1073,
806 1075, 1083, 1093, 1095, 1099, 1107, 1111, 1121, 1133, 1146,
807 1147, 1149, 1151, 1155, 1157, 1161, 1169, 1181, 1193, 1199,
808 1210, 1221, 1232, 1249, 1254, 1259, 1267, 1286, 1297, 1308,
809 1326, 1338, 1356, 1368, 1369, 1373, 1380, 1389, 1390, 1407,
810 1409, 1417, 1419, 1427, 1435, 1454, 1473, 1477, 1491, 1495,
811 1504, 1508, 1542, 1560, 1569, 1579, 1590, 1603, 1616, 1651,
812 1658, 1667, 1673, 1683, 1689, 1695, 1703, 1721, 1729, 1730,
813 1744, 1749, 1762, 1766, 1777, 1778, 1791, 1792, 1798, 1799,
814 1812, 1813, 1825, 1843, 1863, 1864, 1872, 1874, 1882, 1884,
815 1890, 1899, 1905, 1917, 1923, 1931, 1936, 1940, 1949, 1951,
816 1953, 1955, 1957, 1963, 1969, 1975, 1984, 2001, 2009, 2013,
817 2023, 2025, 2056, 2060, 2077, 2084, 2089, 2096, 2099, 2098,
818 2114, 2116, 2121, 2125, 2134, 2136, 2144, 2161, 2169, 2173,
819 2182, 2184, 2192, 2196, 2213, 2221, 2225, 2234, 2236, 2244,
820 2257, 2264, 2272, 2275, 2281, 2285, 2291, 2297, 2303, 2312,
821 2313, 2318, 2319, 2323, 2329, 2337, 2343, 2349, 2355, 2361,
822 2367, 2376, 2377
823};
824#endif
825
826/** Accessing symbol of state STATE. */
827#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
828
829#if OCTAVE_DEBUG || 0
830/* The user-facing name of the symbol whose (internal) number is
831 YYSYMBOL. No bounds checking. */
832static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
833
834/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
835 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
836static const char *const yytname[] =
837{
838 "\"end of file\"", "error", "\"invalid token\"", "'='", "':'", "'-'",
839 "'+'", "'*'", "'/'", "'('", "')'", "'['", "']'", "'{'", "'}'", "'.'",
840 "'@'", "','", "';'", "'\\n'", "ADD_EQ", "SUB_EQ", "MUL_EQ", "DIV_EQ",
841 "LEFTDIV_EQ", "POW_EQ", "EMUL_EQ", "EDIV_EQ", "ELEFTDIV_EQ", "EPOW_EQ",
842 "AND_EQ", "OR_EQ", "EXPR_AND_AND", "EXPR_OR_OR", "EXPR_AND", "EXPR_OR",
843 "EXPR_NOT", "EXPR_LT", "EXPR_LE", "EXPR_EQ", "EXPR_NE", "EXPR_GE",
844 "EXPR_GT", "LEFTDIV", "EMUL", "EDIV", "ELEFTDIV", "HERMITIAN",
845 "TRANSPOSE", "PLUS_PLUS", "MINUS_MINUS", "POW", "EPOW", "NUMBER",
846 "STRUCT_ELT", "NAME", "END", "DQ_STRING", "SQ_STRING", "FOR", "PARFOR",
847 "WHILE", "DO", "UNTIL", "SPMD", "IF", "ELSEIF", "ELSE", "SWITCH", "CASE",
848 "OTHERWISE", "BREAK", "CONTINUE", "FUNC_RET", "UNWIND", "CLEANUP", "TRY",
849 "CATCH", "GLOBAL", "PERSISTENT", "FCN_HANDLE", "CLASSDEF", "PROPERTIES",
850 "METHODS", "EVENTS", "ENUMERATION", "METAQUERY", "SUPERCLASSREF",
851 "FQ_IDENT", "GET", "SET", "FCN", "ARGUMENTS", "LEXICAL_ERROR",
852 "END_OF_INPUT", "INPUT_FILE", "UNARY", "$accept", "input", "simple_list",
853 "simple_list1", "opt_list", "list", "list1", "opt_fcn_list", "fcn_list",
854 "fcn_list1", "statement", "word_list_cmd", "word_list", "identifier",
855 "superclass_identifier", "meta_identifier", "string", "constant",
856 "matrix", "matrix_rows", "cell", "cell_rows", "cell_or_matrix_row",
857 "fcn_handle", "anon_fcn_handle", "primary_expr", "magic_colon",
858 "magic_tilde", "arg_list", "indirect_ref_op", "oper_expr", "power_expr",
859 "colon_expr", "simple_expr", "assign_lhs", "assign_expr", "expression",
860 "command", "declaration", "decl_init_list", "decl_elt", "select_command",
861 "if_command", "if_cmd_list", "if_cmd_list1", "elseif_clause",
862 "else_clause", "switch_command", "case_list", "case_list1",
863 "switch_case", "default_case", "loop_command", "jump_command",
864 "spmd_command", "except_command", "push_fcn_symtab", "param_list_beg",
865 "param_list_end", "opt_param_list", "param_list", "param_list1",
866 "param_list2", "param_list_elt", "return_list", "return_list1",
867 "parsing_local_fcns", "push_script_symtab", "begin_file", "file",
868 "function_beg", "fcn_name", "function_end", "function", "function_body",
869 "at_first_executable_stmt", "function_body1", "arguments_block",
870 "arguments_beg", "args_attr_list", "args_validation_list", "arg_name",
871 "arg_validation", "size_spec", "class_name", "validation_fcns",
872 "default_value", "classdef_beg", "classdef", "attr_list", "attr_list1",
873 "attr", "superclass_list", "superclass_list1", "superclass",
874 "class_body", "class_body1", "properties_block", "properties_beg",
875 "property_list", "property_list1", "class_property", "methods_block",
876 "methods_beg", "method_decl1", "method_decl", "$@1", "method",
877 "methods_list", "methods_list1", "events_block", "events_beg",
878 "events_list", "events_list1", "class_event", "enum_block",
879 "enumeration_beg", "enum_list", "enum_list1", "class_enum", "stmt_begin",
880 "anon_fcn_begin", "stash_comment", "parse_error", "sep_no_nl",
881 "opt_sep_no_nl", "opt_nl", "nl", "sep", "opt_sep", YY_NULLPTR
882};
883
884static const char *
885yysymbol_name (yysymbol_kind_t yysymbol)
886{
887 return yytname[yysymbol];
888}
889#endif
890
891#define YYPACT_NINF (-464)
892
893#define yypact_value_is_default(Yyn) \
894 ((Yyn) == YYPACT_NINF)
895
896#define YYTABLE_NINF (-313)
897
898#define yytable_value_is_error(Yyn) \
899 0
900
901/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
902 STATE-NUM. */
903static const yytype_int16 yypact[] =
904{
905 792, -464, 662, 662, 1386, 1220, 1220, 52, -464, -464,
906 662, 662, 662, -464, -464, -464, -464, -464, -464, -464,
907 -464, -464, -464, -464, -464, -464, -464, -464, -464, 28,
908 28, -464, -464, -464, -464, 38, -5, 113, -464, -464,
909 163, -464, -464, -464, -464, -464, -464, -464, -464, -464,
910 612, -464, 1567, 459, -464, -464, -464, -464, -464, -464,
911 -464, -464, -464, -464, -464, 30, 66, 151, -464, -464,
912 -464, -464, 210, -464, -464, 192, 192, 188, -464, 1329,
913 662, 91, -464, -464, -464, 167, -464, 134, -464, -464,
914 27, -464, 192, 192, 192, 1303, 1401, 1386, 185, 185,
915 1386, 1386, 185, 185, 197, 28, -464, 28, -464, -464,
916 -464, 966, -464, 163, -464, 662, 662, 662, 662, 662,
917 542, 720, -464, 662, 662, 662, 662, -464, -464, -464,
918 -464, 1412, 1412, 4, 662, 662, 662, 662, 662, 662,
919 662, 662, 662, 662, 1386, 1386, 1386, 1386, 1386, 1386,
920 1386, 1386, 1386, 1386, 1386, 1386, 1386, -464, -464, -464,
921 1049, 187, -3, -464, -464, -464, 201, -464, 1220, 1329,
922 -464, 1220, -464, -464, -464, -464, 213, 215, -464, 286,
923 1386, 220, 243, 1386, 260, -464, -464, -464, -464, 218,
924 1132, 1132, -464, 209, 182, 185, 1132, 1132, 1386, -464,
925 -464, -464, 1470, 1534, 1534, 192, 192, -464, 55, -464,
926 136, 192, 192, 192, 192, 1412, 1412, 1412, 1412, 1412,
927 -464, 44, 44, 1386, -464, 174, 141, 266, 323, -464,
928 -464, -464, -464, -464, -464, -464, -464, -464, -464, -464,
929 -464, -464, -464, -464, -464, -464, -464, -464, -464, 172,
930 -464, 185, -464, -464, -464, -464, 15, 253, 254, 279,
931 285, 52, 1329, -464, -464, -464, -464, -464, -464, -464,
932 24, -464, -464, 887, 1386, 900, 1386, 185, -464, -464,
933 -464, 226, 227, 185, -464, -464, -464, -464, -464, 181,
934 219, 11, -464, 662, -464, 1329, -464, 44, 44, 44,
935 44, 44, 1235, 1314, -464, -464, 8, 283, -464, 883,
936 -464, 281, 185, -464, -464, 117, 28, 28, -13, 185,
937 -464, -464, 1386, -464, 1386, -464, 1132, 1386, -464, 1132,
938 185, 185, -464, -464, 240, 181, -464, -464, -464, -464,
939 -464, 1488, -464, 61, -464, 154, 1386, -464, -464, -464,
940 45, 28, 222, -464, 28, -464, -464, -464, 52, 223,
941 291, 185, 293, 185, 255, -464, -464, 1386, 1132, 185,
942 185, -464, -464, -464, 185, 185, -464, -464, 309, 28,
943 317, 98, -464, 185, 229, -464, 185, -464, -464, 185,
944 -464, -21, 1132, 185, -464, -464, 185, 1132, 1386, 1132,
945 -464, -464, -464, 1386, 1132, 1132, 1132, -464, -464, 1386,
946 185, 45, 284, -464, 222, 223, -464, -464, -464, -464,
947 223, 185, 1132, 268, 315, 271, 185, -464, -464, 272,
948 274, -464, -464, -464, 244, 73, 32, -464, -21, 1132,
949 -464, 322, 277, -464, 185, -464, 1132, 185, -464, -464,
950 -464, -464, -464, -464, -464, -464, 278, 185, -464, -464,
951 -464, -464, -464, -464, -464, -464, 244, -464, -464, -464,
952 28, 28, -464, 1132, -464, 1132, -464, 73, 185, 185,
953 185, 185, -464, 327, -464, 185, 329, 289, -464, -464,
954 -464, -464, -464, 281, 281, 281, 281, -464, 37, 290,
955 1329, -464, 28, -464, 287, -17, 287, 287, 329, -464,
956 132, -464, 334, 292, 185, -464, 28, -464, -464, -464,
957 296, 185, 9, 297, 185, -464, 28, 299, 185, -464,
958 28, -464, -464, 1329, 337, -464, 29, -464, 329, -464,
959 13, 103, 346, -464, -464, 287, -464, -464, 287, 347,
960 178, 1386, -464, -464, -464, -464, -464, -464, -464, -464,
961 1386, -464, -464, 28, 357, 52, -464, -464
962};
963
964/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
965 Performed when YYTABLE does not specify something else to do. Zero
966 means the default is an error. */
967static const yytype_int16 yydefact[] =
968{
969 0, 294, 0, 0, 0, 38, 38, 0, 295, 296,
970 0, 0, 0, 30, 25, 28, 29, 292, 292, 292,
971 292, 292, 292, 292, 173, 174, 175, 292, 292, 0,
972 0, 44, 27, 26, 293, 0, 0, 299, 7, 21,
973 47, 53, 52, 31, 48, 50, 51, 49, 134, 64,
974 106, 107, 132, 0, 133, 19, 20, 135, 136, 149,
975 150, 137, 138, 139, 140, 0, 0, 301, 142, 292,
976 141, 4, 300, 5, 47, 79, 78, 0, 55, 39,
977 56, 0, 33, 58, 59, 40, 57, 0, 36, 181,
978 0, 291, 77, 75, 76, 0, 0, 0, 311, 311,
979 0, 0, 311, 311, 147, 143, 145, 144, 1, 2,
980 3, 300, 6, 22, 23, 0, 0, 0, 0, 0,
981 0, 0, 63, 0, 0, 0, 0, 71, 72, 65,
982 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
983 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
984 0, 0, 0, 0, 0, 0, 0, 203, 200, 303,
985 9, 302, 0, 297, 298, 54, 42, 32, 38, 41,
986 35, 38, 186, 56, 192, 191, 0, 188, 189, 0,
987 0, 118, 0, 0, 0, 290, 305, 306, 307, 312,
988 9, 9, 290, 0, 152, 311, 9, 9, 0, 146,
989 8, 24, 104, 83, 82, 84, 85, 67, 0, 69,
990 0, 88, 86, 87, 89, 0, 0, 0, 0, 0,
991 90, 80, 81, 0, 73, 116, 117, 114, 115, 108,
992 109, 110, 113, 111, 112, 119, 120, 121, 122, 123,
993 124, 125, 126, 127, 128, 129, 130, 131, 232, 0,
994 10, 311, 12, 292, 198, 304, 0, 0, 0, 204,
995 0, 183, 43, 34, 60, 61, 62, 37, 182, 185,
996 0, 46, 45, 0, 0, 0, 0, 311, 308, 309,
997 310, 0, 0, 311, 151, 292, 292, 155, 153, 159,
998 0, 0, 148, 0, 68, 0, 70, 103, 102, 101,
999 99, 100, 0, 0, 91, 92, 0, 0, 201, 312,
1000 11, 234, 311, 193, 196, 0, 0, 0, 0, 311,
1001 184, 190, 0, 290, 0, 290, 9, 0, 176, 9,
1002 311, 311, 292, 292, 0, 161, 163, 160, 292, 179,
1003 292, 105, 93, 0, 95, 0, 0, 97, 74, 13,
1004 0, 0, 14, 195, 0, 205, 206, 204, 183, 213,
1005 0, 311, 119, 311, 0, 168, 154, 0, 9, 311,
1006 311, 158, 164, 162, 311, 311, 94, 96, 0, 0,
1007 238, 0, 236, 311, 0, 15, 311, 17, 197, 311,
1008 217, 0, 9, 311, 214, 292, 311, 9, 0, 9,
1009 167, 290, 157, 0, 9, 9, 9, 98, 240, 0,
1010 311, 0, 241, 202, 16, 213, 207, 208, 209, 211,
1011 213, 311, 9, 0, 0, 0, 311, 290, 166, 0,
1012 0, 239, 235, 237, 0, 246, 311, 18, 0, 9,
1013 215, 218, 0, 169, 311, 171, 9, 311, 177, 178,
1014 245, 243, 257, 264, 277, 284, 0, 311, 248, 292,
1015 249, 292, 250, 292, 251, 292, 0, 242, 210, 212,
1016 0, 0, 170, 9, 156, 9, 233, 247, 311, 311,
1017 311, 311, 244, 0, 222, 311, 224, 0, 165, 252,
1018 253, 254, 255, 234, 234, 234, 234, 219, 312, 0,
1019 0, 220, 226, 172, 258, 292, 278, 285, 224, 216,
1020 0, 227, 228, 0, 311, 260, 0, 271, 270, 274,
1021 0, 311, 0, 0, 311, 280, 0, 0, 311, 287,
1022 0, 221, 225, 0, 230, 256, 292, 259, 224, 263,
1023 292, 265, 0, 267, 276, 279, 282, 283, 286, 0,
1024 0, 0, 223, 261, 262, 275, 266, 268, 281, 288,
1025 0, 229, 231, 0, 0, 265, 269, 289
1026};
1027
1028/* YYPGOTO[NTERM-NUM]. */
1029static const yytype_int16 yypgoto[] =
1030{
1031 -464, -464, -464, -464, -175, -464, -464, -464, -464, -464,
1032 3, -464, -464, 0, -464, -464, -22, -464, -464, -464,
1033 -464, -464, 1, -464, -464, -120, -160, -85, -77, -181,
1034 21, -52, -464, 138, -70, -464, 280, -464, -464, 339,
1035 -71, -464, -464, -464, -464, -464, -464, -464, -464, -464,
1036 35, 36, -464, -464, -464, -464, -464, -464, -464, 16,
1037 -6, -464, -464, 106, -147, -464, -464, -464, -464, -464,
1038 -464, 60, -56, -346, -32, -36, -464, -35, -464, -464,
1039 -464, -112, -463, -464, -464, -464, -464, -464, -464, -307,
1040 -464, -24, -464, -464, -78, -464, -464, -88, -464, -464,
1041 -464, -143, -83, -464, -168, -464, -464, -144, -464, -464,
1042 -79, -464, -464, -464, -142, -75, -464, -464, -464, -141,
1043 -182, -464, 105, -464, 371, 372, -464, -464, -247, 311
1044};
1045
1046/* YYDEFGOTO[NTERM-NUM]. */
1047static const yytype_int16 yydefgoto[] =
1048{
1049 0, 35, 36, 37, 249, 250, 251, 384, 385, 386,
1050 252, 39, 113, 74, 41, 42, 43, 44, 45, 81,
1051 46, 87, 82, 47, 48, 49, 83, 84, 85, 133,
1052 50, 221, 51, 52, 53, 54, 55, 56, 57, 105,
1053 106, 58, 59, 193, 194, 287, 288, 60, 334, 335,
1054 336, 337, 61, 62, 63, 64, 65, 90, 269, 319,
1055 320, 176, 177, 178, 260, 315, 312, 66, 67, 68,
1056 69, 261, 418, 70, 391, 392, 393, 394, 395, 471,
1057 485, 486, 501, 502, 512, 534, 552, 253, 254, 351,
1058 381, 382, 435, 436, 451, 456, 457, 458, 459, 513,
1059 514, 515, 460, 461, 543, 518, 563, 519, 520, 521,
1060 462, 463, 523, 524, 525, 464, 465, 527, 528, 529,
1061 277, 179, 516, 71, 72, 73, 160, 161, 189, 190
1062};
1063
1064/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1065 positive, shift that token. If negative, reduce the rule whose
1066 number is the opposite. If YYTABLE_NINF, syntax error. */
1067static const yytype_int16 yytable[] =
1068{
1069 40, 91, 166, 38, 309, 174, 387, 88, 256, 264,
1070 283, 220, 220, 223, 109, 281, 282, 346, 114, 175,
1071 256, 290, 291, 75, 76, 182, 184, 313, 172, 104,
1072 104, 92, 93, 94, 199, 416, 199, -187, 108, -272,
1073 306, 306, 14, 208, 210, 531, 278, 279, 280, 186,
1074 187, 188, 14, 302, 278, 279, 280, 303, 224, 122,
1075 173, 89, 347, 173, 14, 294, 466, 339, 437, -273,
1076 14, 376, 295, 417, -180, 554, 257, 258, 295, 14,
1077 222, 379, 14, 14, 265, -312, 257, 258, 340, 110,
1078 104, 201, 14, 304, 305, 220, 220, 220, 220, 220,
1079 14, 92, 264, 167, -180, 104, -194, 104, 410, 168,
1080 273, 40, 89, 275, 200, 411, 306, 306, 306, 306,
1081 306, 157, 95, 96, 97, 98, 99, 100, 101, 353,
1082 8, 9, 102, 103, 354, 264, 202, 203, 204, 205,
1083 206, 361, 532, 363, 211, 212, 213, 214, 170, 295,
1084 296, 364, 171, 295, 366, 452, 453, 454, 455, 517,
1085 40, 158, 259, 297, 298, 299, 300, 301, 377, 263,
1086 159, 295, 267, 134, 162, 136, 137, 265, 138, 139,
1087 140, 141, 142, 143, 169, 174, 504, 505, 506, 507,
1088 40, 40, 561, 402, 517, 295, 40, 40, 165, 175,
1089 198, 120, 186, 187, 188, 121, 255, 122, 136, 137,
1090 265, 138, 139, 140, 141, 142, 143, 419, 262, 426,
1091 15, 16, 423, 268, 425, 343, 345, 163, 164, 428,
1092 429, 430, 270, 181, 181, 278, 279, 280, 498, 127,
1093 128, 129, 130, 131, 132, 447, 274, 442, 285, 286,
1094 332, 333, 134, 135, 136, 137, 314, 138, 139, 140,
1095 141, 142, 143, 276, 469, 284, 308, 536, 316, 317,
1096 104, 474, 225, 226, 227, 228, 229, 230, 231, 232,
1097 233, 234, -194, 328, 77, 86, 86, 271, 318, 327,
1098 350, 2, 3, 348, 338, 4, 371, 5, 487, 6,
1099 488, 396, 7, 138, 139, 140, 141, 142, 143, 40,
1100 398, 400, 349, -180, 341, 390, 355, 356, 357, 407,
1101 409, 434, 10, 413, 443, 444, 40, 445, 448, 40,
1102 449, 470, 450, 472, 476, 11, 12, 497, 500, 13,
1103 551, 14, -292, 15, 16, 503, 509, 533, 535, 557,
1104 380, 383, 539, 544, 388, 547, 560, 136, 311, 86,
1105 138, 139, 140, 141, 142, 143, 31, 567, 40, 107,
1106 372, 373, 32, 33, 389, 542, 321, 185, 358, 408,
1107 192, 195, 468, 438, 439, 440, 508, 433, 482, 489,
1108 330, 331, 40, 553, 490, 566, 555, 40, 491, 40,
1109 86, 86, 492, 558, 40, 40, 40, 559, 111, 112,
1110 191, 380, 0, 196, 197, 0, 0, 0, 0, 0,
1111 0, 0, 40, 510, 235, 236, 237, 238, 239, 240,
1112 241, 242, 243, 244, 245, 246, 247, 369, 370, 40,
1113 0, 0, 0, 374, 0, 375, 40, 0, 86, 266,
1114 0, 86, 0, 0, 0, 0, 550, 0, 0, 272,
1115 77, 0, 144, 77, 0, 0, 0, 0, 0, 0,
1116 483, 484, 0, 40, 0, 40, 0, 0, 292, 145,
1117 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
1118 156, 0, 0, 0, 0, 0, 0, 0, 484, 0,
1119 421, 0, 511, 307, 0, 0, 289, 0, 0, 0,
1120 0, 0, 0, 0, 0, 0, 538, 0, 0, 0,
1121 0, 0, 541, 0, 0, 0, 546, 0, 0, 0,
1122 549, 0, 0, 0, 0, 556, 0, 0, 0, 0,
1123 0, 0, 266, 0, 0, 0, 78, 2, 3, 0,
1124 0, 4, 207, 5, 323, 6, 325, 0, 7, 556,
1125 0, 0, 310, 565, 478, 0, 479, 0, 480, 0,
1126 481, 0, 0, 0, 0, 266, 0, 0, 80, 0,
1127 0, 0, 86, 86, 0, 0, 0, 0, 326, 0,
1128 0, 11, 12, 0, 329, 13, 0, 14, 0, 15,
1129 16, 0, 360, 0, 362, 0, 0, 365, 0, 0,
1130 522, 526, 530, 0, 0, 0, 115, 116, 117, 118,
1131 119, 120, 31, 352, 0, 121, 378, 122, 32, 33,
1132 359, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1133 0, 367, 368, 0, 0, 522, 0, 401, 0, 0,
1134 526, 0, 0, 530, 0, 123, 124, 125, 126, 127,
1135 128, 129, 130, 131, 132, 0, 0, 2, 3, 0,
1136 0, 4, 397, 5, 399, 6, 0, 0, 424, 0,
1137 403, 404, 0, 427, 0, 405, 406, 0, 0, 431,
1138 0, 0, 0, 0, 412, 0, 0, 414, 10, 0,
1139 415, 0, 0, 0, 420, 0, 0, 422, 0, 0,
1140 0, 11, 12, 0, 0, 13, 0, 14, 0, 15,
1141 16, 432, 0, 0, 78, 2, 3, 0, 0, 4,
1142 0, 5, 441, 6, 209, 0, 7, 446, 0, 0,
1143 0, 0, 31, 0, 0, 0, 0, 467, 32, 33,
1144 0, 0, 0, 0, 0, 473, 80, 0, 475, 0,
1145 0, 0, 0, 0, 0, 0, 0, 0, 477, 11,
1146 12, 0, 0, 13, 0, 14, 0, 15, 16, 0,
1147 86, 0, 0, 0, 0, 0, 0, 0, 0, 493,
1148 494, 495, 496, 1, 0, 0, 499, 2, 3, 0,
1149 31, 4, 0, 5, 0, 6, 32, 33, 7, 8,
1150 9, -299, 0, 86, 0, 0, 0, 0, 0, 0,
1151 0, 0, 0, 0, 0, 537, 0, 0, 10, 0,
1152 0, 562, 540, 0, 0, 545, 0, 0, 0, 548,
1153 564, 11, 12, 0, 0, 13, 0, 14, 0, 15,
1154 16, 17, 18, 19, 20, 0, 21, 22, 0, 0,
1155 23, 0, 0, 24, 25, 26, 27, 0, 28, 0,
1156 29, 30, 31, 0, 0, 0, 0, 0, 32, 33,
1157 0, 0, 0, -180, 0, 34, -299, -199, 2, 3,
1158 322, 0, 4, 0, 5, 0, 6, 0, 0, 7,
1159 278, 279, 280, 324, 0, 0, 0, 145, 146, 147,
1160 148, 149, 150, 151, 152, 153, 154, 155, 156, 10,
1161 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1162 155, 156, 11, 12, 0, 0, 13, 0, 14, 0,
1163 15, 16, 17, 18, 19, 20, 0, 21, 22, 0,
1164 0, 23, 0, 0, 24, 25, 26, 27, 0, 28,
1165 0, 29, 30, 31, 0, 0, 0, 0, 0, 32,
1166 33, 2, 3, 0, -180, 4, 0, 5, -199, 6,
1167 0, 0, 7, 163, 164, 0, 0, 0, 0, 0,
1168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1169 0, 0, 10, 0, 0, 0, 0, 0, 0, 0,
1170 0, 0, 0, 0, 0, 11, 12, 0, 0, 13,
1171 0, 14, 0, 15, 16, 17, 18, 19, 20, 0,
1172 21, 22, 0, 0, 23, 0, 0, 24, 25, 26,
1173 27, 0, 28, 0, 29, 30, 31, 0, 0, 0,
1174 0, 0, 32, 33, 2, 3, 0, -180, 4, 0,
1175 5, -199, 6, 0, 0, 7, 0, 0, 0, 0,
1176 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1177 0, 0, 0, 0, 0, 10, 0, 0, 0, 0,
1178 0, 0, 0, 0, 0, 0, 0, 0, 11, 12,
1179 0, 0, 13, 0, 14, 0, 15, 16, 17, 18,
1180 19, 20, 0, 21, 22, 0, 0, 23, 0, 0,
1181 24, 25, 26, 27, 0, 28, 0, 29, 30, 31,
1182 248, 0, 0, 0, 0, 32, 33, 2, 3, 0,
1183 -180, 4, 0, 5, -199, 6, 0, 0, 7, 0,
1184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1185 0, 0, 0, 0, 0, 0, 0, 0, 10, 0,
1186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1187 0, 11, 12, 0, 0, 13, 0, 14, 0, 15,
1188 16, 17, 18, 19, 20, 0, 21, 22, 0, 0,
1189 23, 0, 0, 24, 25, 26, 27, 0, 28, 0,
1190 29, 30, 31, 0, 0, 0, 0, 0, 32, 33,
1191 0, 0, 0, -180, 78, 2, 3, -199, 0, 4,
1192 0, 5, 0, 6, 0, 0, 7, 79, 0, 78,
1193 2, 3, 0, 0, 4, 342, 5, 0, 6, 0,
1194 0, 7, 0, 0, 0, 0, 80, 0, 0, 0,
1195 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1196 12, 80, 0, 13, 0, 14, 0, 15, 16, 0,
1197 0, 0, 0, 0, 11, 12, 0, 0, 13, 0,
1198 14, 0, 15, 16, 0, 0, 0, 0, 0, 0,
1199 31, 0, 0, 0, 0, 0, 32, 33, 2, 3,
1200 0, 0, 180, 0, 5, 31, 6, 0, 78, 2,
1201 3, 32, 33, 4, 0, 5, 0, 6, 344, 0,
1202 7, 0, 0, 78, 2, 3, 0, 0, 4, 10,
1203 5, 0, 6, 0, 0, 7, 0, 0, 0, 0,
1204 80, 0, 11, 12, 0, 0, 13, 0, 14, 0,
1205 15, 16, 0, 11, 12, 80, 0, 13, 0, 14,
1206 0, 15, 16, 0, 0, 0, 0, 0, 11, 12,
1207 0, 0, 13, 31, 14, 0, 15, 16, 0, 32,
1208 33, 2, 3, 0, 31, 4, 0, 5, 0, 6,
1209 32, 33, 7, 0, 0, 0, 2, 3, 0, 31,
1210 183, 0, 5, 0, 6, 32, 33, 215, 216, 0,
1211 0, 4, 10, 5, 0, 6, 0, 0, 0, 0,
1212 0, 0, 0, 0, 0, 11, 12, 10, 0, 13,
1213 0, 14, 0, 15, 16, 0, 0, 0, 217, 0,
1214 11, 12, 0, 0, 13, 0, 14, 0, 15, 16,
1215 0, 218, 219, 0, 0, 13, 31, 14, 0, 15,
1216 16, 0, 32, 33, 293, 116, 117, 118, 119, 120,
1217 0, 31, 0, 121, 0, 122, 0, 32, 33, 0,
1218 0, 0, 31, 116, 117, 118, 119, 120, 32, 33,
1219 0, 121, 0, 122, 0, 0, 0, 0, 0, 0,
1220 0, 0, 0, 123, 124, 125, 126, 127, 128, 129,
1221 130, 131, 132, 0, 0, 0, 0, 0, 0, 0,
1222 0, 123, 124, 125, 126, 127, 128, 129, 130, 131,
1223 132, 118, 119, 120, 0, 0, 0, 121, 0, 122,
1224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1225 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1226 -118, 0, 0, 0, 0, 0, 0, 123, 124, 125,
1227 126, 127, 128, 129, 130, 131, 132, -118, -118, -118,
1228 -118, -118, -118, -118, -118, -118, -118, -118, -118, 134,
1229 135, 136, 137, 0, 138, 139, 140, 141, 142, 143
1230};
1231
1232static const yytype_int16 yycheck[] =
1233{
1234 0, 7, 79, 0, 251, 90, 352, 6, 11, 169,
1235 192, 131, 132, 9, 19, 190, 191, 9, 40, 90,
1236 11, 196, 197, 2, 3, 95, 96, 12, 1, 29,
1237 30, 10, 11, 12, 105, 56, 107, 10, 0, 56,
1238 221, 222, 55, 120, 121, 508, 17, 18, 19, 17,
1239 18, 19, 55, 9, 17, 18, 19, 13, 54, 15,
1240 36, 9, 54, 36, 55, 10, 34, 56, 414, 56,
1241 55, 10, 17, 94, 91, 538, 89, 90, 17, 55,
1242 132, 36, 55, 55, 169, 56, 89, 90, 77, 94,
1243 90, 113, 55, 49, 50, 215, 216, 217, 218, 219,
1244 55, 80, 262, 12, 91, 105, 3, 107, 10, 18,
1245 180, 111, 9, 183, 111, 17, 297, 298, 299, 300,
1246 301, 91, 17, 18, 19, 20, 21, 22, 23, 12,
1247 17, 18, 27, 28, 17, 295, 115, 116, 117, 118,
1248 119, 323, 10, 325, 123, 124, 125, 126, 14, 17,
1249 14, 326, 18, 17, 329, 82, 83, 84, 85, 505,
1250 160, 95, 162, 215, 216, 217, 218, 219, 14, 168,
1251 19, 17, 171, 32, 69, 34, 35, 262, 37, 38,
1252 39, 40, 41, 42, 17, 270, 493, 494, 495, 496,
1253 190, 191, 14, 368, 540, 17, 196, 197, 10, 270,
1254 3, 9, 17, 18, 19, 13, 19, 15, 34, 35,
1255 295, 37, 38, 39, 40, 41, 42, 392, 17, 401,
1256 57, 58, 397, 10, 399, 302, 303, 17, 18, 404,
1257 405, 406, 17, 95, 96, 17, 18, 19, 485, 47,
1258 48, 49, 50, 51, 52, 427, 3, 422, 66, 67,
1259 69, 70, 32, 33, 34, 35, 256, 37, 38, 39,
1260 40, 41, 42, 3, 439, 56, 94, 514, 15, 15,
1261 270, 446, 134, 135, 136, 137, 138, 139, 140, 141,
1262 142, 143, 3, 56, 4, 5, 6, 1, 3, 63,
1263 9, 5, 6, 10, 75, 9, 56, 11, 473, 13,
1264 475, 10, 16, 37, 38, 39, 40, 41, 42, 309,
1265 17, 56, 309, 91, 293, 92, 316, 317, 318, 10,
1266 3, 37, 36, 94, 56, 10, 326, 56, 56, 329,
1267 56, 9, 88, 56, 56, 49, 50, 10, 9, 53,
1268 3, 55, 55, 57, 58, 56, 56, 13, 56, 3,
1269 350, 351, 56, 56, 354, 56, 9, 34, 253, 79,
1270 37, 38, 39, 40, 41, 42, 80, 10, 368, 30,
1271 335, 335, 86, 87, 358, 522, 270, 97, 318, 379,
1272 100, 101, 438, 415, 420, 420, 498, 411, 466, 477,
1273 285, 286, 392, 536, 477, 563, 540, 397, 477, 399,
1274 120, 121, 477, 545, 404, 405, 406, 548, 37, 37,
1275 99, 411, -1, 102, 103, -1, -1, -1, -1, -1,
1276 -1, -1, 422, 500, 144, 145, 146, 147, 148, 149,
1277 150, 151, 152, 153, 154, 155, 156, 332, 333, 439,
1278 -1, -1, -1, 338, -1, 340, 446, -1, 168, 169,
1279 -1, 171, -1, -1, -1, -1, 533, -1, -1, 179,
1280 180, -1, 3, 183, -1, -1, -1, -1, -1, -1,
1281 470, 471, -1, 473, -1, 475, -1, -1, 198, 20,
1282 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1283 31, -1, -1, -1, -1, -1, -1, -1, 498, -1,
1284 395, -1, 502, 223, -1, -1, 195, -1, -1, -1,
1285 -1, -1, -1, -1, -1, -1, 516, -1, -1, -1,
1286 -1, -1, 522, -1, -1, -1, 526, -1, -1, -1,
1287 530, -1, -1, -1, -1, 541, -1, -1, -1, -1,
1288 -1, -1, 262, -1, -1, -1, 4, 5, 6, -1,
1289 -1, 9, 10, 11, 274, 13, 276, -1, 16, 565,
1290 -1, -1, 251, 563, 459, -1, 461, -1, 463, -1,
1291 465, -1, -1, -1, -1, 295, -1, -1, 36, -1,
1292 -1, -1, 302, 303, -1, -1, -1, -1, 277, -1,
1293 -1, 49, 50, -1, 283, 53, -1, 55, -1, 57,
1294 58, -1, 322, -1, 324, -1, -1, 327, -1, -1,
1295 505, 506, 507, -1, -1, -1, 4, 5, 6, 7,
1296 8, 9, 80, 312, -1, 13, 346, 15, 86, 87,
1297 319, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1298 -1, 330, 331, -1, -1, 540, -1, 367, -1, -1,
1299 545, -1, -1, 548, -1, 43, 44, 45, 46, 47,
1300 48, 49, 50, 51, 52, -1, -1, 5, 6, -1,
1301 -1, 9, 361, 11, 363, 13, -1, -1, 398, -1,
1302 369, 370, -1, 403, -1, 374, 375, -1, -1, 409,
1303 -1, -1, -1, -1, 383, -1, -1, 386, 36, -1,
1304 389, -1, -1, -1, 393, -1, -1, 396, -1, -1,
1305 -1, 49, 50, -1, -1, 53, -1, 55, -1, 57,
1306 58, 410, -1, -1, 4, 5, 6, -1, -1, 9,
1307 -1, 11, 421, 13, 14, -1, 16, 426, -1, -1,
1308 -1, -1, 80, -1, -1, -1, -1, 436, 86, 87,
1309 -1, -1, -1, -1, -1, 444, 36, -1, 447, -1,
1310 -1, -1, -1, -1, -1, -1, -1, -1, 457, 49,
1311 50, -1, -1, 53, -1, 55, -1, 57, 58, -1,
1312 500, -1, -1, -1, -1, -1, -1, -1, -1, 478,
1313 479, 480, 481, 1, -1, -1, 485, 5, 6, -1,
1314 80, 9, -1, 11, -1, 13, 86, 87, 16, 17,
1315 18, 19, -1, 533, -1, -1, -1, -1, -1, -1,
1316 -1, -1, -1, -1, -1, 514, -1, -1, 36, -1,
1317 -1, 551, 521, -1, -1, 524, -1, -1, -1, 528,
1318 560, 49, 50, -1, -1, 53, -1, 55, -1, 57,
1319 58, 59, 60, 61, 62, -1, 64, 65, -1, -1,
1320 68, -1, -1, 71, 72, 73, 74, -1, 76, -1,
1321 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
1322 -1, -1, -1, 91, -1, 93, 94, 95, 5, 6,
1323 3, -1, 9, -1, 11, -1, 13, -1, -1, 16,
1324 17, 18, 19, 3, -1, -1, -1, 20, 21, 22,
1325 23, 24, 25, 26, 27, 28, 29, 30, 31, 36,
1326 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1327 30, 31, 49, 50, -1, -1, 53, -1, 55, -1,
1328 57, 58, 59, 60, 61, 62, -1, 64, 65, -1,
1329 -1, 68, -1, -1, 71, 72, 73, 74, -1, 76,
1330 -1, 78, 79, 80, -1, -1, -1, -1, -1, 86,
1331 87, 5, 6, -1, 91, 9, -1, 11, 95, 13,
1332 -1, -1, 16, 17, 18, -1, -1, -1, -1, -1,
1333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1334 -1, -1, 36, -1, -1, -1, -1, -1, -1, -1,
1335 -1, -1, -1, -1, -1, 49, 50, -1, -1, 53,
1336 -1, 55, -1, 57, 58, 59, 60, 61, 62, -1,
1337 64, 65, -1, -1, 68, -1, -1, 71, 72, 73,
1338 74, -1, 76, -1, 78, 79, 80, -1, -1, -1,
1339 -1, -1, 86, 87, 5, 6, -1, 91, 9, -1,
1340 11, 95, 13, -1, -1, 16, -1, -1, -1, -1,
1341 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1342 -1, -1, -1, -1, -1, 36, -1, -1, -1, -1,
1343 -1, -1, -1, -1, -1, -1, -1, -1, 49, 50,
1344 -1, -1, 53, -1, 55, -1, 57, 58, 59, 60,
1345 61, 62, -1, 64, 65, -1, -1, 68, -1, -1,
1346 71, 72, 73, 74, -1, 76, -1, 78, 79, 80,
1347 81, -1, -1, -1, -1, 86, 87, 5, 6, -1,
1348 91, 9, -1, 11, 95, 13, -1, -1, 16, -1,
1349 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1350 -1, -1, -1, -1, -1, -1, -1, -1, 36, -1,
1351 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1352 -1, 49, 50, -1, -1, 53, -1, 55, -1, 57,
1353 58, 59, 60, 61, 62, -1, 64, 65, -1, -1,
1354 68, -1, -1, 71, 72, 73, 74, -1, 76, -1,
1355 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
1356 -1, -1, -1, 91, 4, 5, 6, 95, -1, 9,
1357 -1, 11, -1, 13, -1, -1, 16, 17, -1, 4,
1358 5, 6, -1, -1, 9, 10, 11, -1, 13, -1,
1359 -1, 16, -1, -1, -1, -1, 36, -1, -1, -1,
1360 -1, -1, -1, -1, -1, -1, -1, -1, -1, 49,
1361 50, 36, -1, 53, -1, 55, -1, 57, 58, -1,
1362 -1, -1, -1, -1, 49, 50, -1, -1, 53, -1,
1363 55, -1, 57, 58, -1, -1, -1, -1, -1, -1,
1364 80, -1, -1, -1, -1, -1, 86, 87, 5, 6,
1365 -1, -1, 9, -1, 11, 80, 13, -1, 4, 5,
1366 6, 86, 87, 9, -1, 11, -1, 13, 14, -1,
1367 16, -1, -1, 4, 5, 6, -1, -1, 9, 36,
1368 11, -1, 13, -1, -1, 16, -1, -1, -1, -1,
1369 36, -1, 49, 50, -1, -1, 53, -1, 55, -1,
1370 57, 58, -1, 49, 50, 36, -1, 53, -1, 55,
1371 -1, 57, 58, -1, -1, -1, -1, -1, 49, 50,
1372 -1, -1, 53, 80, 55, -1, 57, 58, -1, 86,
1373 87, 5, 6, -1, 80, 9, -1, 11, -1, 13,
1374 86, 87, 16, -1, -1, -1, 5, 6, -1, 80,
1375 9, -1, 11, -1, 13, 86, 87, 5, 6, -1,
1376 -1, 9, 36, 11, -1, 13, -1, -1, -1, -1,
1377 -1, -1, -1, -1, -1, 49, 50, 36, -1, 53,
1378 -1, 55, -1, 57, 58, -1, -1, -1, 36, -1,
1379 49, 50, -1, -1, 53, -1, 55, -1, 57, 58,
1380 -1, 49, 50, -1, -1, 53, 80, 55, -1, 57,
1381 58, -1, 86, 87, 4, 5, 6, 7, 8, 9,
1382 -1, 80, -1, 13, -1, 15, -1, 86, 87, -1,
1383 -1, -1, 80, 5, 6, 7, 8, 9, 86, 87,
1384 -1, 13, -1, 15, -1, -1, -1, -1, -1, -1,
1385 -1, -1, -1, 43, 44, 45, 46, 47, 48, 49,
1386 50, 51, 52, -1, -1, -1, -1, -1, -1, -1,
1387 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1388 52, 7, 8, 9, -1, -1, -1, 13, -1, 15,
1389 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1390 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1391 3, -1, -1, -1, -1, -1, -1, 43, 44, 45,
1392 46, 47, 48, 49, 50, 51, 52, 20, 21, 22,
1393 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1394 33, 34, 35, -1, 37, 38, 39, 40, 41, 42
1395};
1396
1397/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1398 state STATE-NUM. */
1399static const yytype_uint8 yystos[] =
1400{
1401 0, 1, 5, 6, 9, 11, 13, 16, 17, 18,
1402 36, 49, 50, 53, 55, 57, 58, 59, 60, 61,
1403 62, 64, 65, 68, 71, 72, 73, 74, 76, 78,
1404 79, 80, 86, 87, 93, 98, 99, 100, 107, 108,
1405 110, 111, 112, 113, 114, 115, 117, 120, 121, 122,
1406 127, 129, 130, 131, 132, 133, 134, 135, 138, 139,
1407 144, 149, 150, 151, 152, 153, 164, 165, 166, 167,
1408 170, 220, 221, 222, 110, 127, 127, 133, 4, 17,
1409 36, 116, 119, 123, 124, 125, 133, 118, 119, 9,
1410 154, 157, 127, 127, 127, 219, 219, 219, 219, 219,
1411 219, 219, 219, 219, 110, 136, 137, 136, 0, 19,
1412 94, 221, 222, 109, 113, 4, 5, 6, 7, 8,
1413 9, 13, 15, 43, 44, 45, 46, 47, 48, 49,
1414 50, 51, 52, 126, 32, 33, 34, 35, 37, 38,
1415 39, 40, 41, 42, 3, 20, 21, 22, 23, 24,
1416 25, 26, 27, 28, 29, 30, 31, 91, 95, 19,
1417 223, 224, 219, 17, 18, 10, 125, 12, 18, 17,
1418 14, 18, 1, 36, 124, 137, 158, 159, 160, 218,
1419 9, 130, 131, 9, 131, 133, 17, 18, 19, 225,
1420 226, 226, 133, 140, 141, 133, 226, 226, 3, 137,
1421 107, 113, 127, 127, 127, 127, 127, 10, 125, 14,
1422 125, 127, 127, 127, 127, 5, 6, 36, 49, 50,
1423 122, 128, 128, 9, 54, 130, 130, 130, 130, 130,
1424 130, 130, 130, 130, 130, 133, 133, 133, 133, 133,
1425 133, 133, 133, 133, 133, 133, 133, 133, 81, 101,
1426 102, 103, 107, 184, 185, 19, 11, 89, 90, 110,
1427 161, 168, 17, 119, 123, 124, 133, 119, 10, 155,
1428 17, 1, 133, 131, 3, 131, 3, 217, 17, 18,
1429 19, 101, 101, 217, 56, 66, 67, 142, 143, 226,
1430 101, 101, 133, 4, 10, 17, 14, 128, 128, 128,
1431 128, 128, 9, 13, 49, 50, 126, 133, 94, 225,
1432 226, 219, 163, 12, 110, 162, 15, 15, 3, 156,
1433 157, 160, 3, 133, 3, 133, 226, 63, 56, 226,
1434 219, 219, 69, 70, 145, 146, 147, 148, 75, 56,
1435 77, 127, 10, 125, 14, 125, 9, 54, 10, 107,
1436 9, 186, 226, 12, 17, 110, 110, 110, 168, 226,
1437 133, 217, 133, 217, 101, 133, 101, 226, 226, 219,
1438 219, 56, 147, 148, 219, 219, 10, 14, 133, 36,
1439 110, 187, 188, 110, 104, 105, 106, 170, 110, 156,
1440 92, 171, 172, 173, 174, 175, 10, 226, 17, 226,
1441 56, 133, 101, 226, 226, 226, 226, 10, 110, 3,
1442 10, 17, 226, 94, 226, 226, 56, 94, 169, 101,
1443 226, 219, 226, 101, 133, 101, 217, 133, 101, 101,
1444 101, 133, 226, 188, 37, 189, 190, 170, 171, 172,
1445 174, 226, 101, 56, 10, 56, 226, 217, 56, 56,
1446 88, 191, 82, 83, 84, 85, 192, 193, 194, 195,
1447 199, 200, 207, 208, 212, 213, 34, 226, 169, 101,
1448 9, 176, 56, 226, 101, 226, 56, 226, 219, 219,
1449 219, 219, 191, 110, 110, 177, 178, 101, 101, 194,
1450 199, 207, 212, 226, 226, 226, 226, 10, 225, 226,
1451 9, 179, 180, 56, 186, 186, 186, 186, 178, 56,
1452 125, 110, 181, 196, 197, 198, 219, 170, 202, 204,
1453 205, 206, 219, 209, 210, 211, 219, 214, 215, 216,
1454 219, 179, 10, 13, 182, 56, 225, 226, 110, 56,
1455 226, 110, 161, 201, 56, 226, 110, 56, 226, 110,
1456 125, 3, 183, 198, 179, 204, 157, 3, 211, 216,
1457 9, 14, 133, 203, 133, 110, 201, 10
1458};
1459
1460/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1461static const yytype_uint8 yyr1[] =
1462{
1463 0, 97, 98, 98, 98, 99, 99, 100, 100, 101,
1464 101, 102, 103, 103, 104, 104, 105, 106, 106, 107,
1465 107, 107, 108, 109, 109, 110, 111, 112, 113, 113,
1466 114, 114, 115, 116, 116, 117, 118, 118, 119, 119,
1467 119, 119, 119, 119, 120, 121, 121, 122, 122, 122,
1468 122, 122, 122, 122, 122, 123, 124, 125, 125, 125,
1469 125, 125, 125, 126, 127, 127, 127, 127, 127, 127,
1470 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
1471 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
1472 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
1473 128, 128, 128, 128, 129, 129, 130, 130, 130, 130,
1474 130, 130, 130, 130, 130, 130, 130, 130, 131, 132,
1475 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
1476 132, 132, 133, 133, 133, 134, 134, 134, 134, 134,
1477 134, 134, 134, 135, 135, 136, 136, 137, 137, 138,
1478 138, 139, 140, 140, 141, 141, 142, 143, 144, 145,
1479 145, 145, 145, 146, 146, 147, 148, 149, 149, 149,
1480 149, 149, 149, 150, 150, 150, 151, 152, 152, 152,
1481 153, 154, 155, 156, 156, 157, 157, 158, 158, 159,
1482 159, 160, 160, 161, 161, 161, 162, 162, 163, 164,
1483 165, 166, 166, 167, 168, 168, 168, 169, 169, 170,
1484 170, 171, 171, 172, 173, 173, 174, 175, 176, 176,
1485 177, 177, 178, 179, 180, 180, 181, 181, 182, 182,
1486 183, 183, 184, 185, 186, 186, 187, 187, 188, 188,
1487 188, 189, 189, 190, 190, 191, 192, 192, 193, 193,
1488 193, 193, 193, 193, 193, 193, 194, 195, 196, 196,
1489 197, 197, 198, 199, 200, 201, 201, 202, 203, 202,
1490 204, 204, 205, 205, 206, 206, 207, 208, 209, 209,
1491 210, 210, 211, 212, 213, 214, 214, 215, 215, 216,
1492 217, 218, 219, 220, 220, 221, 221, 221, 221, 222,
1493 222, 223, 223, 224, 224, 225, 225, 225, 225, 225,
1494 225, 226, 226
1495};
1496
1497/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1498static const yytype_int8 yyr2[] =
1499{
1500 0, 2, 2, 2, 1, 1, 2, 1, 3, 0,
1501 1, 2, 1, 3, 0, 1, 2, 1, 3, 1,
1502 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
1503 1, 1, 3, 1, 3, 3, 1, 3, 0, 1,
1504 1, 2, 2, 3, 1, 4, 4, 1, 1, 1,
1505 1, 1, 1, 1, 3, 1, 1, 1, 1, 1,
1506 3, 3, 3, 1, 1, 2, 2, 3, 4, 3,
1507 4, 2, 2, 3, 5, 2, 2, 2, 2, 2,
1508 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1509 1, 2, 2, 3, 4, 3, 4, 3, 5, 2,
1510 2, 2, 2, 2, 3, 5, 1, 1, 3, 3,
1511 3, 3, 3, 3, 3, 3, 3, 3, 1, 3,
1512 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1513 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1514 1, 1, 1, 2, 2, 1, 2, 1, 3, 1,
1515 1, 4, 1, 2, 4, 2, 7, 4, 6, 0,
1516 1, 1, 2, 1, 2, 7, 4, 7, 6, 9,
1517 10, 9, 12, 1, 1, 1, 5, 9, 9, 5,
1518 0, 1, 1, 0, 1, 3, 2, 0, 1, 1,
1519 3, 1, 1, 2, 1, 3, 1, 3, 0, 0,
1520 2, 4, 7, 2, 1, 3, 3, 1, 1, 7,
1521 9, 2, 4, 0, 1, 3, 7, 1, 0, 3,
1522 2, 4, 1, 4, 0, 3, 0, 1, 0, 3,
1523 0, 2, 1, 8, 0, 4, 1, 3, 1, 3,
1524 2, 0, 2, 2, 3, 1, 0, 2, 1, 1,
1525 1, 1, 3, 3, 3, 3, 6, 1, 0, 2,
1526 1, 3, 3, 6, 1, 1, 2, 2, 0, 5,
1527 1, 1, 0, 2, 1, 3, 6, 1, 0, 2,
1528 1, 3, 2, 6, 1, 0, 2, 1, 3, 5,
1529 0, 0, 0, 1, 1, 1, 1, 2, 2, 0,
1530 1, 0, 1, 1, 2, 1, 1, 1, 2, 2,
1531 2, 0, 1
1532};
1533
1534
1535enum { YYENOMEM = -2 };
1536
1537#define yyerrok (yyerrstatus = 0)
1538#define yyclearin (yychar = OCTAVE_EMPTY)
1539
1540#define YYACCEPT goto yyacceptlab
1541#define YYABORT goto yyabortlab
1542#define YYERROR goto yyerrorlab
1543#define YYNOMEM goto yyexhaustedlab
1544
1545
1546#define YYRECOVERING() (!!yyerrstatus)
1547
1548#define YYBACKUP(Token, Value) \
1549 do \
1550 if (yychar == OCTAVE_EMPTY) \
1551 { \
1552 yychar = (Token); \
1553 yylval = (Value); \
1554 YYPOPSTACK (yylen); \
1555 yystate = *yyssp; \
1556 goto yybackup; \
1557 } \
1558 else \
1559 { \
1560 yyerror (parser, YY_("syntax error: cannot back up")); \
1561 YYERROR; \
1562 } \
1563 while (0)
1564
1565/* Backward compatibility with an undocumented macro.
1566 Use OCTAVE_error or OCTAVE_UNDEF. */
1567#define YYERRCODE OCTAVE_UNDEF
1568
1569
1570/* Enable debugging if requested. */
1571#if OCTAVE_DEBUG
1572
1573# ifndef YYFPRINTF
1574# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1575# define YYFPRINTF fprintf
1576# endif
1577
1578# define YYDPRINTF(Args) \
1579do { \
1580 if (yydebug) \
1581 YYFPRINTF Args; \
1582} while (0)
1583
1584
1585
1586
1587# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1588do { \
1589 if (yydebug) \
1590 { \
1591 YYFPRINTF (stderr, "%s ", Title); \
1592 yy_symbol_print (stderr, \
1593 Kind, Value, parser); \
1594 YYFPRINTF (stderr, "\n"); \
1595 } \
1596} while (0)
1597
1598
1599/*-----------------------------------.
1600| Print this symbol's value on YYO. |
1601`-----------------------------------*/
1602
1603static void
1604yy_symbol_value_print (FILE *yyo,
1605 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, octave::base_parser& parser)
1606{
1607 FILE *yyoutput = yyo;
1608 YY_USE (yyoutput);
1609 YY_USE (parser);
1610 if (!yyvaluep)
1611 return;
1613 YY_USE (yykind);
1615}
1616
1617
1618/*---------------------------.
1619| Print this symbol on YYO. |
1620`---------------------------*/
1621
1622static void
1623yy_symbol_print (FILE *yyo,
1624 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, octave::base_parser& parser)
1625{
1626 YYFPRINTF (yyo, "%s %s (",
1627 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1628
1629 yy_symbol_value_print (yyo, yykind, yyvaluep, parser);
1630 YYFPRINTF (yyo, ")");
1631}
1632
1633/*------------------------------------------------------------------.
1634| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1635| TOP (included). |
1636`------------------------------------------------------------------*/
1637
1638static void
1639yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1640{
1641 YYFPRINTF (stderr, "Stack now");
1642 for (; yybottom <= yytop; yybottom++)
1643 {
1644 int yybot = *yybottom;
1645 YYFPRINTF (stderr, " %d", yybot);
1646 }
1647 YYFPRINTF (stderr, "\n");
1648}
1649
1650# define YY_STACK_PRINT(Bottom, Top) \
1651do { \
1652 if (yydebug) \
1653 yy_stack_print ((Bottom), (Top)); \
1654} while (0)
1655
1656
1657/*------------------------------------------------.
1658| Report that the YYRULE is going to be reduced. |
1659`------------------------------------------------*/
1660
1661static void
1662yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1663 int yyrule, octave::base_parser& parser)
1664{
1665 int yylno = yyrline[yyrule];
1666 int yynrhs = yyr2[yyrule];
1667 int yyi;
1668 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1669 yyrule - 1, yylno);
1670 /* The symbols being reduced. */
1671 for (yyi = 0; yyi < yynrhs; yyi++)
1672 {
1673 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1674 yy_symbol_print (stderr,
1675 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1676 &yyvsp[(yyi + 1) - (yynrhs)], parser);
1677 YYFPRINTF (stderr, "\n");
1678 }
1679}
1680
1681# define YY_REDUCE_PRINT(Rule) \
1682do { \
1683 if (yydebug) \
1684 yy_reduce_print (yyssp, yyvsp, Rule, parser); \
1685} while (0)
1686
1687/* Nonzero means print parse trace. It is left uninitialized so that
1688 multiple parsers can coexist. */
1689int yydebug;
1690#else /* !OCTAVE_DEBUG */
1691# define YYDPRINTF(Args) ((void) 0)
1692# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1693# define YY_STACK_PRINT(Bottom, Top)
1694# define YY_REDUCE_PRINT(Rule)
1695#endif /* !OCTAVE_DEBUG */
1696
1697
1698/* YYINITDEPTH -- initial size of the parser's stacks. */
1699#ifndef YYINITDEPTH
1700# define YYINITDEPTH 200
1701#endif
1702
1703/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1704 if the built-in stack extension method is used).
1705
1706 Do not make this value too large; the results are undefined if
1707 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1708 evaluated with infinite-precision integer arithmetic. */
1709
1710#ifndef YYMAXDEPTH
1711# define YYMAXDEPTH 10000
1712#endif
1713/* Parser data structure. */
1715 {
1716 /* Number of syntax errors so far. */
1718
1720 /* Number of tokens to shift before error messages enabled. */
1722
1723 /* Refer to the stacks through separate pointers, to allow yyoverflow
1724 to reallocate them elsewhere. */
1725
1726 /* Their size. */
1728
1729 /* The state stack: array, bottom, top. */
1733
1734 /* The semantic value stack: array, bottom, top. */
1738 /* Whether this instance has not started parsing yet.
1739 * If 2, it corresponds to a finished parsing. */
1741 };
1742
1743
1744
1745
1746
1747
1748/*-----------------------------------------------.
1749| Release the memory associated to this symbol. |
1750`-----------------------------------------------*/
1751
1752static void
1753yydestruct (const char *yymsg,
1754 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, octave::base_parser& parser)
1755{
1756 YY_USE (yyvaluep);
1757 YY_USE (parser);
1758 if (!yymsg)
1759 yymsg = "Deleting";
1760 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1761
1763 switch (yykind)
1764 {
1765 case YYSYMBOL_3_: /* '=' */
1766#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1767 { }
1768#line 1769 "libinterp/parse-tree/oct-parse.cc"
1769 break;
1770
1771 case YYSYMBOL_4_: /* ':' */
1772#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1773 { }
1774#line 1775 "libinterp/parse-tree/oct-parse.cc"
1775 break;
1776
1777 case YYSYMBOL_5_: /* '-' */
1778#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1779 { }
1780#line 1781 "libinterp/parse-tree/oct-parse.cc"
1781 break;
1782
1783 case YYSYMBOL_6_: /* '+' */
1784#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1785 { }
1786#line 1787 "libinterp/parse-tree/oct-parse.cc"
1787 break;
1788
1789 case YYSYMBOL_7_: /* '*' */
1790#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1791 { }
1792#line 1793 "libinterp/parse-tree/oct-parse.cc"
1793 break;
1794
1795 case YYSYMBOL_8_: /* '/' */
1796#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1797 { }
1798#line 1799 "libinterp/parse-tree/oct-parse.cc"
1799 break;
1800
1801 case YYSYMBOL_9_: /* '(' */
1802#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1803 { }
1804#line 1805 "libinterp/parse-tree/oct-parse.cc"
1805 break;
1806
1807 case YYSYMBOL_10_: /* ')' */
1808#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1809 { }
1810#line 1811 "libinterp/parse-tree/oct-parse.cc"
1811 break;
1812
1813 case YYSYMBOL_11_: /* '[' */
1814#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1815 { }
1816#line 1817 "libinterp/parse-tree/oct-parse.cc"
1817 break;
1818
1819 case YYSYMBOL_12_: /* ']' */
1820#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1821 { }
1822#line 1823 "libinterp/parse-tree/oct-parse.cc"
1823 break;
1824
1825 case YYSYMBOL_13_: /* '{' */
1826#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1827 { }
1828#line 1829 "libinterp/parse-tree/oct-parse.cc"
1829 break;
1830
1831 case YYSYMBOL_14_: /* '}' */
1832#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1833 { }
1834#line 1835 "libinterp/parse-tree/oct-parse.cc"
1835 break;
1836
1837 case YYSYMBOL_15_: /* '.' */
1838#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1839 { }
1840#line 1841 "libinterp/parse-tree/oct-parse.cc"
1841 break;
1842
1843 case YYSYMBOL_16_: /* '@' */
1844#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1845 { }
1846#line 1847 "libinterp/parse-tree/oct-parse.cc"
1847 break;
1848
1849 case YYSYMBOL_17_: /* ',' */
1850#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1851 { }
1852#line 1853 "libinterp/parse-tree/oct-parse.cc"
1853 break;
1854
1855 case YYSYMBOL_18_: /* ';' */
1856#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1857 { }
1858#line 1859 "libinterp/parse-tree/oct-parse.cc"
1859 break;
1860
1861 case YYSYMBOL_19_n_: /* '\n' */
1862#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1863 { }
1864#line 1865 "libinterp/parse-tree/oct-parse.cc"
1865 break;
1866
1867 case YYSYMBOL_ADD_EQ: /* ADD_EQ */
1868#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1869 { }
1870#line 1871 "libinterp/parse-tree/oct-parse.cc"
1871 break;
1872
1873 case YYSYMBOL_SUB_EQ: /* SUB_EQ */
1874#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1875 { }
1876#line 1877 "libinterp/parse-tree/oct-parse.cc"
1877 break;
1878
1879 case YYSYMBOL_MUL_EQ: /* MUL_EQ */
1880#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1881 { }
1882#line 1883 "libinterp/parse-tree/oct-parse.cc"
1883 break;
1884
1885 case YYSYMBOL_DIV_EQ: /* DIV_EQ */
1886#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1887 { }
1888#line 1889 "libinterp/parse-tree/oct-parse.cc"
1889 break;
1890
1891 case YYSYMBOL_LEFTDIV_EQ: /* LEFTDIV_EQ */
1892#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1893 { }
1894#line 1895 "libinterp/parse-tree/oct-parse.cc"
1895 break;
1896
1897 case YYSYMBOL_POW_EQ: /* POW_EQ */
1898#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1899 { }
1900#line 1901 "libinterp/parse-tree/oct-parse.cc"
1901 break;
1902
1903 case YYSYMBOL_EMUL_EQ: /* EMUL_EQ */
1904#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1905 { }
1906#line 1907 "libinterp/parse-tree/oct-parse.cc"
1907 break;
1908
1909 case YYSYMBOL_EDIV_EQ: /* EDIV_EQ */
1910#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1911 { }
1912#line 1913 "libinterp/parse-tree/oct-parse.cc"
1913 break;
1914
1915 case YYSYMBOL_ELEFTDIV_EQ: /* ELEFTDIV_EQ */
1916#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1917 { }
1918#line 1919 "libinterp/parse-tree/oct-parse.cc"
1919 break;
1920
1921 case YYSYMBOL_EPOW_EQ: /* EPOW_EQ */
1922#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1923 { }
1924#line 1925 "libinterp/parse-tree/oct-parse.cc"
1925 break;
1926
1927 case YYSYMBOL_AND_EQ: /* AND_EQ */
1928#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1929 { }
1930#line 1931 "libinterp/parse-tree/oct-parse.cc"
1931 break;
1932
1933 case YYSYMBOL_OR_EQ: /* OR_EQ */
1934#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1935 { }
1936#line 1937 "libinterp/parse-tree/oct-parse.cc"
1937 break;
1938
1939 case YYSYMBOL_EXPR_AND_AND: /* EXPR_AND_AND */
1940#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1941 { }
1942#line 1943 "libinterp/parse-tree/oct-parse.cc"
1943 break;
1944
1945 case YYSYMBOL_EXPR_OR_OR: /* EXPR_OR_OR */
1946#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1947 { }
1948#line 1949 "libinterp/parse-tree/oct-parse.cc"
1949 break;
1950
1951 case YYSYMBOL_EXPR_AND: /* EXPR_AND */
1952#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1953 { }
1954#line 1955 "libinterp/parse-tree/oct-parse.cc"
1955 break;
1956
1957 case YYSYMBOL_EXPR_OR: /* EXPR_OR */
1958#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1959 { }
1960#line 1961 "libinterp/parse-tree/oct-parse.cc"
1961 break;
1962
1963 case YYSYMBOL_EXPR_NOT: /* EXPR_NOT */
1964#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1965 { }
1966#line 1967 "libinterp/parse-tree/oct-parse.cc"
1967 break;
1968
1969 case YYSYMBOL_EXPR_LT: /* EXPR_LT */
1970#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1971 { }
1972#line 1973 "libinterp/parse-tree/oct-parse.cc"
1973 break;
1974
1975 case YYSYMBOL_EXPR_LE: /* EXPR_LE */
1976#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1977 { }
1978#line 1979 "libinterp/parse-tree/oct-parse.cc"
1979 break;
1980
1981 case YYSYMBOL_EXPR_EQ: /* EXPR_EQ */
1982#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1983 { }
1984#line 1985 "libinterp/parse-tree/oct-parse.cc"
1985 break;
1986
1987 case YYSYMBOL_EXPR_NE: /* EXPR_NE */
1988#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1989 { }
1990#line 1991 "libinterp/parse-tree/oct-parse.cc"
1991 break;
1992
1993 case YYSYMBOL_EXPR_GE: /* EXPR_GE */
1994#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
1995 { }
1996#line 1997 "libinterp/parse-tree/oct-parse.cc"
1997 break;
1998
1999 case YYSYMBOL_EXPR_GT: /* EXPR_GT */
2000#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2001 { }
2002#line 2003 "libinterp/parse-tree/oct-parse.cc"
2003 break;
2004
2005 case YYSYMBOL_LEFTDIV: /* LEFTDIV */
2006#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2007 { }
2008#line 2009 "libinterp/parse-tree/oct-parse.cc"
2009 break;
2010
2011 case YYSYMBOL_EMUL: /* EMUL */
2012#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2013 { }
2014#line 2015 "libinterp/parse-tree/oct-parse.cc"
2015 break;
2016
2017 case YYSYMBOL_EDIV: /* EDIV */
2018#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2019 { }
2020#line 2021 "libinterp/parse-tree/oct-parse.cc"
2021 break;
2022
2023 case YYSYMBOL_ELEFTDIV: /* ELEFTDIV */
2024#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2025 { }
2026#line 2027 "libinterp/parse-tree/oct-parse.cc"
2027 break;
2028
2029 case YYSYMBOL_HERMITIAN: /* HERMITIAN */
2030#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2031 { }
2032#line 2033 "libinterp/parse-tree/oct-parse.cc"
2033 break;
2034
2035 case YYSYMBOL_TRANSPOSE: /* TRANSPOSE */
2036#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2037 { }
2038#line 2039 "libinterp/parse-tree/oct-parse.cc"
2039 break;
2040
2041 case YYSYMBOL_PLUS_PLUS: /* PLUS_PLUS */
2042#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2043 { }
2044#line 2045 "libinterp/parse-tree/oct-parse.cc"
2045 break;
2046
2047 case YYSYMBOL_MINUS_MINUS: /* MINUS_MINUS */
2048#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2049 { }
2050#line 2051 "libinterp/parse-tree/oct-parse.cc"
2051 break;
2052
2053 case YYSYMBOL_POW: /* POW */
2054#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2055 { }
2056#line 2057 "libinterp/parse-tree/oct-parse.cc"
2057 break;
2058
2059 case YYSYMBOL_EPOW: /* EPOW */
2060#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2061 { }
2062#line 2063 "libinterp/parse-tree/oct-parse.cc"
2063 break;
2064
2065 case YYSYMBOL_NUMBER: /* NUMBER */
2066#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2067 { }
2068#line 2069 "libinterp/parse-tree/oct-parse.cc"
2069 break;
2070
2071 case YYSYMBOL_STRUCT_ELT: /* STRUCT_ELT */
2072#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2073 { }
2074#line 2075 "libinterp/parse-tree/oct-parse.cc"
2075 break;
2076
2077 case YYSYMBOL_NAME: /* NAME */
2078#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2079 { }
2080#line 2081 "libinterp/parse-tree/oct-parse.cc"
2081 break;
2082
2083 case YYSYMBOL_END: /* END */
2084#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2085 { }
2086#line 2087 "libinterp/parse-tree/oct-parse.cc"
2087 break;
2088
2089 case YYSYMBOL_DQ_STRING: /* DQ_STRING */
2090#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2091 { }
2092#line 2093 "libinterp/parse-tree/oct-parse.cc"
2093 break;
2094
2095 case YYSYMBOL_SQ_STRING: /* SQ_STRING */
2096#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2097 { }
2098#line 2099 "libinterp/parse-tree/oct-parse.cc"
2099 break;
2100
2101 case YYSYMBOL_FOR: /* FOR */
2102#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2103 { }
2104#line 2105 "libinterp/parse-tree/oct-parse.cc"
2105 break;
2106
2107 case YYSYMBOL_PARFOR: /* PARFOR */
2108#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2109 { }
2110#line 2111 "libinterp/parse-tree/oct-parse.cc"
2111 break;
2112
2113 case YYSYMBOL_WHILE: /* WHILE */
2114#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2115 { }
2116#line 2117 "libinterp/parse-tree/oct-parse.cc"
2117 break;
2118
2119 case YYSYMBOL_DO: /* DO */
2120#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2121 { }
2122#line 2123 "libinterp/parse-tree/oct-parse.cc"
2123 break;
2124
2125 case YYSYMBOL_UNTIL: /* UNTIL */
2126#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2127 { }
2128#line 2129 "libinterp/parse-tree/oct-parse.cc"
2129 break;
2130
2131 case YYSYMBOL_SPMD: /* SPMD */
2132#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2133 { }
2134#line 2135 "libinterp/parse-tree/oct-parse.cc"
2135 break;
2136
2137 case YYSYMBOL_IF: /* IF */
2138#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2139 { }
2140#line 2141 "libinterp/parse-tree/oct-parse.cc"
2141 break;
2142
2143 case YYSYMBOL_ELSEIF: /* ELSEIF */
2144#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2145 { }
2146#line 2147 "libinterp/parse-tree/oct-parse.cc"
2147 break;
2148
2149 case YYSYMBOL_ELSE: /* ELSE */
2150#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2151 { }
2152#line 2153 "libinterp/parse-tree/oct-parse.cc"
2153 break;
2154
2155 case YYSYMBOL_SWITCH: /* SWITCH */
2156#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2157 { }
2158#line 2159 "libinterp/parse-tree/oct-parse.cc"
2159 break;
2160
2161 case YYSYMBOL_CASE: /* CASE */
2162#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2163 { }
2164#line 2165 "libinterp/parse-tree/oct-parse.cc"
2165 break;
2166
2167 case YYSYMBOL_OTHERWISE: /* OTHERWISE */
2168#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2169 { }
2170#line 2171 "libinterp/parse-tree/oct-parse.cc"
2171 break;
2172
2173 case YYSYMBOL_BREAK: /* BREAK */
2174#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2175 { }
2176#line 2177 "libinterp/parse-tree/oct-parse.cc"
2177 break;
2178
2179 case YYSYMBOL_CONTINUE: /* CONTINUE */
2180#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2181 { }
2182#line 2183 "libinterp/parse-tree/oct-parse.cc"
2183 break;
2184
2185 case YYSYMBOL_FUNC_RET: /* FUNC_RET */
2186#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2187 { }
2188#line 2189 "libinterp/parse-tree/oct-parse.cc"
2189 break;
2190
2191 case YYSYMBOL_UNWIND: /* UNWIND */
2192#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2193 { }
2194#line 2195 "libinterp/parse-tree/oct-parse.cc"
2195 break;
2196
2197 case YYSYMBOL_CLEANUP: /* CLEANUP */
2198#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2199 { }
2200#line 2201 "libinterp/parse-tree/oct-parse.cc"
2201 break;
2202
2203 case YYSYMBOL_TRY: /* TRY */
2204#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2205 { }
2206#line 2207 "libinterp/parse-tree/oct-parse.cc"
2207 break;
2208
2209 case YYSYMBOL_CATCH: /* CATCH */
2210#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2211 { }
2212#line 2213 "libinterp/parse-tree/oct-parse.cc"
2213 break;
2214
2215 case YYSYMBOL_GLOBAL: /* GLOBAL */
2216#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2217 { }
2218#line 2219 "libinterp/parse-tree/oct-parse.cc"
2219 break;
2220
2221 case YYSYMBOL_PERSISTENT: /* PERSISTENT */
2222#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2223 { }
2224#line 2225 "libinterp/parse-tree/oct-parse.cc"
2225 break;
2226
2227 case YYSYMBOL_FCN_HANDLE: /* FCN_HANDLE */
2228#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2229 { }
2230#line 2231 "libinterp/parse-tree/oct-parse.cc"
2231 break;
2232
2233 case YYSYMBOL_CLASSDEF: /* CLASSDEF */
2234#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2235 { }
2236#line 2237 "libinterp/parse-tree/oct-parse.cc"
2237 break;
2238
2239 case YYSYMBOL_PROPERTIES: /* PROPERTIES */
2240#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2241 { }
2242#line 2243 "libinterp/parse-tree/oct-parse.cc"
2243 break;
2244
2245 case YYSYMBOL_METHODS: /* METHODS */
2246#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2247 { }
2248#line 2249 "libinterp/parse-tree/oct-parse.cc"
2249 break;
2250
2251 case YYSYMBOL_EVENTS: /* EVENTS */
2252#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2253 { }
2254#line 2255 "libinterp/parse-tree/oct-parse.cc"
2255 break;
2256
2257 case YYSYMBOL_ENUMERATION: /* ENUMERATION */
2258#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2259 { }
2260#line 2261 "libinterp/parse-tree/oct-parse.cc"
2261 break;
2262
2263 case YYSYMBOL_METAQUERY: /* METAQUERY */
2264#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2265 { }
2266#line 2267 "libinterp/parse-tree/oct-parse.cc"
2267 break;
2268
2269 case YYSYMBOL_SUPERCLASSREF: /* SUPERCLASSREF */
2270#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2271 { }
2272#line 2273 "libinterp/parse-tree/oct-parse.cc"
2273 break;
2274
2275 case YYSYMBOL_FQ_IDENT: /* FQ_IDENT */
2276#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2277 { }
2278#line 2279 "libinterp/parse-tree/oct-parse.cc"
2279 break;
2280
2281 case YYSYMBOL_GET: /* GET */
2282#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2283 { }
2284#line 2285 "libinterp/parse-tree/oct-parse.cc"
2285 break;
2286
2287 case YYSYMBOL_SET: /* SET */
2288#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2289 { }
2290#line 2291 "libinterp/parse-tree/oct-parse.cc"
2291 break;
2292
2293 case YYSYMBOL_FCN: /* FCN */
2294#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2295 { }
2296#line 2297 "libinterp/parse-tree/oct-parse.cc"
2297 break;
2298
2299 case YYSYMBOL_ARGUMENTS: /* ARGUMENTS */
2300#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2301 { }
2302#line 2303 "libinterp/parse-tree/oct-parse.cc"
2303 break;
2304
2305 case YYSYMBOL_LEXICAL_ERROR: /* LEXICAL_ERROR */
2306#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2307 { }
2308#line 2309 "libinterp/parse-tree/oct-parse.cc"
2309 break;
2310
2311 case YYSYMBOL_END_OF_INPUT: /* END_OF_INPUT */
2312#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2313 { }
2314#line 2315 "libinterp/parse-tree/oct-parse.cc"
2315 break;
2316
2317 case YYSYMBOL_UNARY: /* UNARY */
2318#line 343 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2319 { }
2320#line 2321 "libinterp/parse-tree/oct-parse.cc"
2321 break;
2322
2323 case YYSYMBOL_input: /* input */
2324#line 345 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2325 { delete ((*yyvaluep).tree_type); }
2326#line 2327 "libinterp/parse-tree/oct-parse.cc"
2327 break;
2328
2329 case YYSYMBOL_simple_list: /* simple_list */
2330#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2331 { delete ((*yyvaluep).tree_statement_list_type); }
2332#line 2333 "libinterp/parse-tree/oct-parse.cc"
2333 break;
2334
2335 case YYSYMBOL_simple_list1: /* simple_list1 */
2336#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2337 { delete ((*yyvaluep).tree_statement_list_type); }
2338#line 2339 "libinterp/parse-tree/oct-parse.cc"
2339 break;
2340
2341 case YYSYMBOL_opt_list: /* opt_list */
2342#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2343 { delete ((*yyvaluep).tree_statement_list_type); }
2344#line 2345 "libinterp/parse-tree/oct-parse.cc"
2345 break;
2346
2347 case YYSYMBOL_list: /* list */
2348#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2349 { delete ((*yyvaluep).tree_statement_list_type); }
2350#line 2351 "libinterp/parse-tree/oct-parse.cc"
2351 break;
2352
2353 case YYSYMBOL_list1: /* list1 */
2354#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2355 { delete ((*yyvaluep).tree_statement_list_type); }
2356#line 2357 "libinterp/parse-tree/oct-parse.cc"
2357 break;
2358
2359 case YYSYMBOL_opt_fcn_list: /* opt_fcn_list */
2360#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2361 { delete ((*yyvaluep).tree_statement_list_type); }
2362#line 2363 "libinterp/parse-tree/oct-parse.cc"
2363 break;
2364
2365 case YYSYMBOL_fcn_list: /* fcn_list */
2366#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2367 { delete ((*yyvaluep).tree_statement_list_type); }
2368#line 2369 "libinterp/parse-tree/oct-parse.cc"
2369 break;
2370
2371 case YYSYMBOL_fcn_list1: /* fcn_list1 */
2372#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2373 { delete ((*yyvaluep).tree_statement_list_type); }
2374#line 2375 "libinterp/parse-tree/oct-parse.cc"
2375 break;
2376
2377 case YYSYMBOL_statement: /* statement */
2378#line 369 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2379 { delete ((*yyvaluep).tree_statement_type); }
2380#line 2381 "libinterp/parse-tree/oct-parse.cc"
2381 break;
2382
2383 case YYSYMBOL_word_list_cmd: /* word_list_cmd */
2384#line 356 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2385 { delete ((*yyvaluep).tree_index_expression_type); }
2386#line 2387 "libinterp/parse-tree/oct-parse.cc"
2387 break;
2388
2389 case YYSYMBOL_word_list: /* word_list */
2390#line 357 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2391 { delete ((*yyvaluep).tree_argument_list_type); }
2392#line 2393 "libinterp/parse-tree/oct-parse.cc"
2393 break;
2394
2395 case YYSYMBOL_identifier: /* identifier */
2396#line 355 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2397 { delete ((*yyvaluep).tree_identifier_type); }
2398#line 2399 "libinterp/parse-tree/oct-parse.cc"
2399 break;
2400
2401 case YYSYMBOL_superclass_identifier: /* superclass_identifier */
2402#line 351 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2403 { delete ((*yyvaluep).tree_superclass_ref_type); }
2404#line 2405 "libinterp/parse-tree/oct-parse.cc"
2405 break;
2406
2407 case YYSYMBOL_meta_identifier: /* meta_identifier */
2408#line 352 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2409 { delete ((*yyvaluep).tree_metaclass_query_type); }
2410#line 2411 "libinterp/parse-tree/oct-parse.cc"
2411 break;
2412
2413 case YYSYMBOL_string: /* string */
2414#line 349 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2415 { delete ((*yyvaluep).tree_constant_type); }
2416#line 2417 "libinterp/parse-tree/oct-parse.cc"
2417 break;
2418
2419 case YYSYMBOL_constant: /* constant */
2420#line 349 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2421 { delete ((*yyvaluep).tree_constant_type); }
2422#line 2423 "libinterp/parse-tree/oct-parse.cc"
2423 break;
2424
2425 case YYSYMBOL_matrix: /* matrix */
2426#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2427 { delete ((*yyvaluep).tree_expression_type); }
2428#line 2429 "libinterp/parse-tree/oct-parse.cc"
2429 break;
2430
2431 case YYSYMBOL_matrix_rows: /* matrix_rows */
2432#line 346 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2433 { delete ((*yyvaluep).tree_matrix_type); }
2434#line 2435 "libinterp/parse-tree/oct-parse.cc"
2435 break;
2436
2437 case YYSYMBOL_cell: /* cell */
2438#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2439 { delete ((*yyvaluep).tree_expression_type); }
2440#line 2441 "libinterp/parse-tree/oct-parse.cc"
2441 break;
2442
2443 case YYSYMBOL_cell_rows: /* cell_rows */
2444#line 347 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2445 { delete ((*yyvaluep).tree_cell_type); }
2446#line 2447 "libinterp/parse-tree/oct-parse.cc"
2447 break;
2448
2449 case YYSYMBOL_cell_or_matrix_row: /* cell_or_matrix_row */
2450#line 357 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2451 { delete ((*yyvaluep).tree_argument_list_type); }
2452#line 2453 "libinterp/parse-tree/oct-parse.cc"
2453 break;
2454
2455 case YYSYMBOL_fcn_handle: /* fcn_handle */
2456#line 350 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2457 { delete ((*yyvaluep).tree_fcn_handle_type); }
2458#line 2459 "libinterp/parse-tree/oct-parse.cc"
2459 break;
2460
2461 case YYSYMBOL_anon_fcn_handle: /* anon_fcn_handle */
2462#line 354 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2463 { delete ((*yyvaluep).tree_anon_fcn_handle_type); }
2464#line 2465 "libinterp/parse-tree/oct-parse.cc"
2465 break;
2466
2467 case YYSYMBOL_primary_expr: /* primary_expr */
2468#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2469 { delete ((*yyvaluep).tree_expression_type); }
2470#line 2471 "libinterp/parse-tree/oct-parse.cc"
2471 break;
2472
2473 case YYSYMBOL_magic_colon: /* magic_colon */
2474#line 349 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2475 { delete ((*yyvaluep).tree_constant_type); }
2476#line 2477 "libinterp/parse-tree/oct-parse.cc"
2477 break;
2478
2479 case YYSYMBOL_magic_tilde: /* magic_tilde */
2480#line 355 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2481 { delete ((*yyvaluep).tree_identifier_type); }
2482#line 2483 "libinterp/parse-tree/oct-parse.cc"
2483 break;
2484
2485 case YYSYMBOL_arg_list: /* arg_list */
2486#line 357 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2487 { delete ((*yyvaluep).tree_argument_list_type); }
2488#line 2489 "libinterp/parse-tree/oct-parse.cc"
2489 break;
2490
2491 case YYSYMBOL_oper_expr: /* oper_expr */
2492#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2493 { delete ((*yyvaluep).tree_expression_type); }
2494#line 2495 "libinterp/parse-tree/oct-parse.cc"
2495 break;
2496
2497 case YYSYMBOL_power_expr: /* power_expr */
2498#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2499 { delete ((*yyvaluep).tree_expression_type); }
2500#line 2501 "libinterp/parse-tree/oct-parse.cc"
2501 break;
2502
2503 case YYSYMBOL_colon_expr: /* colon_expr */
2504#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2505 { delete ((*yyvaluep).tree_expression_type); }
2506#line 2507 "libinterp/parse-tree/oct-parse.cc"
2507 break;
2508
2509 case YYSYMBOL_simple_expr: /* simple_expr */
2510#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2511 { delete ((*yyvaluep).tree_expression_type); }
2512#line 2513 "libinterp/parse-tree/oct-parse.cc"
2513 break;
2514
2515 case YYSYMBOL_assign_lhs: /* assign_lhs */
2516#line 357 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2517 { delete ((*yyvaluep).tree_argument_list_type); }
2518#line 2519 "libinterp/parse-tree/oct-parse.cc"
2519 break;
2520
2521 case YYSYMBOL_assign_expr: /* assign_expr */
2522#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2523 { delete ((*yyvaluep).tree_expression_type); }
2524#line 2525 "libinterp/parse-tree/oct-parse.cc"
2525 break;
2526
2527 case YYSYMBOL_expression: /* expression */
2528#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2529 { delete ((*yyvaluep).tree_expression_type); }
2530#line 2531 "libinterp/parse-tree/oct-parse.cc"
2531 break;
2532
2533 case YYSYMBOL_command: /* command */
2534#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2535 { delete ((*yyvaluep).tree_command_type); }
2536#line 2537 "libinterp/parse-tree/oct-parse.cc"
2537 break;
2538
2539 case YYSYMBOL_declaration: /* declaration */
2540#line 368 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2541 { delete ((*yyvaluep).tree_decl_command_type); }
2542#line 2543 "libinterp/parse-tree/oct-parse.cc"
2543 break;
2544
2545 case YYSYMBOL_decl_init_list: /* decl_init_list */
2546#line 367 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2547 { delete ((*yyvaluep).tree_decl_init_list_type); }
2548#line 2549 "libinterp/parse-tree/oct-parse.cc"
2549 break;
2550
2551 case YYSYMBOL_decl_elt: /* decl_elt */
2552#line 366 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2553 { delete ((*yyvaluep).tree_decl_elt_type); }
2554#line 2555 "libinterp/parse-tree/oct-parse.cc"
2555 break;
2556
2557 case YYSYMBOL_select_command: /* select_command */
2558#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2559 { delete ((*yyvaluep).tree_command_type); }
2560#line 2561 "libinterp/parse-tree/oct-parse.cc"
2561 break;
2562
2563 case YYSYMBOL_if_command: /* if_command */
2564#line 360 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2565 { delete ((*yyvaluep).tree_if_command_type); }
2566#line 2567 "libinterp/parse-tree/oct-parse.cc"
2567 break;
2568
2569 case YYSYMBOL_if_cmd_list: /* if_cmd_list */
2570#line 362 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2571 { delete ((*yyvaluep).tree_if_command_list_type); }
2572#line 2573 "libinterp/parse-tree/oct-parse.cc"
2573 break;
2574
2575 case YYSYMBOL_if_cmd_list1: /* if_cmd_list1 */
2576#line 362 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2577 { delete ((*yyvaluep).tree_if_command_list_type); }
2578#line 2579 "libinterp/parse-tree/oct-parse.cc"
2579 break;
2580
2581 case YYSYMBOL_elseif_clause: /* elseif_clause */
2582#line 361 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2583 { delete ((*yyvaluep).tree_if_clause_type); }
2584#line 2585 "libinterp/parse-tree/oct-parse.cc"
2585 break;
2586
2587 case YYSYMBOL_else_clause: /* else_clause */
2588#line 361 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2589 { delete ((*yyvaluep).tree_if_clause_type); }
2590#line 2591 "libinterp/parse-tree/oct-parse.cc"
2591 break;
2592
2593 case YYSYMBOL_switch_command: /* switch_command */
2594#line 363 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2595 { delete ((*yyvaluep).tree_switch_command_type); }
2596#line 2597 "libinterp/parse-tree/oct-parse.cc"
2597 break;
2598
2599 case YYSYMBOL_case_list: /* case_list */
2600#line 365 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2601 { delete ((*yyvaluep).tree_switch_case_list_type); }
2602#line 2603 "libinterp/parse-tree/oct-parse.cc"
2603 break;
2604
2605 case YYSYMBOL_case_list1: /* case_list1 */
2606#line 365 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2607 { delete ((*yyvaluep).tree_switch_case_list_type); }
2608#line 2609 "libinterp/parse-tree/oct-parse.cc"
2609 break;
2610
2611 case YYSYMBOL_switch_case: /* switch_case */
2612#line 364 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2613 { delete ((*yyvaluep).tree_switch_case_type); }
2614#line 2615 "libinterp/parse-tree/oct-parse.cc"
2615 break;
2616
2617 case YYSYMBOL_default_case: /* default_case */
2618#line 364 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2619 { delete ((*yyvaluep).tree_switch_case_type); }
2620#line 2621 "libinterp/parse-tree/oct-parse.cc"
2621 break;
2622
2623 case YYSYMBOL_loop_command: /* loop_command */
2624#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2625 { delete ((*yyvaluep).tree_command_type); }
2626#line 2627 "libinterp/parse-tree/oct-parse.cc"
2627 break;
2628
2629 case YYSYMBOL_jump_command: /* jump_command */
2630#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2631 { delete ((*yyvaluep).tree_command_type); }
2632#line 2633 "libinterp/parse-tree/oct-parse.cc"
2633 break;
2634
2635 case YYSYMBOL_spmd_command: /* spmd_command */
2636#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2637 { delete ((*yyvaluep).tree_command_type); }
2638#line 2639 "libinterp/parse-tree/oct-parse.cc"
2639 break;
2640
2641 case YYSYMBOL_except_command: /* except_command */
2642#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2643 { delete ((*yyvaluep).tree_command_type); }
2644#line 2645 "libinterp/parse-tree/oct-parse.cc"
2645 break;
2646
2647 case YYSYMBOL_opt_param_list: /* opt_param_list */
2648#line 358 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2649 { delete ((*yyvaluep).tree_parameter_list_type); }
2650#line 2651 "libinterp/parse-tree/oct-parse.cc"
2651 break;
2652
2653 case YYSYMBOL_param_list: /* param_list */
2654#line 358 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2655 { delete ((*yyvaluep).tree_parameter_list_type); }
2656#line 2657 "libinterp/parse-tree/oct-parse.cc"
2657 break;
2658
2659 case YYSYMBOL_param_list1: /* param_list1 */
2660#line 358 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2661 { delete ((*yyvaluep).tree_parameter_list_type); }
2662#line 2663 "libinterp/parse-tree/oct-parse.cc"
2663 break;
2664
2665 case YYSYMBOL_param_list2: /* param_list2 */
2666#line 358 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2667 { delete ((*yyvaluep).tree_parameter_list_type); }
2668#line 2669 "libinterp/parse-tree/oct-parse.cc"
2669 break;
2670
2671 case YYSYMBOL_param_list_elt: /* param_list_elt */
2672#line 366 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2673 { delete ((*yyvaluep).tree_decl_elt_type); }
2674#line 2675 "libinterp/parse-tree/oct-parse.cc"
2675 break;
2676
2677 case YYSYMBOL_return_list: /* return_list */
2678#line 358 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2679 { delete ((*yyvaluep).tree_parameter_list_type); }
2680#line 2681 "libinterp/parse-tree/oct-parse.cc"
2681 break;
2682
2683 case YYSYMBOL_return_list1: /* return_list1 */
2684#line 358 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2685 { delete ((*yyvaluep).tree_parameter_list_type); }
2686#line 2687 "libinterp/parse-tree/oct-parse.cc"
2687 break;
2688
2689 case YYSYMBOL_file: /* file */
2690#line 359 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2691 { delete ((*yyvaluep).tree_command_type); }
2692#line 2693 "libinterp/parse-tree/oct-parse.cc"
2693 break;
2694
2695 case YYSYMBOL_function_beg: /* function_beg */
2696#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2697 { }
2698#line 2699 "libinterp/parse-tree/oct-parse.cc"
2699 break;
2700
2701 case YYSYMBOL_fcn_name: /* fcn_name */
2702#line 355 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2703 { delete ((*yyvaluep).tree_identifier_type); }
2704#line 2705 "libinterp/parse-tree/oct-parse.cc"
2705 break;
2706
2707 case YYSYMBOL_function_end: /* function_end */
2708#line 369 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2709 { delete ((*yyvaluep).tree_statement_type); }
2710#line 2711 "libinterp/parse-tree/oct-parse.cc"
2711 break;
2712
2713 case YYSYMBOL_function: /* function */
2714#line 353 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2715 { delete ((*yyvaluep).tree_function_def_type); }
2716#line 2717 "libinterp/parse-tree/oct-parse.cc"
2717 break;
2718
2719 case YYSYMBOL_function_body: /* function_body */
2720#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2721 { delete ((*yyvaluep).tree_statement_list_type); }
2722#line 2723 "libinterp/parse-tree/oct-parse.cc"
2723 break;
2724
2725 case YYSYMBOL_function_body1: /* function_body1 */
2726#line 370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2727 { delete ((*yyvaluep).tree_statement_list_type); }
2728#line 2729 "libinterp/parse-tree/oct-parse.cc"
2729 break;
2730
2731 case YYSYMBOL_arguments_block: /* arguments_block */
2732#line 371 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2733 { delete ((*yyvaluep).tree_arguments_block_type); }
2734#line 2735 "libinterp/parse-tree/oct-parse.cc"
2735 break;
2736
2737 case YYSYMBOL_arguments_beg: /* arguments_beg */
2738#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2739 { }
2740#line 2741 "libinterp/parse-tree/oct-parse.cc"
2741 break;
2742
2743 case YYSYMBOL_args_attr_list: /* args_attr_list */
2744#line 372 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2745 { delete ((*yyvaluep).tree_args_block_attribute_list_type); }
2746#line 2747 "libinterp/parse-tree/oct-parse.cc"
2747 break;
2748
2749 case YYSYMBOL_args_validation_list: /* args_validation_list */
2750#line 373 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2751 { delete ((*yyvaluep).tree_args_block_validation_list_type); }
2752#line 2753 "libinterp/parse-tree/oct-parse.cc"
2753 break;
2754
2755 case YYSYMBOL_arg_name: /* arg_name */
2756#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2757 { delete ((*yyvaluep).tree_expression_type); }
2758#line 2759 "libinterp/parse-tree/oct-parse.cc"
2759 break;
2760
2761 case YYSYMBOL_arg_validation: /* arg_validation */
2762#line 374 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2763 { delete ((*yyvaluep).tree_arg_validation_type); }
2764#line 2765 "libinterp/parse-tree/oct-parse.cc"
2765 break;
2766
2767 case YYSYMBOL_size_spec: /* size_spec */
2768#line 375 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2769 { delete ((*yyvaluep).tree_arg_size_spec_type); }
2770#line 2771 "libinterp/parse-tree/oct-parse.cc"
2771 break;
2772
2773 case YYSYMBOL_class_name: /* class_name */
2774#line 355 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2775 { delete ((*yyvaluep).tree_identifier_type); }
2776#line 2777 "libinterp/parse-tree/oct-parse.cc"
2777 break;
2778
2779 case YYSYMBOL_validation_fcns: /* validation_fcns */
2780#line 376 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2781 { delete ((*yyvaluep).tree_arg_validation_fcns_type); }
2782#line 2783 "libinterp/parse-tree/oct-parse.cc"
2783 break;
2784
2785 case YYSYMBOL_default_value: /* default_value */
2786#line 348 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2787 { delete ((*yyvaluep).tree_expression_type); }
2788#line 2789 "libinterp/parse-tree/oct-parse.cc"
2789 break;
2790
2791 case YYSYMBOL_classdef_beg: /* classdef_beg */
2792#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2793 { }
2794#line 2795 "libinterp/parse-tree/oct-parse.cc"
2795 break;
2796
2797 case YYSYMBOL_classdef: /* classdef */
2798#line 379 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2799 { delete ((*yyvaluep).tree_classdef_type); }
2800#line 2801 "libinterp/parse-tree/oct-parse.cc"
2801 break;
2802
2803 case YYSYMBOL_attr_list: /* attr_list */
2804#line 381 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2805 { delete ((*yyvaluep).tree_classdef_attribute_list_type); }
2806#line 2807 "libinterp/parse-tree/oct-parse.cc"
2807 break;
2808
2809 case YYSYMBOL_attr_list1: /* attr_list1 */
2810#line 381 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2811 { delete ((*yyvaluep).tree_classdef_attribute_list_type); }
2812#line 2813 "libinterp/parse-tree/oct-parse.cc"
2813 break;
2814
2815 case YYSYMBOL_attr: /* attr */
2816#line 380 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2817 { delete ((*yyvaluep).tree_classdef_attribute_type); }
2818#line 2819 "libinterp/parse-tree/oct-parse.cc"
2819 break;
2820
2821 case YYSYMBOL_superclass_list: /* superclass_list */
2822#line 383 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2823 { delete ((*yyvaluep).tree_classdef_superclass_list_type); }
2824#line 2825 "libinterp/parse-tree/oct-parse.cc"
2825 break;
2826
2827 case YYSYMBOL_superclass_list1: /* superclass_list1 */
2828#line 383 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2829 { delete ((*yyvaluep).tree_classdef_superclass_list_type); }
2830#line 2831 "libinterp/parse-tree/oct-parse.cc"
2831 break;
2832
2833 case YYSYMBOL_superclass: /* superclass */
2834#line 382 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2835 { delete ((*yyvaluep).tree_classdef_superclass_type); }
2836#line 2837 "libinterp/parse-tree/oct-parse.cc"
2837 break;
2838
2839 case YYSYMBOL_class_body: /* class_body */
2840#line 384 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2841 { delete ((*yyvaluep).tree_classdef_body_type); }
2842#line 2843 "libinterp/parse-tree/oct-parse.cc"
2843 break;
2844
2845 case YYSYMBOL_class_body1: /* class_body1 */
2846#line 384 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2847 { delete ((*yyvaluep).tree_classdef_body_type); }
2848#line 2849 "libinterp/parse-tree/oct-parse.cc"
2849 break;
2850
2851 case YYSYMBOL_properties_block: /* properties_block */
2852#line 387 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2853 { delete ((*yyvaluep).tree_classdef_properties_block_type); }
2854#line 2855 "libinterp/parse-tree/oct-parse.cc"
2855 break;
2856
2857 case YYSYMBOL_properties_beg: /* properties_beg */
2858#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2859 { }
2860#line 2861 "libinterp/parse-tree/oct-parse.cc"
2861 break;
2862
2863 case YYSYMBOL_property_list: /* property_list */
2864#line 386 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2865 { delete ((*yyvaluep).tree_classdef_property_list_type); }
2866#line 2867 "libinterp/parse-tree/oct-parse.cc"
2867 break;
2868
2869 case YYSYMBOL_property_list1: /* property_list1 */
2870#line 386 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2871 { delete ((*yyvaluep).tree_classdef_property_list_type); }
2872#line 2873 "libinterp/parse-tree/oct-parse.cc"
2873 break;
2874
2875 case YYSYMBOL_class_property: /* class_property */
2876#line 385 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2877 { delete ((*yyvaluep).tree_classdef_property_type); }
2878#line 2879 "libinterp/parse-tree/oct-parse.cc"
2879 break;
2880
2881 case YYSYMBOL_methods_block: /* methods_block */
2882#line 389 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2883 { delete ((*yyvaluep).tree_classdef_methods_block_type); }
2884#line 2885 "libinterp/parse-tree/oct-parse.cc"
2885 break;
2886
2887 case YYSYMBOL_methods_beg: /* methods_beg */
2888#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2889 { }
2890#line 2891 "libinterp/parse-tree/oct-parse.cc"
2891 break;
2892
2893 case YYSYMBOL_method_decl1: /* method_decl1 */
2894#line 377 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2895 { delete ((*yyvaluep).octave_user_function_type); }
2896#line 2897 "libinterp/parse-tree/oct-parse.cc"
2897 break;
2898
2899 case YYSYMBOL_method_decl: /* method_decl */
2900#line 353 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2901 { delete ((*yyvaluep).tree_function_def_type); }
2902#line 2903 "libinterp/parse-tree/oct-parse.cc"
2903 break;
2904
2905 case YYSYMBOL_method: /* method */
2906#line 353 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2907 { delete ((*yyvaluep).tree_function_def_type); }
2908#line 2909 "libinterp/parse-tree/oct-parse.cc"
2909 break;
2910
2911 case YYSYMBOL_methods_list: /* methods_list */
2912#line 388 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2913 { delete ((*yyvaluep).tree_classdef_methods_list_type); }
2914#line 2915 "libinterp/parse-tree/oct-parse.cc"
2915 break;
2916
2917 case YYSYMBOL_methods_list1: /* methods_list1 */
2918#line 388 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2919 { delete ((*yyvaluep).tree_classdef_methods_list_type); }
2920#line 2921 "libinterp/parse-tree/oct-parse.cc"
2921 break;
2922
2923 case YYSYMBOL_events_block: /* events_block */
2924#line 392 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2925 { delete ((*yyvaluep).tree_classdef_events_block_type); }
2926#line 2927 "libinterp/parse-tree/oct-parse.cc"
2927 break;
2928
2929 case YYSYMBOL_events_beg: /* events_beg */
2930#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2931 { }
2932#line 2933 "libinterp/parse-tree/oct-parse.cc"
2933 break;
2934
2935 case YYSYMBOL_events_list: /* events_list */
2936#line 391 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2937 { delete ((*yyvaluep).tree_classdef_events_list_type); }
2938#line 2939 "libinterp/parse-tree/oct-parse.cc"
2939 break;
2940
2941 case YYSYMBOL_events_list1: /* events_list1 */
2942#line 391 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2943 { delete ((*yyvaluep).tree_classdef_events_list_type); }
2944#line 2945 "libinterp/parse-tree/oct-parse.cc"
2945 break;
2946
2947 case YYSYMBOL_class_event: /* class_event */
2948#line 390 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2949 { delete ((*yyvaluep).tree_classdef_event_type); }
2950#line 2951 "libinterp/parse-tree/oct-parse.cc"
2951 break;
2952
2953 case YYSYMBOL_enum_block: /* enum_block */
2954#line 395 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2955 { delete ((*yyvaluep).tree_classdef_enum_block_type); }
2956#line 2957 "libinterp/parse-tree/oct-parse.cc"
2957 break;
2958
2959 case YYSYMBOL_enumeration_beg: /* enumeration_beg */
2960#line 340 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2961 { }
2962#line 2963 "libinterp/parse-tree/oct-parse.cc"
2963 break;
2964
2965 case YYSYMBOL_enum_list: /* enum_list */
2966#line 394 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2967 { delete ((*yyvaluep).tree_classdef_enum_list_type); }
2968#line 2969 "libinterp/parse-tree/oct-parse.cc"
2969 break;
2970
2971 case YYSYMBOL_enum_list1: /* enum_list1 */
2972#line 394 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2973 { delete ((*yyvaluep).tree_classdef_enum_list_type); }
2974#line 2975 "libinterp/parse-tree/oct-parse.cc"
2975 break;
2976
2977 case YYSYMBOL_class_enum: /* class_enum */
2978#line 393 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2979 { delete ((*yyvaluep).tree_classdef_enum_type); }
2980#line 2981 "libinterp/parse-tree/oct-parse.cc"
2981 break;
2982
2983 case YYSYMBOL_stash_comment: /* stash_comment */
2984#line 342 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2985 { }
2986#line 2987 "libinterp/parse-tree/oct-parse.cc"
2987 break;
2988
2989 case YYSYMBOL_sep_no_nl: /* sep_no_nl */
2990#line 341 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2991 { }
2992#line 2993 "libinterp/parse-tree/oct-parse.cc"
2993 break;
2994
2995 case YYSYMBOL_opt_sep_no_nl: /* opt_sep_no_nl */
2996#line 341 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
2997 { }
2998#line 2999 "libinterp/parse-tree/oct-parse.cc"
2999 break;
3000
3001 case YYSYMBOL_opt_nl: /* opt_nl */
3002#line 341 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3003 { }
3004#line 3005 "libinterp/parse-tree/oct-parse.cc"
3005 break;
3006
3007 case YYSYMBOL_nl: /* nl */
3008#line 341 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3009 { }
3010#line 3011 "libinterp/parse-tree/oct-parse.cc"
3011 break;
3012
3013 case YYSYMBOL_sep: /* sep */
3014#line 341 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3015 { }
3016#line 3017 "libinterp/parse-tree/oct-parse.cc"
3017 break;
3018
3019 case YYSYMBOL_opt_sep: /* opt_sep */
3020#line 341 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3021 { }
3022#line 3023 "libinterp/parse-tree/oct-parse.cc"
3023 break;
3024
3025 default:
3026 break;
3027 }
3029}
3030
3031
3032
3033
3034
3035int
3037{
3038 yypstate *yyps = yypstate_new ();
3039 if (!yyps)
3040 {
3041 yyerror (parser, YY_("memory exhausted"));
3042 return 2;
3043 }
3044 int yystatus = yypull_parse (yyps, parser);
3045 yypstate_delete (yyps);
3046 return yystatus;
3047}
3048
3049int
3051{
3052 YY_ASSERT (yyps);
3053 int yystatus;
3054 do {
3056 int yychar = yylex (&yylval, scanner);
3057 yystatus = yypush_parse (yyps, yychar, &yylval, parser);
3058 } while (yystatus == YYPUSH_MORE);
3059 return yystatus;
3060}
3061
3062#define octave_nerrs yyps->octave_nerrs
3063#define yystate yyps->yystate
3064#define yyerrstatus yyps->yyerrstatus
3065#define yyssa yyps->yyssa
3066#define yyss yyps->yyss
3067#define yyssp yyps->yyssp
3068#define yyvsa yyps->yyvsa
3069#define yyvs yyps->yyvs
3070#define yyvsp yyps->yyvsp
3071#define yystacksize yyps->yystacksize
3072
3073/* Initialize the parser data structure. */
3074static void
3076{
3077 yynerrs = 0;
3078 yystate = 0;
3079 yyerrstatus = 0;
3080
3081 yyssp = yyss;
3082 yyvsp = yyvs;
3083
3084 /* Initialize the state stack, in case yypcontext_expected_tokens is
3085 called before the first call to yyparse. */
3086 *yyssp = 0;
3087 yyps->yynew = 1;
3088}
3089
3090/* Initialize the parser data structure. */
3091yypstate *
3093{
3094 yypstate *yyps;
3095 yyps = YY_CAST (yypstate *, YYMALLOC (sizeof *yyps));
3096 if (!yyps)
3097 return YY_NULLPTR;
3099 yyss = yyssa;
3100 yyvs = yyvsa;
3101 yypstate_clear (yyps);
3102 return yyps;
3103}
3104
3105void
3107{
3108 if (yyps)
3109 {
3110#ifndef yyoverflow
3111 /* If the stack was reallocated but the parse did not complete, then the
3112 stack still needs to be freed. */
3113 if (yyss != yyssa)
3115#endif
3116 YYFREE (yyps);
3117 }
3118}
3119
3120
3121
3122/*---------------.
3123| yypush_parse. |
3124`---------------*/
3125
3126int
3128 int yypushed_char, YYSTYPE const *yypushed_val, octave::base_parser& parser)
3129{
3130/* Lookahead token kind. */
3131int yychar;
3132
3133
3134/* The semantic value of the lookahead symbol. */
3135/* Default value used for initialization, for pacifying older GCCs
3136 or non-GCC compilers. */
3137YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
3138YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
3139
3140 int yyn;
3141 /* The return value of yyparse. */
3142 int yyresult;
3143 /* Lookahead symbol kind. */
3145 /* The variables used to return semantic value and location from the
3146 action routines. */
3147 YYSTYPE yyval;
3148
3149
3150
3151#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3152
3153 /* The number of symbols on the RHS of the reduced rule.
3154 Keep to zero when no symbol should be popped. */
3155 int yylen = 0;
3156
3157 switch (yyps->yynew)
3158 {
3159 case 0:
3160 yyn = yypact[yystate];
3161 goto yyread_pushed_token;
3162
3163 case 2:
3164 yypstate_clear (yyps);
3165 break;
3166
3167 default:
3168 break;
3169 }
3170
3171 YYDPRINTF ((stderr, "Starting parse\n"));
3172
3173 yychar = OCTAVE_EMPTY; /* Cause a token to be read. */
3174
3175 goto yysetstate;
3176
3177
3178/*------------------------------------------------------------.
3179| yynewstate -- push a new state, which is found in yystate. |
3180`------------------------------------------------------------*/
3181yynewstate:
3182 /* In all cases, when you get here, the value and location stacks
3183 have just been pushed. So pushing a state here evens the stacks. */
3184 yyssp++;
3185
3186
3187/*--------------------------------------------------------------------.
3188| yysetstate -- set current state (the top of the stack) to yystate. |
3189`--------------------------------------------------------------------*/
3190yysetstate:
3191 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3192 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
3197
3198 if (yyss + yystacksize - 1 <= yyssp)
3199#if !defined yyoverflow && !defined YYSTACK_RELOCATE
3200 YYNOMEM;
3201#else
3202 {
3203 /* Get the current used size of the three stacks, in elements. */
3204 YYPTRDIFF_T yysize = yyssp - yyss + 1;
3205
3206# if defined yyoverflow
3207 {
3208 /* Give user a chance to reallocate the stack. Use copies of
3209 these so that the &'s don't force the real ones into
3210 memory. */
3211 yy_state_t *yyss1 = yyss;
3212 YYSTYPE *yyvs1 = yyvs;
3213
3214 /* Each stack pointer address is followed by the size of the
3215 data in use in that stack, in bytes. This used to be a
3216 conditional around just the two extra args, but that might
3217 be undefined if yyoverflow is a macro. */
3218 yyoverflow (YY_("memory exhausted"),
3219 &yyss1, yysize * YYSIZEOF (*yyssp),
3220 &yyvs1, yysize * YYSIZEOF (*yyvsp),
3221 &yystacksize);
3222 yyss = yyss1;
3223 yyvs = yyvs1;
3224 }
3225# else /* defined YYSTACK_RELOCATE */
3226 /* Extend the stack our own way. */
3227 if (YYMAXDEPTH <= yystacksize)
3228 YYNOMEM;
3229 yystacksize *= 2;
3230 if (YYMAXDEPTH < yystacksize)
3232
3233 {
3234 yy_state_t *yyss1 = yyss;
3235 union yyalloc *yyptr =
3236 YY_CAST (union yyalloc *,
3238 if (! yyptr)
3239 YYNOMEM;
3240 YYSTACK_RELOCATE (yyss_alloc, yyss);
3241 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3242# undef YYSTACK_RELOCATE
3243 if (yyss1 != yyssa)
3244 YYSTACK_FREE (yyss1);
3245 }
3246# endif
3247
3248 yyssp = yyss + yysize - 1;
3249 yyvsp = yyvs + yysize - 1;
3250
3252 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
3253 YY_CAST (long, yystacksize)));
3255
3256 if (yyss + yystacksize - 1 <= yyssp)
3257 YYABORT;
3258 }
3259#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
3260
3261
3262 if (yystate == YYFINAL)
3263 YYACCEPT;
3264
3265 goto yybackup;
3266
3267
3268/*-----------.
3269| yybackup. |
3270`-----------*/
3271yybackup:
3272 /* Do appropriate processing given the current state. Read a
3273 lookahead token if we need one and don't already have one. */
3274
3275 /* First try to decide what to do without reference to lookahead token. */
3276 yyn = yypact[yystate];
3277 if (yypact_value_is_default (yyn))
3278 goto yydefault;
3279
3280 /* Not known => get a lookahead token if don't already have one. */
3281
3282 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
3283 if (yychar == OCTAVE_EMPTY)
3284 {
3285 if (!yyps->yynew)
3286 {
3287 YYDPRINTF ((stderr, "Return for a new token:\n"));
3288 yyresult = YYPUSH_MORE;
3289 goto yypushreturn;
3290 }
3291 yyps->yynew = 0;
3292yyread_pushed_token:
3293 YYDPRINTF ((stderr, "Reading a token\n"));
3294 yychar = yypushed_char;
3295 if (yypushed_val)
3296 yylval = *yypushed_val;
3297 }
3298
3299 if (yychar <= OCTAVE_EOF)
3300 {
3301 yychar = OCTAVE_EOF;
3302 yytoken = YYSYMBOL_YYEOF;
3303 YYDPRINTF ((stderr, "Now at end of input.\n"));
3304 }
3305 else if (yychar == OCTAVE_error)
3306 {
3307 /* The scanner already issued an error message, process directly
3308 to error recovery. But do not keep the error token as
3309 lookahead, it is too special and may lead us to an endless
3310 loop in error recovery. */
3311 yychar = OCTAVE_UNDEF;
3312 yytoken = YYSYMBOL_YYerror;
3313 goto yyerrlab1;
3314 }
3315 else
3316 {
3317 yytoken = YYTRANSLATE (yychar);
3318 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3319 }
3320
3321 /* If the proper action on seeing token YYTOKEN is to reduce or to
3322 detect an error, take that action. */
3323 yyn += yytoken;
3324 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3325 goto yydefault;
3326 yyn = yytable[yyn];
3327 if (yyn <= 0)
3328 {
3329 if (yytable_value_is_error (yyn))
3330 goto yyerrlab;
3331 yyn = -yyn;
3332 goto yyreduce;
3333 }
3334
3335 /* Count tokens shifted since error; after three, turn off error
3336 status. */
3337 if (yyerrstatus)
3338 yyerrstatus--;
3339
3340 /* Shift the lookahead token. */
3341 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3342 yystate = yyn;
3344 *++yyvsp = yylval;
3346
3347 /* Discard the shifted token. */
3348 yychar = OCTAVE_EMPTY;
3349 goto yynewstate;
3350
3351
3352/*-----------------------------------------------------------.
3353| yydefault -- do the default action for the current state. |
3354`-----------------------------------------------------------*/
3355yydefault:
3356 yyn = yydefact[yystate];
3357 if (yyn == 0)
3358 goto yyerrlab;
3359 goto yyreduce;
3360
3361
3362/*-----------------------------.
3363| yyreduce -- do a reduction. |
3364`-----------------------------*/
3365yyreduce:
3366 /* yyn is the number of a rule to reduce with. */
3367 yylen = yyr2[yyn];
3368
3369 /* If YYLEN is nonzero, implement the default value of the action:
3370 '$$ = $1'.
3371
3372 Otherwise, the following line sets YYVAL to garbage.
3373 This behavior is undocumented and Bison
3374 users should not rely upon it. Assigning to YYVAL
3375 unconditionally makes the parser a bit smaller, and it avoids a
3376 GCC warning that YYVAL may be used uninitialized. */
3377 yyval = yyvsp[1-yylen];
3378
3379
3380 YY_REDUCE_PRINT (yyn);
3381 switch (yyn)
3382 {
3383 case 2: /* input: simple_list '\n' */
3384#line 416 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3385 {
3386 OCTAVE_YYUSE ((yyvsp[0].tok_val));
3387
3388 (yyval.tree_type) = nullptr;
3389
3390 if (! parser.finish_input ((yyvsp[-1].tree_statement_list_type)))
3391 YYABORT;
3392 else
3393 YYACCEPT;
3394 }
3395#line 3396 "libinterp/parse-tree/oct-parse.cc"
3396 break;
3397
3398 case 3: /* input: simple_list END_OF_INPUT */
3399#line 427 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3400 {
3401 OCTAVE_YYUSE ((yyvsp[0].tok_val));
3402
3403 (yyval.tree_type) = nullptr;
3404
3405 if (! parser.finish_input ((yyvsp[-1].tree_statement_list_type), true))
3406 YYABORT;
3407 else
3408 YYACCEPT;
3409 }
3410#line 3411 "libinterp/parse-tree/oct-parse.cc"
3411 break;
3412
3413 case 4: /* input: parse_error */
3414#line 438 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3415 {
3416 (yyval.tree_type) = nullptr;
3417 YYABORT;
3418 }
3419#line 3420 "libinterp/parse-tree/oct-parse.cc"
3420 break;
3421
3422 case 5: /* simple_list: opt_sep_no_nl */
3423#line 445 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3424 {
3425 OCTAVE_YYUSE ((yyvsp[0].punct_type));
3426
3427 (yyval.tree_statement_list_type) = nullptr;
3428 }
3429#line 3430 "libinterp/parse-tree/oct-parse.cc"
3430 break;
3431
3432 case 6: /* simple_list: simple_list1 opt_sep_no_nl */
3433#line 451 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3434 { (yyval.tree_statement_list_type) = parser.set_stmt_print_flag ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].punct_type), false); }
3435#line 3436 "libinterp/parse-tree/oct-parse.cc"
3436 break;
3437
3438 case 7: /* simple_list1: statement */
3439#line 455 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3440 { (yyval.tree_statement_list_type) = parser.make_statement_list ((yyvsp[0].tree_statement_type)); }
3441#line 3442 "libinterp/parse-tree/oct-parse.cc"
3442 break;
3443
3444 case 8: /* simple_list1: simple_list1 sep_no_nl statement */
3445#line 457 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3446 { (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].punct_type), (yyvsp[0].tree_statement_type), false); }
3447#line 3448 "libinterp/parse-tree/oct-parse.cc"
3448 break;
3449
3450 case 9: /* opt_list: %empty */
3451#line 461 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3452 { (yyval.tree_statement_list_type) = nullptr; }
3453#line 3454 "libinterp/parse-tree/oct-parse.cc"
3454 break;
3455
3456 case 10: /* opt_list: list */
3457#line 463 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3458 { (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type); }
3459#line 3460 "libinterp/parse-tree/oct-parse.cc"
3460 break;
3461
3462 case 11: /* list: list1 opt_sep */
3463#line 467 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3464 { (yyval.tree_statement_list_type) = parser.set_stmt_print_flag ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].punct_type), true); }
3465#line 3466 "libinterp/parse-tree/oct-parse.cc"
3466 break;
3467
3468 case 12: /* list1: statement */
3469#line 471 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3470 { (yyval.tree_statement_list_type) = parser.make_statement_list ((yyvsp[0].tree_statement_type)); }
3471#line 3472 "libinterp/parse-tree/oct-parse.cc"
3472 break;
3473
3474 case 13: /* list1: list1 sep statement */
3475#line 473 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3476 { (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].punct_type), (yyvsp[0].tree_statement_type), true); }
3477#line 3478 "libinterp/parse-tree/oct-parse.cc"
3478 break;
3479
3480 case 14: /* opt_fcn_list: %empty */
3481#line 477 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3482 { (yyval.tree_statement_list_type) = nullptr; }
3483#line 3484 "libinterp/parse-tree/oct-parse.cc"
3484 break;
3485
3486 case 15: /* opt_fcn_list: fcn_list */
3487#line 479 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3488 { (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type); }
3489#line 3490 "libinterp/parse-tree/oct-parse.cc"
3490 break;
3491
3492 case 16: /* fcn_list: fcn_list1 opt_sep */
3493#line 483 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3494 {
3495 OCTAVE_YYUSE ((yyvsp[0].punct_type));
3496
3497 (yyval.tree_statement_list_type) = (yyvsp[-1].tree_statement_list_type);
3498 }
3499#line 3500 "libinterp/parse-tree/oct-parse.cc"
3500 break;
3501
3502 case 17: /* fcn_list1: function */
3503#line 491 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3504 {
3505 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_function_def_type));
3506 (yyval.tree_statement_list_type) = parser.make_statement_list (stmt);
3507 }
3508#line 3509 "libinterp/parse-tree/oct-parse.cc"
3509 break;
3510
3511 case 18: /* fcn_list1: fcn_list1 opt_sep function */
3512#line 496 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3513 {
3514 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_function_def_type));
3515 (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].punct_type), stmt, false);
3516 }
3517#line 3518 "libinterp/parse-tree/oct-parse.cc"
3518 break;
3519
3520 case 19: /* statement: expression */
3521#line 503 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3522 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_expression_type)); }
3523#line 3524 "libinterp/parse-tree/oct-parse.cc"
3524 break;
3525
3526 case 20: /* statement: command */
3527#line 505 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3528 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_command_type)); }
3529#line 3530 "libinterp/parse-tree/oct-parse.cc"
3530 break;
3531
3532 case 21: /* statement: word_list_cmd */
3533#line 507 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3534 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_index_expression_type)); }
3535#line 3536 "libinterp/parse-tree/oct-parse.cc"
3536 break;
3537
3538 case 22: /* word_list_cmd: identifier word_list */
3539#line 519 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3540 {
3541 (yyval.tree_index_expression_type) = parser.make_index_expression ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_argument_list_type), '(');
3542 if (! (yyval.tree_index_expression_type))
3543 {
3544 // make_index_expression deleted $1 and $2.
3545 YYABORT;
3546 }
3547 (yyval.tree_index_expression_type)->mark_word_list_cmd ();
3548 }
3549#line 3550 "libinterp/parse-tree/oct-parse.cc"
3550 break;
3551
3552 case 23: /* word_list: string */
3553#line 531 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3554 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_constant_type)); }
3555#line 3556 "libinterp/parse-tree/oct-parse.cc"
3556 break;
3557
3558 case 24: /* word_list: word_list string */
3559#line 533 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3560 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-1].tree_argument_list_type), (yyvsp[0].tree_constant_type)); }
3561#line 3562 "libinterp/parse-tree/oct-parse.cc"
3562 break;
3563
3564 case 25: /* identifier: NAME */
3565#line 541 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3566 { (yyval.tree_identifier_type) = parser.make_identifier ((yyvsp[0].tok_val)); }
3567#line 3568 "libinterp/parse-tree/oct-parse.cc"
3568 break;
3569
3570 case 26: /* superclass_identifier: SUPERCLASSREF */
3571#line 546 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3572 { (yyval.tree_superclass_ref_type) = parser.make_superclass_ref ((yyvsp[0].tok_val)); }
3573#line 3574 "libinterp/parse-tree/oct-parse.cc"
3574 break;
3575
3576 case 27: /* meta_identifier: METAQUERY */
3577#line 550 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3578 { (yyval.tree_metaclass_query_type) = parser.make_metaclass_query ((yyvsp[0].tok_val)); }
3579#line 3580 "libinterp/parse-tree/oct-parse.cc"
3580 break;
3581
3582 case 28: /* string: DQ_STRING */
3583#line 554 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3584 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok_val)); }
3585#line 3586 "libinterp/parse-tree/oct-parse.cc"
3586 break;
3587
3588 case 29: /* string: SQ_STRING */
3589#line 556 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3590 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok_val)); }
3591#line 3592 "libinterp/parse-tree/oct-parse.cc"
3592 break;
3593
3594 case 30: /* constant: NUMBER */
3595#line 560 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3596 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok_val)); }
3597#line 3598 "libinterp/parse-tree/oct-parse.cc"
3598 break;
3599
3600 case 31: /* constant: string */
3601#line 562 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3602 { (yyval.tree_constant_type) = (yyvsp[0].tree_constant_type); }
3603#line 3604 "libinterp/parse-tree/oct-parse.cc"
3604 break;
3605
3606 case 32: /* matrix: '[' matrix_rows ']' */
3607#line 566 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3608 { (yyval.tree_expression_type) = parser.finish_matrix ((yyvsp[-1].tree_matrix_type), (yyvsp[-2].tok_val), (yyvsp[0].tok_val)); }
3609#line 3610 "libinterp/parse-tree/oct-parse.cc"
3610 break;
3611
3612 case 33: /* matrix_rows: cell_or_matrix_row */
3613#line 570 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3614 { (yyval.tree_matrix_type) = parser.make_matrix ((yyvsp[0].tree_argument_list_type)); }
3615#line 3616 "libinterp/parse-tree/oct-parse.cc"
3616 break;
3617
3618 case 34: /* matrix_rows: matrix_rows ';' cell_or_matrix_row */
3619#line 572 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3620 {
3621 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
3622
3623 (yyval.tree_matrix_type) = parser.append_matrix_row ((yyvsp[-2].tree_matrix_type), (yyvsp[0].tree_argument_list_type));
3624 }
3625#line 3626 "libinterp/parse-tree/oct-parse.cc"
3626 break;
3627
3628 case 35: /* cell: '{' cell_rows '}' */
3629#line 580 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3630 { (yyval.tree_expression_type) = parser.finish_cell ((yyvsp[-1].tree_cell_type), (yyvsp[-2].tok_val), (yyvsp[0].tok_val)); }
3631#line 3632 "libinterp/parse-tree/oct-parse.cc"
3632 break;
3633
3634 case 36: /* cell_rows: cell_or_matrix_row */
3635#line 584 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3636 { (yyval.tree_cell_type) = parser.make_cell ((yyvsp[0].tree_argument_list_type)); }
3637#line 3638 "libinterp/parse-tree/oct-parse.cc"
3638 break;
3639
3640 case 37: /* cell_rows: cell_rows ';' cell_or_matrix_row */
3641#line 586 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3642 {
3643 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
3644
3645 (yyval.tree_cell_type) = parser.append_cell_row ((yyvsp[-2].tree_cell_type), (yyvsp[0].tree_argument_list_type));
3646 }
3647#line 3648 "libinterp/parse-tree/oct-parse.cc"
3648 break;
3649
3650 case 38: /* cell_or_matrix_row: %empty */
3651#line 602 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3652 { (yyval.tree_argument_list_type) = nullptr; }
3653#line 3654 "libinterp/parse-tree/oct-parse.cc"
3654 break;
3655
3656 case 39: /* cell_or_matrix_row: ',' */
3657#line 604 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3658 {
3659 OCTAVE_YYUSE ((yyvsp[0].tok_val));
3660
3661 (yyval.tree_argument_list_type) = nullptr;
3662 }
3663#line 3664 "libinterp/parse-tree/oct-parse.cc"
3664 break;
3665
3666 case 40: /* cell_or_matrix_row: arg_list */
3667#line 610 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3668 { (yyval.tree_argument_list_type) = (yyvsp[0].tree_argument_list_type); }
3669#line 3670 "libinterp/parse-tree/oct-parse.cc"
3670 break;
3671
3672 case 41: /* cell_or_matrix_row: arg_list ',' */
3673#line 612 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3674 {
3675 OCTAVE_YYUSE ((yyvsp[0].tok_val));
3676
3677 (yyval.tree_argument_list_type) = (yyvsp[-1].tree_argument_list_type);
3678 }
3679#line 3680 "libinterp/parse-tree/oct-parse.cc"
3680 break;
3681
3682 case 42: /* cell_or_matrix_row: ',' arg_list */
3683#line 618 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3684 {
3685 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
3686
3687 (yyval.tree_argument_list_type) = (yyvsp[0].tree_argument_list_type);
3688 }
3689#line 3690 "libinterp/parse-tree/oct-parse.cc"
3690 break;
3691
3692 case 43: /* cell_or_matrix_row: ',' arg_list ',' */
3693#line 624 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3694 {
3695 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
3696
3697 (yyval.tree_argument_list_type) = (yyvsp[-1].tree_argument_list_type);
3698 }
3699#line 3700 "libinterp/parse-tree/oct-parse.cc"
3700 break;
3701
3702 case 44: /* fcn_handle: FCN_HANDLE */
3703#line 632 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3704 { (yyval.tree_fcn_handle_type) = parser.make_fcn_handle ((yyvsp[0].tok_val)); }
3705#line 3706 "libinterp/parse-tree/oct-parse.cc"
3706 break;
3707
3708 case 45: /* anon_fcn_handle: '@' param_list anon_fcn_begin expression */
3709#line 640 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3710 {
3711 (yyval.tree_anon_fcn_handle_type) = parser.make_anon_fcn_handle ((yyvsp[-2].tree_parameter_list_type), (yyvsp[0].tree_expression_type), (yyvsp[-3].tok_val)->beg_pos ());
3712 if (! (yyval.tree_anon_fcn_handle_type))
3713 {
3714 // make_anon_fcn_handle deleted $2 and $4.
3715 YYABORT;
3716 }
3717
3718 lexer.m_parsing_anon_fcn_body = false;
3719 lexer.m_nesting_level.remove ();
3720 }
3721#line 3722 "libinterp/parse-tree/oct-parse.cc"
3722 break;
3723
3724 case 46: /* anon_fcn_handle: '@' param_list anon_fcn_begin error */
3725#line 652 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3726 {
3727 OCTAVE_YYUSE ((yyvsp[-3].tok_val), (yyvsp[-2].tree_parameter_list_type));
3728
3729 lexer.m_parsing_anon_fcn_body = false;
3730
3731 (yyval.tree_anon_fcn_handle_type) = nullptr;
3732 parser.bison_error ("anonymous function bodies must be single expressions");
3733 YYABORT;
3734 }
3735#line 3736 "libinterp/parse-tree/oct-parse.cc"
3736 break;
3737
3738 case 47: /* primary_expr: identifier */
3739#line 664 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3740 { (yyval.tree_expression_type) = (yyvsp[0].tree_identifier_type); }
3741#line 3742 "libinterp/parse-tree/oct-parse.cc"
3742 break;
3743
3744 case 48: /* primary_expr: constant */
3745#line 666 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3746 { (yyval.tree_expression_type) = (yyvsp[0].tree_constant_type); }
3747#line 3748 "libinterp/parse-tree/oct-parse.cc"
3748 break;
3749
3750 case 49: /* primary_expr: fcn_handle */
3751#line 668 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3752 { (yyval.tree_expression_type) = (yyvsp[0].tree_fcn_handle_type); }
3753#line 3754 "libinterp/parse-tree/oct-parse.cc"
3754 break;
3755
3756 case 50: /* primary_expr: matrix */
3757#line 670 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3758 {
3759 lexer.m_looking_at_matrix_or_assign_lhs = false;
3760 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
3761 }
3762#line 3763 "libinterp/parse-tree/oct-parse.cc"
3763 break;
3764
3765 case 51: /* primary_expr: cell */
3766#line 675 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3767 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
3768#line 3769 "libinterp/parse-tree/oct-parse.cc"
3769 break;
3770
3771 case 52: /* primary_expr: meta_identifier */
3772#line 677 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3773 { (yyval.tree_expression_type) = (yyvsp[0].tree_metaclass_query_type); }
3774#line 3775 "libinterp/parse-tree/oct-parse.cc"
3775 break;
3776
3777 case 53: /* primary_expr: superclass_identifier */
3778#line 679 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3779 { (yyval.tree_expression_type) = (yyvsp[0].tree_superclass_ref_type); }
3780#line 3781 "libinterp/parse-tree/oct-parse.cc"
3781 break;
3782
3783 case 54: /* primary_expr: '(' expression ')' */
3784#line 681 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3785 {
3786 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
3787
3788 (yyval.tree_expression_type) = (yyvsp[-1].tree_expression_type)->mark_in_parens ();
3789 }
3790#line 3791 "libinterp/parse-tree/oct-parse.cc"
3791 break;
3792
3793 case 55: /* magic_colon: ':' */
3794#line 689 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3795 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok_val)); }
3796#line 3797 "libinterp/parse-tree/oct-parse.cc"
3797 break;
3798
3799 case 56: /* magic_tilde: EXPR_NOT */
3800#line 693 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3801 {
3802 OCTAVE_YYUSE ((yyvsp[0].tok_val));
3803
3804 (yyval.tree_identifier_type) = parser.make_black_hole ();
3805 }
3806#line 3807 "libinterp/parse-tree/oct-parse.cc"
3807 break;
3808
3809 case 57: /* arg_list: expression */
3810#line 701 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3811 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_expression_type)); }
3812#line 3813 "libinterp/parse-tree/oct-parse.cc"
3813 break;
3814
3815 case 58: /* arg_list: magic_colon */
3816#line 703 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3817 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_constant_type)); }
3818#line 3819 "libinterp/parse-tree/oct-parse.cc"
3819 break;
3820
3821 case 59: /* arg_list: magic_tilde */
3822#line 705 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3823 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_identifier_type)); }
3824#line 3825 "libinterp/parse-tree/oct-parse.cc"
3825 break;
3826
3827 case 60: /* arg_list: arg_list ',' magic_colon */
3828#line 707 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3829 {
3830 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
3831
3832 (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[0].tree_constant_type));
3833 }
3834#line 3835 "libinterp/parse-tree/oct-parse.cc"
3835 break;
3836
3837 case 61: /* arg_list: arg_list ',' magic_tilde */
3838#line 713 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3839 {
3840 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
3841
3842 (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[0].tree_identifier_type));
3843 }
3844#line 3845 "libinterp/parse-tree/oct-parse.cc"
3845 break;
3846
3847 case 62: /* arg_list: arg_list ',' expression */
3848#line 719 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3849 {
3850 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
3851
3852 (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[0].tree_expression_type));
3853 }
3854#line 3855 "libinterp/parse-tree/oct-parse.cc"
3855 break;
3856
3857 case 63: /* indirect_ref_op: '.' */
3858#line 727 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3859 {
3860 OCTAVE_YYUSE ((yyvsp[0].tok_val));
3861
3862 (yyval.dummy_type) = 0;
3863 lexer.m_looking_at_indirect_ref = true;
3864 }
3865#line 3866 "libinterp/parse-tree/oct-parse.cc"
3866 break;
3867
3868 case 64: /* oper_expr: primary_expr */
3869#line 736 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3870 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
3871#line 3872 "libinterp/parse-tree/oct-parse.cc"
3872 break;
3873
3874 case 65: /* oper_expr: oper_expr PLUS_PLUS */
3875#line 738 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3876 { (yyval.tree_expression_type) = parser.make_postfix_op (PLUS_PLUS, (yyvsp[-1].tree_expression_type), (yyvsp[0].tok_val)); }
3877#line 3878 "libinterp/parse-tree/oct-parse.cc"
3878 break;
3879
3880 case 66: /* oper_expr: oper_expr MINUS_MINUS */
3881#line 740 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3882 { (yyval.tree_expression_type) = parser.make_postfix_op (MINUS_MINUS, (yyvsp[-1].tree_expression_type), (yyvsp[0].tok_val)); }
3883#line 3884 "libinterp/parse-tree/oct-parse.cc"
3884 break;
3885
3886 case 67: /* oper_expr: oper_expr '(' ')' */
3887#line 742 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3888 {
3889 OCTAVE_YYUSE ((yyvsp[-1].tok_val), (yyvsp[0].tok_val));
3890
3891 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), nullptr, '(');
3892 if (! (yyval.tree_expression_type))
3893 {
3894 // make_index_expression deleted $1.
3895 YYABORT;
3896 }
3897 }
3898#line 3899 "libinterp/parse-tree/oct-parse.cc"
3899 break;
3900
3901 case 68: /* oper_expr: oper_expr '(' arg_list ')' */
3902#line 753 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3903 {
3904 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
3905
3906 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_argument_list_type), '(');
3907 if (! (yyval.tree_expression_type))
3908 {
3909 // make_index_expression deleted $1 and $3.
3910 YYABORT;
3911 }
3912 }
3913#line 3914 "libinterp/parse-tree/oct-parse.cc"
3914 break;
3915
3916 case 69: /* oper_expr: oper_expr '{' '}' */
3917#line 764 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3918 {
3919 OCTAVE_YYUSE ((yyvsp[-1].tok_val), (yyvsp[0].tok_val));
3920
3921 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), nullptr, '{');
3922 if (! (yyval.tree_expression_type))
3923 {
3924 // make_index_expression deleted $1.
3925 YYABORT;
3926 }
3927 }
3928#line 3929 "libinterp/parse-tree/oct-parse.cc"
3929 break;
3930
3931 case 70: /* oper_expr: oper_expr '{' arg_list '}' */
3932#line 775 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3933 {
3934 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
3935
3936 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_argument_list_type), '{');
3937 if (! (yyval.tree_expression_type))
3938 {
3939 // make_index_expression deleted $1 and $3.
3940 YYABORT;
3941 }
3942 }
3943#line 3944 "libinterp/parse-tree/oct-parse.cc"
3944 break;
3945
3946 case 71: /* oper_expr: oper_expr HERMITIAN */
3947#line 786 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3948 { (yyval.tree_expression_type) = parser.make_postfix_op (HERMITIAN, (yyvsp[-1].tree_expression_type), (yyvsp[0].tok_val)); }
3949#line 3950 "libinterp/parse-tree/oct-parse.cc"
3950 break;
3951
3952 case 72: /* oper_expr: oper_expr TRANSPOSE */
3953#line 788 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3954 { (yyval.tree_expression_type) = parser.make_postfix_op (TRANSPOSE, (yyvsp[-1].tree_expression_type), (yyvsp[0].tok_val)); }
3955#line 3956 "libinterp/parse-tree/oct-parse.cc"
3956 break;
3957
3958 case 73: /* oper_expr: oper_expr indirect_ref_op STRUCT_ELT */
3959#line 790 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3960 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-2].tree_expression_type), (yyvsp[0].tok_val)->text ()); }
3961#line 3962 "libinterp/parse-tree/oct-parse.cc"
3962 break;
3963
3964 case 74: /* oper_expr: oper_expr indirect_ref_op '(' expression ')' */
3965#line 792 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3966 {
3967 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
3968
3969 (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-4].tree_expression_type), (yyvsp[-1].tree_expression_type));
3970 }
3971#line 3972 "libinterp/parse-tree/oct-parse.cc"
3972 break;
3973
3974 case 75: /* oper_expr: PLUS_PLUS oper_expr */
3975#line 798 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3976 { (yyval.tree_expression_type) = parser.make_prefix_op (PLUS_PLUS, (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
3977#line 3978 "libinterp/parse-tree/oct-parse.cc"
3978 break;
3979
3980 case 76: /* oper_expr: MINUS_MINUS oper_expr */
3981#line 800 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3982 { (yyval.tree_expression_type) = parser.make_prefix_op (MINUS_MINUS, (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
3983#line 3984 "libinterp/parse-tree/oct-parse.cc"
3984 break;
3985
3986 case 77: /* oper_expr: EXPR_NOT oper_expr */
3987#line 802 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3988 { (yyval.tree_expression_type) = parser.make_prefix_op (EXPR_NOT, (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
3989#line 3990 "libinterp/parse-tree/oct-parse.cc"
3990 break;
3991
3992 case 78: /* oper_expr: '+' oper_expr */
3993#line 804 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
3994 { (yyval.tree_expression_type) = parser.make_prefix_op ('+', (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
3995#line 3996 "libinterp/parse-tree/oct-parse.cc"
3996 break;
3997
3998 case 79: /* oper_expr: '-' oper_expr */
3999#line 806 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4000 { (yyval.tree_expression_type) = parser.make_prefix_op ('-', (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
4001#line 4002 "libinterp/parse-tree/oct-parse.cc"
4002 break;
4003
4004 case 80: /* oper_expr: oper_expr POW power_expr */
4005#line 808 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4006 { (yyval.tree_expression_type) = parser.make_binary_op (POW, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4007#line 4008 "libinterp/parse-tree/oct-parse.cc"
4008 break;
4009
4010 case 81: /* oper_expr: oper_expr EPOW power_expr */
4011#line 810 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4012 { (yyval.tree_expression_type) = parser.make_binary_op (EPOW, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4013#line 4014 "libinterp/parse-tree/oct-parse.cc"
4014 break;
4015
4016 case 82: /* oper_expr: oper_expr '+' oper_expr */
4017#line 812 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4018 { (yyval.tree_expression_type) = parser.make_binary_op ('+', (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4019#line 4020 "libinterp/parse-tree/oct-parse.cc"
4020 break;
4021
4022 case 83: /* oper_expr: oper_expr '-' oper_expr */
4023#line 814 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4024 { (yyval.tree_expression_type) = parser.make_binary_op ('-', (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4025#line 4026 "libinterp/parse-tree/oct-parse.cc"
4026 break;
4027
4028 case 84: /* oper_expr: oper_expr '*' oper_expr */
4029#line 816 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4030 { (yyval.tree_expression_type) = parser.make_binary_op ('*', (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4031#line 4032 "libinterp/parse-tree/oct-parse.cc"
4032 break;
4033
4034 case 85: /* oper_expr: oper_expr '/' oper_expr */
4035#line 818 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4036 { (yyval.tree_expression_type) = parser.make_binary_op ('/', (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4037#line 4038 "libinterp/parse-tree/oct-parse.cc"
4038 break;
4039
4040 case 86: /* oper_expr: oper_expr EMUL oper_expr */
4041#line 820 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4042 { (yyval.tree_expression_type) = parser.make_binary_op (EMUL, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4043#line 4044 "libinterp/parse-tree/oct-parse.cc"
4044 break;
4045
4046 case 87: /* oper_expr: oper_expr EDIV oper_expr */
4047#line 822 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4048 { (yyval.tree_expression_type) = parser.make_binary_op (EDIV, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4049#line 4050 "libinterp/parse-tree/oct-parse.cc"
4050 break;
4051
4052 case 88: /* oper_expr: oper_expr LEFTDIV oper_expr */
4053#line 824 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4054 { (yyval.tree_expression_type) = parser.make_binary_op (LEFTDIV, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4055#line 4056 "libinterp/parse-tree/oct-parse.cc"
4056 break;
4057
4058 case 89: /* oper_expr: oper_expr ELEFTDIV oper_expr */
4059#line 826 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4060 { (yyval.tree_expression_type) = parser.make_binary_op (ELEFTDIV, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4061#line 4062 "libinterp/parse-tree/oct-parse.cc"
4062 break;
4063
4064 case 90: /* power_expr: primary_expr */
4065#line 830 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4066 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4067#line 4068 "libinterp/parse-tree/oct-parse.cc"
4068 break;
4069
4070 case 91: /* power_expr: power_expr PLUS_PLUS */
4071#line 832 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4072 { (yyval.tree_expression_type) = parser.make_postfix_op (PLUS_PLUS, (yyvsp[-1].tree_expression_type), (yyvsp[0].tok_val)); }
4073#line 4074 "libinterp/parse-tree/oct-parse.cc"
4074 break;
4075
4076 case 92: /* power_expr: power_expr MINUS_MINUS */
4077#line 834 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4078 { (yyval.tree_expression_type) = parser.make_postfix_op (MINUS_MINUS, (yyvsp[-1].tree_expression_type), (yyvsp[0].tok_val)); }
4079#line 4080 "libinterp/parse-tree/oct-parse.cc"
4080 break;
4081
4082 case 93: /* power_expr: power_expr '(' ')' */
4083#line 836 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4084 {
4085 OCTAVE_YYUSE ((yyvsp[-1].tok_val), (yyvsp[0].tok_val));
4086
4087 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), nullptr, '(');
4088 if (! (yyval.tree_expression_type))
4089 {
4090 // make_index_expression deleted $1.
4091 YYABORT;
4092 }
4093 }
4094#line 4095 "libinterp/parse-tree/oct-parse.cc"
4095 break;
4096
4097 case 94: /* power_expr: power_expr '(' arg_list ')' */
4098#line 847 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4099 {
4100 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
4101
4102 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_argument_list_type), '(');
4103 if (! (yyval.tree_expression_type))
4104 {
4105 // make_index_expression deleted $1 and $3.
4106 YYABORT;
4107 }
4108 }
4109#line 4110 "libinterp/parse-tree/oct-parse.cc"
4110 break;
4111
4112 case 95: /* power_expr: power_expr '{' '}' */
4113#line 858 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4114 {
4115 OCTAVE_YYUSE ((yyvsp[-1].tok_val), (yyvsp[0].tok_val));
4116
4117 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), nullptr, '{');
4118 if (! (yyval.tree_expression_type))
4119 {
4120 // make_index_expression deleted $1.
4121 YYABORT;
4122 }
4123 }
4124#line 4125 "libinterp/parse-tree/oct-parse.cc"
4125 break;
4126
4127 case 96: /* power_expr: power_expr '{' arg_list '}' */
4128#line 869 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4129 {
4130 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
4131
4132 (yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_argument_list_type), '{');
4133 if (! (yyval.tree_expression_type))
4134 {
4135 // make_index_expression deleted $1 and $3.
4136 YYABORT;
4137 }
4138 }
4139#line 4140 "libinterp/parse-tree/oct-parse.cc"
4140 break;
4141
4142 case 97: /* power_expr: power_expr indirect_ref_op STRUCT_ELT */
4143#line 880 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4144 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-2].tree_expression_type), (yyvsp[0].tok_val)->text ()); }
4145#line 4146 "libinterp/parse-tree/oct-parse.cc"
4146 break;
4147
4148 case 98: /* power_expr: power_expr indirect_ref_op '(' expression ')' */
4149#line 882 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4150 {
4151 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
4152
4153 (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-4].tree_expression_type), (yyvsp[-1].tree_expression_type));
4154 }
4155#line 4156 "libinterp/parse-tree/oct-parse.cc"
4156 break;
4157
4158 case 99: /* power_expr: PLUS_PLUS power_expr */
4159#line 888 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4160 { (yyval.tree_expression_type) = parser.make_prefix_op (PLUS_PLUS, (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
4161#line 4162 "libinterp/parse-tree/oct-parse.cc"
4162 break;
4163
4164 case 100: /* power_expr: MINUS_MINUS power_expr */
4165#line 890 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4166 { (yyval.tree_expression_type) = parser.make_prefix_op (MINUS_MINUS, (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
4167#line 4168 "libinterp/parse-tree/oct-parse.cc"
4168 break;
4169
4170 case 101: /* power_expr: EXPR_NOT power_expr */
4171#line 892 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4172 { (yyval.tree_expression_type) = parser.make_prefix_op (EXPR_NOT, (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
4173#line 4174 "libinterp/parse-tree/oct-parse.cc"
4174 break;
4175
4176 case 102: /* power_expr: '+' power_expr */
4177#line 894 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4178 { (yyval.tree_expression_type) = parser.make_prefix_op ('+', (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
4179#line 4180 "libinterp/parse-tree/oct-parse.cc"
4180 break;
4181
4182 case 103: /* power_expr: '-' power_expr */
4183#line 896 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4184 { (yyval.tree_expression_type) = parser.make_prefix_op ('-', (yyvsp[0].tree_expression_type), (yyvsp[-1].tok_val)); }
4185#line 4186 "libinterp/parse-tree/oct-parse.cc"
4186 break;
4187
4188 case 104: /* colon_expr: oper_expr ':' oper_expr */
4189#line 900 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4190 {
4191 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
4192
4193 (yyval.tree_expression_type) = parser.make_colon_expression ((yyvsp[-2].tree_expression_type), (yyvsp[0].tree_expression_type));
4194
4195 if (! (yyval.tree_expression_type))
4196 {
4197 // make_colon_expression deleted $1 and $3.
4198 YYABORT;
4199 }
4200 }
4201#line 4202 "libinterp/parse-tree/oct-parse.cc"
4202 break;
4203
4204 case 105: /* colon_expr: oper_expr ':' oper_expr ':' oper_expr */
4205#line 912 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4206 {
4207 OCTAVE_YYUSE ((yyvsp[-3].tok_val), (yyvsp[-1].tok_val));
4208
4209 (yyval.tree_expression_type) = parser.make_colon_expression ((yyvsp[-4].tree_expression_type), (yyvsp[0].tree_expression_type), (yyvsp[-2].tree_expression_type));
4210
4211 if (! (yyval.tree_expression_type))
4212 {
4213 // make_colon_expression deleted $1, $3, and $5.
4214 YYABORT;
4215 }
4216 }
4217#line 4218 "libinterp/parse-tree/oct-parse.cc"
4218 break;
4219
4220 case 106: /* simple_expr: oper_expr */
4221#line 926 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4222 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4223#line 4224 "libinterp/parse-tree/oct-parse.cc"
4224 break;
4225
4226 case 107: /* simple_expr: colon_expr */
4227#line 928 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4228 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4229#line 4230 "libinterp/parse-tree/oct-parse.cc"
4230 break;
4231
4232 case 108: /* simple_expr: simple_expr EXPR_LT simple_expr */
4233#line 930 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4234 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_LT, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4235#line 4236 "libinterp/parse-tree/oct-parse.cc"
4236 break;
4237
4238 case 109: /* simple_expr: simple_expr EXPR_LE simple_expr */
4239#line 932 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4240 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_LE, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4241#line 4242 "libinterp/parse-tree/oct-parse.cc"
4242 break;
4243
4244 case 110: /* simple_expr: simple_expr EXPR_EQ simple_expr */
4245#line 934 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4246 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_EQ, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4247#line 4248 "libinterp/parse-tree/oct-parse.cc"
4248 break;
4249
4250 case 111: /* simple_expr: simple_expr EXPR_GE simple_expr */
4251#line 936 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4252 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_GE, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4253#line 4254 "libinterp/parse-tree/oct-parse.cc"
4254 break;
4255
4256 case 112: /* simple_expr: simple_expr EXPR_GT simple_expr */
4257#line 938 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4258 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_GT, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4259#line 4260 "libinterp/parse-tree/oct-parse.cc"
4260 break;
4261
4262 case 113: /* simple_expr: simple_expr EXPR_NE simple_expr */
4263#line 940 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4264 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_NE, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4265#line 4266 "libinterp/parse-tree/oct-parse.cc"
4266 break;
4267
4268 case 114: /* simple_expr: simple_expr EXPR_AND simple_expr */
4269#line 942 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4270 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_AND, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4271#line 4272 "libinterp/parse-tree/oct-parse.cc"
4272 break;
4273
4274 case 115: /* simple_expr: simple_expr EXPR_OR simple_expr */
4275#line 944 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4276 { (yyval.tree_expression_type) = parser.make_binary_op (EXPR_OR, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4277#line 4278 "libinterp/parse-tree/oct-parse.cc"
4278 break;
4279
4280 case 116: /* simple_expr: simple_expr EXPR_AND_AND simple_expr */
4281#line 946 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4282 { (yyval.tree_expression_type) = parser.make_boolean_op (EXPR_AND_AND, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4283#line 4284 "libinterp/parse-tree/oct-parse.cc"
4284 break;
4285
4286 case 117: /* simple_expr: simple_expr EXPR_OR_OR simple_expr */
4287#line 948 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4288 { (yyval.tree_expression_type) = parser.make_boolean_op (EXPR_OR_OR, (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4289#line 4290 "libinterp/parse-tree/oct-parse.cc"
4290 break;
4291
4292 case 118: /* assign_lhs: simple_expr */
4293#line 952 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4294 {
4295 (yyval.tree_argument_list_type) = parser.validate_matrix_for_assignment ((yyvsp[0].tree_expression_type));
4296
4297 if ((yyval.tree_argument_list_type))
4298 { lexer.m_looking_at_matrix_or_assign_lhs = false; }
4299 else
4300 {
4301 // validate_matrix_for_assignment deleted $1.
4302 YYABORT;
4303 }
4304 }
4305#line 4306 "libinterp/parse-tree/oct-parse.cc"
4306 break;
4307
4308 case 119: /* assign_expr: assign_lhs '=' expression */
4309#line 966 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4310 { (yyval.tree_expression_type) = parser.make_assign_op ('=', (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4311#line 4312 "libinterp/parse-tree/oct-parse.cc"
4312 break;
4313
4314 case 120: /* assign_expr: assign_lhs ADD_EQ expression */
4315#line 968 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4316 { (yyval.tree_expression_type) = parser.make_assign_op (ADD_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4317#line 4318 "libinterp/parse-tree/oct-parse.cc"
4318 break;
4319
4320 case 121: /* assign_expr: assign_lhs SUB_EQ expression */
4321#line 970 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4322 { (yyval.tree_expression_type) = parser.make_assign_op (SUB_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4323#line 4324 "libinterp/parse-tree/oct-parse.cc"
4324 break;
4325
4326 case 122: /* assign_expr: assign_lhs MUL_EQ expression */
4327#line 972 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4328 { (yyval.tree_expression_type) = parser.make_assign_op (MUL_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4329#line 4330 "libinterp/parse-tree/oct-parse.cc"
4330 break;
4331
4332 case 123: /* assign_expr: assign_lhs DIV_EQ expression */
4333#line 974 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4334 { (yyval.tree_expression_type) = parser.make_assign_op (DIV_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4335#line 4336 "libinterp/parse-tree/oct-parse.cc"
4336 break;
4337
4338 case 124: /* assign_expr: assign_lhs LEFTDIV_EQ expression */
4339#line 976 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4340 { (yyval.tree_expression_type) = parser.make_assign_op (LEFTDIV_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4341#line 4342 "libinterp/parse-tree/oct-parse.cc"
4342 break;
4343
4344 case 125: /* assign_expr: assign_lhs POW_EQ expression */
4345#line 978 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4346 { (yyval.tree_expression_type) = parser.make_assign_op (POW_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4347#line 4348 "libinterp/parse-tree/oct-parse.cc"
4348 break;
4349
4350 case 126: /* assign_expr: assign_lhs EMUL_EQ expression */
4351#line 980 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4352 { (yyval.tree_expression_type) = parser.make_assign_op (EMUL_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4353#line 4354 "libinterp/parse-tree/oct-parse.cc"
4354 break;
4355
4356 case 127: /* assign_expr: assign_lhs EDIV_EQ expression */
4357#line 982 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4358 { (yyval.tree_expression_type) = parser.make_assign_op (EDIV_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4359#line 4360 "libinterp/parse-tree/oct-parse.cc"
4360 break;
4361
4362 case 128: /* assign_expr: assign_lhs ELEFTDIV_EQ expression */
4363#line 984 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4364 { (yyval.tree_expression_type) = parser.make_assign_op (ELEFTDIV_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4365#line 4366 "libinterp/parse-tree/oct-parse.cc"
4366 break;
4367
4368 case 129: /* assign_expr: assign_lhs EPOW_EQ expression */
4369#line 986 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4370 { (yyval.tree_expression_type) = parser.make_assign_op (EPOW_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4371#line 4372 "libinterp/parse-tree/oct-parse.cc"
4372 break;
4373
4374 case 130: /* assign_expr: assign_lhs AND_EQ expression */
4375#line 988 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4376 { (yyval.tree_expression_type) = parser.make_assign_op (AND_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4377#line 4378 "libinterp/parse-tree/oct-parse.cc"
4378 break;
4379
4380 case 131: /* assign_expr: assign_lhs OR_EQ expression */
4381#line 990 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4382 { (yyval.tree_expression_type) = parser.make_assign_op (OR_EQ, (yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4383#line 4384 "libinterp/parse-tree/oct-parse.cc"
4384 break;
4385
4386 case 132: /* expression: simple_expr */
4387#line 994 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4388 {
4389 if ((yyvsp[0].tree_expression_type) && ((yyvsp[0].tree_expression_type)->is_matrix () || (yyvsp[0].tree_expression_type)->iscell ()))
4390 {
4391 if (parser.validate_array_list ((yyvsp[0].tree_expression_type)))
4392 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4393 else
4394 {
4395 delete (yyvsp[0].tree_expression_type);
4396 YYABORT;
4397 }
4398 }
4399 else
4400 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4401 }
4402#line 4403 "libinterp/parse-tree/oct-parse.cc"
4403 break;
4404
4405 case 133: /* expression: assign_expr */
4406#line 1009 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4407 {
4408 if (! (yyvsp[0].tree_expression_type))
4409 YYABORT;
4410
4411 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4412 }
4413#line 4414 "libinterp/parse-tree/oct-parse.cc"
4414 break;
4415
4416 case 134: /* expression: anon_fcn_handle */
4417#line 1016 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4418 { (yyval.tree_expression_type) = (yyvsp[0].tree_anon_fcn_handle_type); }
4419#line 4420 "libinterp/parse-tree/oct-parse.cc"
4420 break;
4421
4422 case 135: /* command: declaration */
4423#line 1024 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4424 { (yyval.tree_command_type) = (yyvsp[0].tree_decl_command_type); }
4425#line 4426 "libinterp/parse-tree/oct-parse.cc"
4426 break;
4427
4428 case 136: /* command: select_command */
4429#line 1026 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4430 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4431#line 4432 "libinterp/parse-tree/oct-parse.cc"
4432 break;
4433
4434 case 137: /* command: loop_command */
4435#line 1028 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4436 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4437#line 4438 "libinterp/parse-tree/oct-parse.cc"
4438 break;
4439
4440 case 138: /* command: jump_command */
4441#line 1030 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4442 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4443#line 4444 "libinterp/parse-tree/oct-parse.cc"
4444 break;
4445
4446 case 139: /* command: spmd_command */
4447#line 1032 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4448 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4449#line 4450 "libinterp/parse-tree/oct-parse.cc"
4450 break;
4451
4452 case 140: /* command: except_command */
4453#line 1034 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4454 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4455#line 4456 "libinterp/parse-tree/oct-parse.cc"
4456 break;
4457
4458 case 141: /* command: function */
4459#line 1036 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4460 { (yyval.tree_command_type) = (yyvsp[0].tree_function_def_type); }
4461#line 4462 "libinterp/parse-tree/oct-parse.cc"
4462 break;
4463
4464 case 142: /* command: file */
4465#line 1038 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4466 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4467#line 4468 "libinterp/parse-tree/oct-parse.cc"
4468 break;
4469
4470 case 143: /* declaration: GLOBAL decl_init_list */
4471#line 1046 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4472 {
4473 (yyval.tree_decl_command_type) = parser.make_decl_command (GLOBAL, (yyvsp[-1].tok_val), (yyvsp[0].tree_decl_init_list_type));
4474 lexer.m_looking_at_decl_list = false;
4475 }
4476#line 4477 "libinterp/parse-tree/oct-parse.cc"
4477 break;
4478
4479 case 144: /* declaration: PERSISTENT decl_init_list */
4480#line 1051 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4481 {
4482 (yyval.tree_decl_command_type) = parser.make_decl_command (PERSISTENT, (yyvsp[-1].tok_val), (yyvsp[0].tree_decl_init_list_type));
4483 lexer.m_looking_at_decl_list = false;
4484 }
4485#line 4486 "libinterp/parse-tree/oct-parse.cc"
4486 break;
4487
4488 case 145: /* decl_init_list: decl_elt */
4489#line 1058 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4490 { (yyval.tree_decl_init_list_type) = parser.make_decl_init_list ((yyvsp[0].tree_decl_elt_type)); }
4491#line 4492 "libinterp/parse-tree/oct-parse.cc"
4492 break;
4493
4494 case 146: /* decl_init_list: decl_init_list decl_elt */
4495#line 1060 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4496 { (yyval.tree_decl_init_list_type) = parser.append_decl_init_list ((yyvsp[-1].tree_decl_init_list_type), (yyvsp[0].tree_decl_elt_type)); }
4497#line 4498 "libinterp/parse-tree/oct-parse.cc"
4498 break;
4499
4500 case 147: /* decl_elt: identifier */
4501#line 1064 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4502 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[0].tree_identifier_type)); }
4503#line 4504 "libinterp/parse-tree/oct-parse.cc"
4504 break;
4505
4506 case 148: /* decl_elt: identifier '=' expression */
4507#line 1066 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4508 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[-2].tree_identifier_type), (yyvsp[-1].tok_val), (yyvsp[0].tree_expression_type)); }
4509#line 4510 "libinterp/parse-tree/oct-parse.cc"
4510 break;
4511
4512 case 149: /* select_command: if_command */
4513#line 1074 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4514 { (yyval.tree_command_type) = (yyvsp[0].tree_if_command_type); }
4515#line 4516 "libinterp/parse-tree/oct-parse.cc"
4516 break;
4517
4518 case 150: /* select_command: switch_command */
4519#line 1076 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4520 { (yyval.tree_command_type) = (yyvsp[0].tree_switch_command_type); }
4521#line 4522 "libinterp/parse-tree/oct-parse.cc"
4522 break;
4523
4524 case 151: /* if_command: IF stash_comment if_cmd_list END */
4525#line 1084 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4526 {
4527 if (! ((yyval.tree_if_command_type) = parser.finish_if_command ((yyvsp[-3].tok_val), (yyvsp[-1].tree_if_command_list_type), (yyvsp[0].tok_val), (yyvsp[-2].comment_type))))
4528 {
4529 // finish_if_command deleted $3.
4530 YYABORT;
4531 }
4532 }
4533#line 4534 "libinterp/parse-tree/oct-parse.cc"
4534 break;
4535
4536 case 152: /* if_cmd_list: if_cmd_list1 */
4537#line 1094 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4538 { (yyval.tree_if_command_list_type) = (yyvsp[0].tree_if_command_list_type); }
4539#line 4540 "libinterp/parse-tree/oct-parse.cc"
4540 break;
4541
4542 case 153: /* if_cmd_list: if_cmd_list1 else_clause */
4543#line 1096 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4544 { (yyval.tree_if_command_list_type) = parser.append_if_clause ((yyvsp[-1].tree_if_command_list_type), (yyvsp[0].tree_if_clause_type)); }
4545#line 4546 "libinterp/parse-tree/oct-parse.cc"
4546 break;
4547
4548 case 154: /* if_cmd_list1: expression stmt_begin opt_sep opt_list */
4549#line 1100 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4550 {
4551 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
4552
4553 (yyvsp[-3].tree_expression_type)->mark_braindead_shortcircuit ();
4554
4555 (yyval.tree_if_command_list_type) = parser.start_if_command ((yyvsp[-3].tree_expression_type), (yyvsp[0].tree_statement_list_type));
4556 }
4557#line 4558 "libinterp/parse-tree/oct-parse.cc"
4558 break;
4559
4560 case 155: /* if_cmd_list1: if_cmd_list1 elseif_clause */
4561#line 1108 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4562 { (yyval.tree_if_command_list_type) = parser.append_if_clause ((yyvsp[-1].tree_if_command_list_type), (yyvsp[0].tree_if_clause_type)); }
4563#line 4564 "libinterp/parse-tree/oct-parse.cc"
4564 break;
4565
4566 case 156: /* elseif_clause: ELSEIF stash_comment opt_sep expression stmt_begin opt_sep opt_list */
4567#line 1112 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4568 {
4569 OCTAVE_YYUSE ((yyvsp[-4].punct_type), (yyvsp[-1].punct_type));
4570
4571 (yyvsp[-3].tree_expression_type)->mark_braindead_shortcircuit ();
4572
4573 (yyval.tree_if_clause_type) = parser.make_elseif_clause ((yyvsp[-6].tok_val), (yyvsp[-3].tree_expression_type), (yyvsp[0].tree_statement_list_type), (yyvsp[-5].comment_type));
4574 }
4575#line 4576 "libinterp/parse-tree/oct-parse.cc"
4576 break;
4577
4578 case 157: /* else_clause: ELSE stash_comment opt_sep opt_list */
4579#line 1122 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4580 {
4581 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
4582
4583 (yyval.tree_if_clause_type) = parser.make_else_clause ((yyvsp[-3].tok_val), (yyvsp[-2].comment_type), (yyvsp[0].tree_statement_list_type));
4584 }
4585#line 4586 "libinterp/parse-tree/oct-parse.cc"
4586 break;
4587
4588 case 158: /* switch_command: SWITCH stash_comment expression opt_sep case_list END */
4589#line 1134 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4590 {
4591 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
4592
4593 if (! ((yyval.tree_switch_command_type) = parser.finish_switch_command ((yyvsp[-5].tok_val), (yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tok_val), (yyvsp[-4].comment_type))))
4594 {
4595 // finish_switch_command deleted $3 adn $5.
4596 YYABORT;
4597 }
4598 }
4599#line 4600 "libinterp/parse-tree/oct-parse.cc"
4600 break;
4601
4602 case 159: /* case_list: %empty */
4603#line 1146 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4604 { (yyval.tree_switch_case_list_type) = nullptr; }
4605#line 4606 "libinterp/parse-tree/oct-parse.cc"
4606 break;
4607
4608 case 160: /* case_list: default_case */
4609#line 1148 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4610 { (yyval.tree_switch_case_list_type) = parser.make_switch_case_list ((yyvsp[0].tree_switch_case_type)); }
4611#line 4612 "libinterp/parse-tree/oct-parse.cc"
4612 break;
4613
4614 case 161: /* case_list: case_list1 */
4615#line 1150 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4616 { (yyval.tree_switch_case_list_type) = (yyvsp[0].tree_switch_case_list_type); }
4617#line 4618 "libinterp/parse-tree/oct-parse.cc"
4618 break;
4619
4620 case 162: /* case_list: case_list1 default_case */
4621#line 1152 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4622 { (yyval.tree_switch_case_list_type) = parser.append_switch_case ((yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tree_switch_case_type)); }
4623#line 4624 "libinterp/parse-tree/oct-parse.cc"
4624 break;
4625
4626 case 163: /* case_list1: switch_case */
4627#line 1156 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4628 { (yyval.tree_switch_case_list_type) = parser.make_switch_case_list ((yyvsp[0].tree_switch_case_type)); }
4629#line 4630 "libinterp/parse-tree/oct-parse.cc"
4630 break;
4631
4632 case 164: /* case_list1: case_list1 switch_case */
4633#line 1158 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4634 { (yyval.tree_switch_case_list_type) = parser.append_switch_case ((yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tree_switch_case_type)); }
4635#line 4636 "libinterp/parse-tree/oct-parse.cc"
4636 break;
4637
4638 case 165: /* switch_case: CASE stash_comment opt_sep expression stmt_begin opt_sep opt_list */
4639#line 1162 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4640 {
4641 OCTAVE_YYUSE ((yyvsp[-4].punct_type), (yyvsp[-1].punct_type));
4642
4643 (yyval.tree_switch_case_type) = parser.make_switch_case ((yyvsp[-6].tok_val), (yyvsp[-3].tree_expression_type), (yyvsp[0].tree_statement_list_type), (yyvsp[-5].comment_type));
4644 }
4645#line 4646 "libinterp/parse-tree/oct-parse.cc"
4646 break;
4647
4648 case 166: /* default_case: OTHERWISE stash_comment opt_sep opt_list */
4649#line 1170 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4650 {
4651 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
4652
4653 (yyval.tree_switch_case_type) = parser.make_default_switch_case ((yyvsp[-3].tok_val), (yyvsp[-2].comment_type), (yyvsp[0].tree_statement_list_type));
4654 }
4655#line 4656 "libinterp/parse-tree/oct-parse.cc"
4656 break;
4657
4658 case 167: /* loop_command: WHILE stash_comment expression stmt_begin opt_sep opt_list END */
4659#line 1182 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4660 {
4661 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
4662
4663 (yyvsp[-4].tree_expression_type)->mark_braindead_shortcircuit ();
4664
4665 if (! ((yyval.tree_command_type) = parser.make_while_command ((yyvsp[-6].tok_val), (yyvsp[-4].tree_expression_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-5].comment_type))))
4666 {
4667 // make_while_command deleted $3 and $6.
4668 YYABORT;
4669 }
4670 }
4671#line 4672 "libinterp/parse-tree/oct-parse.cc"
4672 break;
4673
4674 case 168: /* loop_command: DO stash_comment opt_sep opt_list UNTIL expression */
4675#line 1194 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4676 {
4677 OCTAVE_YYUSE ((yyvsp[-5].tok_val), (yyvsp[-3].punct_type));
4678
4679 (yyval.tree_command_type) = parser.make_do_until_command ((yyvsp[-1].tok_val), (yyvsp[-2].tree_statement_list_type), (yyvsp[0].tree_expression_type), (yyvsp[-4].comment_type));
4680 }
4681#line 4682 "libinterp/parse-tree/oct-parse.cc"
4682 break;
4683
4684 case 169: /* loop_command: FOR stash_comment assign_lhs '=' expression stmt_begin opt_sep opt_list END */
4685#line 1200 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4686 {
4687 OCTAVE_YYUSE ((yyvsp[-5].tok_val), (yyvsp[-2].punct_type));
4688
4689 if (! ((yyval.tree_command_type) = parser.make_for_command (FOR, (yyvsp[-8].tok_val), (yyvsp[-6].tree_argument_list_type), (yyvsp[-4].tree_expression_type),
4690 nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-7].comment_type))))
4691 {
4692 // make_for_command deleted $3, $5, and $8.
4693 YYABORT;
4694 }
4695 }
4696#line 4697 "libinterp/parse-tree/oct-parse.cc"
4697 break;
4698
4699 case 170: /* loop_command: FOR stash_comment '(' assign_lhs '=' expression ')' opt_sep opt_list END */
4700#line 1211 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4701 {
4702 OCTAVE_YYUSE ((yyvsp[-7].tok_val), (yyvsp[-5].tok_val), (yyvsp[-3].tok_val), (yyvsp[-2].punct_type));
4703
4704 if (! ((yyval.tree_command_type) = parser.make_for_command (FOR, (yyvsp[-9].tok_val), (yyvsp[-6].tree_argument_list_type), (yyvsp[-4].tree_expression_type),
4705 nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-8].comment_type))))
4706 {
4707 // make_for_command deleted $4, $6, and $9.
4708 YYABORT;
4709 }
4710 }
4711#line 4712 "libinterp/parse-tree/oct-parse.cc"
4712 break;
4713
4714 case 171: /* loop_command: PARFOR stash_comment assign_lhs '=' expression stmt_begin opt_sep opt_list END */
4715#line 1222 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4716 {
4717 OCTAVE_YYUSE ((yyvsp[-5].tok_val), (yyvsp[-2].punct_type));
4718
4719 if (! ((yyval.tree_command_type) = parser.make_for_command (PARFOR, (yyvsp[-8].tok_val), (yyvsp[-6].tree_argument_list_type), (yyvsp[-4].tree_expression_type),
4720 nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-7].comment_type))))
4721 {
4722 // make_for_command deleted $3, $5, and $8.
4723 YYABORT;
4724 }
4725 }
4726#line 4727 "libinterp/parse-tree/oct-parse.cc"
4727 break;
4728
4729 case 172: /* loop_command: PARFOR stash_comment '(' assign_lhs '=' expression ',' expression ')' opt_sep opt_list END */
4730#line 1233 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4731 {
4732 OCTAVE_YYUSE ((yyvsp[-9].tok_val), (yyvsp[-7].tok_val), (yyvsp[-5].tok_val), (yyvsp[-3].tok_val), (yyvsp[-2].punct_type));
4733
4734 if (! ((yyval.tree_command_type) = parser.make_for_command (PARFOR, (yyvsp[-11].tok_val), (yyvsp[-8].tree_argument_list_type), (yyvsp[-6].tree_expression_type),
4735 (yyvsp[-4].tree_expression_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-10].comment_type))))
4736 {
4737 // make_for_command deleted $4, $6, $8, and $11.
4738 YYABORT;
4739 }
4740 }
4741#line 4742 "libinterp/parse-tree/oct-parse.cc"
4742 break;
4743
4744 case 173: /* jump_command: BREAK */
4745#line 1250 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4746 {
4747 if (! ((yyval.tree_command_type) = parser.make_break_command ((yyvsp[0].tok_val))))
4748 YYABORT;
4749 }
4750#line 4751 "libinterp/parse-tree/oct-parse.cc"
4751 break;
4752
4753 case 174: /* jump_command: CONTINUE */
4754#line 1255 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4755 {
4756 if (! ((yyval.tree_command_type) = parser.make_continue_command ((yyvsp[0].tok_val))))
4757 YYABORT;
4758 }
4759#line 4760 "libinterp/parse-tree/oct-parse.cc"
4760 break;
4761
4762 case 175: /* jump_command: FUNC_RET */
4763#line 1260 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4764 { (yyval.tree_command_type) = parser.make_return_command ((yyvsp[0].tok_val)); }
4765#line 4766 "libinterp/parse-tree/oct-parse.cc"
4766 break;
4767
4768 case 176: /* spmd_command: SPMD stash_comment opt_sep opt_list END */
4769#line 1268 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4770 {
4771 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
4772
4773 octave::comment_list *lc = (yyvsp[-3].comment_type);
4774 octave::comment_list *tc = lexer.get_comment ();
4775
4776 if (! ((yyval.tree_command_type) = parser.make_spmd_command ((yyvsp[-4].tok_val), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), lc, tc)))
4777 {
4778 // make_spmd_command deleted $4, LC, and TC.
4779 YYABORT;
4780 }
4781 }
4782#line 4783 "libinterp/parse-tree/oct-parse.cc"
4783 break;
4784
4785 case 177: /* except_command: UNWIND stash_comment opt_sep opt_list CLEANUP stash_comment opt_sep opt_list END */
4786#line 1288 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4787 {
4788 OCTAVE_YYUSE ((yyvsp[-6].punct_type), (yyvsp[-4].tok_val), (yyvsp[-2].punct_type));
4789
4790 if (! ((yyval.tree_command_type) = parser.make_unwind_command ((yyvsp[-8].tok_val), (yyvsp[-5].tree_statement_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-7].comment_type), (yyvsp[-3].comment_type))))
4791 {
4792 // make_unwind_command deleted $4 and $8.
4793 YYABORT;
4794 }
4795 }
4796#line 4797 "libinterp/parse-tree/oct-parse.cc"
4797 break;
4798
4799 case 178: /* except_command: TRY stash_comment opt_sep opt_list CATCH stash_comment opt_sep opt_list END */
4800#line 1299 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4801 {
4802 OCTAVE_YYUSE ((yyvsp[-6].punct_type), (yyvsp[-4].tok_val), (yyvsp[-2].punct_type));
4803
4804 if (! ((yyval.tree_command_type) = parser.make_try_command ((yyvsp[-8].tok_val), (yyvsp[-5].tree_statement_list_type), (yyvsp[-2].punct_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok_val), (yyvsp[-7].comment_type), (yyvsp[-3].comment_type))))
4805 {
4806 // make_try_command deleted $4 and $8.
4807 YYABORT;
4808 }
4809 }
4810#line 4811 "libinterp/parse-tree/oct-parse.cc"
4811 break;
4812
4813 case 179: /* except_command: TRY stash_comment opt_sep opt_list END */
4814#line 1309 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4815 {
4816 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
4817
4818 if (! ((yyval.tree_command_type) = parser.make_try_command ((yyvsp[-4].tok_val), (yyvsp[-1].tree_statement_list_type), 0, nullptr,
4819 (yyvsp[0].tok_val), (yyvsp[-3].comment_type), nullptr)))
4820 {
4821 // make_try_command deleted $4.
4822 YYABORT;
4823 }
4824 }
4825#line 4826 "libinterp/parse-tree/oct-parse.cc"
4826 break;
4827
4828 case 180: /* push_fcn_symtab: %empty */
4829#line 1326 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4830 {
4831 if (! parser.push_fcn_symtab ())
4832 YYABORT;
4833
4834 (yyval.dummy_type) = 0;
4835 }
4836#line 4837 "libinterp/parse-tree/oct-parse.cc"
4837 break;
4838
4839 case 181: /* param_list_beg: '(' */
4840#line 1339 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4841 {
4842 OCTAVE_YYUSE ((yyvsp[0].tok_val));
4843
4844 (yyval.dummy_type) = 0;
4845 lexer.m_looking_at_parameter_list = true;
4846 lexer.m_arguments_is_keyword = false;
4847
4848 if (lexer.m_looking_at_function_handle)
4849 {
4850 // Will get a real name later.
4851 lexer.m_symtab_context.push (octave::symbol_scope ("parser:param_list_beg"));
4852 lexer.m_looking_at_function_handle--;
4853 lexer.m_looking_at_anon_fcn_args = true;
4854 }
4855 }
4856#line 4857 "libinterp/parse-tree/oct-parse.cc"
4857 break;
4858
4859 case 182: /* param_list_end: ')' */
4860#line 1357 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4861 {
4862 OCTAVE_YYUSE ((yyvsp[0].tok_val));
4863
4864 (yyval.dummy_type) = 0;
4865 lexer.m_looking_at_parameter_list = false;
4866 lexer.m_arguments_is_keyword = true;
4867 lexer.m_looking_for_object_index = false;
4868 }
4869#line 4870 "libinterp/parse-tree/oct-parse.cc"
4870 break;
4871
4872 case 183: /* opt_param_list: %empty */
4873#line 1368 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4874 { (yyval.tree_parameter_list_type) = nullptr; }
4875#line 4876 "libinterp/parse-tree/oct-parse.cc"
4876 break;
4877
4878 case 184: /* opt_param_list: param_list */
4879#line 1370 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4880 { (yyval.tree_parameter_list_type) = (yyvsp[0].tree_parameter_list_type); }
4881#line 4882 "libinterp/parse-tree/oct-parse.cc"
4882 break;
4883
4884 case 185: /* param_list: param_list_beg param_list1 param_list_end */
4885#line 1374 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4886 {
4887 if ((yyvsp[-1].tree_parameter_list_type))
4888 lexer.mark_as_variables ((yyvsp[-1].tree_parameter_list_type)->variable_names ());
4889
4890 (yyval.tree_parameter_list_type) = (yyvsp[-1].tree_parameter_list_type);
4891 }
4892#line 4893 "libinterp/parse-tree/oct-parse.cc"
4893 break;
4894
4895 case 186: /* param_list: param_list_beg error */
4896#line 1381 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4897 {
4898 (yyval.tree_parameter_list_type) = nullptr;
4899 parser.bison_error ("invalid parameter list");
4900 YYABORT;
4901 }
4902#line 4903 "libinterp/parse-tree/oct-parse.cc"
4903 break;
4904
4905 case 187: /* param_list1: %empty */
4906#line 1389 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4907 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::in); }
4908#line 4909 "libinterp/parse-tree/oct-parse.cc"
4909 break;
4910
4911 case 188: /* param_list1: param_list2 */
4912#line 1391 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4913 {
4914 (yyvsp[0].tree_parameter_list_type)->mark_as_formal_parameters ();
4915
4916 if (parser.validate_param_list ((yyvsp[0].tree_parameter_list_type), octave::tree_parameter_list::in))
4917 {
4918 lexer.mark_as_variables ((yyvsp[0].tree_parameter_list_type)->variable_names ());
4919 (yyval.tree_parameter_list_type) = (yyvsp[0].tree_parameter_list_type);
4920 }
4921 else
4922 {
4923 delete (yyvsp[0].tree_parameter_list_type);
4924 YYABORT;
4925 }
4926 }
4927#line 4928 "libinterp/parse-tree/oct-parse.cc"
4928 break;
4929
4930 case 189: /* param_list2: param_list_elt */
4931#line 1408 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4932 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::in, (yyvsp[0].tree_decl_elt_type)); }
4933#line 4934 "libinterp/parse-tree/oct-parse.cc"
4934 break;
4935
4936 case 190: /* param_list2: param_list2 ',' param_list_elt */
4937#line 1410 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4938 {
4939 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
4940
4941 (yyval.tree_parameter_list_type) = parser.append_parameter_list ((yyvsp[-2].tree_parameter_list_type), (yyvsp[0].tree_decl_elt_type));
4942 }
4943#line 4944 "libinterp/parse-tree/oct-parse.cc"
4944 break;
4945
4946 case 191: /* param_list_elt: decl_elt */
4947#line 1418 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4948 { (yyval.tree_decl_elt_type) = (yyvsp[0].tree_decl_elt_type); }
4949#line 4950 "libinterp/parse-tree/oct-parse.cc"
4950 break;
4951
4952 case 192: /* param_list_elt: magic_tilde */
4953#line 1420 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4954 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[0].tree_identifier_type)); }
4955#line 4956 "libinterp/parse-tree/oct-parse.cc"
4956 break;
4957
4958 case 193: /* return_list: '[' ']' */
4959#line 1428 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4960 {
4961 OCTAVE_YYUSE ((yyvsp[-1].tok_val), (yyvsp[0].tok_val));
4962
4963 lexer.m_looking_at_return_list = false;
4964
4965 (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::out);
4966 }
4967#line 4968 "libinterp/parse-tree/oct-parse.cc"
4968 break;
4969
4970 case 194: /* return_list: identifier */
4971#line 1436 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4972 {
4973 lexer.m_looking_at_return_list = false;
4974
4976 = parser.make_parameter_list (octave::tree_parameter_list::out, (yyvsp[0].tree_identifier_type));
4977
4978 // Even though this parameter list can contain only
4979 // a single identifier, we still need to validate it
4980 // to check for varargin or varargout.
4981
4983 (yyval.tree_parameter_list_type) = tmp;
4984 else
4985 {
4986 delete tmp;
4987 YYABORT;
4988 }
4989 }
4990#line 4991 "libinterp/parse-tree/oct-parse.cc"
4991 break;
4992
4993 case 195: /* return_list: '[' return_list1 ']' */
4994#line 1455 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
4995 {
4996 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
4997
4998 lexer.m_looking_at_return_list = false;
4999
5000 // Check for duplicate parameter names, varargin,
5001 // or varargout.
5002
5003 if (parser.validate_param_list ((yyvsp[-1].tree_parameter_list_type), octave::tree_parameter_list::out))
5004 (yyval.tree_parameter_list_type) = (yyvsp[-1].tree_parameter_list_type);
5005 else
5006 {
5007 delete (yyvsp[-1].tree_parameter_list_type);
5008 YYABORT;
5009 }
5010 }
5011#line 5012 "libinterp/parse-tree/oct-parse.cc"
5012 break;
5013
5014 case 196: /* return_list1: identifier */
5015#line 1474 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5016 {
5017 (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::out, (yyvsp[0].tree_identifier_type));
5018 }
5019#line 5020 "libinterp/parse-tree/oct-parse.cc"
5020 break;
5021
5022 case 197: /* return_list1: return_list1 ',' identifier */
5023#line 1478 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5024 {
5025 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5026
5027 (yyval.tree_parameter_list_type) = parser.append_parameter_list ((yyvsp[-2].tree_parameter_list_type), (yyvsp[0].tree_identifier_type));
5028 }
5029#line 5030 "libinterp/parse-tree/oct-parse.cc"
5030 break;
5031
5032 case 198: /* parsing_local_fcns: %empty */
5033#line 1491 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5034 { parser.parsing_local_functions (true); }
5035#line 5036 "libinterp/parse-tree/oct-parse.cc"
5036 break;
5037
5038 case 199: /* push_script_symtab: %empty */
5039#line 1495 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5040 {
5041 (yyval.dummy_type) = 0;
5042
5043 // This scope may serve as the parent scope for local
5044 // functions in classdef files..
5045 lexer.m_symtab_context.push (octave::symbol_scope ("parser:push_script_symtab"));
5046 }
5047#line 5048 "libinterp/parse-tree/oct-parse.cc"
5048 break;
5049
5050 case 200: /* begin_file: push_script_symtab INPUT_FILE */
5051#line 1505 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5052 { (yyval.dummy_type) = 0; }
5053#line 5054 "libinterp/parse-tree/oct-parse.cc"
5054 break;
5055
5056 case 201: /* file: begin_file opt_nl opt_list END_OF_INPUT */
5057#line 1509 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5058 {
5059 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
5060
5061 if (lexer.m_reading_fcn_file)
5062 {
5063 // Delete the dummy statement_list we created
5064 // after parsing the function. Any function
5065 // definitions found in the file have already
5066 // been stored in the symbol table or in
5067 // base_parser::m_primary_fcn.
5068
5069 // Unused symbol table context.
5070 lexer.m_symtab_context.pop ();
5071
5072 delete (yyvsp[-1].tree_statement_list_type);
5073
5074 if (! parser.validate_primary_fcn ())
5075 YYABORT;
5076 }
5077 else
5078 {
5079 octave::tree_statement *end_of_script
5080 = parser.make_end ("endscript", true,
5081 (yyvsp[0].tok_val)->beg_pos (), (yyvsp[0].tok_val)->end_pos ());
5082
5083 parser.make_script ((yyvsp[-1].tree_statement_list_type), end_of_script);
5084
5085 if (! parser.validate_primary_fcn ())
5086 YYABORT;
5087 }
5088
5089 (yyval.tree_command_type) = nullptr;
5090 }
5091#line 5092 "libinterp/parse-tree/oct-parse.cc"
5092 break;
5093
5094 case 202: /* file: begin_file opt_nl classdef parsing_local_fcns opt_sep opt_fcn_list END_OF_INPUT */
5095#line 1543 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5096 {
5097 OCTAVE_YYUSE ((yyvsp[-5].punct_type), (yyvsp[-2].punct_type), (yyvsp[0].tok_val));
5098
5099 // Unused symbol table context.
5100 lexer.m_symtab_context.pop ();
5101
5102 if (! parser.finish_classdef_file ((yyvsp[-4].tree_classdef_type), (yyvsp[-1].tree_statement_list_type)))
5103 YYABORT;
5104
5105 (yyval.tree_command_type) = nullptr;
5106 }
5107#line 5108 "libinterp/parse-tree/oct-parse.cc"
5108 break;
5109
5110 case 203: /* function_beg: push_fcn_symtab FCN */
5111#line 1561 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5112 {
5113 (yyval.tok_val) = (yyvsp[0].tok_val);
5114 if (lexer.m_reading_classdef_file
5115 || lexer.m_parsing_classdef)
5116 lexer.m_maybe_classdef_get_set_method = true;
5117 }
5118#line 5119 "libinterp/parse-tree/oct-parse.cc"
5119 break;
5120
5121 case 204: /* fcn_name: identifier */
5122#line 1570 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5123 {
5124 if (! ((yyval.tree_identifier_type) = parser.make_fcn_name ((yyvsp[0].tree_identifier_type))))
5125 {
5126 // make_fcn_name deleted $1.
5127 YYABORT;
5128 }
5129
5130 lexer.m_arguments_is_keyword = true;
5131 }
5132#line 5133 "libinterp/parse-tree/oct-parse.cc"
5133 break;
5134
5135 case 205: /* fcn_name: GET '.' identifier */
5136#line 1580 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5137 {
5138 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[-1].tok_val));
5139
5140 (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type);
5141
5142 lexer.m_parsed_function_name.top () = true;
5143 lexer.m_maybe_classdef_get_set_method = false;
5144 lexer.m_parsing_classdef_get_method = true;
5145 lexer.m_arguments_is_keyword = true;
5146 }
5147#line 5148 "libinterp/parse-tree/oct-parse.cc"
5148 break;
5149
5150 case 206: /* fcn_name: SET '.' identifier */
5151#line 1591 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5152 {
5153 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[-1].tok_val));
5154
5155 (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type);
5156
5157 lexer.m_parsed_function_name.top () = true;
5158 lexer.m_maybe_classdef_get_set_method = false;
5159 lexer.m_parsing_classdef_set_method = true;
5160 lexer.m_arguments_is_keyword = true;
5161 }
5162#line 5163 "libinterp/parse-tree/oct-parse.cc"
5163 break;
5164
5165 case 207: /* function_end: END */
5166#line 1604 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5167 {
5168 parser.endfunction_found (true);
5169
5170 if (parser.end_token_ok ((yyvsp[0].tok_val), octave::token::function_end))
5171 (yyval.tree_statement_type) = parser.make_end ("endfunction", false,
5172 (yyvsp[0].tok_val)->beg_pos (), (yyvsp[0].tok_val)->end_pos ());
5173 else
5174 {
5175 parser.end_token_error ((yyvsp[0].tok_val), octave::token::function_end);
5176 YYABORT;
5177 }
5178 }
5179#line 5180 "libinterp/parse-tree/oct-parse.cc"
5180 break;
5181
5182 case 208: /* function_end: END_OF_INPUT */
5183#line 1617 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5184 {
5185// A lot of tests are based on the assumption that this is OK
5186// if (lexer.m_reading_script_file)
5187// {
5188// parser.bison_error ("function body open at end of script");
5189// YYABORT;
5190// }
5191
5192 if (parser.endfunction_found ())
5193 {
5194 parser.bison_error ("inconsistent function endings -- "
5195 "if one function is explicitly ended, "
5196 "so must all the others");
5197 YYABORT;
5198 }
5199
5200 if (! (lexer.m_reading_fcn_file || lexer.m_reading_script_file
5201 || lexer.input_from_eval_string ()))
5202 {
5203 parser.bison_error ("function body open at end of input");
5204 YYABORT;
5205 }
5206
5207 if (lexer.m_reading_classdef_file)
5208 {
5209 parser.bison_error ("classdef body open at end of input");
5210 YYABORT;
5211 }
5212
5213 (yyval.tree_statement_type) = parser.make_end ("endfunction", true,
5214 (yyvsp[0].tok_val)->beg_pos (), (yyvsp[0].tok_val)->end_pos ());
5215 }
5216#line 5217 "libinterp/parse-tree/oct-parse.cc"
5217 break;
5218
5219 case 209: /* function: function_beg stash_comment fcn_name opt_param_list opt_sep function_body function_end */
5220#line 1653 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5221 {
5222 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
5223
5224 (yyval.tree_function_def_type) = parser.make_function ((yyvsp[-6].tok_val), nullptr, (yyvsp[-4].tree_identifier_type), (yyvsp[-3].tree_parameter_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_type), (yyvsp[-5].comment_type));
5225 }
5226#line 5227 "libinterp/parse-tree/oct-parse.cc"
5227 break;
5228
5229 case 210: /* function: function_beg stash_comment return_list '=' fcn_name opt_param_list opt_sep function_body function_end */
5230#line 1660 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5231 {
5232 OCTAVE_YYUSE ((yyvsp[-5].tok_val), (yyvsp[-2].punct_type));
5233
5234 (yyval.tree_function_def_type) = parser.make_function ((yyvsp[-8].tok_val), (yyvsp[-6].tree_parameter_list_type), (yyvsp[-4].tree_identifier_type), (yyvsp[-3].tree_parameter_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_type), (yyvsp[-7].comment_type));
5235 }
5236#line 5237 "libinterp/parse-tree/oct-parse.cc"
5237 break;
5238
5239 case 211: /* function_body: at_first_executable_stmt opt_list */
5240#line 1668 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5241 {
5242 OCTAVE_YYUSE ((yyvsp[-1].dummy_type));
5243
5244 (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type);
5245 }
5246#line 5247 "libinterp/parse-tree/oct-parse.cc"
5247 break;
5248
5249 case 212: /* function_body: function_body1 opt_sep at_first_executable_stmt opt_list */
5250#line 1674 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5251 {
5252 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
5253
5254 (yyval.tree_statement_list_type) = parser.append_function_body ((yyvsp[-3].tree_statement_list_type), (yyvsp[0].tree_statement_list_type));
5255 }
5256#line 5257 "libinterp/parse-tree/oct-parse.cc"
5257 break;
5258
5259 case 213: /* at_first_executable_stmt: %empty */
5260#line 1683 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5261 {
5262 (yyval.dummy_type) = 0;
5263 lexer.m_arguments_is_keyword = false;
5264 }
5265#line 5266 "libinterp/parse-tree/oct-parse.cc"
5266 break;
5267
5268 case 214: /* function_body1: arguments_block */
5269#line 1690 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5270 {
5271 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_arguments_block_type));
5272
5273 (yyval.tree_statement_list_type) = parser.make_statement_list (stmt);
5274 }
5275#line 5276 "libinterp/parse-tree/oct-parse.cc"
5276 break;
5277
5278 case 215: /* function_body1: function_body1 opt_sep arguments_block */
5279#line 1696 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5280 {
5281 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_arguments_block_type));
5282
5283 (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].punct_type), stmt, false);
5284 }
5285#line 5286 "libinterp/parse-tree/oct-parse.cc"
5286 break;
5287
5288 case 216: /* arguments_block: arguments_beg stash_comment opt_sep args_attr_list args_validation_list opt_sep END */
5289#line 1705 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5290 {
5291 OCTAVE_YYUSE ((yyvsp[-4].punct_type), (yyvsp[-1].punct_type));
5292
5293 octave::comment_list *lc = (yyvsp[-5].comment_type);
5294 octave::comment_list *tc = lexer.get_comment ();
5295
5296 if (! ((yyval.tree_arguments_block_type) = parser.make_arguments_block ((yyvsp[-6].tok_val), (yyvsp[-3].tree_args_block_attribute_list_type), (yyvsp[-2].tree_args_block_validation_list_type), (yyvsp[0].tok_val), lc, tc)))
5297 {
5298 // make_arguments_block deleted $4, $5, LC, and TC.
5299 YYABORT;
5300 }
5301
5302 lexer.m_arguments_is_keyword = true;
5303 }
5304#line 5305 "libinterp/parse-tree/oct-parse.cc"
5305 break;
5306
5307 case 217: /* arguments_beg: ARGUMENTS */
5308#line 1722 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5309 {
5310 (yyval.tok_val) = (yyvsp[0].tok_val);
5311 lexer.m_arguments_is_keyword = false;
5312 }
5313#line 5314 "libinterp/parse-tree/oct-parse.cc"
5314 break;
5315
5316 case 218: /* args_attr_list: %empty */
5317#line 1729 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5318 { (yyval.tree_args_block_attribute_list_type) = nullptr; }
5319#line 5320 "libinterp/parse-tree/oct-parse.cc"
5320 break;
5321
5322 case 219: /* args_attr_list: '(' identifier ')' */
5323#line 1731 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5324 {
5325 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
5326
5327 // Error if $$ is nullptr.
5328 if (! ((yyval.tree_args_block_attribute_list_type) = parser.make_args_attribute_list ((yyvsp[-1].tree_identifier_type))))
5329 {
5330 // make_args_attribute_list deleted $2.
5331 YYABORT;
5332 }
5333 }
5334#line 5335 "libinterp/parse-tree/oct-parse.cc"
5335 break;
5336
5337 case 220: /* args_validation_list: arg_name arg_validation */
5338#line 1745 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5339 {
5340 (yyvsp[0].tree_arg_validation_type)->arg_name ((yyvsp[-1].tree_expression_type));
5341 (yyval.tree_args_block_validation_list_type) = parser.make_args_validation_list ((yyvsp[0].tree_arg_validation_type));
5342 }
5343#line 5344 "libinterp/parse-tree/oct-parse.cc"
5344 break;
5345
5346 case 221: /* args_validation_list: args_validation_list sep arg_name arg_validation */
5347#line 1750 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5348 {
5349 OCTAVE_YYUSE ((yyvsp[-2].punct_type));
5350
5351 (yyvsp[0].tree_arg_validation_type)->arg_name ((yyvsp[-1].tree_expression_type));
5352 (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));
5353 }
5354#line 5355 "libinterp/parse-tree/oct-parse.cc"
5355 break;
5356
5357 case 222: /* arg_name: identifier */
5358#line 1763 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5359 { (yyval.tree_expression_type) = (yyvsp[0].tree_identifier_type); }
5360#line 5361 "libinterp/parse-tree/oct-parse.cc"
5361 break;
5362
5363 case 223: /* arg_validation: size_spec class_name validation_fcns default_value */
5364#line 1767 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5365 {
5366 if (! ((yyval.tree_arg_validation_type) = parser.make_arg_validation ((yyvsp[-3].tree_arg_size_spec_type), (yyvsp[-2].tree_identifier_type), (yyvsp[-1].tree_arg_validation_fcns_type), (yyvsp[0].tree_expression_type))))
5367 {
5368 // make_arg_validation deleted ...
5369 YYABORT;
5370 }
5371 }
5372#line 5373 "libinterp/parse-tree/oct-parse.cc"
5373 break;
5374
5375 case 224: /* size_spec: %empty */
5376#line 1777 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5377 { (yyval.tree_arg_size_spec_type) = nullptr; }
5378#line 5379 "libinterp/parse-tree/oct-parse.cc"
5379 break;
5380
5381 case 225: /* size_spec: '(' arg_list ')' */
5382#line 1779 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5383 {
5384 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
5385
5386 if (! ((yyval.tree_arg_size_spec_type) = parser.make_arg_size_spec ((yyvsp[-1].tree_argument_list_type))))
5387 {
5388 // make_arg_size_spec deleted $2.
5389 YYABORT;
5390 }
5391 }
5392#line 5393 "libinterp/parse-tree/oct-parse.cc"
5393 break;
5394
5395 case 226: /* class_name: %empty */
5396#line 1791 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5397 { (yyval.tree_identifier_type) = nullptr; }
5398#line 5399 "libinterp/parse-tree/oct-parse.cc"
5399 break;
5400
5401 case 227: /* class_name: identifier */
5402#line 1793 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5403 { (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type); }
5404#line 5405 "libinterp/parse-tree/oct-parse.cc"
5405 break;
5406
5407 case 228: /* validation_fcns: %empty */
5408#line 1798 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5409 { (yyval.tree_arg_validation_fcns_type) = nullptr; }
5410#line 5411 "libinterp/parse-tree/oct-parse.cc"
5411 break;
5412
5413 case 229: /* validation_fcns: '{' arg_list '}' */
5414#line 1800 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5415 {
5416 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
5417
5418 if (! ((yyval.tree_arg_validation_fcns_type) = parser.make_arg_validation_fcns ((yyvsp[-1].tree_argument_list_type))))
5419 {
5420 // make_arg_validation_fcns deleted $2.
5421 YYABORT;
5422 }
5423 }
5424#line 5425 "libinterp/parse-tree/oct-parse.cc"
5425 break;
5426
5427 case 230: /* default_value: %empty */
5428#line 1812 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5429 { (yyval.tree_expression_type) = nullptr; }
5430#line 5431 "libinterp/parse-tree/oct-parse.cc"
5431 break;
5432
5433 case 231: /* default_value: '=' expression */
5434#line 1814 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5435 {
5436 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5437
5438 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
5439 }
5440#line 5441 "libinterp/parse-tree/oct-parse.cc"
5441 break;
5442
5443 case 232: /* classdef_beg: CLASSDEF */
5444#line 1826 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5445 {
5446 if (! lexer.m_reading_classdef_file)
5447 {
5448 parser.bison_error ("classdef must appear inside a file containing only a class definition");
5449 YYABORT;
5450 }
5451
5452 // Create invalid parent scope.
5453 lexer.m_symtab_context.push (octave::symbol_scope ());
5454 lexer.m_parsing_classdef = true;
5455 lexer.m_parsing_classdef_decl = true;
5456 lexer.m_classdef_element_names_are_keywords = true;
5457
5458 (yyval.tok_val) = (yyvsp[0].tok_val);
5459 }
5460#line 5461 "libinterp/parse-tree/oct-parse.cc"
5461 break;
5462
5463 case 233: /* classdef: classdef_beg stash_comment attr_list identifier opt_sep superclass_list class_body END */
5464#line 1844 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5465 {
5466 OCTAVE_YYUSE ((yyvsp[-3].punct_type));
5467
5468 octave::comment_list *lc = (yyvsp[-6].comment_type);
5469 octave::comment_list *tc = lexer.get_comment ();
5470
5471 lexer.m_parsing_classdef = false;
5472
5473 if (! ((yyval.tree_classdef_type) = parser.make_classdef ((yyvsp[-7].tok_val), (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_val),
5474 lc, tc)))
5475 {
5476 // make_classdef deleted $3, $4, $6, $7, LC, and
5477 // TC.
5478 YYABORT;
5479 }
5480 }
5481#line 5482 "libinterp/parse-tree/oct-parse.cc"
5482 break;
5483
5484 case 234: /* attr_list: %empty */
5485#line 1863 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5486 { (yyval.tree_classdef_attribute_list_type) = nullptr; }
5487#line 5488 "libinterp/parse-tree/oct-parse.cc"
5488 break;
5489
5490 case 235: /* attr_list: '(' attr_list1 ')' opt_sep */
5491#line 1865 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5492 {
5493 OCTAVE_YYUSE ((yyvsp[-3].tok_val), (yyvsp[-1].tok_val), (yyvsp[0].punct_type));
5494
5495 (yyval.tree_classdef_attribute_list_type) = (yyvsp[-2].tree_classdef_attribute_list_type);
5496 }
5497#line 5498 "libinterp/parse-tree/oct-parse.cc"
5498 break;
5499
5500 case 236: /* attr_list1: attr */
5501#line 1873 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5502 { (yyval.tree_classdef_attribute_list_type) = parser.make_classdef_attribute_list ((yyvsp[0].tree_classdef_attribute_type)); }
5503#line 5504 "libinterp/parse-tree/oct-parse.cc"
5504 break;
5505
5506 case 237: /* attr_list1: attr_list1 ',' attr */
5507#line 1875 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5508 {
5509 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5510
5511 (yyval.tree_classdef_attribute_list_type) = parser.append_classdef_attribute ((yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[0].tree_classdef_attribute_type));
5512 }
5513#line 5514 "libinterp/parse-tree/oct-parse.cc"
5514 break;
5515
5516 case 238: /* attr: identifier */
5517#line 1883 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5518 { (yyval.tree_classdef_attribute_type) = parser.make_classdef_attribute ((yyvsp[0].tree_identifier_type)); }
5519#line 5520 "libinterp/parse-tree/oct-parse.cc"
5520 break;
5521
5522 case 239: /* attr: identifier '=' expression */
5523#line 1885 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5524 {
5525 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5526
5527 (yyval.tree_classdef_attribute_type) = parser.make_classdef_attribute ((yyvsp[-2].tree_identifier_type), (yyvsp[0].tree_expression_type));
5528 }
5529#line 5530 "libinterp/parse-tree/oct-parse.cc"
5530 break;
5531
5532 case 240: /* attr: EXPR_NOT identifier */
5533#line 1891 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5534 {
5535 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5536
5537 (yyval.tree_classdef_attribute_type) = parser.make_not_classdef_attribute ((yyvsp[0].tree_identifier_type));
5538 }
5539#line 5540 "libinterp/parse-tree/oct-parse.cc"
5540 break;
5541
5542 case 241: /* superclass_list: %empty */
5543#line 1899 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5544 {
5545 lexer.m_parsing_classdef_decl = false;
5546 lexer.m_parsing_classdef_superclass = false;
5547
5548 (yyval.tree_classdef_superclass_list_type) = nullptr;
5549 }
5550#line 5551 "libinterp/parse-tree/oct-parse.cc"
5551 break;
5552
5553 case 242: /* superclass_list: superclass_list1 opt_sep */
5554#line 1906 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5555 {
5556 OCTAVE_YYUSE ((yyvsp[0].punct_type));
5557
5558 lexer.m_parsing_classdef_decl = false;
5559 lexer.m_parsing_classdef_superclass = false;
5560
5561 (yyval.tree_classdef_superclass_list_type) = (yyvsp[-1].tree_classdef_superclass_list_type);
5562 }
5563#line 5564 "libinterp/parse-tree/oct-parse.cc"
5564 break;
5565
5566 case 243: /* superclass_list1: EXPR_LT superclass */
5567#line 1918 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5568 {
5569 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5570
5571 (yyval.tree_classdef_superclass_list_type) = parser.make_classdef_superclass_list ((yyvsp[0].tree_classdef_superclass_type));
5572 }
5573#line 5574 "libinterp/parse-tree/oct-parse.cc"
5574 break;
5575
5576 case 244: /* superclass_list1: superclass_list1 EXPR_AND superclass */
5577#line 1924 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5578 {
5579 OCTAVE_YYUSE ((yyvsp[-1].tok_val));
5580
5581 (yyval.tree_classdef_superclass_list_type) = parser.append_classdef_superclass ((yyvsp[-2].tree_classdef_superclass_list_type), (yyvsp[0].tree_classdef_superclass_type));
5582 }
5583#line 5584 "libinterp/parse-tree/oct-parse.cc"
5584 break;
5585
5586 case 245: /* superclass: FQ_IDENT */
5587#line 1932 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5588 { (yyval.tree_classdef_superclass_type) = parser.make_classdef_superclass ((yyvsp[0].tok_val)); }
5589#line 5590 "libinterp/parse-tree/oct-parse.cc"
5590 break;
5591
5592 case 246: /* class_body: %empty */
5593#line 1936 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5594 {
5595 lexer.m_classdef_element_names_are_keywords = false;
5596 (yyval.tree_classdef_body_type) = nullptr;
5597 }
5598#line 5599 "libinterp/parse-tree/oct-parse.cc"
5599 break;
5600
5601 case 247: /* class_body: class_body1 opt_sep */
5602#line 1941 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5603 {
5604 OCTAVE_YYUSE ((yyvsp[0].punct_type));
5605
5606 lexer.m_classdef_element_names_are_keywords = false;
5607 (yyval.tree_classdef_body_type) = (yyvsp[-1].tree_classdef_body_type);
5608 }
5609#line 5610 "libinterp/parse-tree/oct-parse.cc"
5610 break;
5611
5612 case 248: /* class_body1: properties_block */
5613#line 1950 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5614 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_properties_block_type)); }
5615#line 5616 "libinterp/parse-tree/oct-parse.cc"
5616 break;
5617
5618 case 249: /* class_body1: methods_block */
5619#line 1952 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5620 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_methods_block_type)); }
5621#line 5622 "libinterp/parse-tree/oct-parse.cc"
5622 break;
5623
5624 case 250: /* class_body1: events_block */
5625#line 1954 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5626 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_events_block_type)); }
5627#line 5628 "libinterp/parse-tree/oct-parse.cc"
5628 break;
5629
5630 case 251: /* class_body1: enum_block */
5631#line 1956 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5632 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_enum_block_type)); }
5633#line 5634 "libinterp/parse-tree/oct-parse.cc"
5634 break;
5635
5636 case 252: /* class_body1: class_body1 opt_sep properties_block */
5637#line 1958 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5638 {
5639 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5640
5641 (yyval.tree_classdef_body_type) = parser.append_classdef_properties_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_properties_block_type));
5642 }
5643#line 5644 "libinterp/parse-tree/oct-parse.cc"
5644 break;
5645
5646 case 253: /* class_body1: class_body1 opt_sep methods_block */
5647#line 1964 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5648 {
5649 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5650
5651 (yyval.tree_classdef_body_type) = parser.append_classdef_methods_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_methods_block_type));
5652 }
5653#line 5654 "libinterp/parse-tree/oct-parse.cc"
5654 break;
5655
5656 case 254: /* class_body1: class_body1 opt_sep events_block */
5657#line 1970 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5658 {
5659 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5660
5661 (yyval.tree_classdef_body_type) = parser.append_classdef_events_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_events_block_type));
5662 }
5663#line 5664 "libinterp/parse-tree/oct-parse.cc"
5664 break;
5665
5666 case 255: /* class_body1: class_body1 opt_sep enum_block */
5667#line 1976 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5668 {
5669 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5670
5671 (yyval.tree_classdef_body_type) = parser.append_classdef_enum_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_enum_block_type));
5672 }
5673#line 5674 "libinterp/parse-tree/oct-parse.cc"
5674 break;
5675
5676 case 256: /* properties_block: properties_beg stash_comment opt_sep attr_list property_list END */
5677#line 1985 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5678 {
5679 OCTAVE_YYUSE ((yyvsp[-3].punct_type));
5680
5681 octave::comment_list *lc = (yyvsp[-4].comment_type);
5682 octave::comment_list *tc = lexer.get_comment ();
5683
5684 if (! ((yyval.tree_classdef_properties_block_type) = parser.make_classdef_properties_block
5685 ((yyvsp[-5].tok_val), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_property_list_type), (yyvsp[0].tok_val), lc, tc)))
5686 {
5687 // make_classdef_properties_block deleted $4,
5688 // $5, LC, and TC.
5689 YYABORT;
5690 }
5691 }
5692#line 5693 "libinterp/parse-tree/oct-parse.cc"
5693 break;
5694
5695 case 257: /* properties_beg: PROPERTIES */
5696#line 2002 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5697 {
5698 lexer.m_classdef_element_names_are_keywords = false;
5699 (yyval.tok_val) = (yyvsp[0].tok_val);
5700 }
5701#line 5702 "libinterp/parse-tree/oct-parse.cc"
5702 break;
5703
5704 case 258: /* property_list: %empty */
5705#line 2009 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5706 {
5707 lexer.m_classdef_element_names_are_keywords = true;
5708 (yyval.tree_classdef_property_list_type) = nullptr;
5709 }
5710#line 5711 "libinterp/parse-tree/oct-parse.cc"
5711 break;
5712
5713 case 259: /* property_list: property_list1 opt_sep */
5714#line 2014 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5715 {
5716 OCTAVE_YYUSE ((yyvsp[0].punct_type));
5717
5718 lexer.m_classdef_element_names_are_keywords = true;
5719 (yyval.tree_classdef_property_list_type) = (yyvsp[-1].tree_classdef_property_list_type);
5720 }
5721#line 5722 "libinterp/parse-tree/oct-parse.cc"
5722 break;
5723
5724 case 260: /* property_list1: class_property */
5725#line 2024 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5726 { (yyval.tree_classdef_property_list_type) = parser.make_classdef_property_list ((yyvsp[0].tree_classdef_property_type)); }
5727#line 5728 "libinterp/parse-tree/oct-parse.cc"
5728 break;
5729
5730 case 261: /* property_list1: property_list1 sep class_property */
5731#line 2026 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5732 {
5733 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5734
5735 // We don't look ahead to grab end-of-line comments.
5736 // Instead, they are grabbed when we see the
5737 // identifier that becomes the next element in the
5738 // list. If the element at the end of the list
5739 // doesn't have a doc string, see whether the
5740 // element we are adding is stroing an end-of-line
5741 // comment for us to use.
5742
5743 octave::tree_classdef_property *last_elt = (yyvsp[-2].tree_classdef_property_list_type)->back ();
5744
5745 if (! last_elt->have_doc_string ())
5746 {
5747 octave::comment_list *cl = (yyvsp[0].tree_classdef_property_type)->comments ();
5748
5749 if (cl)
5750 {
5751 octave::comment_elt elt = cl->front ();
5752
5753 if (elt.is_end_of_line ())
5754 last_elt->doc_string (elt.text ());
5755 }
5756 }
5757
5758 (yyval.tree_classdef_property_list_type) = parser.append_classdef_property ((yyvsp[-2].tree_classdef_property_list_type), (yyvsp[0].tree_classdef_property_type));
5759 }
5760#line 5761 "libinterp/parse-tree/oct-parse.cc"
5761 break;
5762
5763 case 262: /* class_property: stash_comment identifier arg_validation */
5764#line 2057 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5765 { (yyval.tree_classdef_property_type) = parser.make_classdef_property ((yyvsp[-2].comment_type), (yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_arg_validation_type)); }
5766#line 5767 "libinterp/parse-tree/oct-parse.cc"
5767 break;
5768
5769 case 263: /* methods_block: methods_beg stash_comment opt_sep attr_list methods_list END */
5770#line 2061 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5771 {
5772 OCTAVE_YYUSE ((yyvsp[-3].punct_type));
5773
5774 octave::comment_list *lc = (yyvsp[-4].comment_type);
5775 octave::comment_list *tc = lexer.get_comment ();
5776
5777 if (! ((yyval.tree_classdef_methods_block_type) = parser.make_classdef_methods_block
5778 ((yyvsp[-5].tok_val), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_methods_list_type), (yyvsp[0].tok_val), lc, tc)))
5779 {
5780 // make_classdef_methods_block deleted $4, $5,
5781 // LC, and TC.
5782 YYABORT;
5783 }
5784 }
5785#line 5786 "libinterp/parse-tree/oct-parse.cc"
5786 break;
5787
5788 case 264: /* methods_beg: METHODS */
5789#line 2078 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5790 {
5791 lexer.m_classdef_element_names_are_keywords = false;
5792 (yyval.tok_val) = (yyvsp[0].tok_val);
5793 }
5794#line 5795 "libinterp/parse-tree/oct-parse.cc"
5795 break;
5796
5797 case 265: /* method_decl1: identifier */
5798#line 2085 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5799 {
5800 if (! ((yyval.octave_user_function_type) = parser.start_classdef_external_method ((yyvsp[0].tree_identifier_type), nullptr)))
5801 YYABORT;
5802 }
5803#line 5804 "libinterp/parse-tree/oct-parse.cc"
5804 break;
5805
5806 case 266: /* method_decl1: identifier param_list */
5807#line 2090 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5808 {
5809 if (! ((yyval.octave_user_function_type) = parser.start_classdef_external_method ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_parameter_list_type))))
5810 YYABORT;
5811 }
5812#line 5813 "libinterp/parse-tree/oct-parse.cc"
5813 break;
5814
5815 case 267: /* method_decl: stash_comment method_decl1 */
5816#line 2097 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5817 { (yyval.tree_function_def_type) = parser.finish_classdef_external_method ((yyvsp[0].octave_user_function_type), nullptr, (yyvsp[-1].comment_type)); }
5818#line 5819 "libinterp/parse-tree/oct-parse.cc"
5819 break;
5820
5821 case 268: /* $@1: %empty */
5822#line 2099 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5823 {
5824 OCTAVE_YYUSE ((yyvsp[0].tok_val));
5825
5826 lexer.m_defining_func++;
5827 lexer.m_parsed_function_name.push (false);
5828 }
5829#line 5830 "libinterp/parse-tree/oct-parse.cc"
5830 break;
5831
5832 case 269: /* method_decl: stash_comment return_list '=' $@1 method_decl1 */
5833#line 2106 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5834 {
5835 lexer.m_defining_func--;
5836 lexer.m_parsed_function_name.pop ();
5837
5838 (yyval.tree_function_def_type) = parser.finish_classdef_external_method ((yyvsp[0].octave_user_function_type), (yyvsp[-3].tree_parameter_list_type), (yyvsp[-4].comment_type));
5839 }
5840#line 5841 "libinterp/parse-tree/oct-parse.cc"
5841 break;
5842
5843 case 270: /* method: method_decl */
5844#line 2115 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5845 { (yyval.tree_function_def_type) = (yyvsp[0].tree_function_def_type); }
5846#line 5847 "libinterp/parse-tree/oct-parse.cc"
5847 break;
5848
5849 case 271: /* method: function */
5850#line 2117 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5851 { (yyval.tree_function_def_type) = (yyvsp[0].tree_function_def_type); }
5852#line 5853 "libinterp/parse-tree/oct-parse.cc"
5853 break;
5854
5855 case 272: /* methods_list: %empty */
5856#line 2121 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5857 {
5858 lexer.m_classdef_element_names_are_keywords = true;
5859 (yyval.tree_classdef_methods_list_type) = nullptr;
5860 }
5861#line 5862 "libinterp/parse-tree/oct-parse.cc"
5862 break;
5863
5864 case 273: /* methods_list: methods_list1 opt_sep */
5865#line 2126 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5866 {
5867 OCTAVE_YYUSE ((yyvsp[0].punct_type));
5868
5869 lexer.m_classdef_element_names_are_keywords = true;
5870 (yyval.tree_classdef_methods_list_type) = (yyvsp[-1].tree_classdef_methods_list_type);
5871 }
5872#line 5873 "libinterp/parse-tree/oct-parse.cc"
5873 break;
5874
5875 case 274: /* methods_list1: method */
5876#line 2135 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5877 { (yyval.tree_classdef_methods_list_type) = parser.make_classdef_methods_list ((yyvsp[0].tree_function_def_type)); }
5878#line 5879 "libinterp/parse-tree/oct-parse.cc"
5879 break;
5880
5881 case 275: /* methods_list1: methods_list1 opt_sep method */
5882#line 2137 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5883 {
5884 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5885
5886 (yyval.tree_classdef_methods_list_type) = parser.append_classdef_method ((yyvsp[-2].tree_classdef_methods_list_type), (yyvsp[0].tree_function_def_type));
5887 }
5888#line 5889 "libinterp/parse-tree/oct-parse.cc"
5889 break;
5890
5891 case 276: /* events_block: events_beg stash_comment opt_sep attr_list events_list END */
5892#line 2145 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5893 {
5894 OCTAVE_YYUSE ((yyvsp[-3].punct_type));
5895
5896 octave::comment_list *lc = (yyvsp[-4].comment_type);
5897 octave::comment_list *tc = lexer.get_comment ();
5898
5899 if (! ((yyval.tree_classdef_events_block_type) = parser.make_classdef_events_block
5900 ((yyvsp[-5].tok_val), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_events_list_type), (yyvsp[0].tok_val), lc, tc)))
5901 {
5902 // make_classdef_events_block deleted $4, $5,
5903 // LC, and TC.
5904 YYABORT;
5905 }
5906 }
5907#line 5908 "libinterp/parse-tree/oct-parse.cc"
5908 break;
5909
5910 case 277: /* events_beg: EVENTS */
5911#line 2162 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5912 {
5913 lexer.m_classdef_element_names_are_keywords = false;
5914 (yyval.tok_val) = (yyvsp[0].tok_val);
5915 }
5916#line 5917 "libinterp/parse-tree/oct-parse.cc"
5917 break;
5918
5919 case 278: /* events_list: %empty */
5920#line 2169 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5921 {
5922 lexer.m_classdef_element_names_are_keywords = true;
5923 (yyval.tree_classdef_events_list_type) = nullptr;
5924 }
5925#line 5926 "libinterp/parse-tree/oct-parse.cc"
5926 break;
5927
5928 case 279: /* events_list: events_list1 opt_sep */
5929#line 2174 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5930 {
5931 OCTAVE_YYUSE ((yyvsp[0].punct_type));
5932
5933 lexer.m_classdef_element_names_are_keywords = true;
5934 (yyval.tree_classdef_events_list_type) = (yyvsp[-1].tree_classdef_events_list_type);
5935 }
5936#line 5937 "libinterp/parse-tree/oct-parse.cc"
5937 break;
5938
5939 case 280: /* events_list1: class_event */
5940#line 2183 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5941 { (yyval.tree_classdef_events_list_type) = parser.make_classdef_events_list ((yyvsp[0].tree_classdef_event_type)); }
5942#line 5943 "libinterp/parse-tree/oct-parse.cc"
5943 break;
5944
5945 case 281: /* events_list1: events_list1 opt_sep class_event */
5946#line 2185 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5947 {
5948 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
5949
5950 (yyval.tree_classdef_events_list_type) = parser.append_classdef_event ((yyvsp[-2].tree_classdef_events_list_type), (yyvsp[0].tree_classdef_event_type));
5951 }
5952#line 5953 "libinterp/parse-tree/oct-parse.cc"
5953 break;
5954
5955 case 282: /* class_event: stash_comment identifier */
5956#line 2193 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5957 { (yyval.tree_classdef_event_type) = parser.make_classdef_event ((yyvsp[-1].comment_type), (yyvsp[0].tree_identifier_type)); }
5958#line 5959 "libinterp/parse-tree/oct-parse.cc"
5959 break;
5960
5961 case 283: /* enum_block: enumeration_beg stash_comment opt_sep attr_list enum_list END */
5962#line 2197 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5963 {
5964 OCTAVE_YYUSE ((yyvsp[-3].punct_type));
5965
5966 octave::comment_list *lc = (yyvsp[-4].comment_type);
5967 octave::comment_list *tc = lexer.get_comment ();
5968
5969 if (! ((yyval.tree_classdef_enum_block_type) = parser.make_classdef_enum_block
5970 ((yyvsp[-5].tok_val), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_enum_list_type), (yyvsp[0].tok_val), lc, tc)))
5971 {
5972 // make_classdef_enum_block deleted $4, $5, LC,
5973 // and TC.
5974 YYABORT;
5975 }
5976 }
5977#line 5978 "libinterp/parse-tree/oct-parse.cc"
5978 break;
5979
5980 case 284: /* enumeration_beg: ENUMERATION */
5981#line 2214 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5982 {
5983 lexer.m_classdef_element_names_are_keywords = false;
5984 (yyval.tok_val) = (yyvsp[0].tok_val);
5985 }
5986#line 5987 "libinterp/parse-tree/oct-parse.cc"
5987 break;
5988
5989 case 285: /* enum_list: %empty */
5990#line 2221 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
5991 {
5992 lexer.m_classdef_element_names_are_keywords = true;
5993 (yyval.tree_classdef_enum_list_type) = nullptr;
5994 }
5995#line 5996 "libinterp/parse-tree/oct-parse.cc"
5996 break;
5997
5998 case 286: /* enum_list: enum_list1 opt_sep */
5999#line 2226 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6000 {
6001 OCTAVE_YYUSE ((yyvsp[0].punct_type));
6002
6003 lexer.m_classdef_element_names_are_keywords = true;
6004 (yyval.tree_classdef_enum_list_type) = (yyvsp[-1].tree_classdef_enum_list_type);
6005 }
6006#line 6007 "libinterp/parse-tree/oct-parse.cc"
6007 break;
6008
6009 case 287: /* enum_list1: class_enum */
6010#line 2235 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6011 { (yyval.tree_classdef_enum_list_type) = parser.make_classdef_enum_list ((yyvsp[0].tree_classdef_enum_type)); }
6012#line 6013 "libinterp/parse-tree/oct-parse.cc"
6013 break;
6014
6015 case 288: /* enum_list1: enum_list1 opt_sep class_enum */
6016#line 2237 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6017 {
6018 OCTAVE_YYUSE ((yyvsp[-1].punct_type));
6019
6020 (yyval.tree_classdef_enum_list_type) = parser.append_classdef_enum ((yyvsp[-2].tree_classdef_enum_list_type), (yyvsp[0].tree_classdef_enum_type));
6021 }
6022#line 6023 "libinterp/parse-tree/oct-parse.cc"
6023 break;
6024
6025 case 289: /* class_enum: stash_comment identifier '(' expression ')' */
6026#line 2245 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6027 {
6028 OCTAVE_YYUSE ((yyvsp[-2].tok_val), (yyvsp[0].tok_val));
6029
6030 (yyval.tree_classdef_enum_type) = parser.make_classdef_enum ((yyvsp[-3].tree_identifier_type), (yyvsp[-1].tree_expression_type), (yyvsp[-4].comment_type));
6031 }
6032#line 6033 "libinterp/parse-tree/oct-parse.cc"
6033 break;
6034
6035 case 290: /* stmt_begin: %empty */
6036#line 2257 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6037 {
6038 (yyval.dummy_type) = 0;
6039 lexer.m_at_beginning_of_statement = true;
6040 }
6041#line 6042 "libinterp/parse-tree/oct-parse.cc"
6042 break;
6043
6044 case 291: /* anon_fcn_begin: %empty */
6045#line 2264 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6046 {
6047 (yyval.dummy_type) = 0;
6048 lexer.m_at_beginning_of_statement = true;
6049 lexer.m_parsing_anon_fcn_body = true;
6050 }
6051#line 6052 "libinterp/parse-tree/oct-parse.cc"
6052 break;
6053
6054 case 292: /* stash_comment: %empty */
6055#line 2272 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6056 { (yyval.comment_type) = lexer.get_comment (); }
6057#line 6058 "libinterp/parse-tree/oct-parse.cc"
6058 break;
6059
6060 case 293: /* parse_error: LEXICAL_ERROR */
6061#line 2276 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6062 {
6063 (yyval.dummy_type) = 0;
6064 std::string msg = (yyvsp[0].tok_val)->text ();
6065 parser.bison_error (msg.c_str ());
6066 }
6067#line 6068 "libinterp/parse-tree/oct-parse.cc"
6068 break;
6069
6070 case 294: /* parse_error: error */
6071#line 2282 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6072 { (yyval.dummy_type) = 0; }
6073#line 6074 "libinterp/parse-tree/oct-parse.cc"
6074 break;
6075
6076 case 295: /* sep_no_nl: ',' */
6077#line 2286 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6078 {
6079 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6080
6081 (yyval.punct_type) = ',';
6082 }
6083#line 6084 "libinterp/parse-tree/oct-parse.cc"
6084 break;
6085
6086 case 296: /* sep_no_nl: ';' */
6087#line 2292 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6088 {
6089 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6090
6091 (yyval.punct_type) = ';';
6092 }
6093#line 6094 "libinterp/parse-tree/oct-parse.cc"
6094 break;
6095
6096 case 297: /* sep_no_nl: sep_no_nl ',' */
6097#line 2298 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6098 {
6099 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6100
6101 (yyval.punct_type) = (yyvsp[-1].punct_type);
6102 }
6103#line 6104 "libinterp/parse-tree/oct-parse.cc"
6104 break;
6105
6106 case 298: /* sep_no_nl: sep_no_nl ';' */
6107#line 2304 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6108 {
6109 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6110
6111 (yyval.punct_type) = (yyvsp[-1].punct_type);
6112 }
6113#line 6114 "libinterp/parse-tree/oct-parse.cc"
6114 break;
6115
6116 case 299: /* opt_sep_no_nl: %empty */
6117#line 2312 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6118 { (yyval.punct_type) = 0; }
6119#line 6120 "libinterp/parse-tree/oct-parse.cc"
6120 break;
6121
6122 case 300: /* opt_sep_no_nl: sep_no_nl */
6123#line 2314 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6124 { (yyval.punct_type) = (yyvsp[0].punct_type); }
6125#line 6126 "libinterp/parse-tree/oct-parse.cc"
6126 break;
6127
6128 case 301: /* opt_nl: %empty */
6129#line 2318 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6130 { (yyval.punct_type) = 0; }
6131#line 6132 "libinterp/parse-tree/oct-parse.cc"
6132 break;
6133
6134 case 302: /* opt_nl: nl */
6135#line 2320 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6136 { (yyval.punct_type) = (yyvsp[0].punct_type); }
6137#line 6138 "libinterp/parse-tree/oct-parse.cc"
6138 break;
6139
6140 case 303: /* nl: '\n' */
6141#line 2324 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6142 {
6143 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6144
6145 (yyval.punct_type) = '\n';
6146 }
6147#line 6148 "libinterp/parse-tree/oct-parse.cc"
6148 break;
6149
6150 case 304: /* nl: nl '\n' */
6151#line 2330 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6152 {
6153 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6154
6155 (yyval.punct_type) = (yyvsp[-1].punct_type);
6156 }
6157#line 6158 "libinterp/parse-tree/oct-parse.cc"
6158 break;
6159
6160 case 305: /* sep: ',' */
6161#line 2338 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6162 {
6163 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6164
6165 (yyval.punct_type) = ',';
6166 }
6167#line 6168 "libinterp/parse-tree/oct-parse.cc"
6168 break;
6169
6170 case 306: /* sep: ';' */
6171#line 2344 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6172 {
6173 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6174
6175 (yyval.punct_type) = ';';
6176 }
6177#line 6178 "libinterp/parse-tree/oct-parse.cc"
6178 break;
6179
6180 case 307: /* sep: '\n' */
6181#line 2350 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6182 {
6183 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6184
6185 (yyval.punct_type) = '\n';
6186 }
6187#line 6188 "libinterp/parse-tree/oct-parse.cc"
6188 break;
6189
6190 case 308: /* sep: sep ',' */
6191#line 2356 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6192 {
6193 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6194
6195 (yyval.punct_type) = (yyvsp[-1].punct_type);
6196 }
6197#line 6198 "libinterp/parse-tree/oct-parse.cc"
6198 break;
6199
6200 case 309: /* sep: sep ';' */
6201#line 2362 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6202 {
6203 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6204
6205 (yyval.punct_type) = (yyvsp[-1].punct_type);
6206 }
6207#line 6208 "libinterp/parse-tree/oct-parse.cc"
6208 break;
6209
6210 case 310: /* sep: sep '\n' */
6211#line 2368 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6212 {
6213 OCTAVE_YYUSE ((yyvsp[0].tok_val));
6214
6215 (yyval.punct_type) = (yyvsp[-1].punct_type);
6216 }
6217#line 6218 "libinterp/parse-tree/oct-parse.cc"
6218 break;
6219
6220 case 311: /* opt_sep: %empty */
6221#line 2376 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6222 { (yyval.punct_type) = 0; }
6223#line 6224 "libinterp/parse-tree/oct-parse.cc"
6224 break;
6225
6226 case 312: /* opt_sep: sep */
6227#line 2378 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6228 { (yyval.punct_type) = (yyvsp[0].punct_type); }
6229#line 6230 "libinterp/parse-tree/oct-parse.cc"
6230 break;
6231
6232
6233#line 6234 "libinterp/parse-tree/oct-parse.cc"
6234
6235 default: break;
6236 }
6237 /* User semantic actions sometimes alter yychar, and that requires
6238 that yytoken be updated with the new translation. We take the
6239 approach of translating immediately before every use of yytoken.
6240 One alternative is translating here after every semantic action,
6241 but that translation would be missed if the semantic action invokes
6242 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
6243 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
6244 incorrect destructor might then be invoked immediately. In the
6245 case of YYERROR or YYBACKUP, subsequent parser actions might lead
6246 to an incorrect destructor call or verbose syntax error message
6247 before the lookahead is translated. */
6248 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
6249
6250 YYPOPSTACK (yylen);
6251 yylen = 0;
6252
6253 *++yyvsp = yyval;
6254
6255 /* Now 'shift' the result of the reduction. Determine what state
6256 that goes to, based on the state we popped back to and the rule
6257 number reduced by. */
6258 {
6259 const int yylhs = yyr1[yyn] - YYNTOKENS;
6260 const int yyi = yypgoto[yylhs] + *yyssp;
6261 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
6262 ? yytable[yyi]
6263 : yydefgoto[yylhs]);
6264 }
6265
6266 goto yynewstate;
6267
6268
6269/*--------------------------------------.
6270| yyerrlab -- here on detecting error. |
6271`--------------------------------------*/
6272yyerrlab:
6273 /* Make sure we have latest lookahead translation. See comments at
6274 user semantic actions for why this is necessary. */
6275 yytoken = yychar == OCTAVE_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
6276 /* If not already recovering from an error, report this error. */
6277 if (!yyerrstatus)
6278 {
6279 ++yynerrs;
6280 yyerror (parser, YY_("syntax error"));
6281 }
6282
6283 if (yyerrstatus == 3)
6284 {
6285 /* If just tried and failed to reuse lookahead token after an
6286 error, discard it. */
6287
6288 if (yychar <= OCTAVE_EOF)
6289 {
6290 /* Return failure if at end of input. */
6291 if (yychar == OCTAVE_EOF)
6292 YYABORT;
6293 }
6294 else
6295 {
6296 yydestruct ("Error: discarding",
6297 yytoken, &yylval, parser);
6298 yychar = OCTAVE_EMPTY;
6299 }
6300 }
6301
6302 /* Else will try to reuse lookahead token after shifting the error
6303 token. */
6304 goto yyerrlab1;
6305
6306
6307/*---------------------------------------------------.
6308| yyerrorlab -- error raised explicitly by YYERROR. |
6309`---------------------------------------------------*/
6310yyerrorlab:
6311 /* Pacify compilers when the user code never invokes YYERROR and the
6312 label yyerrorlab therefore never appears in user code. */
6313 if (0)
6314 YYERROR;
6315 ++yynerrs;
6316
6317 /* Do not reclaim the symbols of the rule whose action triggered
6318 this YYERROR. */
6319 YYPOPSTACK (yylen);
6320 yylen = 0;
6322 yystate = *yyssp;
6323 goto yyerrlab1;
6324
6325
6326/*-------------------------------------------------------------.
6327| yyerrlab1 -- common code for both syntax error and YYERROR. |
6328`-------------------------------------------------------------*/
6329yyerrlab1:
6330 yyerrstatus = 3; /* Each real token shifted decrements this. */
6331
6332 /* Pop stack until we find a state that shifts the error token. */
6333 for (;;)
6334 {
6335 yyn = yypact[yystate];
6336 if (!yypact_value_is_default (yyn))
6337 {
6338 yyn += YYSYMBOL_YYerror;
6339 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
6340 {
6341 yyn = yytable[yyn];
6342 if (0 < yyn)
6343 break;
6344 }
6345 }
6346
6347 /* Pop the current state because it cannot handle the error token. */
6348 if (yyssp == yyss)
6349 YYABORT;
6350
6351
6352 yydestruct ("Error: popping",
6353 YY_ACCESSING_SYMBOL (yystate), yyvsp, parser);
6354 YYPOPSTACK (1);
6355 yystate = *yyssp;
6357 }
6358
6360 *++yyvsp = yylval;
6362
6363
6364 /* Shift the error token. */
6365 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
6366
6367 yystate = yyn;
6368 goto yynewstate;
6369
6370
6371/*-------------------------------------.
6372| yyacceptlab -- YYACCEPT comes here. |
6373`-------------------------------------*/
6374yyacceptlab:
6375 yyresult = 0;
6376 goto yyreturnlab;
6377
6378
6379/*-----------------------------------.
6380| yyabortlab -- YYABORT comes here. |
6381`-----------------------------------*/
6382yyabortlab:
6383 yyresult = 1;
6384 goto yyreturnlab;
6385
6386
6387/*-----------------------------------------------------------.
6388| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
6389`-----------------------------------------------------------*/
6390yyexhaustedlab:
6391 yyerror (parser, YY_("memory exhausted"));
6392 yyresult = 2;
6393 goto yyreturnlab;
6394
6395
6396/*----------------------------------------------------------.
6397| yyreturnlab -- parsing is finished, clean up and return. |
6398`----------------------------------------------------------*/
6399yyreturnlab:
6400 if (yychar != OCTAVE_EMPTY)
6401 {
6402 /* Make sure we have latest lookahead translation. See comments at
6403 user semantic actions for why this is necessary. */
6404 yytoken = YYTRANSLATE (yychar);
6405 yydestruct ("Cleanup: discarding lookahead",
6406 yytoken, &yylval, parser);
6407 }
6408 /* Do not reclaim the symbols of the rule whose action triggered
6409 this YYABORT or YYACCEPT. */
6410 YYPOPSTACK (yylen);
6412 while (yyssp != yyss)
6413 {
6414 yydestruct ("Cleanup: popping",
6415 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parser);
6416 YYPOPSTACK (1);
6417 }
6418 yyps->yynew = 2;
6419 goto yypushreturn;
6420
6421
6422/*-------------------------.
6423| yypushreturn -- return. |
6424`-------------------------*/
6425yypushreturn:
6426
6427 return yyresult;
6428}
6429#undef octave_nerrs
6430#undef yystate
6431#undef yyerrstatus
6432#undef yyssa
6433#undef yyss
6434#undef yyssp
6435#undef yyvsa
6436#undef yyvs
6437#undef yyvsp
6438#undef yystacksize
6439#line 2381 "/home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy"
6440
6441
6442#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
6443 // Restore prevailing warning state for remainder of the file.
6444# pragma GCC diagnostic pop
6445#endif
6446
6447// Generic error messages.
6448
6449#undef lexer
6450#undef scanner
6451
6452static void
6453yyerror (octave::base_parser& parser, const char *s)
6454{
6455 parser.bison_error (s);
6456}
6457
6458OCTAVE_NAMESPACE_BEGIN
6459
6460 class parse_exception : public std::runtime_error
6461 {
6462 public:
6463
6464 parse_exception (const std::string& message,
6465 const std::string& fcn_name = "",
6466 const std::string& file_name = "",
6467 int line = -1, int column = -1)
6468 : runtime_error (message), m_message (message),
6471 { }
6472
6474
6476
6477 ~parse_exception (void) = default;
6478
6479 std::string message (void) const { return m_message; }
6480
6481 // Provided for std::exception interface.
6482 const char * what (void) const noexcept { return m_message.c_str (); }
6483
6484 std::string fcn_name (void) const { return m_fcn_name; }
6485 std::string file_name (void) const { return m_file_name; }
6486
6487 int line (void) const { return m_line; }
6488 int column (void) const { return m_column; }
6489
6490 // virtual void display (std::ostream& os) const;
6491
6492 private:
6493
6494 std::string m_message;
6495
6496 std::string m_fcn_name;
6497 std::string m_file_name;
6500 };
6501
6503 {
6504 public:
6505
6507 : m_scope (), m_error_list ()
6508 { }
6509
6511
6513
6514 ~parse_tree_validator (void) = default;
6515
6516 symbol_scope get_scope (void) const { return m_scope; }
6517
6518 bool ok (void) const { return m_error_list.empty (); }
6519
6520 std::list<parse_exception> error_list (void) const
6521 {
6522 return m_error_list;
6523 }
6524
6526 {
6527 unwind_protect_var<symbol_scope> restore_var (m_scope, script.scope ());
6528
6529 tree_statement_list *stmt_list = script.body ();
6530
6531 if (stmt_list)
6532 stmt_list->accept (*this);
6533 }
6534
6536 {
6537 unwind_protect_var<symbol_scope> restore_var (m_scope, fcn.scope ());
6538
6539 tree_statement_list *stmt_list = fcn.body ();
6540
6541 if (stmt_list)
6542 stmt_list->accept (*this);
6543
6544 std::map<std::string, octave_value> subfcns = fcn.subfunctions ();
6545
6546 if (! subfcns.empty ())
6547 {
6548 for (auto& nm_val : subfcns)
6549 {
6550 octave_user_function *subfcn
6551 = nm_val.second.user_function_value ();
6552
6553 if (subfcn)
6554 subfcn->accept (*this);
6555 }
6556 }
6557 }
6558
6559 void visit_index_expression (tree_index_expression& idx_expr)
6560 {
6561 if (idx_expr.is_word_list_cmd ())
6562 {
6563 std::string sym_nm = idx_expr.name ();
6564
6565 if (m_scope.is_variable (sym_nm))
6566 {
6567 std::string message
6568 = sym_nm + ": invalid use of symbol as both variable and command";
6569 parse_exception pe (message, m_scope.fcn_name (),
6570 m_scope.fcn_file_name (),
6571 idx_expr.line (), idx_expr.column ());
6572
6573 m_error_list.push_back (pe);
6574 }
6575 }
6576 }
6577
6578 private:
6579
6580 symbol_scope m_scope;
6581
6582 std::list<parse_exception> m_error_list;
6583 };
6584
6585 template <typename LIST_T, typename ELT_T>
6586 static LIST_T *
6587 list_append (LIST_T *list, ELT_T elt)
6588 {
6589 list->append (elt);
6590 return list;
6591 }
6592
6593 std::size_t
6594 base_parser::parent_scope_info::size (void) const
6595 {
6596 return m_info.size ();
6597 }
6598
6599 void
6600 base_parser::parent_scope_info::push (const value_type& elt)
6601 {
6602 m_info.push_back (elt);
6603 }
6604
6605 void
6606 base_parser::parent_scope_info::push (const symbol_scope& scope)
6607 {
6608 push (value_type (scope, ""));
6609 }
6610
6611 void
6612 base_parser::parent_scope_info::pop (void)
6613 {
6614 m_info.pop_back ();
6615 }
6616
6617 bool
6618 base_parser::parent_scope_info::name_ok (const std::string& name)
6619 {
6620 // Name can't be the same as any parent function or any other
6621 // function we've already seen. We could maintain a complex
6622 // tree structure of names, or we can just store the set of
6623 // full names of all the functions, which must be unique.
6624
6625 std::string full_name;
6626
6627 for (std::size_t i = 0; i < size()-1; i++)
6628 {
6629 const value_type& elt = m_info[i];
6630
6631 if (name == elt.second)
6632 return false;
6633
6634 full_name += elt.second + ">";
6635 }
6636
6637 full_name += name;
6638
6639 if (m_all_names.find (full_name) != m_all_names.end ())
6640 {
6641 // Return false (failure) if we are parsing a subfunction, local
6642 // function, or nested function. Otherwise, it is OK to have a
6643 // duplicate name.
6644
6645 return ! (m_parser.parsing_subfunctions ()
6646 || m_parser.parsing_local_functions ()
6647 || m_parser.curr_fcn_depth () > 0);
6648 }
6649
6650 m_all_names.insert (full_name);
6651
6652 return true;
6653 }
6654
6655 bool
6656 base_parser::parent_scope_info::name_current_scope (const std::string& name)
6657 {
6658 if (! name_ok (name))
6659 return false;
6660
6661 if (size () > 0)
6662 m_info.back().second = name;
6663
6664 return true;
6665 }
6666
6668 base_parser::parent_scope_info::parent_scope (void) const
6669 {
6670 return size () > 1 ? m_info[size()-2].first : symbol_scope ();
6671 }
6672
6673 std::string
6674 base_parser::parent_scope_info::parent_name (void) const
6675 {
6676 return m_info[size()-2].second;
6677 }
6678
6679 void base_parser::parent_scope_info::clear (void)
6680 {
6681 m_info.clear ();
6682 m_all_names.clear ();
6683 }
6684
6685 base_parser::base_parser (base_lexer& lxr)
6686 : m_endfunction_found (false), m_autoloading (false),
6687 m_fcn_file_from_relative_lookup (false),
6688 m_parsing_subfunctions (false), m_parsing_local_functions (false),
6689 m_max_fcn_depth (-1), m_curr_fcn_depth (-1), m_primary_fcn_scope (),
6690 m_curr_class_name (), m_curr_package_name (), m_function_scopes (*this),
6691 m_primary_fcn (), m_subfunction_names (), m_classdef_object (),
6692 m_stmt_list (), m_lexer (lxr), m_parser_state (yypstate_new ())
6693 { }
6694
6696 {
6697 delete &m_lexer;
6698
6699 // FIXME: Deleting the internal Bison parser state structure does
6700 // not clean up any partial parse trees in the event of an interrupt or
6701 // error. It's not clear how to safely do that with the C language
6702 // parser that Bison generates. The C++ language parser that Bison
6703 // generates would do it for us automatically whenever an exception
6704 // is thrown while parsing input, but there is currently no C++
6705 // interface for a push parser.
6706
6707 yypstate_delete (static_cast<yypstate *> (m_parser_state));
6708 }
6709
6710 void
6712 {
6713 m_endfunction_found = false;
6714 m_autoloading = false;
6716 m_parsing_subfunctions = false;
6718 m_max_fcn_depth = -1;
6719 m_curr_fcn_depth = -1;
6721 m_curr_class_name = "";
6725 m_subfunction_names.clear ();
6726 m_classdef_object.reset ();
6727 m_stmt_list.reset ();
6728
6729 m_lexer.reset ();
6730
6731 yypstate_delete (static_cast<yypstate *> (m_parser_state));
6733 }
6734
6735 // Error messages for mismatched end tokens.
6736
6737 static std::string
6739 {
6740 std::string retval = "<unknown>";
6741
6742 switch (ettype)
6743 {
6744 case token::simple_end:
6745 retval = "end";
6746 break;
6747
6749 retval = "endclassdef";
6750 break;
6751
6753 retval = "endenumeration";
6754 break;
6755
6756 case token::events_end:
6757 retval = "endevents";
6758 break;
6759
6760 case token::for_end:
6761 retval = "endfor";
6762 break;
6763
6765 retval = "endfunction";
6766 break;
6767
6768 case token::if_end:
6769 retval = "endif";
6770 break;
6771
6772 case token::methods_end:
6773 retval = "endmethods";
6774 break;
6775
6776 case token::parfor_end:
6777 retval = "endparfor";
6778 break;
6779
6781 retval = "endproperties";
6782 break;
6783
6784 case token::spmd_end:
6785 retval = "endspmd";
6786 break;
6787
6788 case token::switch_end:
6789 retval = "endswitch";
6790 break;
6791
6793 retval = "end_try_catch";
6794 break;
6795
6797 retval = "end_unwind_protect";
6798 break;
6799
6800 case token::while_end:
6801 retval = "endwhile";
6802 break;
6803
6804 default:
6806 break;
6807 }
6808
6809 return retval;
6810 }
6811
6812 void
6813 base_parser::statement_list (std::shared_ptr<tree_statement_list>& lst)
6814 {
6815 if (! lst)
6816 return;
6817
6818 if (m_stmt_list)
6819 {
6820 // Append additional code to existing statement list.
6821
6822 while (! lst->empty ())
6823 {
6824 m_stmt_list->push_back (lst->front ());
6825 lst->pop_front ();
6826 }
6827 }
6828 else
6829 m_stmt_list = lst;
6830 }
6831
6832 void
6834 {
6835 std::string msg = ("'" + end_token_as_string (expected)
6836 + "' command matched by '"
6837 + end_token_as_string (tok->ettype ()) + "'");
6838
6839 bison_error (msg, tok->beg_pos ());
6840 }
6841
6842 // Check to see that end tokens are properly matched.
6843
6844 bool
6846 {
6847 token::end_tok_type ettype = tok->ettype ();
6848
6849 return ettype == expected || ettype == token::simple_end;
6850 }
6851
6852 bool
6854 {
6856
6859
6860 // Will get a real name later.
6861 m_lexer.m_symtab_context.push (symbol_scope ("parser:push_fcn_symtab"));
6863
6866 {
6869 }
6870
6872 {
6873 bison_error ("nested functions not implemented in this context");
6874
6875 return false;
6876 }
6877
6878 return true;
6879 }
6880
6881 // Make a constant.
6882
6885 {
6886 int l = tok_val->line ();
6887 int c = tok_val->column ();
6888
6889 int op = tok_val->token_value ();
6890
6891 tree_constant *retval = nullptr;
6892
6893 switch (op)
6894 {
6895 case ':':
6896 {
6898 retval = new tree_constant (tmp);
6899 }
6900 break;
6901
6902 case NUMBER:
6903 {
6904 retval = new tree_constant (tok_val->number (), l, c);
6905 retval->stash_original_text (tok_val->text_rep ());
6906 }
6907 break;
6908
6909 case DQ_STRING:
6910 case SQ_STRING:
6911 {
6912 std::string txt = tok_val->text ();
6913
6914 char delim = op == DQ_STRING ? '"' : '\'';
6915 octave_value tmp (txt, delim);
6916
6917 if (txt.empty ())
6918 {
6919 if (op == DQ_STRING)
6921 else
6923 }
6924
6925 retval = new tree_constant (tmp, l, c);
6926
6927 if (op == DQ_STRING)
6928 txt = undo_string_escapes (txt);
6929
6930 // FIXME: maybe this should also be handled by
6931 // tok_val->text_rep () for character strings?
6932 retval->stash_original_text (delim + txt + delim);
6933 }
6934 break;
6935
6936 default:
6938 break;
6939 }
6940
6941 return retval;
6942 }
6943
6946 {
6947 return new tree_black_hole ();
6948 }
6949
6950 // Make a function handle.
6951
6954 {
6955 int l = tok_val->line ();
6956 int c = tok_val->column ();
6957
6958 tree_fcn_handle *retval = new tree_fcn_handle (tok_val->text (), l, c);
6959
6960 return retval;
6961 }
6962
6963 // Make an anonymous function handle.
6964
6967 tree_expression *expr,
6968 const filepos& at_pos)
6969 {
6970 // FIXME: We need to examine EXPR and issue an error if any
6971 // sub-expression contains an assignment, compound assignment,
6972 // increment, or decrement operator.
6973
6974 anon_fcn_validator validator (param_list, expr);
6975
6976 if (! validator.ok ())
6977 {
6978 delete param_list;
6979 delete expr;
6980
6981 bison_error (validator.message (), validator.line (),
6982 validator.column ());
6983
6984 return nullptr;
6985 }
6986
6989
6991
6992 expr->set_print_flag (false);
6993
6994 fcn_scope.mark_static ();
6995
6996 int at_line = at_pos.line ();
6997 int at_column = at_pos.column ();
6998
6999 tree_anon_fcn_handle *retval
7000 = new tree_anon_fcn_handle (param_list, expr, fcn_scope,
7001 parent_scope, at_line, at_column);
7002
7003 std::ostringstream buf;
7004
7005 tree_print_code tpc (buf);
7006
7007 retval->accept (tpc);
7008
7009 std::string file = m_lexer.m_fcn_file_full_name;
7010 if (! file.empty ())
7011 buf << ": file: " << file;
7012 else if (m_lexer.input_from_terminal ())
7013 buf << ": *terminal input*";
7014 else if (m_lexer.input_from_eval_string ())
7015 buf << ": *eval string*";
7016 buf << ": line: " << at_line << " column: " << at_column;
7017
7018 std::string scope_name = buf.str ();
7019
7020 fcn_scope.cache_name (scope_name);
7021
7022 // FIXME: Stash the filename. This does not work and produces
7023 // errors when executed.
7024 //retval->stash_file_name (m_lexer.m_fcn_file_name);
7025
7026 return retval;
7027 }
7028
7029 // Build a colon expression.
7030
7033 tree_expression *limit,
7034 tree_expression *incr)
7035 {
7036 tree_expression *retval = nullptr;
7037
7038 if (! base || ! limit)
7039 {
7040 delete base;
7041 delete limit;
7042 delete incr;
7043
7044 return retval;
7045 }
7046
7047 int l = base->line ();
7048 int c = base->column ();
7049
7051 = new tree_colon_expression (base, limit, incr, l, c);
7052
7053 retval = expr;
7054
7055 if (base->is_constant () && limit->is_constant ()
7056 && (! incr || incr->is_constant ()))
7057 {
7058 interpreter& interp = __get_interpreter__ ("finish_colon_expression");
7059
7060 try
7061 {
7062 // If the evaluation generates a warning message, restore
7063 // the previous value of last_warning_message and skip the
7064 // conversion to a constant value.
7065
7066 error_system& es = interp.get_error_system ();
7067
7068 unwind_action restore_last_warning_message
7070 es.last_warning_message (""));
7071
7072 unwind_action restore_discard_warning_messages
7074 es.discard_warning_messages (true));
7075
7076 tree_evaluator& tw = interp.get_evaluator ();
7077
7078 octave_value tmp = expr->evaluate (tw);
7079
7080 std::string msg = es.last_warning_message ();
7081
7082 if (msg.empty ())
7083 {
7084 tree_constant *tc_retval
7085 = new tree_constant (tmp, expr->line (), expr->column ());
7086
7087 std::ostringstream buf;
7088
7089 tree_print_code tpc (buf);
7090
7091 expr->accept (tpc);
7092
7093 tc_retval->stash_original_text (buf.str ());
7094
7095 delete expr;
7096
7097 retval = tc_retval;
7098 }
7099 }
7100 catch (const execution_exception&)
7101 {
7102 interp.recover_from_exception ();
7103 }
7104 }
7105
7106 return retval;
7107 }
7108
7109 // Build a binary expression.
7110
7113 token *tok_val, tree_expression *op2)
7114 {
7116
7117 switch (op)
7118 {
7119 case POW:
7121 break;
7122
7123 case EPOW:
7125 break;
7126
7127 case '+':
7129 break;
7130
7131 case '-':
7133 break;
7134
7135 case '*':
7137 break;
7138
7139 case '/':
7141 break;
7142
7143 case EMUL:
7145 break;
7146
7147 case EDIV:
7149 break;
7150
7151 case LEFTDIV:
7153 break;
7154
7155 case ELEFTDIV:
7157 break;
7158
7159 case EXPR_LT:
7161 break;
7162
7163 case EXPR_LE:
7165 break;
7166
7167 case EXPR_EQ:
7169 break;
7170
7171 case EXPR_GE:
7173 break;
7174
7175 case EXPR_GT:
7177 break;
7178
7179 case EXPR_NE:
7181 break;
7182
7183 case EXPR_AND:
7185 break;
7186
7187 case EXPR_OR:
7189 break;
7190
7191 default:
7193 break;
7194 }
7195
7196 int l = tok_val->line ();
7197 int c = tok_val->column ();
7198
7199 return maybe_compound_binary_expression (op1, op2, l, c, t);
7200 }
7201
7202 // Build a boolean expression.
7203
7206 token *tok_val, tree_expression *op2)
7207 {
7209
7210 switch (op)
7211 {
7212 case EXPR_AND_AND:
7214 break;
7215
7216 case EXPR_OR_OR:
7218 break;
7219
7220 default:
7222 break;
7223 }
7224
7225 int l = tok_val->line ();
7226 int c = tok_val->column ();
7227
7228 return new tree_boolean_expression (op1, op2, l, c, t);
7229 }
7230
7231 // Build a prefix expression.
7232
7235 {
7237
7238 switch (op)
7239 {
7240 case EXPR_NOT:
7242 break;
7243
7244 case '+':
7246 break;
7247
7248 case '-':
7250 break;
7251
7252 case PLUS_PLUS:
7254 break;
7255
7256 case MINUS_MINUS:
7258 break;
7259
7260 default:
7262 break;
7263 }
7264
7265 int l = tok_val->line ();
7266 int c = tok_val->column ();
7267
7268 return new tree_prefix_expression (op1, l, c, t);
7269 }
7270
7271 // Build a postfix expression.
7272
7275 {
7277
7278 switch (op)
7279 {
7280 case HERMITIAN:
7282 break;
7283
7284 case TRANSPOSE:
7286 break;
7287
7288 case PLUS_PLUS:
7290 break;
7291
7292 case MINUS_MINUS:
7294 break;
7295
7296 default:
7298 break;
7299 }
7300
7301 int l = tok_val->line ();
7302 int c = tok_val->column ();
7303
7304 return new tree_postfix_expression (op1, l, c, t);
7305 }
7306
7307 // Build an unwind-protect command.
7308
7309 tree_command *
7311 tree_statement_list *body,
7312 tree_statement_list *cleanup_stmts,
7313 token *end_tok,
7314 comment_list *lc,
7315 comment_list *mc)
7316 {
7317 tree_command *retval = nullptr;
7318
7320 {
7322
7323 int l = unwind_tok->line ();
7324 int c = unwind_tok->column ();
7325
7326 retval = new tree_unwind_protect_command (body, cleanup_stmts,
7327 lc, mc, tc, l, c);
7328 }
7329 else
7330 {
7331 delete body;
7332 delete cleanup_stmts;
7333
7335 }
7336
7337 return retval;
7338 }
7339
7340 // Build a try-catch command.
7341
7342 tree_command *
7344 tree_statement_list *body,
7345 char catch_sep,
7346 tree_statement_list *cleanup_stmts,
7347 token *end_tok,
7348 comment_list *lc,
7349 comment_list *mc)
7350 {
7351 tree_command *retval = nullptr;
7352
7353 if (end_token_ok (end_tok, token::try_catch_end))
7354 {
7356
7357 int l = try_tok->line ();
7358 int c = try_tok->column ();
7359
7360 tree_identifier *id = nullptr;
7361
7362 if (! catch_sep && cleanup_stmts && ! cleanup_stmts->empty ())
7363 {
7364 tree_statement *stmt = cleanup_stmts->front ();
7365
7366 if (stmt)
7367 {
7368 tree_expression *expr = stmt->expression ();
7369
7370 if (expr && expr->is_identifier ())
7371 {
7372 id = dynamic_cast<tree_identifier *> (expr);
7373
7374 cleanup_stmts->pop_front ();
7375
7376 stmt->set_expression (nullptr);
7377 delete stmt;
7378 }
7379 }
7380 }
7381
7382 retval = new tree_try_catch_command (body, cleanup_stmts, id,
7383 lc, mc, tc, l, c);
7384 }
7385 else
7386 {
7387 delete body;
7388 delete cleanup_stmts;
7389
7391 }
7392
7393 return retval;
7394 }
7395
7396 // Build a while command.
7397
7398 tree_command *
7400 tree_expression *expr,
7401 tree_statement_list *body,
7402 token *end_tok,
7403 comment_list *lc)
7404 {
7405 tree_command *retval = nullptr;
7406
7408
7409 if (end_token_ok (end_tok, token::while_end))
7410 {
7412
7414
7415 int l = while_tok->line ();
7416 int c = while_tok->column ();
7417
7418 retval = new tree_while_command (expr, body, lc, tc, l, c);
7419 }
7420 else
7421 {
7422 delete expr;
7423 delete body;
7424
7426 }
7427
7428 return retval;
7429 }
7430
7431 // Build a do-until command.
7432
7433 tree_command *
7435 tree_statement_list *body,
7436 tree_expression *expr,
7437 comment_list *lc)
7438 {
7440
7442
7444
7445 int l = until_tok->line ();
7446 int c = until_tok->column ();
7447
7448 return new tree_do_until_command (expr, body, lc, tc, l, c);
7449 }
7450
7451 // Build a for command.
7452
7453 tree_command *
7455 tree_argument_list *lhs,
7456 tree_expression *expr,
7457 tree_expression *maxproc,
7458 tree_statement_list *body,
7459 token *end_tok,
7460 comment_list *lc)
7461 {
7462 tree_command *retval = nullptr;
7463
7464 bool parfor = tok_id == PARFOR;
7465
7466 if (end_token_ok (end_tok, parfor ? token::parfor_end : token::for_end))
7467 {
7468 expr->mark_as_for_cmd_expr ();
7469
7471
7473
7474 int l = for_tok->line ();
7475 int c = for_tok->column ();
7476
7477 if (lhs->length () == 1)
7478 {
7479 tree_expression *tmp = lhs->remove_front ();
7480
7481 m_lexer.mark_as_variable (tmp->name ());
7482
7483 retval = new tree_simple_for_command (parfor, tmp, expr, maxproc,
7484 body, lc, tc, l, c);
7485
7486 delete lhs;
7487 }
7488 else
7489 {
7490 if (parfor)
7491 {
7492 delete lhs;
7493 delete expr;
7494 delete maxproc;
7495 delete body;
7496
7497 bison_error ("invalid syntax for parfor statement");
7498 }
7499
7501
7502 retval = new tree_complex_for_command (lhs, expr, body,
7503 lc, tc, l, c);
7504 }
7505 }
7506 else
7507 {
7508 delete lhs;
7509 delete expr;
7510 delete maxproc;
7511 delete body;
7512
7513 end_token_error (end_tok, parfor ? token::parfor_end : token::for_end);
7514 }
7515
7516 return retval;
7517 }
7518
7519 // Build a break command.
7520
7521 tree_command *
7523 {
7524 int l = break_tok->line ();
7525 int c = break_tok->column ();
7526
7527 if (! m_lexer.m_looping)
7528 {
7529 bison_error ("break must appear within a loop");
7530 return nullptr;
7531 }
7532 else
7533 return new tree_break_command (l, c);
7534 }
7535
7536 // Build a continue command.
7537
7538 tree_command *
7540 {
7541 int l = continue_tok->line ();
7542 int c = continue_tok->column ();
7543
7544 if (! m_lexer.m_looping)
7545 {
7546 bison_error ("continue must appear within a loop");
7547 return nullptr;
7548 }
7549 else
7550 return new tree_continue_command (l, c);
7551 }
7552
7553 // Build a return command.
7554
7555 tree_command *
7557 {
7558 int l = return_tok->line ();
7559 int c = return_tok->column ();
7560
7561 return new tree_return_command (l, c);
7562 }
7563
7564 // Build an spmd command.
7565
7568 token *end_tok, comment_list *lc,
7569 comment_list *tc)
7570 {
7571 tree_spmd_command *retval = nullptr;
7572
7573 if (end_token_ok (end_tok, token::spmd_end))
7574 {
7575 int l = spmd_tok->line ();
7576 int c = spmd_tok->column ();
7577
7578 retval = new tree_spmd_command (body, lc, tc, l, c);
7579 }
7580 else
7581 {
7582 delete body;
7583 delete lc;
7584 delete tc;
7585
7587 }
7588
7589 return retval;
7590 }
7591
7592 // Start an if command.
7593
7596 tree_statement_list *list)
7597 {
7599
7600 // Line and column will be set in finish_if_command.
7601
7602 tree_if_clause *t = new tree_if_clause (expr, list);
7603
7604 return new tree_if_command_list (t);
7605 }
7606
7607 // Finish an if command.
7608
7612 token *end_tok,
7613 comment_list *lc)
7614 {
7615 tree_if_command *retval = nullptr;
7616
7617 if (end_token_ok (end_tok, token::if_end))
7618 {
7620
7621 int l = if_tok->line ();
7622 int c = if_tok->column ();
7623
7624 if (list && ! list->empty ())
7625 {
7626 tree_if_clause *elt = list->front ();
7627
7628 if (elt)
7629 {
7630 elt->line (l);
7631 elt->column (c);
7632 }
7633 }
7634
7635 retval = new tree_if_command (list, lc, tc, l, c);
7636 }
7637 else
7638 {
7639 delete list;
7640
7641 end_token_error (end_tok, token::if_end);
7642 }
7643
7644 return retval;
7645 }
7646
7647 // Build an elseif clause.
7648
7651 tree_expression *expr,
7652 tree_statement_list *list,
7653 comment_list *lc)
7654 {
7656
7657 int l = elseif_tok->line ();
7658 int c = elseif_tok->column ();
7659
7660 return new tree_if_clause (expr, list, lc, l, c);
7661 }
7662
7665 tree_statement_list *list)
7666 {
7667 int l = else_tok->line ();
7668 int c = else_tok->column ();
7669
7670 return new tree_if_clause (list, lc, l, c);
7671 }
7672
7675 tree_if_clause *clause)
7676 {
7677 return list_append (list, clause);
7678 }
7679
7680 // Finish a switch command.
7681
7684 tree_expression *expr,
7686 token *end_tok,
7687 comment_list *lc)
7688 {
7689 tree_switch_command *retval = nullptr;
7690
7691 if (end_token_ok (end_tok, token::switch_end))
7692 {
7694
7695 int l = switch_tok->line ();
7696 int c = switch_tok->column ();
7697
7698 if (list && ! list->empty ())
7699 {
7700 tree_switch_case *elt = list->front ();
7701
7702 if (elt)
7703 {
7704 elt->line (l);
7705 elt->column (c);
7706 }
7707 }
7708
7709 retval = new tree_switch_command (expr, list, lc, tc, l, c);
7710 }
7711 else
7712 {
7713 delete expr;
7714 delete list;
7715
7717 }
7718
7719 return retval;
7720 }
7721
7724 {
7725 return new tree_switch_case_list (switch_case);
7726 }
7727
7728 // Build a switch case.
7729
7732 tree_expression *expr,
7733 tree_statement_list *list,
7734 comment_list *lc)
7735 {
7737
7738 int l = case_tok->line ();
7739 int c = case_tok->column ();
7740
7741 return new tree_switch_case (expr, list, lc, l, c);
7742 }
7743
7746 tree_statement_list *list)
7747 {
7748 int l = default_tok->line ();
7749 int c = default_tok->column ();
7750
7751 return new tree_switch_case (list, lc, l, c);
7752 }
7753
7756 tree_switch_case *elt)
7757 {
7758 return list_append (list, elt);
7759 }
7760
7761 // Build an assignment to a variable.
7762
7765 token *eq_tok, tree_expression *rhs)
7766 {
7768
7769 switch (op)
7770 {
7771 case '=':
7773 break;
7774
7775 case ADD_EQ:
7777 break;
7778
7779 case SUB_EQ:
7781 break;
7782
7783 case MUL_EQ:
7785 break;
7786
7787 case DIV_EQ:
7789 break;
7790
7791 case LEFTDIV_EQ:
7793 break;
7794
7795 case POW_EQ:
7797 break;
7798
7799 case EMUL_EQ:
7801 break;
7802
7803 case EDIV_EQ:
7805 break;
7806
7807 case ELEFTDIV_EQ:
7809 break;
7810
7811 case EPOW_EQ:
7813 break;
7814
7815 case AND_EQ:
7817 break;
7818
7819 case OR_EQ:
7821 break;
7822
7823 default:
7825 break;
7826 }
7827
7828 int l = eq_tok->line ();
7829 int c = eq_tok->column ();
7830
7831 if (! lhs->is_simple_assign_lhs () && t != octave_value::op_asn_eq)
7832 {
7833 // Multiple assignments like [x,y] OP= rhs are only valid for
7834 // '=', not '+=', etc.
7835
7836 delete lhs;
7837 delete rhs;
7838
7839 bison_error ("computed multiple assignment not allowed",
7840 eq_tok->beg_pos ());
7841
7842 return nullptr;
7843 }
7844
7845 if (lhs->is_simple_assign_lhs ())
7846 {
7847 // We are looking at a simple assignment statement like x = rhs;
7848
7849 tree_expression *tmp = lhs->remove_front ();
7850
7851 if ((tmp->is_identifier () || tmp->is_index_expression ())
7852 && iskeyword (tmp->name ()))
7853 {
7854 std::string kw = tmp->name ();
7855
7856 delete tmp;
7857 delete lhs;
7858 delete rhs;
7859
7860 bison_error ("invalid assignment to keyword \"" + kw + "\"",
7861 eq_tok->beg_pos ());
7862
7863 return nullptr;
7864 }
7865
7866 delete lhs;
7867
7868 m_lexer.mark_as_variable (tmp->name ());
7869
7870 return new tree_simple_assignment (tmp, rhs, false, l, c, t);
7871 }
7872 else
7873 {
7874 std::list<std::string> names = lhs->variable_names ();
7875
7876 for (const auto& kw : names)
7877 {
7878 if (iskeyword (kw))
7879 {
7880 delete lhs;
7881 delete rhs;
7882
7883 bison_error ("invalid assignment to keyword \"" + kw + "\"",
7884 eq_tok->beg_pos ());
7885
7886 return nullptr;
7887 }
7888 }
7889
7890 m_lexer.mark_as_variables (names);
7891
7892 return new tree_multi_assignment (lhs, rhs, false, l, c);
7893 }
7894 }
7895
7896 void
7898 tree_statement *end_script)
7899 {
7900 if (! cmds)
7901 cmds = new tree_statement_list ();
7902
7903 cmds->append (end_script);
7904
7906
7909 script_scope.cache_dir_name (m_lexer.m_dir_name);
7910
7911 octave_user_script *script
7913 m_lexer.m_fcn_file_name, script_scope,
7914 cmds, m_lexer.m_help_text);
7915
7917 m_lexer.m_help_text = "";
7918
7919 sys::time now;
7920
7921 script->stash_fcn_file_time (now);
7923
7924 m_primary_fcn = octave_value (script);
7925 }
7926
7929 {
7930 std::string id_name = id->name ();
7931
7932 // Make classdef local functions unique from classdef methods.
7933
7935 id_name = m_lexer.m_fcn_file_name + ">" + id_name;
7936
7937 if (! m_function_scopes.name_current_scope (id_name))
7938 {
7939 bison_error ("duplicate subfunction or nested function name",
7940 id->line (), id->column ());
7941
7942 delete id;
7943 return nullptr;
7944 }
7945
7947 curr_scope.cache_name (id_name);
7948
7949 m_lexer.m_parsed_function_name.top () = true;
7951
7952 return id;
7953 }
7954
7955 // Define a function.
7956
7957 // FIXME: combining start_function, finish_function, and
7958 // recover_from_parsing_function should be possible, but it makes
7959 // for a large mess. Maybe this could be a bit better organized?
7960
7963 tree_parameter_list *ret_list,
7964 tree_identifier *id,
7965 tree_parameter_list *param_list,
7966 tree_statement_list *body,
7967 tree_statement *end_fcn_stmt,
7968 comment_list *lc)
7969 {
7970 int l = fcn_tok->line ();
7971 int c = fcn_tok->column ();
7972
7973 octave_user_function *tmp_fcn
7974 = start_function (id, param_list, body, end_fcn_stmt);
7975
7976 tree_function_def *retval = finish_function (ret_list, tmp_fcn, lc, l, c);
7977
7979
7980 return retval;
7981 }
7982
7983 // Begin defining a function.
7984
7987 tree_parameter_list *param_list,
7988 tree_statement_list *body,
7989 tree_statement *end_fcn_stmt)
7990 {
7991 // We'll fill in the return list later.
7992
7993 std::string id_name = id->name ();
7994
7995 delete id;
7996
7998 id_name.insert (0, "get.");
8000 id_name.insert (0, "set.");
8001
8004
8005 if (! body)
8006 body = new tree_statement_list ();
8007
8008 body->append (end_fcn_stmt);
8009
8012 param_list, nullptr, body);
8013
8015
8016 fcn->stash_trailing_comment (tc);
8017 fcn->stash_fcn_end_location (end_fcn_stmt->line (),
8018 end_fcn_stmt->column ());
8019
8020 // If input is coming from a file, issue a warning if the name of
8021 // the file does not match the name of the function stated in the
8022 // file. Matlab doesn't provide a diagnostic (it ignores the stated
8023 // name).
8026 {
8027 // FIXME: should m_lexer.m_fcn_file_name already be
8028 // preprocessed when we get here? It seems to only be a
8029 // problem with relative filenames.
8030
8031 std::string nm = m_lexer.m_fcn_file_name;
8032
8033 std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ());
8034
8035 if (pos != std::string::npos)
8036 nm = m_lexer.m_fcn_file_name.substr (pos+1);
8037
8038 if (nm != id_name)
8039 {
8041 ("Octave:function-name-clash",
8042 "function name '%s' does not agree with function filename '%s'",
8043 id_name.c_str (), m_lexer.m_fcn_file_full_name.c_str ());
8044
8045 id_name = nm;
8046 }
8047 }
8048
8049 sys::time now;
8050
8052 fcn->stash_fcn_file_time (now);
8056 fcn->stash_function_name (id_name);
8057
8059 {
8061 fcn->mark_relative ();
8062
8064 {
8066 {
8067 if (m_curr_class_name == id_name)
8069 else
8071 }
8072 else
8073 {
8074 if (m_curr_class_name == id_name)
8076 else
8077 fcn->mark_as_legacy_method ();
8078 }
8079
8081 }
8082
8083 std::string nm = fcn->fcn_file_name ();
8084
8085 sys::file_stat fs (nm);
8086
8087 if (fs && fs.is_newer (now))
8088 warning_with_id ("Octave:future-time-stamp",
8089 "time stamp for '%s' is in the future", nm.c_str ());
8090 }
8094 && m_lexer.m_fcn_file_name == id_name)
8095 {
8096 warning ("function '%s' defined within script file '%s'",
8097 id_name.c_str (), m_lexer.m_fcn_file_full_name.c_str ());
8098 }
8099
8100 // Record help text for functions other than nested functions.
8101 // We cannot currently record help for nested functions (bug #46008)
8102 // because the doc_string of the outermost function is read first,
8103 // whereas this function is called for the innermost function first.
8104 // We could have a stack of help_text in lexer.
8105 if (! m_lexer.m_help_text.empty () && m_curr_fcn_depth == 0)
8106 {
8108
8109 m_lexer.m_help_text = "";
8110 }
8111
8115
8116 return fcn;
8117 }
8118
8120 base_parser::make_end (const std::string& type, bool eof,
8121 const filepos& beg_pos, const filepos& /*end_pos*/)
8122 {
8123 int l = beg_pos.line ();
8124 int c = beg_pos.column ();
8125
8126 return make_statement (new tree_no_op_command (type, eof, l, c));
8127 }
8128
8132 comment_list *lc,
8133 int l, int c)
8134 {
8135 tree_function_def *retval = nullptr;
8136
8137 if (! ret_list)
8139
8140 ret_list->mark_as_formal_parameters ();
8141
8142 if (fcn)
8143 {
8144 std::string fcn_nm = fcn->name ();
8145 std::string file = fcn->fcn_file_name ();
8146
8147 std::string tmp = fcn_nm;
8148 if (! file.empty ())
8149 tmp += ": " + file;
8150
8151 symbol_scope fcn_scope = fcn->scope ();
8152 fcn_scope.cache_name (tmp);
8153 fcn_scope.cache_fcn_name (fcn_nm);
8154 fcn_scope.cache_fcn_file_name (file);
8155 fcn_scope.cache_dir_name (m_lexer.m_dir_name);
8156
8157 if (lc)
8158 fcn->stash_leading_comment (lc);
8159
8160 fcn->define_ret_list (ret_list);
8161
8163 {
8164 fcn->stash_fcn_location (l, c);
8165
8166 octave_value ov_fcn (fcn);
8167
8169 {
8172
8174 fcn_scope.set_parent (pscope);
8176
8177 pscope.install_nestfunction (fcn_nm, ov_fcn, fcn_scope);
8178
8179 // For nested functions, the list of parent functions is
8180 // set in symbol_scope::update_nest.
8181 }
8182 else
8183 {
8184 fcn->mark_as_subfunction ();
8185 m_subfunction_names.push_back (fcn_nm);
8186
8187 fcn_scope.set_parent (m_primary_fcn_scope);
8190
8192 }
8193 }
8194
8195 if (m_curr_fcn_depth == 0)
8196 fcn_scope.update_nest ();
8197
8199 {
8200 // We are either reading a script file or defining a function
8201 // at the command line, so this definition creates a
8202 // tree_function object that is placed in the parse tree.
8203 // Otherwise, it is just inserted in the symbol table,
8204 // either as a subfunction or nested function (see above),
8205 // or as the primary function for the file, via
8206 // m_primary_fcn (see also load_fcn_from_file,,
8207 // parse_fcn_file, and
8208 // fcn_info::fcn_info_rep::find_user_function).
8209
8211 {
8213 fcn->time_parsed ());
8215 }
8216
8217 retval = new tree_function_def (fcn, l, c);
8218 }
8219 }
8220
8221 return retval;
8222 }
8223
8226 tree_statement_list *list)
8227 {
8228 if (list)
8229 {
8230 for (const auto& elt : *list)
8231 list_append (body, elt);
8232
8233 list->clear ();
8234 delete (list);
8235 }
8236
8237 return body;
8238 }
8239
8243 tree_args_block_validation_list *validation_list,
8244 token *end_tok,
8245 comment_list *lc, comment_list *tc)
8246 {
8247 tree_arguments_block *retval = nullptr;
8248
8249 if (end_token_ok (end_tok, token::arguments_end))
8250 {
8251 filepos beg_pos = arguments_tok->beg_pos ();
8252
8253 int l = beg_pos.line ();
8254 int c = beg_pos.column ();
8255
8256 retval = new tree_arguments_block (attr_list, validation_list, l, c);
8257 }
8258 else
8259 {
8260 delete attr_list;
8261 delete validation_list;
8262
8263 delete lc;
8264 delete tc;
8265 }
8266
8267 return retval;
8268 }
8269
8272 tree_identifier *class_name,
8273 tree_arg_validation_fcns *validation_fcns,
8274 tree_expression *default_value)
8275 {
8276 // FIXME: Validate arguments and convert to more specific types
8277 // (std::string for arg_name and class_name, etc).
8278
8279 return new tree_arg_validation (size_spec, class_name,
8280 validation_fcns, default_value);
8281 }
8282
8285 {
8286 // FIXME: Validate argument and convert to more specific type
8287 // (std::string for attribute_name).
8288
8289 return new tree_args_block_attribute_list (attribute_name);
8290 }
8291
8294 {
8295 return new tree_args_block_validation_list (arg_validation);
8296 }
8297
8300 tree_arg_validation *arg_validation)
8301 {
8302 return list_append (list, arg_validation);
8303 }
8304
8307 {
8308 // FIXME: Validate argument.
8309
8310 return new tree_arg_size_spec (size_args);
8311 }
8312
8315 {
8316 // FIXME: Validate argument.
8317
8318 return new tree_arg_validation_fcns (fcn_args);
8319 }
8320
8321 void
8323 {
8325
8329
8332
8337 }
8338
8339 // A CLASSDEF block defines a class that has a constructor and other
8340 // methods, but it is not an executable command. Parsing the block
8341 // makes some changes in the symbol table (inserting the constructor
8342 // and methods, and adding to the list of known objects) and creates
8343 // a parse tree containing meta information about the class.
8344
8345 // LC contains comments appearing before the classdef keyword.
8346 // TC contains comments appearing between the classdef elements
8347 // and the final end token for the classdef block.
8348
8352 tree_identifier *id,
8354 tree_classdef_body *body, token *end_tok,
8355 comment_list *lc, comment_list *tc)
8356 {
8357 tree_classdef *retval = nullptr;
8358
8360
8361 std::string cls_name = id->name ();
8362
8363 std::string full_name = m_lexer.m_fcn_file_full_name;
8364 std::string short_name = m_lexer.m_fcn_file_name;
8365
8366 std::size_t pos
8367 = short_name.find_last_of (sys::file_ops::dir_sep_chars ());
8368
8369 if (pos != std::string::npos)
8370 short_name = short_name.substr (pos+1);
8371
8372 if (short_name != cls_name)
8373 {
8374 int l = id->line ();
8375 int c = id->column ();
8376
8377 delete a;
8378 delete id;
8379 delete sc;
8380 delete body;
8381 delete lc;
8382 delete tc;
8383
8384 bison_error ("invalid classdef definition, the class name must match the filename", l, c);
8385
8386 }
8387 else
8388 {
8389 if (end_token_ok (end_tok, token::classdef_end))
8390 {
8391 int l = tok_val->line ();
8392 int c = tok_val->column ();
8393
8394 if (! body)
8395 body = new tree_classdef_body ();
8396
8398 a, id, sc, body, lc, tc,
8399 m_curr_package_name, full_name, l, c);
8400 }
8401 else
8402 {
8403 delete a;
8404 delete id;
8405 delete sc;
8406 delete body;
8407 delete lc;
8408 delete tc;
8409
8411 }
8412 }
8413
8414 return retval;
8415 }
8416
8417 // LC contains comments appearing before the properties keyword.
8418 // If this properties block appears first in the list of classdef
8419 // elements, this comment list will be used for the help text for the
8420 // classdef block.
8421
8422 // TC contains comments appearing between the list of properties
8423 // and the final end token for the properties block and may be used to
8424 // find the doc string for the final property in the list.
8425
8430 token *end_tok,
8431 comment_list *lc,
8432 comment_list *tc)
8433 {
8434 tree_classdef_properties_block *retval = nullptr;
8435
8436 if (end_token_ok (end_tok, token::properties_end))
8437 {
8438 int l = tok_val->line ();
8439 int c = tok_val->column ();
8440
8441 if (plist)
8442 {
8443 // If the element at the end of the list doesn't have a doc
8444 // string, see whether the first element of TC is an
8445 // end-of-line comment for us to use.
8446
8447 if (tc)
8448 {
8449 tree_classdef_property *last_elt = plist->back ();
8450
8451 if (! last_elt->have_doc_string ())
8452 {
8453 comment_elt first_comment_elt = tc->front ();
8454
8455 if (first_comment_elt.is_end_of_line ())
8456 {
8457 std::string eol_comment = first_comment_elt.text ();
8458
8459 last_elt->doc_string (eol_comment);
8460 }
8461 }
8462 }
8463 }
8464 else
8465 plist = new tree_classdef_property_list ();
8466
8467 retval = new tree_classdef_properties_block (a, plist, lc, tc, l, c);
8468 }
8469 else
8470 {
8471 delete a;
8472 delete plist;
8473 delete lc;
8474 delete tc;
8475
8477 }
8478
8479 return retval;
8480 }
8481
8484 {
8485 return new tree_classdef_property_list (prop);
8486 }
8487
8491 {
8492 av->arg_name (id);
8493
8494 if (av->size_spec () || av->class_name () || av->validation_fcns ())
8495 warning ("size, class, and validation function specifications are not yet supported for classdef properties; INCORRECT RESULTS ARE POSSIBLE!");
8496
8497 return new tree_classdef_property (av, lc);
8498 }
8499
8500 // LC contains comments appearing before the methods keyword.
8501 // If this methods block appears first in the list of classdef
8502 // elements, this comment list will be used for the help text for the
8503 // classdef block.
8504
8509 token *end_tok, comment_list *lc,
8510 comment_list *tc)
8511 {
8512 tree_classdef_methods_block *retval = nullptr;
8513
8514 if (end_token_ok (end_tok, token::methods_end))
8515 {
8516 int l = tok_val->line ();
8517 int c = tok_val->column ();
8518
8519 if (! mlist)
8520 mlist = new tree_classdef_methods_list ();
8521
8522 retval = new tree_classdef_methods_block (a, mlist, lc, tc, l, c);
8523 }
8524 else
8525 {
8526 delete a;
8527 delete mlist;
8528 delete lc;
8529 delete tc;
8530
8532 }
8533
8534 return retval;
8535 }
8536
8537 // LC contains comments appearing before the events keyword.
8538 // If this events block appears first in the list of classdef
8539 // elements, this comment list will be used for the help text for the
8540 // classdef block.
8541
8542 // TC contains comments appearing between the list of events and
8543 // the final end token for the events block and may be used to find
8544 // the doc string for the final event in the list.
8545
8550 token *end_tok,
8551 comment_list *lc,
8552 comment_list *tc)
8553 {
8554 tree_classdef_events_block *retval = nullptr;
8555
8556 if (end_token_ok (end_tok, token::events_end))
8557 {
8558 int l = tok_val->line ();
8559 int c = tok_val->column ();
8560
8561 if (! elist)
8562 elist = new tree_classdef_events_list ();
8563
8564 retval = new tree_classdef_events_block (a, elist, lc, tc, l, c);
8565 }
8566 else
8567 {
8568 delete a;
8569 delete elist;
8570 delete lc;
8571 delete tc;
8572
8574 }
8575
8576 return retval;
8577 }
8578
8581 {
8582 return new tree_classdef_events_list (e);
8583 }
8584
8587 {
8588 return new tree_classdef_event (id, lc);
8589 }
8590
8591 // LC contains comments appearing before the enumeration keyword.
8592 // If this enumeration block appears first in the list of classdef
8593 // elements, this comment list will be used for the help text for the
8594 // classdef block.
8595
8596 // TC contains comments appearing between the list of
8597 // enumerations and the final end token for the enumeration block and
8598 // may be used to find the doc string for the final enumeration in the
8599 // list.
8600
8605 token *end_tok,
8606 comment_list *lc,
8607 comment_list *tc)
8608 {
8609 tree_classdef_enum_block *retval = nullptr;
8610
8611 if (end_token_ok (end_tok, token::enumeration_end))
8612 {
8613 int l = tok_val->line ();
8614 int c = tok_val->column ();
8615
8616 if (! elist)
8617 elist = new tree_classdef_enum_list ();
8618
8619 retval = new tree_classdef_enum_block (a, elist, lc, tc, l, c);
8620 }
8621 else
8622 {
8623 delete a;
8624 delete elist;
8625 delete lc;
8626 delete tc;
8627
8629 }
8630
8631 return retval;
8632 }
8633
8636 {
8637 return new tree_classdef_enum_list (e);
8638 }
8639
8642 comment_list *lc)
8643 {
8644 return new tree_classdef_enum (id, expr, lc);
8645 }
8646
8650 {
8651 return list_append (list, elt);
8652 }
8653
8657 {
8658 return list_append (list, elt);
8659 }
8660
8663 tree_classdef_enum *elt)
8664 {
8665 return list_append (list, elt);
8666 }
8667
8670 {
8671 return new tree_classdef_superclass_list (sc);
8672 }
8673
8676 {
8677 return new tree_classdef_superclass (fqident->text ());
8678 }
8679
8683 {
8684 return list_append (list, elt);
8685 }
8686
8689 {
8690 return new tree_classdef_attribute_list (attr);
8691 }
8692
8695 tree_expression *expr)
8696 {
8697 return (expr
8698 ? new tree_classdef_attribute (id, expr)
8699 : new tree_classdef_attribute (id));
8700 }
8701
8704 {
8705 return new tree_classdef_attribute (id, false);
8706 }
8707
8711 {
8712 return list_append (list, elt);
8713 }
8714
8717 {
8718 return new tree_classdef_body (pb);
8719 }
8720
8723 {
8724 return new tree_classdef_body (mb);
8725 }
8726
8729 {
8730 return new tree_classdef_body (evb);
8731 }
8732
8735 {
8736 return new tree_classdef_body (enb);
8737 }
8738
8742 {
8743 return list_append (body, block);
8744 }
8745
8749 {
8750 return list_append (body, block);
8751 }
8752
8756 {
8757 return list_append (body, block);
8758 }
8759
8763 {
8764 return list_append (body, block);
8765 }
8766
8770 {
8771 octave_user_function* retval = nullptr;
8772
8773 // External methods are only allowed within @-folders. In this case,
8774 // m_curr_class_name will be non-empty.
8775
8776 if (! m_curr_class_name.empty ())
8777 {
8778
8779 std::string mname = id->name ();
8780
8781 // Methods that cannot be declared outside the classdef file:
8782 // - methods with '.' character (e.g. property accessors)
8783 // - class constructor
8784 // - 'delete'
8785
8786 if (mname.find_first_of (".") == std::string::npos
8787 && mname != "delete"
8788 && mname != m_curr_class_name)
8789 {
8790 // Create a dummy function that is used until the real method
8791 // is loaded.
8792
8793 retval = new octave_user_function (symbol_scope (), pl);
8794
8795 retval->stash_function_name (mname);
8796
8797 int l = id->line ();
8798 int c = id->column ();
8799
8800 retval->stash_fcn_location (l, c);
8801 }
8802 else
8803 bison_error ("invalid external method declaration, an external "
8804 "method cannot be the class constructor, 'delete' "
8805 "or have a dot (.) character in its name");
8806 }
8807 else
8808 bison_error ("external methods are only allowed in @-folders");
8809
8810 if (! retval)
8811 delete id;
8812
8813 return retval;
8814 }
8815
8818 tree_parameter_list *ret_list,
8819 comment_list *cl)
8820 {
8821 if (! ret_list)
8823
8824 fcn->define_ret_list (ret_list);
8825
8826 if (cl)
8827 fcn->stash_leading_comment (cl);
8828
8829 int l = fcn->beginning_line ();
8830 int c = fcn->beginning_column ();
8831
8832 return new tree_function_def (fcn, l, c);
8833 }
8834
8837 {
8838 octave_value fcn;
8839
8840 if (fcn_def)
8841 fcn = fcn_def->function ();
8842
8843 delete fcn_def;
8844
8845 return new tree_classdef_methods_list (fcn);
8846 }
8847
8850 tree_function_def *fcn_def)
8851 {
8852 octave_value fcn;
8853
8854 if (fcn_def)
8855 {
8856 fcn = fcn_def->function ();
8857
8858 delete fcn_def;
8859 }
8860
8861 return list_append (list, fcn);
8862 }
8863
8864 bool
8866 tree_statement_list *local_fcns)
8867 {
8868 parse_tree_validator validator;
8869
8870 cls->accept (validator);
8871
8872 if (local_fcns)
8873 {
8874 for (tree_statement *elt : *local_fcns)
8875 {
8876 tree_command *cmd = elt->command ();
8877
8878 tree_function_def *fcn_def
8879 = dynamic_cast<tree_function_def *> (cmd);
8880
8881 fcn_def->accept (validator);
8882 }
8883 }
8884
8885 if (! validator.ok ())
8886 {
8887 delete cls;
8888 delete local_fcns;
8889
8890 bison_error (validator.error_list ());
8891
8892 return false;
8893 }
8894
8895 // Require all validations to succeed before installing any local
8896 // functions or defining the classdef object for later use.
8897
8898 if (local_fcns)
8899 {
8900 symbol_table& symtab
8901 = __get_symbol_table__ ("base_parser::finish_classdef_file");
8902
8903 for (tree_statement *elt : *local_fcns)
8904 {
8905 tree_command *cmd = elt->command ();
8906
8907 tree_function_def *fcn_def
8908 = dynamic_cast<tree_function_def *> (cmd);
8909
8910 octave_value ov_fcn = fcn_def->function ();
8912
8913 std::string nm = fcn->name ();
8914 std::string file = fcn->fcn_file_name ();
8915
8916 symtab.install_local_function (nm, ov_fcn, file);
8917 }
8918
8919 delete local_fcns;
8920 }
8921
8922 // FIXME: Is it possible for the following condition to be false?
8924 m_classdef_object = std::shared_ptr<tree_classdef> (cls);
8925
8926 return true;
8927 }
8928
8929 // Make an index expression.
8930
8933 tree_argument_list *args,
8934 char type)
8935 {
8936 tree_index_expression *retval = nullptr;
8937
8938 if (args && args->has_magic_tilde ())
8939 {
8940 delete expr;
8941 delete args;
8942
8943 bison_error ("invalid use of empty argument (~) in index expression");
8944 }
8945 else
8946 {
8947 int l = expr->line ();
8948 int c = expr->column ();
8949
8950 if (! expr->is_postfix_indexed ())
8951 expr->set_postfix_index (type);
8952
8953 if (expr->is_index_expression ())
8954 {
8956 = dynamic_cast<tree_index_expression *> (expr);
8957
8958 retval = tmp->append (args, type);
8959 }
8960 else
8961 retval = new tree_index_expression (expr, args, l, c, type);
8962 }
8963
8964 return retval;
8965 }
8966
8967 // Make an indirect reference expression.
8968
8971 const std::string& elt)
8972 {
8973 tree_index_expression *retval = nullptr;
8974
8975 int l = expr->line ();
8976 int c = expr->column ();
8977
8978 if (! expr->is_postfix_indexed ())
8979 expr->set_postfix_index ('.');
8980
8981 if (expr->is_index_expression ())
8982 {
8984 = dynamic_cast<tree_index_expression *> (expr);
8985
8986 retval = tmp->append (elt);
8987 }
8988 else
8989 retval = new tree_index_expression (expr, elt, l, c);
8990
8992
8993 return retval;
8994 }
8995
8996 // Make an indirect reference expression with dynamic field name.
8997
8998 tree_index_expression *
8999 base_parser::make_indirect_ref (tree_expression *expr,
9000 tree_expression *elt)
9001 {
9002 tree_index_expression *retval = nullptr;
9003
9004 int l = expr->line ();
9005 int c = expr->column ();
9006
9007 if (! expr->is_postfix_indexed ())
9008 expr->set_postfix_index ('.');
9009
9010 if (expr->is_index_expression ())
9011 {
9012 tree_index_expression *tmp
9013 = dynamic_cast<tree_index_expression *> (expr);
9014
9015 retval = list_append (tmp, elt);
9016 }
9017 else
9018 retval = new tree_index_expression (expr, elt, l, c);
9019
9021
9022 return retval;
9023 }
9024
9025 // Make a declaration command.
9026
9027 tree_decl_command *
9030 {
9031 tree_decl_command *retval = nullptr;
9032
9033 int l = tok_val->line ();
9034 int c = tok_val->column ();
9035
9036 if (lst)
9038
9039 switch (tok)
9040 {
9041 case GLOBAL:
9042 {
9043 retval = new tree_decl_command ("global", lst, l, c);
9044 retval->mark_global ();
9045 }
9046 break;
9047
9048 case PERSISTENT:
9049 if (m_curr_fcn_depth >= 0)
9050 {
9051 retval = new tree_decl_command ("persistent", lst, l, c);
9052 retval->mark_persistent ();
9053 }
9054 else
9055 {
9057 warning ("ignoring persistent declaration near line %d of file '%s'",
9058 l, m_lexer.m_fcn_file_full_name.c_str ());
9059 else
9060 warning ("ignoring persistent declaration near line %d", l);
9061 }
9062 break;
9063
9064 default:
9066 break;
9067 }
9068
9069 return retval;
9070 }
9071
9074 {
9075 return new tree_decl_init_list (elt);
9076 }
9077
9080 tree_decl_elt *elt)
9081 {
9082 return list_append (list, elt);
9083 }
9084
9087 tree_expression *expr)
9088 {
9089 return expr ? new tree_decl_elt (id, expr) : new tree_decl_elt (id);
9090 }
9091
9092 bool
9095 {
9096 std::set<std::string> dict;
9097
9098 for (tree_decl_elt *elt : *lst)
9099 {
9100 tree_identifier *id = elt->ident ();
9101
9102 if (id)
9103 {
9104 std::string name = id->name ();
9105
9106 if (id->is_black_hole ())
9107 {
9108 if (type != tree_parameter_list::in)
9109 {
9110 bison_error ("invalid use of ~ in output list");
9111 return false;
9112 }
9113 }
9114 else if (iskeyword (name))
9115 {
9116 bison_error ("invalid use of keyword '" + name
9117 + "' in parameter list");
9118 return false;
9119 }
9120 else if (dict.find (name) != dict.end ())
9121 {
9122 bison_error ("'" + name
9123 + "' appears more than once in parameter list");
9124 return false;
9125 }
9126 else
9127 dict.insert (name);
9128 }
9129 }
9130
9131 std::string va_type = (type == tree_parameter_list::in
9132 ? "varargin" : "varargout");
9133
9134 std::size_t len = lst->length ();
9135
9136 if (len > 0)
9137 {
9138 tree_decl_elt *elt = lst->back ();
9139
9140 tree_identifier *id = elt->ident ();
9141
9142 if (id && id->name () == va_type)
9143 {
9144 if (len == 1)
9145 lst->mark_varargs_only ();
9146 else
9147 lst->mark_varargs ();
9148
9150 --p;
9151 delete *p;
9152 lst->erase (p);
9153 }
9154 }
9155
9156 return true;
9157 }
9158
9159 bool
9161 {
9162 bool retval = true;
9163
9164 tree_array_list *al = dynamic_cast<tree_array_list *> (e);
9165
9166 for (tree_argument_list* row : *al)
9167 {
9168 if (row && row->has_magic_tilde ())
9169 {
9170 retval = false;
9171
9172 if (e->is_matrix ())
9173 bison_error ("invalid use of tilde (~) in matrix expression");
9174 else
9175 bison_error ("invalid use of tilde (~) in cell expression");
9176
9177 break;
9178 }
9179 }
9180
9181 return retval;
9182 }
9183
9186 {
9187 tree_argument_list *retval = nullptr;
9188
9189 if (e->is_constant ())
9190 {
9191 tree_evaluator& tw
9192 = __get_evaluator__ ("validate_matrix_for_assignment");
9193
9194 octave_value ov = e->evaluate (tw);
9195
9196 delete e;
9197
9198 if (ov.isempty ())
9199 bison_error ("invalid empty left hand side of assignment");
9200 else
9201 bison_error ("invalid constant left hand side of assignment");
9202 }
9203 else
9204 {
9205 bool is_simple_assign = true;
9206
9207 tree_argument_list *tmp = nullptr;
9208
9209 if (e->is_matrix ())
9210 {
9211 tree_matrix *mat = dynamic_cast<tree_matrix *> (e);
9212
9213 if (mat && mat->size () == 1)
9214 {
9215 tmp = mat->front ();
9216 mat->pop_front ();
9217 delete e;
9218 is_simple_assign = false;
9219 }
9220 }
9221 else
9222 tmp = new tree_argument_list (e);
9223
9224 if (tmp && tmp->is_valid_lvalue_list ())
9225 {
9227 retval = tmp;
9228 }
9229 else
9230 {
9231 delete tmp;
9232
9233 bison_error ("invalid left hand side of assignment");
9234 }
9235
9236 if (retval && is_simple_assign)
9237 retval->mark_as_simple_assign_lhs ();
9238 }
9239
9240 return retval;
9241 }
9242
9243 // Finish building an array_list.
9244
9247 token */*open_delim*/, token *close_delim)
9248 {
9249 tree_expression *retval = array_list;
9250
9251 array_list->set_location (close_delim->line (), close_delim->column ());
9252
9253 if (array_list->all_elements_are_constant ())
9254 {
9255 interpreter& interp = __get_interpreter__ ("finish_array_list");
9256
9257 try
9258 {
9259 // If the evaluation generates a warning message, restore
9260 // the previous value of last_warning_message and skip the
9261 // conversion to a constant value.
9262
9263 error_system& es = interp.get_error_system ();
9264
9265 unwind_action restore_last_warning_message
9267 es.last_warning_message (""));
9268
9269 unwind_action restore_discard_warning_messages
9271 es.discard_warning_messages (true));
9272
9273 tree_evaluator& tw = interp.get_evaluator ();
9274
9275 octave_value tmp = array_list->evaluate (tw);
9276
9277 std::string msg = es.last_warning_message ();
9278
9279 if (msg.empty ())
9280 {
9281 tree_constant *tc_retval
9282 = new tree_constant (tmp, close_delim->line (),
9283 close_delim->column ());
9284
9285 std::ostringstream buf;
9286
9287 tree_print_code tpc (buf);
9288
9289 array_list->accept (tpc);
9290
9291 tc_retval->stash_original_text (buf.str ());
9292
9293 delete array_list;
9294
9295 retval = tc_retval;
9296 }
9297 }
9298 catch (const execution_exception&)
9299 {
9300 interp.recover_from_exception ();
9301 }
9302 }
9303
9304 return retval;
9305 }
9306
9307 // Finish building a matrix list.
9308
9311 token *close_delim)
9312 {
9313 return (m
9314 ? finish_array_list (m, open_delim, close_delim)
9316 close_delim->line (), close_delim->column ()));
9317 }
9318
9319 tree_matrix *
9321 {
9322 return row ? new tree_matrix (row) : nullptr;
9323 }
9324
9325 tree_matrix *
9327 {
9328 if (! matrix)
9329 return make_matrix (row);
9330
9331 return row ? list_append (matrix, row) : matrix;
9332 }
9333
9334 // Finish building a cell list.
9335
9338 token *close_delim)
9339 {
9340 return (c
9341 ? finish_array_list (c, open_delim, close_delim)
9342 : new tree_constant (octave_value (Cell ()),
9343 close_delim->line (), close_delim->column ()));
9344 }
9345
9346 tree_cell *
9348 {
9349 return row ? new tree_cell (row) : nullptr;
9350 }
9351
9352 tree_cell *
9354 {
9355 if (! cell)
9356 return make_cell (row);
9357
9358 return row ? list_append (cell, row) : cell;
9359 }
9360
9363 {
9364 // Find the token in the symbol table.
9366
9367 std::string nm = ident->text ();
9368
9369 symbol_record sr = (scope ? scope.insert (nm) : symbol_record (nm));
9370
9371
9372 int l = ident->line ();
9373 int c = ident->column ();
9374
9375 return new tree_identifier (sr, l, c);
9376 }
9377
9380 {
9381 std::string meth = superclassref->superclass_method_name ();
9382 std::string cls = superclassref->superclass_class_name ();
9383
9384 int l = superclassref->line ();
9385 int c = superclassref->column ();
9386
9387 return new tree_superclass_ref (meth, cls, l, c);
9388 }
9389
9392 {
9393 std::string cls = metaquery->text ();
9394
9395 int l = metaquery->line ();
9396 int c = metaquery->column ();
9397
9398 return new tree_metaclass_query (cls, l, c);
9399 }
9400
9403 char sep, bool warn_missing_semi)
9404 {
9405 tree_statement *tmp = list->back ();
9406
9407 switch (sep)
9408 {
9409 case ';':
9410 tmp->set_print_flag (false);
9411 break;
9412
9413 case 0:
9414 case ',':
9415 case '\n':
9416 tmp->set_print_flag (true);
9417 if (warn_missing_semi)
9419 break;
9420
9421 default:
9422 warning ("unrecognized separator type!");
9423 break;
9424 }
9425
9426 // Even if a statement is null, we add it to the list then remove it
9427 // here so that the print flag is applied to the correct statement.
9428
9429 if (tmp->is_null_statement ())
9430 {
9431 list->pop_back ();
9432 delete tmp;
9433 }
9434
9435 return list;
9436 }
9437
9438 // Finish building a statement.
9439 template <typename T>
9442 {
9443 comment_list *comment = m_lexer.get_comment ();
9444
9445 return new tree_statement (arg, comment);
9446 }
9447
9450 {
9451 return new tree_statement_list (stmt);
9452 }
9453
9456 char sep, tree_statement *stmt,
9457 bool warn_missing_semi)
9458 {
9459 set_stmt_print_flag (list, sep, warn_missing_semi);
9460
9461 return list_append (list, stmt);
9462 }
9463
9466 {
9467 return new tree_argument_list (expr);
9468 }
9469
9472 tree_expression *expr)
9473 {
9474 return list_append (list, expr);
9475 }
9476
9479 {
9480 return new tree_parameter_list (io);
9481 }
9482
9485 tree_decl_elt *t)
9486 {
9487 return new tree_parameter_list (io, t);
9488 }
9489
9492 tree_identifier *id)
9493 {
9494 return new tree_parameter_list (io, id);
9495 }
9496
9499 tree_decl_elt *t)
9500 {
9501 return list_append (list, t);
9502 }
9503
9506 tree_identifier *id)
9507 {
9508 return list_append (list, new tree_decl_elt (id));
9509 }
9510
9511 void
9513 {
9515 }
9516
9517 // FIXME: this function partially duplicates do_dbtype in debug.cc.
9518 static std::string
9519 get_file_line (const std::string& name, int line)
9520 {
9521 // NAME should be an absolute file name and the file should exist.
9522
9523 std::ifstream fs = sys::ifstream (name.c_str (), std::ios::in);
9524
9525 std::string text;
9526
9527 if (fs)
9528 {
9529 int i = 1;
9530
9531 do
9532 {
9533 if (! std::getline (fs, text))
9534 {
9535 text = "";
9536 break;
9537 }
9538 }
9539 while (i++ < line);
9540 }
9541
9542 return text;
9543 }
9544
9545 void
9546 base_parser::bison_error (const std::string& str)
9547 {
9549 }
9550
9551 void
9552 base_parser::bison_error (const std::string& str, const filepos& pos)
9553 {
9554 bison_error (str, pos.line (), pos.column ());
9555 }
9556
9557 void
9558 base_parser::bison_error (const std::string& str, int err_line, int err_col)
9559 {
9560 std::ostringstream output_buf;
9561
9564 output_buf << "parse error near line " << err_line
9565 << " of file " << m_lexer.m_fcn_file_full_name;
9566 else
9567 output_buf << "parse error:";
9568
9569 if (str != "parse error")
9570 output_buf << "\n\n " << str;
9571
9572 output_buf << "\n\n";
9573
9574 std::string curr_line;
9575
9578 curr_line = get_file_line (m_lexer.m_fcn_file_full_name, err_line);
9579 else
9580 curr_line = m_lexer.m_current_input_line;
9581
9582 // Adjust the error column for display because it is 1-based in the
9583 // lexer for easier reporting.
9584 err_col--;
9585
9586 if (! curr_line.empty ())
9587 {
9588 // FIXME: we could do better if we just cached lines from the
9589 // input file in a list. See also functions for managing input
9590 // buffers in lex.ll.
9591
9592 std::size_t len = curr_line.length ();
9593
9594 if (curr_line[len-1] == '\n')
9595 curr_line.resize (len-1);
9596
9597 // Print the line, maybe with a pointer near the error token.
9598
9599 output_buf << ">>> " << curr_line << "\n";
9600
9601 if (err_col == 0)
9602 err_col = len;
9603
9604 for (int i = 0; i < err_col + 3; i++)
9605 output_buf << " ";
9606
9607 output_buf << "^";
9608 }
9609
9610 output_buf << "\n";
9611
9612 m_parse_error_msg = output_buf.str ();
9613 }
9614
9615 void
9617 {
9618 bison_error (pe.message (), pe.line (), pe.column ());
9619 }
9620
9621 void
9622 base_parser::bison_error (const std::list<parse_exception>& pe_list)
9623 {
9624 // For now, we just report the first error found. Reporting all
9625 // errors will require a bit more refactoring.
9626
9627 parse_exception pe = pe_list.front ();
9628
9629 bison_error (pe.message (), pe.line (), pe.column ());
9630 }
9631
9632 int
9634 {
9635 int status = -1;
9636
9637 yypstate *pstate = static_cast<yypstate *> (m_parser_state);
9638
9639 try
9640 {
9641 status = octave_pull_parse (pstate, *this);
9642 }
9643 catch (const execution_exception&)
9644 {
9645 // FIXME: In previous versions, we emitted a parse error here
9646 // but that is not always correct because the error could have
9647 // happened inside a GUI callback functions executing in the
9648 // readline event_hook loop. Maybe we need a separate exception
9649 // class for parse errors?
9650
9651 throw;
9652 }
9653 catch (const exit_exception&)
9654 {
9655 throw;
9656 }
9657 catch (const interrupt_exception&)
9658 {
9659 throw;
9660 }
9661 catch (...)
9662 {
9663 std::string file = m_lexer.m_fcn_file_full_name;
9664
9665 if (file.empty ())
9666 error ("unexpected exception while parsing input");
9667 else
9668 error ("unexpected exception while parsing %s", file.c_str ());
9669 }
9670
9671 if (status != 0)
9672 parse_error ("%s", m_parse_error_msg.c_str ());
9673
9674 return status;
9675 }
9676
9677 // Parse input from INPUT. Pass TRUE for EOF if the end of INPUT should
9678 // finish the parse.
9679
9680 int
9681 push_parser::run (const std::string& input, bool eof)
9682 {
9683 int status = -1;
9684
9685 dynamic_cast<push_lexer&> (m_lexer).append_input (input, eof);
9686
9687 do
9688 {
9689 YYSTYPE lval;
9690
9691 int token = octave_lex (&lval, m_lexer.m_scanner);
9692
9693 if (token < 0)
9694 {
9695 // TOKEN == -2 means that the lexer recognized a comment
9696 // and we should be at the end of the buffer but not the
9697 // end of the file so we should return 0 to indicate
9698 // "complete input" instead of -1 to request more input.
9699
9700 status = (token == -2 ? 0 : -1);
9701
9702 if (! eof && m_lexer.at_end_of_buffer ())
9703 return status;
9704
9705 break;
9706 }
9707
9708 yypstate *pstate = static_cast<yypstate *> (m_parser_state);
9709
9710 try
9711 {
9712 status = octave_push_parse (pstate, token, &lval, *this);
9713 }
9714 catch (execution_exception& e)
9715 {
9716 std::string file = m_lexer.m_fcn_file_full_name;
9717
9718 if (file.empty ())
9719 error (e, "parse error");
9720 else
9721 error (e, "parse error in %s", file.c_str ());
9722 }
9723 catch (const exit_exception&)
9724 {
9725 throw;
9726 }
9727 catch (interrupt_exception &)
9728 {
9729 throw;
9730 }
9731 catch (...)
9732 {
9733 std::string file = m_lexer.m_fcn_file_full_name;
9734
9735 if (file.empty ())
9736 error ("unexpected exception while parsing input");
9737 else
9738 error ("unexpected exception while parsing %s", file.c_str ());
9739 }
9740 }
9741 while (status == YYPUSH_MORE || ! m_lexer.at_end_of_buffer ());
9742
9743 if (status != 0)
9744 parse_error ("%s", m_parse_error_msg.c_str ());
9745
9746 return status;
9747 }
9748
9749 int
9751 {
9752 if (! m_reader)
9753 error ("push_parser::run requires valid input_reader");
9754
9755 int exit_status = 0;
9756
9758
9759 std::string prompt
9761
9762 do
9763 {
9764 // Reset status each time through the read loop so that
9765 // it won't be set to -1 and cause us to exit the outer
9766 // loop early if there is an exception while reading
9767 // input or parsing.
9768
9769 exit_status = 0;
9770
9771 bool eof = false;
9772 std::string input_line = m_reader->get_input (prompt, eof);
9773
9774 if (eof)
9775 {
9776 exit_status = EOF;
9777 break;
9778 }
9779
9780 exit_status = run (input_line, false);
9781
9782 prompt = command_editor::decode_prompt_string (input_sys.PS2 ());
9783 }
9784 while (exit_status < 0);
9785
9786 return exit_status;
9787 }
9788
9790 parse_fcn_file (interpreter& interp, const std::string& full_file,
9791 const std::string& file, const std::string& dir_name,
9792 const std::string& dispatch_type,
9793 const std::string& package_name, bool require_file,
9794 bool force_script, bool autoload, bool relative_lookup)
9795 {
9796 octave_value retval;
9797
9798 FILE *ffile = nullptr;
9799
9800 if (! full_file.empty ())
9801 {
9802 // Check that m-file is not overly large which can segfault interpreter.
9803 const int max_file_size = 512 * 1024 * 1024; // 512 MB
9804 sys::file_stat fs (full_file);
9805
9806 if (fs && fs.size () > max_file_size)
9807 {
9808 error ("file '%s' is too large, > 512 MB", full_file.c_str ());
9809
9810 return octave_value ();
9811 }
9812
9813 ffile = sys::fopen (full_file, "rb");
9814 }
9815
9816 if (! ffile)
9817 {
9818 if (require_file)
9819 error ("no such file, '%s'", full_file.c_str ());
9820
9821 return octave_value ();
9822 }
9823
9824 unwind_action act ([=] (void) { ::fclose (ffile); });
9825
9826 // get the encoding for this folder
9827 input_system& input_sys = interp.get_input_system ();
9828 parser parser (ffile, interp, input_sys.dir_encoding (dir_name));
9829
9830 parser.m_curr_class_name = dispatch_type;
9831 parser.m_curr_package_name = package_name;
9832 parser.m_autoloading = autoload;
9833 parser.m_fcn_file_from_relative_lookup = relative_lookup;
9834
9835 parser.m_lexer.m_force_script = force_script;
9837 parser.m_lexer.m_parsing_class_method = ! dispatch_type.empty ();
9838
9841 parser.m_lexer.m_dir_name = dir_name;
9842 parser.m_lexer.m_package_name = package_name;
9843
9844 int err = parser.run ();
9845
9846 if (err)
9847 error ("parse error while reading file %s", full_file.c_str ());
9848
9850
9852 && parser.classdef_object ())
9853 {
9854 // Convert parse tree for classdef object to
9855 // meta.class info (and stash it in the symbol
9856 // table?). Return pointer to constructor?
9857
9858 if (ov_fcn.is_defined ())
9860
9861 bool is_at_folder = ! dispatch_type.empty ();
9862
9863 std::shared_ptr<tree_classdef> cdef_obj
9865
9866 return cdef_obj->make_meta_class (interp, is_at_folder);
9867 }
9868 else if (ov_fcn.is_defined ())
9869 {
9870 octave_function *fcn = ov_fcn.function_value ();
9871
9872 fcn->maybe_relocate_end ();
9873
9875 {
9877 parser.m_subfunction_names.reverse ();
9878
9880 }
9881
9882 return ov_fcn;
9883 }
9884
9885 return octave_value ();
9886 }
9887
9888 bool
9890 {
9891 m_lexer.m_end_of_input = at_eof;
9892
9893 if (lst)
9894 {
9895 parse_tree_validator validator;
9896
9897 lst->accept (validator);
9898
9899 if (! validator.ok ())
9900 {
9901 delete lst;
9902
9903 bison_error (validator.error_list ());
9904
9905 return false;
9906 }
9907 }
9908
9909 std::shared_ptr<tree_statement_list> tmp_lst (lst);
9910
9911 statement_list (tmp_lst);
9912
9913 return true;
9914 }
9915
9916 // Check script or function for semantic errors.
9917 bool
9919 {
9921
9922 if (code)
9923 {
9924 parse_tree_validator validator;
9925
9926 code->accept (validator);
9927
9928 if (! validator.ok ())
9929 {
9930 bison_error (validator.error_list ());
9931
9932 return false;
9933 }
9934 }
9935
9936 return true;
9937 }
9938
9939 // Maybe print a warning if an assignment expression is used as the
9940 // test in a logical expression.
9941
9942 void
9944 {
9945 if (expr->is_assignment_expression ()
9946 && expr->paren_count () < 2)
9947 {
9948 if (m_lexer.m_fcn_file_full_name.empty ())
9950 ("Octave:assign-as-truth-value",
9951 "suggest parenthesis around assignment used as truth value");
9952 else
9954 ("Octave:assign-as-truth-value",
9955 "suggest parenthesis around assignment used as truth value near line %d, column %d in file '%s'",
9956 expr->line (), expr->column (), m_lexer.m_fcn_file_full_name.c_str ());
9957 }
9958 }
9959
9960 // Maybe print a warning about switch labels that aren't constants.
9961
9962 void
9964 {
9965 if (! expr->is_constant ())
9966 {
9967 if (m_lexer.m_fcn_file_full_name.empty ())
9968 warning_with_id ("Octave:variable-switch-label",
9969 "variable switch label");
9970 else
9972 ("Octave:variable-switch-label",
9973 "variable switch label near line %d, column %d in file '%s'",
9974 expr->line (), expr->column (), m_lexer.m_fcn_file_full_name.c_str ());
9975 }
9976 }
9977
9978 void
9980 {
9981 if (m_curr_fcn_depth >= 0)
9982 {
9983 tree_statement *tmp = t->back ();
9984
9985 if (tmp->is_expression ())
9987 ("Octave:missing-semicolon",
9988 "missing semicolon near line %d, column %d in file '%s'",
9989 tmp->line (), tmp->column (), m_lexer.m_fcn_file_full_name.c_str ());
9990 }
9991 }
9992
9993 std::string
9994 get_help_from_file (const std::string& nm, bool& symbol_found,
9995 std::string& full_file)
9996 {
9997 std::string retval;
9998
9999 full_file = fcn_file_in_path (nm);
10000
10001 std::string file = full_file;
10002
10003 std::size_t file_len = file.length ();
10004
10005 if ((file_len > 4 && file.substr (file_len-4) == ".oct")
10006 || (file_len > 4 && file.substr (file_len-4) == ".mex")
10007 || (file_len > 2 && file.substr (file_len-2) == ".m"))
10008 {
10009 file = sys::env::base_pathname (file);
10010 file = file.substr (0, file.find_last_of ('.'));
10011
10012 std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ());
10013 if (pos != std::string::npos)
10014 file = file.substr (pos+1);
10015 }
10016
10017 if (! file.empty ())
10018 {
10019 interpreter& interp = __get_interpreter__ ("get_help_from_file");
10020
10021 symbol_found = true;
10022
10023 octave_value ov_fcn
10024 = parse_fcn_file (interp, full_file, file, "", "", "", true,
10025 false, false, false);
10026
10027 if (ov_fcn.is_defined ())
10028 {
10029 octave_function *fcn = ov_fcn.function_value ();
10030
10031 if (fcn)
10032 retval = fcn->doc_string ();
10033 }
10034 }
10035
10036 return retval;
10037 }
10038
10039 std::string
10040 get_help_from_file (const std::string& nm, bool& symbol_found)
10041 {
10042 std::string file;
10043 return get_help_from_file (nm, symbol_found, file);
10044 }
10045
10047 load_fcn_from_file (const std::string& file_name,
10048 const std::string& dir_name,
10049 const std::string& dispatch_type,
10050 const std::string& package_name,
10051 const std::string& fcn_name, bool autoload)
10052 {
10053 octave_value retval;
10054
10055 unwind_protect frame;
10056
10057 std::string nm = file_name;
10058
10059 std::size_t nm_len = nm.length ();
10060
10061 std::string file;
10062
10063 bool relative_lookup = false;
10064
10065 file = nm;
10066
10067 if ((nm_len > 4 && nm.substr (nm_len-4) == ".oct")
10068 || (nm_len > 4 && nm.substr (nm_len-4) == ".mex")
10069 || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))
10070 {
10071 nm = sys::env::base_pathname (file);
10072 nm = nm.substr (0, nm.find_last_of ('.'));
10073
10074 std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_str ());
10075 if (pos != std::string::npos)
10076 nm = nm.substr (pos+1);
10077 }
10078
10079 relative_lookup = ! sys::env::absolute_pathname (file);
10080
10081 file = sys::env::make_absolute (file);
10082
10083 int len = file.length ();
10084
10085 interpreter& interp = __get_interpreter__ ("load_fcn_from_file");
10086
10087 dynamic_loader& dyn_loader = interp.get_dynamic_loader ();
10088
10089 if (len > 4 && file.substr (len-4, len-1) == ".oct")
10090 {
10091 if (autoload && ! fcn_name.empty ())
10092 nm = fcn_name;
10093
10094 octave_function *tmpfcn
10095 = dyn_loader.load_oct (nm, file, relative_lookup);
10096
10097 if (tmpfcn)
10098 {
10099 tmpfcn->stash_package_name (package_name);
10100 retval = octave_value (tmpfcn);
10101 }
10102 }
10103 else if (len > 4 && file.substr (len-4, len-1) == ".mex")
10104 {
10105 // Temporarily load m-file version of mex-file, if it exists,
10106 // to get the help-string to use.
10107
10108 std::string doc_string;
10109
10110 octave_value ov_fcn
10111 = parse_fcn_file (interp, file.substr (0, len - 2), nm, dir_name,
10112 dispatch_type, package_name, false,
10113 autoload, autoload, relative_lookup);
10114
10115 if (ov_fcn.is_defined ())
10116 {
10117 octave_function *tmpfcn = ov_fcn.function_value ();
10118
10119 if (tmpfcn)
10120 doc_string = tmpfcn->doc_string ();
10121 }
10122
10123 octave_function *tmpfcn
10124 = dyn_loader.load_mex (nm, file, relative_lookup);
10125
10126 if (tmpfcn)
10127 {
10128 tmpfcn->document (doc_string);
10129 tmpfcn->stash_package_name (package_name);
10130
10131 retval = octave_value (tmpfcn);
10132 }
10133 }
10134 else if (len > 2)
10135 {
10136 retval = parse_fcn_file (interp, file, nm, dir_name,
10137 dispatch_type, package_name, true,
10138 autoload, autoload, relative_lookup);
10139 }
10140
10141 return retval;
10142 }
10143
10144DEFMETHOD (autoload, interp, args, ,
10145 doc: /* -*- texinfo -*-
10146@deftypefn {} {@var{autoload_map} =} autoload ()
10147@deftypefnx {} {} autoload (@var{function}, @var{file})
10148@deftypefnx {} {} autoload (@dots{}, "remove")
10149Define @var{function} to autoload from @var{file}.
10150
10151The second argument, @var{file}, should be an absolute filename or a file
10152name in the same directory as the function or script from which the autoload
10153command was run. @var{file} @emph{should not} depend on the Octave load
10154path.
10155
10156Normally, calls to @code{autoload} appear in PKG_ADD script files that are
10157evaluated when a directory is added to Octave's load path. To avoid having
10158to hardcode directory names in @var{file}, if @var{file} is in the same
10159directory as the PKG_ADD script then
10160
10161@example
10162autoload ("foo", "bar.oct");
10163@end example
10164
10165@noindent
10166will load the function @code{foo} from the file @code{bar.oct}. The above
10167usage when @code{bar.oct} is not in the same directory, or usages such as
10168
10169@example
10170autoload ("foo", file_in_loadpath ("bar.oct"))
10171@end example
10172
10173@noindent
10174are strongly discouraged, as their behavior may be unpredictable.
10175
10176With no arguments, return a structure containing the current autoload map.
10177
10178If a third argument @qcode{"remove"} is given, the function is cleared and
10179not loaded anymore during the current Octave session.
10180
10181@seealso{PKG_ADD}
10182@end deftypefn */)
10183{
10184 int nargin = args.length ();
10185
10186 if (nargin == 1 || nargin > 3)
10187 print_usage ();
10188
10189 tree_evaluator& tw = interp.get_evaluator ();
10190
10191 if (nargin == 0)
10192 return octave_value (tw.get_autoload_map ());
10193 else
10194 {
10195 string_vector argv = args.make_argv ("autoload");
10196
10197 if (nargin == 2)
10198 tw.add_autoload (argv[1], argv[2]);
10199 else if (nargin == 3)
10200 {
10201 if (argv[3] != "remove")
10202 error_with_id ("Octave:invalid-input-arg",
10203 "autoload: third argument can only be 'remove'");
10204
10205 tw.remove_autoload (argv[1], argv[2]);
10206 }
10207 }
10208
10209 return octave_value_list ();
10210}
10211
10212DEFMETHOD (mfilename, interp, args, ,
10213 doc: /* -*- texinfo -*-
10214@deftypefn {} {} mfilename ()
10215@deftypefnx {} {} mfilename ("fullpath")
10216@deftypefnx {} {} mfilename ("fullpathext")
10217Return the name of the currently executing file.
10218
10219The base name of the currently executing script or function is returned without
10220any extension. If called from outside an m-file, such as the command line,
10221return the empty string.
10222
10223Given the argument @qcode{"fullpath"}, include the directory part of the
10224filename, but not the extension.
10225
10226Given the argument @qcode{"fullpathext"}, include the directory part of
10227the filename and the extension.
10228@seealso{inputname, dbstack}
10229@end deftypefn */)
10230{
10231 int nargin = args.length ();
10232
10233 if (nargin > 1)
10234 print_usage ();
10235
10236 std::string opt;
10237
10238 if (nargin == 1)
10239 opt = args(0).xstring_value ("mfilename: option argument must be a string");
10240
10241 return octave_value (interp.mfilename (opt));
10242}
10243
10244 // Execute the contents of a script file. For compatibility with
10245 // Matlab, also execute a function file by calling the function it
10246 // defines with no arguments and nargout = 0.
10247
10248 void
10249 source_file (const std::string& file_name, const std::string& context,
10250 bool verbose, bool require_file)
10251 {
10252 interpreter& interp = __get_interpreter__ ("source_file");
10253
10254 interp.source_file (file_name, context, verbose, require_file);
10255 }
10256
10257DEFMETHOD (source, interp, args, ,
10258 doc: /* -*- texinfo -*-
10259@deftypefn {} {} source (@var{file})
10260@deftypefnx {} {} source (@var{file}, @var{context})
10261Parse and execute the contents of @var{file}.
10262
10263Without specifying @var{context}, this is equivalent to executing commands
10264from a script file, but without requiring the file to be named
10265@file{@var{file}.m} or to be on the execution path.
10266
10267Instead of the current context, the script may be executed in either the
10268context of the function that called the present function
10269(@qcode{"caller"}), or the top-level context (@qcode{"base"}).
10270@seealso{run}
10271@end deftypefn */)
10272{
10273 int nargin = args.length ();
10274
10275 if (nargin < 1 || nargin > 2)
10276 print_usage ();
10277
10278 std::string file_name
10279 = args(0).xstring_value ("source: FILE must be a string");
10280
10281 std::string context;
10282 if (nargin == 2)
10283 context = args(1).xstring_value ("source: CONTEXT must be a string");
10284
10285 interp.source_file (file_name, context);
10286
10287 return octave_value_list ();
10288}
10289
10290 //! Evaluate an Octave function (built-in or interpreted) and return
10291 //! the list of result values.
10292 //!
10293 //! @param name The name of the function to call.
10294 //! @param args The arguments to the function.
10295 //! @param nargout The number of output arguments expected.
10296 //! @return A list of output values. The length of the list is not
10297 //! necessarily the same as @c nargout.
10298
10300 feval (const char *name, const octave_value_list& args, int nargout)
10301 {
10302 interpreter& interp = __get_interpreter__ ("feval");
10303
10304 return interp.feval (name, args, nargout);
10305 }
10306
10308 feval (const std::string& name, const octave_value_list& args, int nargout)
10309 {
10310 interpreter& interp = __get_interpreter__ ("feval");
10311
10312 return interp.feval (name, args, nargout);
10313 }
10314
10316 feval (octave_function *fcn, const octave_value_list& args, int nargout)
10317 {
10318 interpreter& interp = __get_interpreter__ ("feval");
10319
10320 return interp.feval (fcn, args, nargout);
10321 }
10322
10324 feval (const octave_value& val, const octave_value_list& args, int nargout)
10325 {
10326 interpreter& interp = __get_interpreter__ ("feval");
10327
10328 return interp.feval (val, args, nargout);
10329 }
10330
10332 feval (const octave_value_list& args, int nargout)
10333 {
10334 interpreter& interp = __get_interpreter__ ("feval");
10335
10336 return interp.feval (args, nargout);
10337 }
10338
10339DEFMETHOD (feval, interp, args, nargout,
10340 doc: /* -*- texinfo -*-
10341@deftypefn {} {} feval (@var{name}, @dots{})
10342Evaluate the function named @var{name}.
10343
10344Any arguments after the first are passed as inputs to the named function.
10345For example,
10346
10347@example
10348@group
10349feval ("acos", -1)
10350 @result{} 3.1416
10351@end group
10352@end example
10353
10354@noindent
10355calls the function @code{acos} with the argument @samp{-1}.
10356
10357The function @code{feval} can also be used with function handles of any sort
10358(@pxref{Function Handles}). Historically, @code{feval} was the only way to
10359call user-supplied functions in strings, but function handles are now
10360preferred due to the cleaner syntax they offer. For example,
10361
10362@example
10363@group
10364@var{f} = @@exp;
10365feval (@var{f}, 1)
10366 @result{} 2.7183
10367@var{f} (1)
10368 @result{} 2.7183
10369@end group
10370@end example
10371
10372@noindent
10373are equivalent ways to call the function referred to by @var{f}. If it
10374cannot be predicted beforehand whether @var{f} is a function handle,
10375function name in a string, or inline function then @code{feval} can be used
10376instead.
10377@end deftypefn */)
10378{
10379 if (args.length () == 0)
10380 print_usage ();
10381
10382 return interp.feval (args, nargout);
10383}
10384
10385DEFMETHOD (builtin, interp, args, nargout,
10386 doc: /* -*- texinfo -*-
10387@deftypefn {} {[@dots{}] =} builtin (@var{f}, @dots{})
10388Call the base function @var{f} even if @var{f} is overloaded to another
10389function for the given type signature.
10390
10391This is normally useful when doing object-oriented programming and there is
10392a requirement to call one of Octave's base functions rather than the
10393overloaded one of a new class.
10394
10395A trivial example which redefines the @code{sin} function to be the
10396@code{cos} function shows how @code{builtin} works.
10397
10398@example
10399@group
10400sin (0)
10401 @result{} 0
10402function y = sin (x), y = cos (x); endfunction
10403sin (0)
10404 @result{} 1
10405builtin ("sin", 0)
10406 @result{} 0
10407@end group
10408@end example
10409@end deftypefn */)
10410{
10411 octave_value_list retval;
10412
10413 if (args.length () == 0)
10414 print_usage ();
10415
10416 const std::string name (args(0).xstring_value ("builtin: function name (F) must be a string"));
10417
10418 symbol_table& symtab = interp.get_symbol_table ();
10419
10420 octave_value fcn = symtab.builtin_find (name);
10421
10422 if (fcn.is_defined ())
10423 retval = interp.feval (fcn.function_value (), args.splice (0, 1), nargout);
10424 else
10425 error ("builtin: lookup for symbol '%s' failed", name.c_str ());
10426
10427 return retval;
10428}
10429
10430 void
10431 cleanup_statement_list (tree_statement_list **lst)
10432 {
10433 if (*lst)
10434 {
10435 delete *lst;
10436 *lst = nullptr;
10437 }
10438 }
10439
10440DEFMETHOD (eval, interp, args, nargout,
10441 doc: /* -*- texinfo -*-
10442@deftypefn {} {} eval (@var{try})
10443@deftypefnx {} {} eval (@var{try}, @var{catch})
10444Parse the string @var{try} and evaluate it as if it were an Octave
10445program.
10446
10447If execution fails, evaluate the optional string @var{catch}.
10448
10449The string @var{try} is evaluated in the current context, so any results
10450remain available after @code{eval} returns.
10451
10452The following example creates the variable @var{A} with the approximate
10453value of 3.1416 in the current workspace.
10454
10455@example
10456eval ("A = acos(-1);");
10457@end example
10458
10459If an error occurs during the evaluation of @var{try} then the @var{catch}
10460string is evaluated, as the following example shows:
10461
10462@example
10463@group
10464eval ('error ("This is a bad example");',
10465 'printf ("This error occurred:\n%s\n", lasterr ());');
10466 @print{} This error occurred:
10467 This is a bad example
10468@end group
10469@end example
10470
10471Programming Note: if you are only using @code{eval} as an error-capturing
10472mechanism, rather than for the execution of arbitrary code strings,
10473Consider using try/catch blocks or unwind_protect/unwind_protect_cleanup
10474blocks instead. These techniques have higher performance and don't
10475introduce the security considerations that the evaluation of arbitrary code
10476does.
10477@seealso{evalin, evalc, assignin, feval}
10478@end deftypefn */)
10479{
10480 int nargin = args.length ();
10481
10482 if (nargin < 1 || nargin > 2)
10483 print_usage ();
10484
10485 if (! args(0).is_string () || args(0).rows () > 1 || args(0).ndims () != 2)
10486 error ("eval: TRY must be a string");
10487
10488 std::string try_code = args(0).string_value ();
10489
10490 if (nargin == 1)
10491 return interp.eval (try_code, nargout);
10492 else
10493 {
10494 if (! args(1).is_string () || args(1).rows () > 1
10495 || args(1).ndims () != 2)
10496 error ("eval: CATCH must be a string");
10497
10498 std::string catch_code = args(1).string_value ();
10499
10500 return interp.eval (try_code, catch_code, nargout);
10501 }
10502}
10503
10504/*
10505
10506%!shared x
10507%! x = 1;
10508
10509%!assert (eval ("x"), 1)
10510%!assert (eval ("x;"))
10511%!assert (eval ("x;"), 1)
10512
10513%!test
10514%! y = eval ("x");
10515%! assert (y, 1);
10516
10517%!test
10518%! y = eval ("x;");
10519%! assert (y, 1);
10520
10521%!test
10522%! eval ("x = 1;");
10523%! assert (x,1);
10524
10525%!test
10526%! eval ("flipud = 2;");
10527%! assert (flipud, 2);
10528
10529%!function y = __f ()
10530%! eval ("flipud = 2;");
10531%! y = flipud;
10532%!endfunction
10533%!assert (__f(), 2)
10534
10535%!test <*35645>
10536%! [a,] = gcd (1,2);
10537%! [a,b,] = gcd (1, 2);
10538
10539## Can't assign to a keyword
10540%!error eval ("switch = 13;")
10541
10542%!shared str
10543%! str = "disp ('hello');";
10544%! str(:,:,2) = str(:,:,1);
10545
10546%!error <TRY must be a string> eval (1)
10547%!error <TRY must be a string> eval (['a';'b'])
10548%!error <TRY must be a string> eval (str)
10549
10550%!error <CATCH must be a string> eval (str(:,:,1), 1)
10551%!error <CATCH must be a string> eval (str(:,:,1), ['a';'b'])
10552%!error <CATCH must be a string> eval (str(:,:,1), str)
10553
10554*/
10555
10556DEFMETHOD (assignin, interp, args, ,
10557 doc: /* -*- texinfo -*-
10558@deftypefn {} {} assignin (@var{context}, @var{varname}, @var{value})
10559Assign @var{value} to @var{varname} in context @var{context}, which
10560may be either @qcode{"base"} or @qcode{"caller"}.
10561@seealso{evalin}
10562@end deftypefn */)
10563{
10564 if (args.length () != 3)
10565 print_usage ();
10566
10567 std::string context
10568 = args(0).xstring_value ("assignin: CONTEXT must be a string");
10569
10570 std::string varname
10571 = args(1).xstring_value ("assignin: VARNAME must be a string");
10572
10573 interp.assignin (context, varname, args(2));
10574
10575 return octave_value_list ();
10576}
10577
10578/*
10579
10580%!error assignin ("base", "switch", "13")
10581
10582*/
10583
10584DEFMETHOD (evalin, interp, args, nargout,
10585 doc: /* -*- texinfo -*-
10586@deftypefn {} {} evalin (@var{context}, @var{try})
10587@deftypefnx {} {} evalin (@var{context}, @var{try}, @var{catch})
10588Like @code{eval}, except that the expressions are evaluated in the context
10589@var{context}, which may be either @qcode{"caller"} or @qcode{"base"}.
10590@seealso{eval, assignin}
10591@end deftypefn */)
10592{
10593 int nargin = args.length ();
10594
10595 if (nargin < 2 || nargin > 3)
10596 print_usage ();
10597
10598 std::string context
10599 = args(0).xstring_value ("evalin: CONTEXT must be a string");
10600
10601 std::string try_code
10602 = args(1).xstring_value ("evalin: TRY must be a string");
10603
10604 if (nargin == 3)
10605 {
10606 std::string catch_code
10607 = args(2).xstring_value ("evalin: CATCH must be a string");
10608
10609 return interp.evalin (context, try_code, catch_code, nargout);
10610 }
10611
10612 return interp.evalin (context, try_code, nargout);
10613}
10614
10615DEFMETHOD (evalc, interp, args, nargout,
10616 doc: /* -*- texinfo -*-
10617@deftypefn {} {@var{s} =} evalc (@var{try})
10618@deftypefnx {} {@var{s} =} evalc (@var{try}, @var{catch})
10619Parse and evaluate the string @var{try} as if it were an Octave program,
10620while capturing the output into the return variable @var{s}.
10621
10622If execution fails, evaluate the optional string @var{catch}.
10623
10624This function behaves like @code{eval}, but any output or warning messages
10625which would normally be written to the console are captured and returned in
10626the string @var{s}.
10627
10628The @code{diary} is disabled during the execution of this function. When
10629@code{system} is used, any output produced by external programs is
10630@emph{not} captured, unless their output is captured by the @code{system}
10631function itself.
10632
10633@example
10634@group
10635s = evalc ("t = 42"), t
10636 @result{} s = t = 42
10637
10638 @result{} t = 42
10639@end group
10640@end example
10641@seealso{eval, diary}
10642@end deftypefn */)
10643{
10644 int nargin = args.length ();
10645
10646 if (nargin == 0 || nargin > 2)
10647 print_usage ();
10648
10649 // Flush pending output and redirect stdout/stderr to capturing
10650 // buffer.
10651
10652 octave_stdout.flush ();
10653 std::cerr.flush ();
10654
10655 std::stringbuf buffer;
10656
10657 std::streambuf *old_out_buf = octave_stdout.rdbuf (&buffer);
10658 std::streambuf *old_err_buf = std::cerr.rdbuf (&buffer);
10659
10660 // Restore previous output buffers no matter how control exits this
10661 // function. There's no need to flush here. That has already
10662 // happened for the normal execution path. If an error happens during
10663 // the eval, then the message is stored in the exception object and we
10664 // will display it later, after the buffers have been restored.
10665
10666 unwind_action act ([=] (void)
10667 {
10668 octave_stdout.rdbuf (old_out_buf);
10669 std::cerr.rdbuf (old_err_buf);
10670 });
10671
10672 // Call standard eval function.
10673
10674 int eval_nargout = std::max (0, nargout - 1);
10675
10676 octave_value_list retval = Feval (interp, args, eval_nargout);
10677
10678 // Make sure we capture all pending output.
10679
10680 octave_stdout.flush ();
10681 std::cerr.flush ();
10682
10683 retval.prepend (buffer.str ());
10684
10685 return retval;
10686}
10687
10688/*
10689
10690%!test
10691%! [old_fmt, old_spacing] = format ();
10692%! unwind_protect
10693%! format short;
10694%! str = evalc ("1");
10695%! assert (str, "ans = 1\n");
10696%! unwind_protect_cleanup
10697%! format (old_fmt);
10698%! format (old_spacing);
10699%! end_unwind_protect
10700
10701%!assert (evalc ("1;"), "")
10702
10703%!test
10704%! [s, y] = evalc ("1");
10705%! assert (s, "");
10706%! assert (y, 1);
10707
10708%!test
10709%! [s, y] = evalc ("1;");
10710%! assert (s, "");
10711%! assert (y, 1);
10712
10713%!test
10714%! [old_fmt, old_spacing] = format ();
10715%! unwind_protect
10716%! format short;
10717%! str = evalc ("y = 2");
10718%! assert (str, "y = 2\n");
10719%! assert (y, 2);
10720%! unwind_protect_cleanup
10721%! format (old_fmt);
10722%! format (old_spacing);
10723%! end_unwind_protect
10724
10725%!test
10726%! assert (evalc ("y = 3;"), "");
10727%! assert (y, 3);
10728
10729%!test
10730%! [s, a, b] = evalc ("deal (1, 2)");
10731%! assert (s, "");
10732%! assert (a, 1);
10733%! assert (b, 2);
10734
10735%!function [a, b] = __f_evalc ()
10736%! printf ("foo");
10737%! fprintf (stdout, "bar ");
10738%! disp (pi);
10739%! a = 1;
10740%! b = 2;
10741%!endfunction
10742%!test
10743%! [old_fmt, old_spacing] = format ();
10744%! unwind_protect
10745%! format short;
10746%! [s, a, b] = evalc ("__f_evalc ()");
10747%! assert (s, "foobar 3.1416\n");
10748%! assert (a, 1);
10749%! assert (b, 2);
10750%! unwind_protect_cleanup
10751%! format (old_fmt);
10752%! format (old_spacing);
10753%! end_unwind_protect
10754
10755%!error <foo> (evalc ("error ('foo')"))
10756%!error <bar> (evalc ("error ('foo')", "error ('bar')"))
10757
10758%!test
10759%! warning ("off", "quiet", "local");
10760%! str = evalc ("warning ('foo')");
10761%! assert (str(1:13), "warning: foo\n");
10762
10763%!test
10764%! warning ("off", "quiet", "local");
10765%! str = evalc ("error ('foo')", "warning ('bar')");
10766%! assert (str(1:13), "warning: bar\n");
10767
10768%!error evalc ("switch = 13;")
10769
10770*/
10771
10772DEFUN (__parser_debug_flag__, args, nargout,
10773 doc: /* -*- texinfo -*-
10774@deftypefn {} {@var{val} =} __parser_debug_flag__ ()
10775@deftypefnx {} {@var{old_val} =} __parser_debug_flag__ (@var{new_val})
10776Query or set the internal flag that determines whether Octave's parser
10777prints debug information as it processes an expression.
10778@seealso{__lexer_debug_flag__}
10779@end deftypefn */)
10780{
10781 octave_value retval;
10782
10783 bool debug_flag = octave_debug;
10784
10785 retval = set_internal_variable (debug_flag, args, nargout,
10786 "__parser_debug_flag__");
10787
10788 octave_debug = debug_flag;
10789
10790 return retval;
10791}
10792
10793DEFMETHOD (__parse_file__, interp, args, ,
10794 doc: /* -*- texinfo -*-
10795@deftypefn {} {} __parse_file__ (@var{file}, @var{verbose})
10796Undocumented internal function.
10797@end deftypefn */)
10798{
10799 octave_value retval;
10800
10801 int nargin = args.length ();
10802
10803 if (nargin < 1 || nargin > 2)
10804 print_usage ();
10805
10806 std::string file
10807 = args(0).xstring_value ("__parse_file__: expecting filename as argument");
10808
10809 std::string full_file = sys::file_ops::tilde_expand (file);
10810
10811 full_file = sys::env::make_absolute (full_file);
10812
10813 std::string dir_name;
10814
10815 std::size_t file_len = file.length ();
10816
10817 if ((file_len > 4 && file.substr (file_len-4) == ".oct")
10818 || (file_len > 4 && file.substr (file_len-4) == ".mex")
10819 || (file_len > 2 && file.substr (file_len-2) == ".m"))
10820 {
10821 file = sys::env::base_pathname (file);
10822 file = file.substr (0, file.find_last_of ('.'));
10823
10824 std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ());
10825 if (pos != std::string::npos)
10826 {
10827 dir_name = file.substr (0, pos);
10828 file = file.substr (pos+1);
10829 }
10830 }
10831
10832 if (nargin == 2)
10833 octave_stdout << "parsing " << full_file << std::endl;
10834
10835 octave_value ov_fcn
10836 = parse_fcn_file (interp, full_file, file, dir_name, "", "", true,
10837 false, false, false);
10838
10839 return retval;
10840}
10841
10842OCTAVE_NAMESPACE_END
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:230
Definition: Cell.h:43
void set_discard_warning_messages(bool flag)
Definition: error.h:102
void set_last_warning_message(const std::string &val)
Definition: error.h:206
OCTINTERP_API octave_value discard_warning_messages(const octave_value_list &args, int nargout)
Definition: error.cc:299
OCTINTERP_API octave_value last_warning_message(const octave_value_list &args, int nargout)
Definition: error.cc:343
octave_value PS2(const octave_value_list &args, int nargout)
octave_value PS1(const octave_value_list &args, int nargout)
dynamic_loader & get_dynamic_loader(void)
Definition: interpreter.h:276
void source_file(const std::string &file_name, const std::string &context="", bool verbose=false, bool require_file=true)
error_system & get_error_system(void)
Definition: interpreter.h:251
tree_evaluator & get_evaluator(void)
input_system & get_input_system(void)
Definition: interpreter.h:261
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(void)
std::string message(void) const
comment_list * get_comment(void)
Definition: lex.h:584
virtual bool input_from_eval_string(void) const
Definition: lex.h:733
bool input_from_tmp_history_file(void)
Definition: lex.cc:6779
comment_list * get_comment(void)
Definition: lex.h:668
comment_buffer m_comment_buf
Definition: lex.h:725
virtual bool input_from_terminal(void) const
Definition: lex.h:729
bool at_end_of_buffer(void) const
Definition: lex.h:632
void prep_for_file(void)
Definition: lex.cc:5403
void * m_scanner
Definition: lex.h:719
virtual void reset(void)
Definition: lex.cc:5380
void pop_front(void)
Definition: base-list.h:88
std::size_t size(void) const
Definition: base-list.h:52
void append(const elt_type &s)
Definition: base-list.h:92
elt_type & back(void)
Definition: base-list.h:80
bool empty(void) const
Definition: base-list.h:50
void pop_back(void)
Definition: base-list.h:89
elt_type & front(void)
Definition: base-list.h:79
std::size_t length(void) const
Definition: base-list.h:53
iterator erase(iterator pos)
Definition: base-list.h:55
std::list< tree_decl_elt * >::iterator iterator
Definition: base-list.h:43
iterator end(void)
Definition: base-list.h:68
OCTINTERP_API void clear(void)
Definition: oct-parse.cc:6679
OCTINTERP_API bool name_current_scope(const std::string &name)
Definition: oct-parse.cc:6656
std::pair< symbol_scope, std::string > value_type
Definition: parse.h:116
OCTINTERP_API std::size_t size(void) const
Definition: oct-parse.cc:6594
OCTINTERP_API symbol_scope parent_scope(void) const
Definition: oct-parse.cc:6668
OCTINTERP_API void pop(void)
Definition: oct-parse.cc:6612
OCTINTERP_API void push(const value_type &elt)
Definition: oct-parse.cc:6600
OCTINTERP_API tree_argument_list * append_argument_list(tree_argument_list *list, tree_expression *expr)
Definition: oct-parse.cc:9471
OCTINTERP_API tree_arg_validation * make_arg_validation(tree_arg_size_spec *size_spec, tree_identifier *class_name, tree_arg_validation_fcns *validation_fcns, tree_expression *default_value)
Definition: oct-parse.cc:8271
OCTINTERP_API tree_decl_command * make_decl_command(int tok, token *tok_val, tree_decl_init_list *lst)
Definition: oct-parse.cc:9028
OCTINTERP_API bool validate_primary_fcn(void)
Definition: oct-parse.cc:9918
OCTINTERP_API tree_classdef_attribute_list * append_classdef_attribute(tree_classdef_attribute_list *list, tree_classdef_attribute *elt)
Definition: oct-parse.cc:8709
std::shared_ptr< tree_statement_list > statement_list(void) const
Definition: parse.h:193
OCTINTERP_API void disallow_command_syntax(void)
Definition: oct-parse.cc:9512
OCTINTERP_API tree_command * make_unwind_command(token *unwind_tok, tree_statement_list *body, tree_statement_list *cleanup, token *end_tok, comment_list *lc, comment_list *mc)
Definition: oct-parse.cc:7310
OCTINTERP_API tree_cell * make_cell(tree_argument_list *row)
Definition: oct-parse.cc:9347
OCTINTERP_API tree_index_expression * make_indirect_ref(tree_expression *expr, const std::string &)
OCTINTERP_API tree_fcn_handle * make_fcn_handle(token *tok_val)
Definition: oct-parse.cc:6953
bool m_parsing_local_functions
Definition: parse.h:753
OCTINTERP_API tree_switch_command * finish_switch_command(token *switch_tok, tree_expression *expr, tree_switch_case_list *list, token *end_tok, comment_list *lc)
Definition: oct-parse.cc:7683
octave_value m_primary_fcn
Definition: parse.h:782
OCTINTERP_API tree_switch_case_list * make_switch_case_list(tree_switch_case *switch_case)
Definition: oct-parse.cc:7723
OCTINTERP_API void recover_from_parsing_function(void)
Definition: oct-parse.cc:8322
OCTINTERP_API tree_argument_list * validate_matrix_for_assignment(tree_expression *e)
Definition: oct-parse.cc:9185
OCTINTERP_API tree_classdef_attribute_list * make_classdef_attribute_list(tree_classdef_attribute *attr)
Definition: oct-parse.cc:8688
OCTINTERP_API tree_classdef_body * make_classdef_body(tree_classdef_properties_block *pb)
Definition: oct-parse.cc:8716
OCTINTERP_API tree_expression * make_assign_op(int op, tree_argument_list *lhs, token *eq_tok, tree_expression *rhs)
Definition: oct-parse.cc:7764
OCTINTERP_API tree_if_command * finish_if_command(token *if_tok, tree_if_command_list *list, token *end_tok, comment_list *lc)
Definition: oct-parse.cc:7610
OCTINTERP_API tree_classdef_properties_block * make_classdef_properties_block(token *tok_val, tree_classdef_attribute_list *a, tree_classdef_property_list *plist, token *end_tok, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:8427
void * m_parser_state
Definition: parse.h:799
OCTINTERP_API bool validate_array_list(tree_expression *e)
Definition: oct-parse.cc:9160
OCTINTERP_API tree_function_def * finish_classdef_external_method(octave_user_function *fcn, tree_parameter_list *ret_list, comment_list *cl)
Definition: oct-parse.cc:8817
OCTINTERP_API tree_identifier * make_identifier(token *ident)
Definition: oct-parse.cc:9362
OCTINTERP_API tree_classdef_events_list * make_classdef_events_list(tree_classdef_event *e)
Definition: oct-parse.cc:8580
OCTINTERP_API tree_matrix * append_matrix_row(tree_matrix *matrix, tree_argument_list *row)
Definition: oct-parse.cc:9326
OCTINTERP_API bool finish_input(tree_statement_list *lst, bool at_eof=false)
Definition: oct-parse.cc:9889
OCTINTERP_API tree_classdef * make_classdef(token *tok_val, tree_classdef_attribute_list *a, tree_identifier *id, tree_classdef_superclass_list *sc, tree_classdef_body *body, token *end_tok, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:8350
OCTINTERP_API tree_parameter_list * make_parameter_list(tree_parameter_list::in_or_out io)
Definition: oct-parse.cc:9478
OCTINTERP_API tree_parameter_list * append_parameter_list(tree_parameter_list *list, tree_decl_elt *t)
Definition: oct-parse.cc:9498
OCTINTERP_API tree_classdef_property * make_classdef_property(comment_list *lc, tree_identifier *id, tree_arg_validation *av)
Definition: oct-parse.cc:8489
OCTINTERP_API tree_classdef_superclass_list * make_classdef_superclass_list(tree_classdef_superclass *sc)
Definition: oct-parse.cc:8669
std::shared_ptr< tree_classdef > m_classdef_object
Definition: parse.h:790
OCTINTERP_API tree_if_command_list * append_if_clause(tree_if_command_list *list, tree_if_clause *clause)
Definition: oct-parse.cc:7674
parent_scope_info m_function_scopes
Definition: parse.h:779
int m_curr_fcn_depth
Definition: parse.h:764
OCTINTERP_API tree_command * make_return_command(token *return_tok)
Definition: oct-parse.cc:7556
virtual ~base_parser(void)
Definition: oct-parse.cc:6695
OCTINTERP_API tree_identifier * make_fcn_name(tree_identifier *id)
Definition: oct-parse.cc:7928
symbol_scope m_primary_fcn_scope
Definition: parse.h:768
OCTINTERP_API tree_cell * append_cell_row(tree_cell *cell, tree_argument_list *row)
Definition: oct-parse.cc:9353
OCTINTERP_API tree_matrix * make_matrix(tree_argument_list *row)
Definition: oct-parse.cc:9320
OCTINTERP_API void reset(void)
Definition: oct-parse.cc:6711
OCTINTERP_API tree_command * make_for_command(int tok_id, token *for_tok, tree_argument_list *lhs, tree_expression *expr, tree_expression *maxproc, tree_statement_list *body, token *end_tok, comment_list *lc)
Definition: oct-parse.cc:7454
OCTINTERP_API tree_expression * make_binary_op(int op, tree_expression *op1, token *tok_val, tree_expression *op2)
Definition: oct-parse.cc:7112
OCTINTERP_API tree_decl_elt * make_decl_elt(tree_identifier *id, token *eq_op=nullptr, tree_expression *expr=nullptr)
Definition: oct-parse.cc:9086
OCTINTERP_API tree_command * make_do_until_command(token *until_tok, tree_statement_list *body, tree_expression *expr, comment_list *lc)
Definition: oct-parse.cc:7434
OCTINTERP_API tree_command * make_continue_command(token *continue_tok)
Definition: oct-parse.cc:7539
OCTINTERP_API void bison_error(const std::string &s)
OCTINTERP_API tree_if_clause * make_else_clause(token *else_tok, comment_list *lc, tree_statement_list *list)
Definition: oct-parse.cc:7664
void endfunction_found(bool flag)
Definition: parse.h:223
OCTINTERP_API tree_command * make_while_command(token *while_tok, tree_expression *expr, tree_statement_list *body, token *end_tok, comment_list *lc)
Definition: oct-parse.cc:7399
OCTINTERP_API tree_command * make_try_command(token *try_tok, tree_statement_list *body, char catch_sep, tree_statement_list *cleanup, token *end_tok, comment_list *lc, comment_list *mc)
Definition: oct-parse.cc:7343
OCTINTERP_API tree_switch_case_list * append_switch_case(tree_switch_case_list *list, tree_switch_case *elt)
Definition: oct-parse.cc:7755
OCTINTERP_API tree_black_hole * make_black_hole(void)
Definition: oct-parse.cc:6945
OCTINTERP_API void maybe_warn_variable_switch_label(tree_expression *expr)
Definition: oct-parse.cc:9963
OCTINTERP_API tree_classdef_property_list * append_classdef_property(tree_classdef_property_list *list, tree_classdef_property *elt)
Definition: oct-parse.cc:8648
OCTINTERP_API tree_classdef_attribute * make_not_classdef_attribute(tree_identifier *id)
Definition: oct-parse.cc:8703
bool m_fcn_file_from_relative_lookup
Definition: parse.h:744
OCTINTERP_API tree_statement * make_end(const std::string &type, bool eof, const filepos &beg_pos, const filepos &end_pos)
Definition: oct-parse.cc:8120
std::string m_curr_class_name
Definition: parse.h:772
OCTINTERP_API tree_classdef_body * append_classdef_enum_block(tree_classdef_body *body, tree_classdef_enum_block *block)
Definition: oct-parse.cc:8761
OCTINTERP_API tree_args_block_attribute_list * make_args_attribute_list(tree_identifier *attribute_name)
Definition: oct-parse.cc:8284
OCTINTERP_API tree_function_def * make_function(token *fcn_tok, tree_parameter_list *ret_list, tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_fcn_stmt, comment_list *lc)
Definition: oct-parse.cc:7962
OCTINTERP_API tree_statement_list * make_statement_list(tree_statement *stmt)
Definition: oct-parse.cc:9449
OCTINTERP_API octave_user_function * start_function(tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_function)
Definition: oct-parse.cc:7986
std::string m_curr_package_name
Definition: parse.h:776
void parsing_local_functions(bool flag)
Definition: parse.h:208
std::list< std::string > m_subfunction_names
Definition: parse.h:787
OCTINTERP_API tree_classdef_enum_list * append_classdef_enum(tree_classdef_enum_list *list, tree_classdef_enum *elt)
Definition: oct-parse.cc:8662
OCTINTERP_API tree_classdef_methods_block * make_classdef_methods_block(token *tok_val, tree_classdef_attribute_list *a, tree_classdef_methods_list *mlist, token *end_tok, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:8506
OCTINTERP_API tree_constant * make_constant(token *tok_val)
Definition: oct-parse.cc:6884
OCTINTERP_API void end_token_error(token *tok, token::end_tok_type expected)
Definition: oct-parse.cc:6833
base_lexer & m_lexer
Definition: parse.h:796
OCTINTERP_API bool finish_classdef_file(tree_classdef *cls, tree_statement_list *local_fcns)
Definition: oct-parse.cc:8865
OCTINTERP_API tree_metaclass_query * make_metaclass_query(token *metaquery)
Definition: oct-parse.cc:9391
OCTINTERP_API tree_classdef_events_block * make_classdef_events_block(token *tok_val, tree_classdef_attribute_list *a, tree_classdef_events_list *elist, token *end_tok, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:8547
OCTINTERP_API void maybe_warn_missing_semi(tree_statement_list *)
Definition: oct-parse.cc:9979
OCTINTERP_API tree_classdef_body * append_classdef_properties_block(tree_classdef_body *body, tree_classdef_properties_block *block)
Definition: oct-parse.cc:8740
OCTINTERP_API tree_switch_case * make_switch_case(token *case_tok, tree_expression *expr, tree_statement_list *list, comment_list *lc)
Definition: oct-parse.cc:7731
OCTINTERP_API tree_switch_case * make_default_switch_case(token *default_tok, comment_list *lc, tree_statement_list *list)
Definition: oct-parse.cc:7745
OCTINTERP_API tree_expression * finish_matrix(tree_matrix *m, token *open_delim, token *close_delim)
Definition: oct-parse.cc:9310
OCTINTERP_API tree_statement * make_statement(T *arg)
OCTINTERP_API tree_classdef_superclass * make_classdef_superclass(token *fqident)
Definition: oct-parse.cc:8675
OCTINTERP_API tree_anon_fcn_handle * make_anon_fcn_handle(tree_parameter_list *param_list, tree_expression *expr, const filepos &at_pos)
Definition: oct-parse.cc:6966
OCTINTERP_API tree_command * make_break_command(token *break_tok)
Definition: oct-parse.cc:7522
OCTINTERP_API tree_statement_list * append_statement_list(tree_statement_list *list, char sep, tree_statement *stmt, bool warn_missing_semi)
Definition: oct-parse.cc:9455
OCTINTERP_API bool push_fcn_symtab(void)
Definition: oct-parse.cc:6853
OCTINTERP_API tree_classdef_methods_list * make_classdef_methods_list(tree_function_def *fcn_def)
Definition: oct-parse.cc:8836
OCTINTERP_API tree_expression * make_prefix_op(int op, tree_expression *op1, token *tok_val)
Definition: oct-parse.cc:7234
OCTINTERP_API tree_statement_list * append_function_body(tree_statement_list *body, tree_statement_list *list)
Definition: oct-parse.cc:8225
OCTINTERP_API tree_classdef_enum * make_classdef_enum(tree_identifier *id, tree_expression *expr, comment_list *lc)
Definition: oct-parse.cc:8641
OCTINTERP_API bool validate_param_list(tree_parameter_list *lst, tree_parameter_list::in_or_out type)
Definition: oct-parse.cc:9093
OCTINTERP_API tree_spmd_command * make_spmd_command(token *spmd_tok, tree_statement_list *body, token *end_tok, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:7567
OCTINTERP_API tree_decl_init_list * make_decl_init_list(tree_decl_elt *elt)
Definition: oct-parse.cc:9073
OCTINTERP_API tree_classdef_enum_block * make_classdef_enum_block(token *tok_val, tree_classdef_attribute_list *a, tree_classdef_enum_list *elist, token *end_tok, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:8602
OCTINTERP_API octave_user_function * start_classdef_external_method(tree_identifier *id, tree_parameter_list *pl)
Definition: oct-parse.cc:8768
OCTINTERP_API tree_decl_init_list * append_decl_init_list(tree_decl_init_list *list, tree_decl_elt *elt)
Definition: oct-parse.cc:9079
OCTINTERP_API tree_classdef_body * append_classdef_events_block(tree_classdef_body *body, tree_classdef_events_block *block)
Definition: oct-parse.cc:8754
void classdef_object(const std::shared_ptr< tree_classdef > &obj)
Definition: parse.h:181
OCTINTERP_API tree_index_expression * make_index_expression(tree_expression *expr, tree_argument_list *args, char type)
Definition: oct-parse.cc:8932
OCTINTERP_API tree_args_block_validation_list * append_args_validation_list(tree_args_block_validation_list *list, tree_arg_validation *arg_validation)
Definition: oct-parse.cc:8299
bool m_parsing_subfunctions
Definition: parse.h:748
OCTINTERP_API tree_classdef_superclass_list * append_classdef_superclass(tree_classdef_superclass_list *list, tree_classdef_superclass *elt)
Definition: oct-parse.cc:8681
std::string m_parse_error_msg
Definition: parse.h:734
OCTINTERP_API tree_if_command_list * start_if_command(tree_expression *expr, tree_statement_list *list)
Definition: oct-parse.cc:7595
OCTINTERP_API tree_arg_size_spec * make_arg_size_spec(tree_argument_list *size_args)
Definition: oct-parse.cc:8306
OCTINTERP_API tree_expression * make_postfix_op(int op, tree_expression *op1, token *tok_val)
Definition: oct-parse.cc:7274
OCTINTERP_API tree_expression * finish_array_list(tree_array_list *a, token *open_delim, token *close_delim)
Definition: oct-parse.cc:9246
OCTINTERP_API tree_classdef_events_list * append_classdef_event(tree_classdef_events_list *list, tree_classdef_event *elt)
Definition: oct-parse.cc:8655
OCTINTERP_API tree_if_clause * make_elseif_clause(token *elseif_tok, tree_expression *expr, tree_statement_list *list, comment_list *lc)
Definition: oct-parse.cc:7650
OCTINTERP_API tree_statement_list * set_stmt_print_flag(tree_statement_list *, char, bool)
Definition: oct-parse.cc:9402
OCTINTERP_API tree_expression * finish_cell(tree_cell *c, token *open_delim, token *close_delim)
Definition: oct-parse.cc:9337
OCTINTERP_API 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, comment_list *lc, comment_list *tc)
Definition: oct-parse.cc:8241
bool m_endfunction_found
Definition: parse.h:737
OCTINTERP_API tree_classdef_methods_list * append_classdef_method(tree_classdef_methods_list *list, tree_function_def *fcn_def)
Definition: oct-parse.cc:8849
OCTINTERP_API tree_classdef_body * append_classdef_methods_block(tree_classdef_body *body, tree_classdef_methods_block *block)
Definition: oct-parse.cc:8747
OCTINTERP_API tree_expression * make_boolean_op(int op, tree_expression *op1, token *tok_val, tree_expression *op2)
Definition: oct-parse.cc:7205
bool m_autoloading
Definition: parse.h:740
OCTINTERP_API tree_expression * make_colon_expression(tree_expression *base, tree_expression *limit, tree_expression *incr=nullptr)
Definition: oct-parse.cc:7032
OCTINTERP_API tree_superclass_ref * make_superclass_ref(token *superclassref)
Definition: oct-parse.cc:9379
OCTINTERP_API tree_classdef_enum_list * make_classdef_enum_list(tree_classdef_enum *e)
Definition: oct-parse.cc:8635
OCTINTERP_API void make_script(tree_statement_list *cmds, tree_statement *end_script)
Definition: oct-parse.cc:7897
OCTINTERP_API tree_argument_list * make_argument_list(tree_expression *expr)
Definition: oct-parse.cc:9465
OCTINTERP_API tree_args_block_validation_list * make_args_validation_list(tree_arg_validation *arg_validation)
Definition: oct-parse.cc:8293
OCTINTERP_API tree_classdef_property_list * make_classdef_property_list(tree_classdef_property *prop)
Definition: oct-parse.cc:8483
OCTINTERP_API tree_classdef_attribute * make_classdef_attribute(tree_identifier *id, tree_expression *expr=nullptr)
Definition: oct-parse.cc:8694
OCTINTERP_API tree_classdef_event * make_classdef_event(comment_list *lc, tree_identifier *id)
Definition: oct-parse.cc:8586
OCTINTERP_API tree_arg_validation_fcns * make_arg_validation_fcns(tree_argument_list *fcn_args)
Definition: oct-parse.cc:8314
std::shared_ptr< tree_statement_list > m_stmt_list
Definition: parse.h:793
OCTINTERP_API bool end_token_ok(token *tok, token::end_tok_type expected)
Definition: oct-parse.cc:6845
OCTINTERP_API void maybe_warn_assign_as_truth_value(tree_expression *expr)
Definition: oct-parse.cc:9943
OCTINTERP_API tree_function_def * finish_function(tree_parameter_list *ret_list, octave_user_function *fcn, comment_list *lc, int l, int c)
Definition: oct-parse.cc:8130
static std::string decode_prompt_string(const std::string &s)
Definition: cmd-edit.cc:1271
std::string text(void) const
Definition: comment-list.h:75
bool is_end_of_line(void) const
Definition: comment-list.h:81
void line(int l)
Definition: filepos.h:49
void column(int c)
Definition: filepos.h:50
symbol_scope curr_scope(void) const
Definition: lex.cc:5091
void push(const symbol_scope &scope)
Definition: lex.h:75
symbol_scope parent_scope(void) const
Definition: lex.cc:5100
void mark_as_variables(const std::list< std::string > &lst)
Definition: lex.cc:5248
std::stack< bool > m_parsed_function_name
Definition: lex.h:513
std::string m_current_input_line
Definition: lex.h:483
bool m_looking_at_return_list
Definition: lex.h:368
bool m_reading_classdef_file
Definition: lex.h:438
bool m_allow_command_syntax
Definition: lex.h:358
bool m_looking_at_parameter_list
Definition: lex.h:371
bool m_parsing_classdef_get_method
Definition: lex.h:419
bool m_parsing_classdef_set_method
Definition: lex.h:422
bool m_reading_script_file
Definition: lex.h:435
symbol_table_context m_symtab_context
Definition: lex.h:516
bool m_buffer_function_text
Definition: lex.h:442
std::string m_help_text
Definition: lex.h:489
std::string m_fcn_file_full_name
Definition: lex.h:498
bool m_maybe_classdef_get_set_method
Definition: lex.h:416
std::string m_package_name
Definition: lex.h:504
bool m_parsing_class_method
Definition: lex.h:399
bool m_looking_at_indirect_ref
Definition: lex.h:386
std::string m_dir_name
Definition: lex.h:501
void mark_as_variable(const std::string &nm)
Definition: lex.cc:5239
std::string m_function_text
Definition: lex.h:492
std::string m_fcn_file_name
Definition: lex.h:495
OCTINTERP_API int run(void)
Definition: oct-parse.cc:9633
OCTINTERP_API int run(void)
Definition: oct-parse.cc:9750
std::shared_ptr< input_reader > m_reader
Definition: parse.h:902
interpreter & m_interpreter
Definition: parse.h:900
void install_subfunction(const std::string &name, const octave_value &fval)
Definition: symscope.h:496
void set_primary_parent(const symbol_scope &p)
Definition: symscope.h:615
void mark_primary_fcn_scope(void)
Definition: symscope.h:643
void install_nestfunction(const std::string &name, const octave_value &fval, const symbol_scope &fcn_scope)
Definition: symscope.h:503
void set_nesting_depth(std::size_t depth)
Definition: symscope.h:425
void set_parent(const symbol_scope &p)
Definition: symscope.h:609
void update_nest(void)
Definition: symscope.h:676
void cache_dir_name(const std::string &name)
Definition: symscope.h:627
symbol_record insert(const std::string &name)
Definition: symscope.h:485
void cache_fcn_name(const std::string &name)
Definition: symscope.h:587
void mark_static(void)
Definition: symscope.h:441
void cache_fcn_file_name(const std::string &name)
Definition: symscope.h:621
void cache_name(const std::string &name)
Definition: symscope.h:576
off_t size(void) const
Definition: file-stat.h:128
bool is_newer(const sys::time &time) const
Definition: file-stat.h:152
static std::string base_pathname(const std::string &s)
Definition: oct-env.cc:124
static bool absolute_pathname(const std::string &s)
Definition: oct-env.cc:110
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
Definition: oct-env.cc:131
std::string superclass_class_name(void) const
Definition: token.cc:130
end_tok_type ettype(void) const
Definition: token.cc:116
int line(void) const
Definition: token.h:116
std::string superclass_method_name(void) const
Definition: token.cc:123
octave_value number(void) const
Definition: token.cc:103
@ try_catch_end
Definition: token.h:66
@ unwind_protect_end
Definition: token.h:67
@ while_end
Definition: token.h:69
@ parfor_end
Definition: token.h:63
@ switch_end
Definition: token.h:65
@ classdef_end
Definition: token.h:56
@ events_end
Definition: token.h:58
@ methods_end
Definition: token.h:62
@ function_end
Definition: token.h:60
@ arguments_end
Definition: token.h:55
@ spmd_end
Definition: token.h:68
@ simple_end
Definition: token.h:54
@ properties_end
Definition: token.h:64
@ enumeration_end
Definition: token.h:57
std::string text(void) const
Definition: token.cc:96
int column(void) const
Definition: token.h:117
int token_value(void) const
Definition: token.h:106
filepos beg_pos(void) const
Definition: token.h:109
std::string text_rep(void) const
Definition: token.cc:137
void accept(tree_walker &tw)
void arg_name(tree_expression *name)
tree_arg_validation_fcns * validation_fcns(void)
tree_identifier * class_name(void)
tree_arg_size_spec * size_spec(void)
void mark_as_simple_assign_lhs(void)
Definition: pt-arg-list.h:92
std::list< std::string > variable_names(void) const
Definition: pt-arg-list.cc:116
bool is_valid_lvalue_list(void) const
Definition: pt-arg-list.cc:81
bool is_simple_assign_lhs(void)
Definition: pt-arg-list.h:94
tree_expression * remove_front(void)
Definition: pt-arg-list.h:82
bool has_magic_tilde(void) const
Definition: pt-arg-list.h:72
bool all_elements_are_constant(void) const
void accept(tree_walker &tw)
bool have_doc_string(void) const
Definition: pt-classdef.h:343
void doc_string(const std::string &txt)
Definition: pt-classdef.h:339
void accept(tree_walker &tw)
Definition: pt-classdef.h:820
void accept(tree_walker &tw)
Definition: pt-colon.h:101
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition: pt-colon.cc:53
void stash_original_text(const std::string &s)
Definition: pt-const.h:98
void mark_persistent(void)
Definition: pt-decl.h:195
void mark_global(void)
Definition: pt-decl.h:189
tree_identifier * ident(void)
Definition: pt-decl.h:88
std::list< std::string > variable_names(void) const
Definition: pt-decl.h:148
virtual bool is_identifier(void) const
Definition: pt-exp.h:70
virtual bool is_index_expression(void) const
Definition: pt-exp.h:72
void mark_as_for_cmd_expr(void)
Definition: pt-exp.h:111
tree_expression * set_postfix_index(char type)
Definition: pt-exp.h:121
tree_expression * set_print_flag(bool print)
Definition: pt-exp.h:127
virtual bool is_matrix(void) const
Definition: pt-exp.h:66
virtual std::string name(void) const
Definition: pt-exp.h:105
virtual octave_value evaluate(tree_evaluator &tw, int nargout=1)=0
int paren_count(void) const
Definition: pt-exp.h:92
virtual bool is_assignment_expression(void) const
Definition: pt-exp.h:74
bool is_postfix_indexed(void) const
Definition: pt-exp.h:94
virtual bool is_constant(void) const
Definition: pt-exp.h:64
octave_value function(void)
Definition: pt-cmd.h:119
void accept(tree_walker &tw)
Definition: pt-cmd.h:114
std::string name(void) const
Definition: pt-id.h:73
virtual bool is_black_hole(void) const
Definition: pt-id.h:75
tree_index_expression * append(tree_argument_list *lst=nullptr, char t='(')
Definition: pt-idx.cc:81
void mark_varargs_only(void)
Definition: pt-misc.h:83
void mark_as_formal_parameters(void)
Definition: pt-misc.cc:48
void accept(tree_walker &tw)
Definition: pt-stmt.h:199
int column(void) const
Definition: pt-stmt.cc:127
int line(void) const
Definition: pt-stmt.cc:119
bool is_expression(void) const
Definition: pt-stmt.h:80
void set_expression(tree_expression *e)
Definition: pt-stmt.h:120
tree_expression * expression(void)
Definition: pt-stmt.h:101
void set_print_flag(bool print_flag)
Definition: pt-stmt.cc:64
bool is_null_statement(void) const
Definition: pt-stmt.h:105
virtual int column(void) const
Definition: pt.h:62
void set_location(int l, int c)
Definition: pt.h:68
virtual int line(void) const
Definition: pt.h:60
virtual std::string doc_string(const std::string &="") const
Definition: ov-fcn.h:220
virtual void maybe_relocate_end(void)
Definition: ov-fcn.h:193
void mark_relative(void)
Definition: ov-fcn.h:203
void document(const std::string &ds)
Definition: ov-fcn.h:217
void stash_dir_name(const std::string &dir)
Definition: ov-fcn.h:173
void stash_dispatch_class(const std::string &nm)
Definition: ov-fcn.h:147
std::string name(void) const
Definition: ov-fcn.h:207
void stash_package_name(const std::string &pack)
Definition: ov-fcn.h:151
virtual void accept(octave::tree_walker &)
Definition: ov-fcn.h:224
virtual void stash_subfunction_names(const std::list< std::string > &)
Definition: ov-fcn.h:198
static const octave_value instance
Definition: ov-null-mat.h:52
static const octave_value instance
Definition: ov-null-mat.h:96
static const octave_value instance
Definition: ov-null-mat.h:73
void stash_fcn_file_name(const std::string &nm)
Definition: ov-usr-fcn.h:95
std::string fcn_file_name(void) const
Definition: ov-usr-fcn.h:106
octave::tree_statement_list * body(void)
Definition: ov-usr-fcn.h:119
octave::sys::time time_parsed(void) const
Definition: ov-usr-fcn.h:108
void cache_function_text(const std::string &text, const octave::sys::time &timestamp)
Definition: ov-usr-fcn.cc:119
void stash_fcn_file_time(const octave::sys::time &t)
Definition: ov-usr-fcn.h:100
octave::symbol_scope scope(void)
Definition: ov-usr-fcn.h:93
void stash_trailing_comment(octave::comment_list *tc)
Definition: ov-usr-fcn.h:259
void stash_function_name(const std::string &s)
Definition: ov-usr-fcn.h:310
void mark_as_system_fcn_file(void)
Definition: ov-usr-fcn.cc:340
octave_user_function * define_ret_list(octave::tree_parameter_list *t)
Definition: ov-usr-fcn.cc:240
void mark_as_classdef_method(void)
Definition: ov-usr-fcn.h:372
octave_user_function * user_function_value(bool=false)
Definition: ov-usr-fcn.h:227
int beginning_column(void) const
Definition: ov-usr-fcn.h:242
void mark_as_classdef_constructor(void)
Definition: ov-usr-fcn.h:356
void accept(octave::tree_walker &tw)
Definition: ov-usr-fcn.cc:499
void mark_as_legacy_constructor(void)
Definition: ov-usr-fcn.h:348
std::map< std::string, octave_value > subfunctions(void) const
Definition: ov-usr-fcn.cc:408
void stash_leading_comment(octave::comment_list *lc)
Definition: ov-usr-fcn.h:257
int beginning_line(void) const
Definition: ov-usr-fcn.h:241
void stash_fcn_location(int line, int col)
Definition: ov-usr-fcn.h:235
void stash_fcn_end_location(int line, int col)
Definition: ov-usr-fcn.h:244
void mark_as_legacy_method(void)
Definition: ov-usr-fcn.h:364
void mark_as_subfunction(void)
Definition: ov-usr-fcn.h:312
void mark_as_nested_function(void)
Definition: ov-usr-fcn.h:342
octave_value_list & prepend(const octave_value &val)
Definition: ovl.cc:80
OCTINTERP_API octave_function * function_value(bool silent=false) const
unary_op
Definition: ov.h:77
@ op_hermitian
Definition: ov.h:82
@ op_uminus
Definition: ov.h:80
@ op_not
Definition: ov.h:78
@ op_transpose
Definition: ov.h:81
@ unknown_unary_op
Definition: ov.h:86
@ op_uplus
Definition: ov.h:79
@ op_incr
Definition: ov.h:83
@ op_decr
Definition: ov.h:84
OCTINTERP_API octave_user_function * user_function_value(bool silent=false) const
bool is_defined(void) const
Definition: ov.h:637
assign_op
Definition: ov.h:132
@ op_pow_eq
Definition: ov.h:139
@ op_asn_eq
Definition: ov.h:133
@ op_add_eq
Definition: ov.h:134
@ op_el_pow_eq
Definition: ov.h:143
@ op_mul_eq
Definition: ov.h:136
@ op_div_eq
Definition: ov.h:137
@ op_el_and_eq
Definition: ov.h:144
@ op_el_ldiv_eq
Definition: ov.h:142
@ op_sub_eq
Definition: ov.h:135
@ op_el_mul_eq
Definition: ov.h:140
@ op_el_or_eq
Definition: ov.h:145
@ unknown_assign_op
Definition: ov.h:147
@ op_el_div_eq
Definition: ov.h:141
@ op_ldiv_eq
Definition: ov.h:138
@ magic_colon_t
Definition: ov.h:168
binary_op
Definition: ov.h:90
@ op_ldiv
Definition: ov.h:96
@ op_ne
Definition: ov.h:102
@ unknown_binary_op
Definition: ov.h:111
@ op_el_or
Definition: ov.h:108
@ op_el_ldiv
Definition: ov.h:106
@ op_pow
Definition: ov.h:95
@ op_ge
Definition: ov.h:100
@ op_div
Definition: ov.h:94
@ op_el_pow
Definition: ov.h:105
@ op_mul
Definition: ov.h:93
@ op_add
Definition: ov.h:91
@ op_sub
Definition: ov.h:92
@ op_el_mul
Definition: ov.h:103
@ op_le
Definition: ov.h:98
@ op_lt
Definition: ov.h:97
@ op_gt
Definition: ov.h:101
@ op_eq
Definition: ov.h:99
@ op_el_and
Definition: ov.h:107
@ op_el_div
Definition: ov.h:104
bool isempty(void) const
Definition: ov.h:646
OCTINTERP_API octave_user_code * user_code_value(bool silent=false) const
OCTINTERP_API octave_idx_type length(void) const
std::string m_file_name
Definition: oct-parse.cc:6497
parse_exception(const parse_exception &)=default
parse_exception & operator=(const parse_exception &)=default
int column(void) const
Definition: oct-parse.cc:6488
const char * what(void) const noexcept
Definition: oct-parse.cc:6482
parse_exception(const std::string &message, const std::string &fcn_name="", const std::string &file_name="", int line=-1, int column=-1)
Definition: oct-parse.cc:6464
std::string fcn_name(void) const
Definition: oct-parse.cc:6484
std::string message(void) const
Definition: oct-parse.cc:6479
std::string m_message
Definition: oct-parse.cc:6494
std::string file_name(void) const
Definition: oct-parse.cc:6485
~parse_exception(void)=default
std::string m_fcn_name
Definition: oct-parse.cc:6496
int line(void) const
Definition: oct-parse.cc:6487
void visit_octave_user_script(octave_user_script &script)
Definition: oct-parse.cc:6525
symbol_scope m_scope
Definition: oct-parse.cc:6580
void visit_index_expression(tree_index_expression &idx_expr)
Definition: oct-parse.cc:6559
std::list< parse_exception > error_list(void) const
Definition: oct-parse.cc:6520
void visit_octave_user_function(octave_user_function &fcn)
Definition: oct-parse.cc:6535
symbol_scope get_scope(void) const
Definition: oct-parse.cc:6516
std::list< parse_exception > m_error_list
Definition: oct-parse.cc:6582
~parse_tree_validator(void)=default
bool ok(void) const
Definition: oct-parse.cc:6518
parse_tree_validator & operator=(const parse_tree_validator &)=delete
parse_tree_validator(const parse_tree_validator &)=delete
octave_value builtin_find(const std::string &name, const symbol_scope &search_scope=symbol_scope())
Definition: symtab.cc:190
void install_local_function(const std::string &name, const octave_value &fcn, const std::string &file_name)
Definition: symtab.cc:356
void add_autoload(const std::string &fcn, const std::string &nm)
Definition: pt-eval.cc:4482
void remove_autoload(const std::string &fcn, const std::string &nm)
Definition: pt-eval.cc:4490
octave_map get_autoload_map(void) const
Definition: pt-eval.cc:4422
OCTINTERP_API void print_usage(void)
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:1025
void warning(const char *fmt,...)
Definition: error.cc:1055
void warning_with_id(const char *id, const char *fmt,...)
Definition: error.cc:1070
void parse_error(const char *fmt,...)
Definition: error.cc:1085
void error(const char *fmt,...)
Definition: error.cc:980
void message(const char *name, const char *fmt,...)
Definition: error.cc:948
#define panic_impossible()
Definition: error.h:411
QString name
std::string tilde_expand(const std::string &name)
Definition: file-ops.cc:281
std::string dir_sep_chars(void)
Definition: file-ops.cc:247
std::string dir_sep_str(void)
Definition: file-ops.cc:238
std::ifstream ifstream(const std::string &filename, const std::ios::openmode mode)
Definition: lo-sysdep.cc:400
std::FILE * fopen(const std::string &filename, const std::string &mode)
Definition: lo-sysdep.cc:314
tree_binary_expression * maybe_compound_binary_expression(tree_expression *a, tree_expression *b, int l, int c, octave_value::binary_op t)
Definition: pt-cbinop.cc:203
OCTINTERP_API void cleanup_statement_list(tree_statement_list **lst)
OCTINTERP_API octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
bool iskeyword(const std::string &s)
interpreter & __get_interpreter__(const std::string &who)
OCTINTERP_API 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)
Definition: oct-parse.cc:9790
tree_evaluator & __get_evaluator__(const std::string &who)
OCTINTERP_API 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=false)
OCTINTERP_API void source_file(const std::string &file_name, const std::string &context="", bool verbose=false, bool require_file=true)
OCTINTERP_API std::string get_help_from_file(const std::string &nm, bool &symbol_found, std::string &file)
symbol_table & __get_symbol_table__(const std::string &who)
OCTAVE_EXPORT octave_value_list Feval(octave::interpreter &interp, const octave_value_list &args, int nargout)
Definition: oct-parse.cc:10478
static const yytype_uint8 yyr1[]
Definition: oct-parse.cc:1461
#define yyss
Definition: oct-parse.cc:3066
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: oct-parse.cc:597
#define YYMAXDEPTH
Definition: oct-parse.cc:1711
#define lexer
Definition: oct-parse.cc:146
#define YYSTACK_FREE
Definition: oct-parse.cc:635
static const yytype_int8 yytranslate[]
Definition: oct-parse.cc:749
yysymbol_kind_t
Definition: oct-parse.cc:193
@ YYSYMBOL_END
Definition: oct-parse.cc:251
@ YYSYMBOL_POW
Definition: oct-parse.cc:246
@ YYSYMBOL_spmd_command
Definition: oct-parse.cc:346
@ YYSYMBOL_INPUT_FILE
Definition: oct-parse.cc:290
@ YYSYMBOL_param_list_beg
Definition: oct-parse.cc:349
@ YYSYMBOL_CLASSDEF
Definition: oct-parse.cc:276
@ YYSYMBOL_TRANSPOSE
Definition: oct-parse.cc:243
@ YYSYMBOL_method_decl
Definition: oct-parse.cc:397
@ YYSYMBOL_function_body
Definition: oct-parse.cc:366
@ YYSYMBOL_opt_list
Definition: oct-parse.cc:296
@ YYSYMBOL_class_name
Definition: oct-parse.cc:376
@ YYSYMBOL_7_
Definition: oct-parse.cc:202
@ YYSYMBOL_matrix
Definition: oct-parse.cc:310
@ YYSYMBOL_3_
Definition: oct-parse.cc:198
@ YYSYMBOL_EXPR_NE
Definition: oct-parse.cc:235
@ YYSYMBOL_MINUS_MINUS
Definition: oct-parse.cc:245
@ YYSYMBOL_power_expr
Definition: oct-parse.cc:323
@ YYSYMBOL_param_list2
Definition: oct-parse.cc:354
@ YYSYMBOL_YYUNDEF
Definition: oct-parse.cc:197
@ YYSYMBOL_anon_fcn_begin
Definition: oct-parse.cc:413
@ YYSYMBOL_EXPR_LT
Definition: oct-parse.cc:232
@ YYSYMBOL_class_body1
Definition: oct-parse.cc:388
@ YYSYMBOL_properties_block
Definition: oct-parse.cc:389
@ YYSYMBOL_14_
Definition: oct-parse.cc:209
@ YYSYMBOL_function_beg
Definition: oct-parse.cc:362
@ YYSYMBOL_TRY
Definition: oct-parse.cc:271
@ YYSYMBOL_function_body1
Definition: oct-parse.cc:368
@ YYSYMBOL_parse_error
Definition: oct-parse.cc:415
@ YYSYMBOL_class_property
Definition: oct-parse.cc:393
@ YYSYMBOL_magic_tilde
Definition: oct-parse.cc:319
@ YYSYMBOL_UNTIL
Definition: oct-parse.cc:258
@ YYSYMBOL_classdef_beg
Definition: oct-parse.cc:379
@ YYSYMBOL_enumeration_beg
Definition: oct-parse.cc:408
@ YYSYMBOL_begin_file
Definition: oct-parse.cc:360
@ YYSYMBOL_jump_command
Definition: oct-parse.cc:345
@ YYSYMBOL_HERMITIAN
Definition: oct-parse.cc:242
@ YYSYMBOL_17_
Definition: oct-parse.cc:212
@ YYSYMBOL_IF
Definition: oct-parse.cc:260
@ YYSYMBOL_LEFTDIV
Definition: oct-parse.cc:238
@ YYSYMBOL_enum_block
Definition: oct-parse.cc:407
@ YYSYMBOL_PROPERTIES
Definition: oct-parse.cc:277
@ YYSYMBOL_203_1
Definition: oct-parse.cc:398
@ YYSYMBOL_list1
Definition: oct-parse.cc:298
@ YYSYMBOL_method
Definition: oct-parse.cc:399
@ YYSYMBOL_ELSEIF
Definition: oct-parse.cc:261
@ YYSYMBOL_simple_list
Definition: oct-parse.cc:294
@ YYSYMBOL_property_list1
Definition: oct-parse.cc:392
@ YYSYMBOL_classdef
Definition: oct-parse.cc:380
@ YYSYMBOL_at_first_executable_stmt
Definition: oct-parse.cc:367
@ YYSYMBOL_switch_case
Definition: oct-parse.cc:342
@ YYSYMBOL_case_list1
Definition: oct-parse.cc:341
@ YYSYMBOL_UNARY
Definition: oct-parse.cc:291
@ YYSYMBOL_NUMBER
Definition: oct-parse.cc:248
@ YYSYMBOL_superclass_list1
Definition: oct-parse.cc:385
@ YYSYMBOL_file
Definition: oct-parse.cc:361
@ YYSYMBOL_return_list
Definition: oct-parse.cc:356
@ YYSYMBOL_YYerror
Definition: oct-parse.cc:196
@ YYSYMBOL_BREAK
Definition: oct-parse.cc:266
@ YYSYMBOL_SET
Definition: oct-parse.cc:285
@ YYSYMBOL_arg_name
Definition: oct-parse.cc:373
@ YYSYMBOL_OR_EQ
Definition: oct-parse.cc:226
@ YYSYMBOL_12_
Definition: oct-parse.cc:207
@ YYSYMBOL_constant
Definition: oct-parse.cc:309
@ YYSYMBOL_opt_sep_no_nl
Definition: oct-parse.cc:417
@ YYSYMBOL_push_fcn_symtab
Definition: oct-parse.cc:348
@ YYSYMBOL_EXPR_AND
Definition: oct-parse.cc:229
@ YYSYMBOL_property_list
Definition: oct-parse.cc:391
@ YYSYMBOL_loop_command
Definition: oct-parse.cc:344
@ YYSYMBOL_sep_no_nl
Definition: oct-parse.cc:416
@ YYSYMBOL_methods_block
Definition: oct-parse.cc:394
@ YYSYMBOL_10_
Definition: oct-parse.cc:205
@ YYSYMBOL_LEXICAL_ERROR
Definition: oct-parse.cc:288
@ YYSYMBOL_parsing_local_fcns
Definition: oct-parse.cc:358
@ YYSYMBOL_attr_list1
Definition: oct-parse.cc:382
@ YYSYMBOL_EXPR_LE
Definition: oct-parse.cc:233
@ YYSYMBOL_assign_lhs
Definition: oct-parse.cc:326
@ YYSYMBOL_EXPR_GT
Definition: oct-parse.cc:237
@ YYSYMBOL_FCN
Definition: oct-parse.cc:286
@ YYSYMBOL_CATCH
Definition: oct-parse.cc:272
@ YYSYMBOL_args_validation_list
Definition: oct-parse.cc:372
@ YYSYMBOL_simple_expr
Definition: oct-parse.cc:325
@ YYSYMBOL_if_cmd_list
Definition: oct-parse.cc:335
@ YYSYMBOL_19_n_
Definition: oct-parse.cc:214
@ YYSYMBOL_magic_colon
Definition: oct-parse.cc:318
@ YYSYMBOL_opt_fcn_list
Definition: oct-parse.cc:299
@ YYSYMBOL_enum_list
Definition: oct-parse.cc:409
@ YYSYMBOL_LEFTDIV_EQ
Definition: oct-parse.cc:219
@ YYSYMBOL_events_beg
Definition: oct-parse.cc:403
@ YYSYMBOL_8_
Definition: oct-parse.cc:203
@ YYSYMBOL_EXPR_OR_OR
Definition: oct-parse.cc:228
@ YYSYMBOL_indirect_ref_op
Definition: oct-parse.cc:321
@ YYSYMBOL_function
Definition: oct-parse.cc:365
@ YYSYMBOL_9_
Definition: oct-parse.cc:204
@ YYSYMBOL_cell_or_matrix_row
Definition: oct-parse.cc:314
@ YYSYMBOL_class_event
Definition: oct-parse.cc:406
@ YYSYMBOL_function_end
Definition: oct-parse.cc:364
@ YYSYMBOL_properties_beg
Definition: oct-parse.cc:390
@ YYSYMBOL_fcn_list
Definition: oct-parse.cc:300
@ YYSYMBOL_expression
Definition: oct-parse.cc:328
@ YYSYMBOL_PARFOR
Definition: oct-parse.cc:255
@ YYSYMBOL_METAQUERY
Definition: oct-parse.cc:281
@ YYSYMBOL_args_attr_list
Definition: oct-parse.cc:371
@ YYSYMBOL_DQ_STRING
Definition: oct-parse.cc:252
@ YYSYMBOL_events_list1
Definition: oct-parse.cc:405
@ YYSYMBOL_if_cmd_list1
Definition: oct-parse.cc:336
@ YYSYMBOL_methods_list1
Definition: oct-parse.cc:401
@ YYSYMBOL_ELEFTDIV_EQ
Definition: oct-parse.cc:223
@ YYSYMBOL_11_
Definition: oct-parse.cc:206
@ YYSYMBOL_methods_beg
Definition: oct-parse.cc:395
@ YYSYMBOL_ARGUMENTS
Definition: oct-parse.cc:287
@ YYSYMBOL_param_list
Definition: oct-parse.cc:352
@ YYSYMBOL_superclass_identifier
Definition: oct-parse.cc:306
@ YYSYMBOL_EMUL
Definition: oct-parse.cc:239
@ YYSYMBOL_events_block
Definition: oct-parse.cc:402
@ YYSYMBOL_simple_list1
Definition: oct-parse.cc:295
@ YYSYMBOL_word_list_cmd
Definition: oct-parse.cc:303
@ YYSYMBOL_ENUMERATION
Definition: oct-parse.cc:280
@ YYSYMBOL_SUPERCLASSREF
Definition: oct-parse.cc:282
@ YYSYMBOL_attr_list
Definition: oct-parse.cc:381
@ YYSYMBOL_string
Definition: oct-parse.cc:308
@ YYSYMBOL_superclass_list
Definition: oct-parse.cc:384
@ YYSYMBOL_default_value
Definition: oct-parse.cc:378
@ YYSYMBOL_identifier
Definition: oct-parse.cc:305
@ YYSYMBOL_nl
Definition: oct-parse.cc:419
@ YYSYMBOL_15_
Definition: oct-parse.cc:210
@ YYSYMBOL_6_
Definition: oct-parse.cc:201
@ YYSYMBOL_ELSE
Definition: oct-parse.cc:262
@ YYSYMBOL_primary_expr
Definition: oct-parse.cc:317
@ YYSYMBOL_switch_command
Definition: oct-parse.cc:339
@ YYSYMBOL_FUNC_RET
Definition: oct-parse.cc:268
@ YYSYMBOL_EXPR_GE
Definition: oct-parse.cc:236
@ YYSYMBOL_cell_rows
Definition: oct-parse.cc:313
@ YYSYMBOL_sep
Definition: oct-parse.cc:420
@ YYSYMBOL_END_OF_INPUT
Definition: oct-parse.cc:289
@ YYSYMBOL_CONTINUE
Definition: oct-parse.cc:267
@ YYSYMBOL_EMUL_EQ
Definition: oct-parse.cc:221
@ YYSYMBOL_MUL_EQ
Definition: oct-parse.cc:217
@ YYSYMBOL_EPOW_EQ
Definition: oct-parse.cc:224
@ YYSYMBOL_EPOW
Definition: oct-parse.cc:247
@ YYSYMBOL_FCN_HANDLE
Definition: oct-parse.cc:275
@ YYSYMBOL_opt_param_list
Definition: oct-parse.cc:351
@ YYSYMBOL_attr
Definition: oct-parse.cc:383
@ YYSYMBOL_arguments_block
Definition: oct-parse.cc:369
@ YYSYMBOL_stash_comment
Definition: oct-parse.cc:414
@ YYSYMBOL_WHILE
Definition: oct-parse.cc:256
@ YYSYMBOL_18_
Definition: oct-parse.cc:213
@ YYSYMBOL_class_enum
Definition: oct-parse.cc:411
@ YYSYMBOL_declaration
Definition: oct-parse.cc:330
@ YYSYMBOL_arg_list
Definition: oct-parse.cc:320
@ YYSYMBOL_UNWIND
Definition: oct-parse.cc:269
@ YYSYMBOL_else_clause
Definition: oct-parse.cc:338
@ YYSYMBOL_param_list_end
Definition: oct-parse.cc:350
@ YYSYMBOL_GET
Definition: oct-parse.cc:284
@ YYSYMBOL_matrix_rows
Definition: oct-parse.cc:311
@ YYSYMBOL_SWITCH
Definition: oct-parse.cc:263
@ YYSYMBOL_return_list1
Definition: oct-parse.cc:357
@ YYSYMBOL_SUB_EQ
Definition: oct-parse.cc:216
@ YYSYMBOL_opt_sep
Definition: oct-parse.cc:421
@ YYSYMBOL_fcn_handle
Definition: oct-parse.cc:315
@ YYSYMBOL_decl_init_list
Definition: oct-parse.cc:331
@ YYSYMBOL_YYACCEPT
Definition: oct-parse.cc:292
@ YYSYMBOL_statement
Definition: oct-parse.cc:302
@ YYSYMBOL_EXPR_AND_AND
Definition: oct-parse.cc:227
@ YYSYMBOL_4_
Definition: oct-parse.cc:199
@ YYSYMBOL_EXPR_EQ
Definition: oct-parse.cc:234
@ YYSYMBOL_assign_expr
Definition: oct-parse.cc:327
@ YYSYMBOL_param_list_elt
Definition: oct-parse.cc:355
@ YYSYMBOL_arguments_beg
Definition: oct-parse.cc:370
@ YYSYMBOL_EDIV
Definition: oct-parse.cc:240
@ YYSYMBOL_select_command
Definition: oct-parse.cc:333
@ YYSYMBOL_YYEOF
Definition: oct-parse.cc:195
@ YYSYMBOL_list
Definition: oct-parse.cc:297
@ YYSYMBOL_GLOBAL
Definition: oct-parse.cc:273
@ YYSYMBOL_13_
Definition: oct-parse.cc:208
@ YYSYMBOL_opt_nl
Definition: oct-parse.cc:418
@ YYSYMBOL_decl_elt
Definition: oct-parse.cc:332
@ YYSYMBOL_SPMD
Definition: oct-parse.cc:259
@ YYSYMBOL_AND_EQ
Definition: oct-parse.cc:225
@ YYSYMBOL_size_spec
Definition: oct-parse.cc:375
@ YYSYMBOL_push_script_symtab
Definition: oct-parse.cc:359
@ YYSYMBOL_class_body
Definition: oct-parse.cc:387
@ YYSYMBOL_input
Definition: oct-parse.cc:293
@ YYSYMBOL_oper_expr
Definition: oct-parse.cc:322
@ YYSYMBOL_DO
Definition: oct-parse.cc:257
@ YYSYMBOL_POW_EQ
Definition: oct-parse.cc:220
@ YYSYMBOL_colon_expr
Definition: oct-parse.cc:324
@ YYSYMBOL_methods_list
Definition: oct-parse.cc:400
@ YYSYMBOL_cell
Definition: oct-parse.cc:312
@ YYSYMBOL_SQ_STRING
Definition: oct-parse.cc:253
@ YYSYMBOL_case_list
Definition: oct-parse.cc:340
@ YYSYMBOL_CASE
Definition: oct-parse.cc:264
@ YYSYMBOL_default_case
Definition: oct-parse.cc:343
@ YYSYMBOL_meta_identifier
Definition: oct-parse.cc:307
@ YYSYMBOL_word_list
Definition: oct-parse.cc:304
@ YYSYMBOL_YYEMPTY
Definition: oct-parse.cc:194
@ YYSYMBOL_method_decl1
Definition: oct-parse.cc:396
@ YYSYMBOL_CLEANUP
Definition: oct-parse.cc:270
@ YYSYMBOL_OTHERWISE
Definition: oct-parse.cc:265
@ YYSYMBOL_PERSISTENT
Definition: oct-parse.cc:274
@ YYSYMBOL_EDIV_EQ
Definition: oct-parse.cc:222
@ YYSYMBOL_EXPR_OR
Definition: oct-parse.cc:230
@ YYSYMBOL_STRUCT_ELT
Definition: oct-parse.cc:249
@ YYSYMBOL_fcn_name
Definition: oct-parse.cc:363
@ YYSYMBOL_except_command
Definition: oct-parse.cc:347
@ YYSYMBOL_superclass
Definition: oct-parse.cc:386
@ YYSYMBOL_DIV_EQ
Definition: oct-parse.cc:218
@ YYSYMBOL_16_
Definition: oct-parse.cc:211
@ YYSYMBOL_fcn_list1
Definition: oct-parse.cc:301
@ YYSYMBOL_NAME
Definition: oct-parse.cc:250
@ YYSYMBOL_5_
Definition: oct-parse.cc:200
@ YYSYMBOL_ADD_EQ
Definition: oct-parse.cc:215
@ YYSYMBOL_ELEFTDIV
Definition: oct-parse.cc:241
@ YYSYMBOL_PLUS_PLUS
Definition: oct-parse.cc:244
@ YYSYMBOL_FOR
Definition: oct-parse.cc:254
@ YYSYMBOL_arg_validation
Definition: oct-parse.cc:374
@ YYSYMBOL_enum_list1
Definition: oct-parse.cc:410
@ YYSYMBOL_validation_fcns
Definition: oct-parse.cc:377
@ YYSYMBOL_FQ_IDENT
Definition: oct-parse.cc:283
@ YYSYMBOL_events_list
Definition: oct-parse.cc:404
@ YYSYMBOL_if_command
Definition: oct-parse.cc:334
@ YYSYMBOL_param_list1
Definition: oct-parse.cc:353
@ YYSYMBOL_command
Definition: oct-parse.cc:329
@ YYSYMBOL_elseif_clause
Definition: oct-parse.cc:337
@ YYSYMBOL_METHODS
Definition: oct-parse.cc:278
@ YYSYMBOL_EXPR_NOT
Definition: oct-parse.cc:231
@ YYSYMBOL_stmt_begin
Definition: oct-parse.cc:412
@ YYSYMBOL_EVENTS
Definition: oct-parse.cc:279
@ YYSYMBOL_anon_fcn_handle
Definition: oct-parse.cc:316
#define YY_ASSERT(E)
Definition: oct-parse.cc:617
#define yyerrstatus
Definition: oct-parse.cc:3064
#define YY_(Msgid)
Definition: oct-parse.cc:551
#define YYNOMEM
Definition: oct-parse.cc:1543
#define yypstate
Definition: oct-parse.cc:75
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: oct-parse.cc:598
#define YYNSTATES
Definition: oct-parse.cc:734
#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:613
#define yypstate_clear
Definition: oct-parse.cc:73
#define yypstate_new
Definition: oct-parse.cc:72
short yytype_int16
Definition: oct-parse.cc:462
static const yytype_int16 yydefact[]
Definition: oct-parse.cc:967
#define YYABORT
Definition: oct-parse.cc:1541
#define YYSTACK_BYTES(N)
Definition: oct-parse.cc:678
int octave_pull_parse(octave_pstate *yyps, octave::base_parser &parser)
Definition: oct-parse.cc:3050
yytype_int16 yy_state_t
Definition: oct-parse.cc:538
int octave_push_parse(octave_pstate *yyps, int yypushed_char, OCTAVE_STYPE const *yypushed_val, octave::base_parser &parser)
Definition: oct-parse.cc:3127
static const yytype_int16 yydefgoto[]
Definition: oct-parse.cc:1047
#define YY_REDUCE_PRINT(Rule)
Definition: oct-parse.cc:1694
static LIST_T * list_append(LIST_T *list, ELT_T elt)
Definition: oct-parse.cc:6587
#define YY_CAST(Type, Val)
Definition: oct-parse.cc:174
static const yytype_int16 yypact[]
Definition: oct-parse.cc:903
#define yylex
Definition: oct-parse.cc:76
#define YYMALLOC
Definition: oct-parse.cc:648
#define YY_NULLPTR
Definition: oct-parse.cc:186
static std::string get_file_line(const std::string &name, int line)
Definition: oct-parse.cc:9519
#define YYFINAL
Definition: oct-parse.cc:723
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: oct-parse.cc:827
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: oct-parse.cc:1692
static const yytype_int16 yypgoto[]
Definition: oct-parse.cc:1029
#define YY_INITIAL_VALUE(Value)
Definition: oct-parse.cc:594
#define yyparse
Definition: oct-parse.cc:69
#define YYNTOKENS
Definition: oct-parse.cc:728
unsigned char yytype_uint8
Definition: oct-parse.cc:483
#define YY_STACK_PRINT(Bottom, Top)
Definition: oct-parse.cc:1693
#define YYSIZE_T
Definition: oct-parse.cc:524
#define yydebug
Definition: oct-parse.cc:78
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: oct-parse.cc:612
#define yyssa
Definition: oct-parse.cc:3065
static const yytype_int8 yyr2[]
Definition: oct-parse.cc:1498
#define YYPTRDIFF_T
Definition: oct-parse.cc:510
#define yynerrs
Definition: oct-parse.cc:79
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, OCTAVE_STYPE *yyvaluep, octave::base_parser &parser)
Definition: oct-parse.cc:1753
static std::string end_token_as_string(token::end_tok_type ettype)
Definition: oct-parse.cc:6738
#define yyvsp
Definition: oct-parse.cc:3070
static const yytype_int16 yytable[]
Definition: oct-parse.cc:1067
#define scanner
Definition: oct-parse.cc:147
#define YYACCEPT
Definition: oct-parse.cc:1540
#define yytable_value_is_error(Yyn)
Definition: oct-parse.cc:898
#define YYTRANSLATE(YYX)
Definition: oct-parse.cc:742
#define yyssp
Definition: oct-parse.cc:3067
void * malloc(unsigned)
#define yystacksize
Definition: oct-parse.cc:3071
#define YY_ATTRIBUTE_UNUSED
Definition: oct-parse.cc:568
#define yyvs
Definition: oct-parse.cc:3069
@ YYENOMEM
Definition: oct-parse.cc:1535
static const yytype_uint8 yystos[]
Definition: oct-parse.cc:1399
#define yystate
Definition: oct-parse.cc:3063
#define YYFREE
Definition: oct-parse.cc:654
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition: oct-parse.cc:541
unsigned short yytype_uint16
Definition: oct-parse.cc:494
int octave_lex(OCTAVE_STYPE *, void *)
The main scanner function which does all the work.
Definition: lex.cc:1645
#define YYLAST
Definition: oct-parse.cc:725
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: oct-parse.cc:689
#define yypact_value_is_default(Yyn)
Definition: oct-parse.cc:893
#define YYINITDEPTH
Definition: oct-parse.cc:1700
#define yypush_parse
Definition: oct-parse.cc:70
signed char yytype_int8
Definition: oct-parse.cc:454
void free(void *)
#define YYERROR
Definition: oct-parse.cc:1542
#define YYSIZEOF(X)
Definition: oct-parse.cc:534
#define OCTAVE_YYUSE(X,...)
Definition: oct-parse.cc:155
static const yytype_int16 yycheck[]
Definition: oct-parse.cc:1232
#define YYSTACK_ALLOC
Definition: oct-parse.cc:634
#define yyvsa
Definition: oct-parse.cc:3068
#define YYDPRINTF(Args)
Definition: oct-parse.cc:1691
#define YY_USE(E)
Definition: oct-parse.cc:574
#define yyerror
Definition: oct-parse.cc:77
@ YYPUSH_MORE
Definition: oct-parse.h:228
@ LEFTDIV
Definition: oct-parse.h:88
@ EDIV
Definition: oct-parse.h:90
@ PLUS_PLUS
Definition: oct-parse.h:94
@ OCTAVE_EOF
Definition: oct-parse.h:62
@ DIV_EQ
Definition: oct-parse.h:68
@ NUMBER
Definition: oct-parse.h:98
@ ELEFTDIV
Definition: oct-parse.h:91
@ EXPR_LT
Definition: oct-parse.h:82
@ DQ_STRING
Definition: oct-parse.h:102
@ MINUS_MINUS
Definition: oct-parse.h:95
@ POW
Definition: oct-parse.h:96
@ TRANSPOSE
Definition: oct-parse.h:93
@ OR_EQ
Definition: oct-parse.h:76
@ EXPR_AND_AND
Definition: oct-parse.h:77
@ EXPR_NE
Definition: oct-parse.h:85
@ 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:97
@ 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
@ 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
@ FOR
Definition: oct-parse.h:104
@ EXPR_NOT
Definition: oct-parse.h:81
@ EXPR_LE
Definition: oct-parse.h:83
@ PARFOR
Definition: oct-parse.h:105
@ EXPR_GE
Definition: oct-parse.h:86
@ OCTAVE_EMPTY
Definition: oct-parse.h:61
@ EXPR_OR
Definition: oct-parse.h:80
@ EMUL
Definition: oct-parse.h:89
@ LEFTDIV_EQ
Definition: oct-parse.h:69
@ HERMITIAN
Definition: oct-parse.h:92
@ EDIV_EQ
Definition: oct-parse.h:72
@ ELEFTDIV_EQ
Definition: oct-parse.h:73
@ EXPR_GT
Definition: oct-parse.h:87
@ EXPR_EQ
Definition: oct-parse.h:84
@ GLOBAL
Definition: oct-parse.h:123
@ EXPR_AND
Definition: oct-parse.h:79
static int input(yyscan_t yyscanner)
#define yylval
#define yyalloc
yysymbol_kind_t
short yytype_int16
unsigned char yytype_uint8
signed char yytype_int8
yytype_int8 yy_state_t
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
#define octave_stdout
Definition: pager.h:314
int octave_debug
yy_state_fast_t yystate
Definition: oct-parse.cc:1719
yy_state_t * yyssp
Definition: oct-parse.cc:1732
yy_state_t * yyss
Definition: oct-parse.cc:1731
OCTAVE_STYPE * yyvsp
Definition: oct-parse.cc:1737
OCTAVE_STYPE * yyvs
Definition: oct-parse.cc:1736
OCTAVE_STYPE yyvs_alloc
Definition: oct-parse.cc:670
yy_state_t yyss_alloc
Definition: oct-parse.cc:669
std::string undo_string_escapes(const std::string &s)
Definition: utils.cc:1029
std::string fcn_file_in_path(const std::string &name)
Definition: utils.cc:739
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)
Definition: variables.cc:587
F77_RET_T len
Definition: xerbla.cc:61