GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
oct-parse.cc
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41/* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48/* Identify Bison output, and Bison version. */
49#define YYBISON 30802
50
51/* Bison version string. */
52#define YYBISON_VERSION "3.8.2"
53
54/* Skeleton name. */
55#define YYSKELETON_NAME "yacc.c"
56
57/* Pure parsers. */
58#define YYPURE 1
59
60/* Push parsers. */
61#define YYPUSH 1
62
63/* Pull parsers. */
64#define YYPULL 1
65
66/* Substitute the type names. */
67#define YYSTYPE OCTAVE_STYPE
68/* Substitute the variable and function names. */
69#define yyparse octave_parse
70#define yypush_parse octave_push_parse
71#define yypull_parse octave_pull_parse
72#define yypstate_new octave_pstate_new
73#define yypstate_clear octave_pstate_clear
74#define yypstate_delete octave_pstate_delete
75#define yypstate octave_pstate
76#define yylex octave_lex
77#define yyerror octave_error
78#define yydebug octave_debug
79#define yynerrs octave_nerrs
80
81/* First part of user prologue. */
82#line 30 "../libinterp/parse-tree/oct-parse.yy"
83
84
85#define YYDEBUG 1
86
87#if defined (HAVE_CONFIG_H)
88# include "config.h"
89#endif
90
91#include <cstdio>
92#include <cstdlib>
93
94#include <iostream>
95#include <map>
96#include <sstream>
97
98#include "Matrix.h"
99#include "cmd-edit.h"
100#include "cmd-hist.h"
101#include "file-ops.h"
102#include "file-stat.h"
103#include "oct-env.h"
104#include "oct-time.h"
105#include "quit.h"
106
107#include "Cell.h"
108#include "anon-fcn-validator.h"
109#include "builtin-defun-decls.h"
110#include "defun.h"
111#include "dynamic-ld.h"
112#include "error.h"
113#include "input.h"
114#include "interpreter-private.h"
115#include "interpreter.h"
116#include "lex.h"
117#include "load-path.h"
118#include "lo-sysdep.h"
119#include "oct-hist.h"
120#include "oct-map.h"
121#include "ov-classdef.h"
122#include "ov-fcn-handle.h"
123#include "ov-usr-fcn.h"
124#include "ov-null-mat.h"
125#include "pager.h"
126#include "parse.h"
127#include "pt-all.h"
128#include "pt-eval.h"
129#include "separator-list.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(...)
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_ = 19, /* ',' */
215 YYSYMBOL_20_ = 20, /* ';' */
216 YYSYMBOL_21_n_ = 21, /* '\n' */
217 YYSYMBOL_ADD_EQ = 22, /* ADD_EQ */
218 YYSYMBOL_SUB_EQ = 23, /* SUB_EQ */
219 YYSYMBOL_MUL_EQ = 24, /* MUL_EQ */
220 YYSYMBOL_DIV_EQ = 25, /* DIV_EQ */
221 YYSYMBOL_LEFTDIV_EQ = 26, /* LEFTDIV_EQ */
222 YYSYMBOL_POW_EQ = 27, /* POW_EQ */
223 YYSYMBOL_EMUL_EQ = 28, /* EMUL_EQ */
224 YYSYMBOL_EDIV_EQ = 29, /* EDIV_EQ */
225 YYSYMBOL_ELEFTDIV_EQ = 30, /* ELEFTDIV_EQ */
226 YYSYMBOL_EPOW_EQ = 31, /* EPOW_EQ */
227 YYSYMBOL_AND_EQ = 32, /* AND_EQ */
228 YYSYMBOL_OR_EQ = 33, /* OR_EQ */
229 YYSYMBOL_EXPR_AND_AND = 34, /* EXPR_AND_AND */
230 YYSYMBOL_EXPR_OR_OR = 35, /* EXPR_OR_OR */
231 YYSYMBOL_EXPR_AND = 36, /* EXPR_AND */
232 YYSYMBOL_EXPR_OR = 37, /* EXPR_OR */
233 YYSYMBOL_EXPR_LT = 38, /* EXPR_LT */
234 YYSYMBOL_EXPR_LE = 39, /* EXPR_LE */
235 YYSYMBOL_EXPR_EQ = 40, /* EXPR_EQ */
236 YYSYMBOL_EXPR_NE = 41, /* EXPR_NE */
237 YYSYMBOL_EXPR_GE = 42, /* EXPR_GE */
238 YYSYMBOL_EXPR_GT = 43, /* EXPR_GT */
239 YYSYMBOL_LEFTDIV = 44, /* LEFTDIV */
240 YYSYMBOL_EMUL = 45, /* EMUL */
241 YYSYMBOL_EDIV = 46, /* EDIV */
242 YYSYMBOL_ELEFTDIV = 47, /* ELEFTDIV */
243 YYSYMBOL_HERMITIAN = 48, /* HERMITIAN */
244 YYSYMBOL_TRANSPOSE = 49, /* TRANSPOSE */
245 YYSYMBOL_PLUS_PLUS = 50, /* PLUS_PLUS */
246 YYSYMBOL_MINUS_MINUS = 51, /* MINUS_MINUS */
247 YYSYMBOL_POW = 52, /* POW */
248 YYSYMBOL_EPOW = 53, /* EPOW */
249 YYSYMBOL_NUMBER = 54, /* NUMBER */
250 YYSYMBOL_CONSTANT = 55, /* CONSTANT */
251 YYSYMBOL_STRUCT_ELT = 56, /* STRUCT_ELT */
252 YYSYMBOL_NAME = 57, /* NAME */
253 YYSYMBOL_END = 58, /* END */
254 YYSYMBOL_DQ_STRING = 59, /* DQ_STRING */
255 YYSYMBOL_SQ_STRING = 60, /* SQ_STRING */
256 YYSYMBOL_FOR = 61, /* FOR */
257 YYSYMBOL_PARFOR = 62, /* PARFOR */
258 YYSYMBOL_WHILE = 63, /* WHILE */
259 YYSYMBOL_DO = 64, /* DO */
260 YYSYMBOL_UNTIL = 65, /* UNTIL */
261 YYSYMBOL_SPMD = 66, /* SPMD */
262 YYSYMBOL_IF = 67, /* IF */
263 YYSYMBOL_ELSEIF = 68, /* ELSEIF */
264 YYSYMBOL_ELSE = 69, /* ELSE */
265 YYSYMBOL_SWITCH = 70, /* SWITCH */
266 YYSYMBOL_CASE = 71, /* CASE */
267 YYSYMBOL_OTHERWISE = 72, /* OTHERWISE */
268 YYSYMBOL_BREAK = 73, /* BREAK */
269 YYSYMBOL_CONTINUE = 74, /* CONTINUE */
270 YYSYMBOL_RETURN = 75, /* RETURN */
271 YYSYMBOL_UNWIND = 76, /* UNWIND */
272 YYSYMBOL_CLEANUP = 77, /* CLEANUP */
273 YYSYMBOL_TRY = 78, /* TRY */
274 YYSYMBOL_CATCH = 79, /* CATCH */
275 YYSYMBOL_GLOBAL = 80, /* GLOBAL */
276 YYSYMBOL_PERSISTENT = 81, /* PERSISTENT */
277 YYSYMBOL_FCN_HANDLE = 82, /* FCN_HANDLE */
278 YYSYMBOL_CLASSDEF = 83, /* CLASSDEF */
279 YYSYMBOL_PROPERTIES = 84, /* PROPERTIES */
280 YYSYMBOL_METHODS = 85, /* METHODS */
281 YYSYMBOL_EVENTS = 86, /* EVENTS */
282 YYSYMBOL_ENUMERATION = 87, /* ENUMERATION */
283 YYSYMBOL_METAQUERY = 88, /* METAQUERY */
284 YYSYMBOL_SUPERCLASSREF = 89, /* SUPERCLASSREF */
285 YYSYMBOL_FQ_IDENT = 90, /* FQ_IDENT */
286 YYSYMBOL_GET = 91, /* GET */
287 YYSYMBOL_SET = 92, /* SET */
288 YYSYMBOL_FUNCTION = 93, /* FUNCTION */
289 YYSYMBOL_ARGUMENTS = 94, /* ARGUMENTS */
290 YYSYMBOL_LEXICAL_ERROR = 95, /* LEXICAL_ERROR */
291 YYSYMBOL_END_OF_INPUT = 96, /* END_OF_INPUT */
292 YYSYMBOL_INPUT_FILE = 97, /* INPUT_FILE */
293 YYSYMBOL_UNARY = 98, /* UNARY */
294 YYSYMBOL_YYACCEPT = 99, /* $accept */
295 YYSYMBOL_input = 100, /* input */
296 YYSYMBOL_simple_list = 101, /* simple_list */
297 YYSYMBOL_simple_list1 = 102, /* simple_list1 */
298 YYSYMBOL_statement_list = 103, /* statement_list */
299 YYSYMBOL_opt_list = 104, /* opt_list */
300 YYSYMBOL_list = 105, /* list */
301 YYSYMBOL_list1 = 106, /* list1 */
302 YYSYMBOL_opt_fcn_list = 107, /* opt_fcn_list */
303 YYSYMBOL_fcn_list = 108, /* fcn_list */
304 YYSYMBOL_fcn_list1 = 109, /* fcn_list1 */
305 YYSYMBOL_statement = 110, /* statement */
306 YYSYMBOL_word_list_cmd = 111, /* word_list_cmd */
307 YYSYMBOL_word_list = 112, /* word_list */
308 YYSYMBOL_identifier = 113, /* identifier */
309 YYSYMBOL_superclass_identifier = 114, /* superclass_identifier */
310 YYSYMBOL_meta_identifier = 115, /* meta_identifier */
311 YYSYMBOL_string = 116, /* string */
312 YYSYMBOL_constant = 117, /* constant */
313 YYSYMBOL_matrix = 118, /* matrix */
314 YYSYMBOL_matrix_rows = 119, /* matrix_rows */
315 YYSYMBOL_cell = 120, /* cell */
316 YYSYMBOL_cell_rows = 121, /* cell_rows */
317 YYSYMBOL_cell_or_matrix_row = 122, /* cell_or_matrix_row */
318 YYSYMBOL_fcn_handle = 123, /* fcn_handle */
319 YYSYMBOL_anon_fcn_handle = 124, /* anon_fcn_handle */
320 YYSYMBOL_primary_expr = 125, /* primary_expr */
321 YYSYMBOL_magic_colon = 126, /* magic_colon */
322 YYSYMBOL_magic_tilde = 127, /* magic_tilde */
323 YYSYMBOL_arg_list = 128, /* arg_list */
324 YYSYMBOL_indirect_ref_op = 129, /* indirect_ref_op */
325 YYSYMBOL_oper_expr = 130, /* oper_expr */
326 YYSYMBOL_power_expr = 131, /* power_expr */
327 YYSYMBOL_colon_expr = 132, /* colon_expr */
328 YYSYMBOL_simple_expr = 133, /* simple_expr */
329 YYSYMBOL_assign_lhs = 134, /* assign_lhs */
330 YYSYMBOL_assign_expr = 135, /* assign_expr */
331 YYSYMBOL_expression = 136, /* expression */
332 YYSYMBOL_command = 137, /* command */
333 YYSYMBOL_declaration = 138, /* declaration */
334 YYSYMBOL_decl_init_list = 139, /* decl_init_list */
335 YYSYMBOL_decl_elt = 140, /* decl_elt */
336 YYSYMBOL_select_command = 141, /* select_command */
337 YYSYMBOL_if_command = 142, /* if_command */
338 YYSYMBOL_if_clause_list = 143, /* if_clause_list */
339 YYSYMBOL_if_clause = 144, /* if_clause */
340 YYSYMBOL_elseif_clause = 145, /* elseif_clause */
341 YYSYMBOL_else_clause = 146, /* else_clause */
342 YYSYMBOL_switch_command = 147, /* switch_command */
343 YYSYMBOL_case_list = 148, /* case_list */
344 YYSYMBOL_case_list1 = 149, /* case_list1 */
345 YYSYMBOL_switch_case = 150, /* switch_case */
346 YYSYMBOL_default_case = 151, /* default_case */
347 YYSYMBOL_loop_command = 152, /* loop_command */
348 YYSYMBOL_jump_command = 153, /* jump_command */
349 YYSYMBOL_spmd_command = 154, /* spmd_command */
350 YYSYMBOL_except_command = 155, /* except_command */
351 YYSYMBOL_push_fcn_symtab = 156, /* push_fcn_symtab */
352 YYSYMBOL_param_list_beg = 157, /* param_list_beg */
353 YYSYMBOL_param_list_end = 158, /* param_list_end */
354 YYSYMBOL_opt_param_list = 159, /* opt_param_list */
355 YYSYMBOL_param_list = 160, /* param_list */
356 YYSYMBOL_param_list1 = 161, /* param_list1 */
357 YYSYMBOL_param_list2 = 162, /* param_list2 */
358 YYSYMBOL_param_list_elt = 163, /* param_list_elt */
359 YYSYMBOL_return_list = 164, /* return_list */
360 YYSYMBOL_return_list1 = 165, /* return_list1 */
361 YYSYMBOL_parsing_local_fcns = 166, /* parsing_local_fcns */
362 YYSYMBOL_push_script_symtab = 167, /* push_script_symtab */
363 YYSYMBOL_begin_file = 168, /* begin_file */
364 YYSYMBOL_file = 169, /* file */
365 YYSYMBOL_function_beg = 170, /* function_beg */
366 YYSYMBOL_fcn_name = 171, /* fcn_name */
367 YYSYMBOL_function_end = 172, /* function_end */
368 YYSYMBOL_function = 173, /* function */
369 YYSYMBOL_function_body = 174, /* function_body */
370 YYSYMBOL_arguments_block_list = 175, /* arguments_block_list */
371 YYSYMBOL_arguments_block = 176, /* arguments_block */
372 YYSYMBOL_arguments_beg = 177, /* arguments_beg */
373 YYSYMBOL_args_attr_list = 178, /* args_attr_list */
374 YYSYMBOL_args_validation_list = 179, /* args_validation_list */
375 YYSYMBOL_arg_name = 180, /* arg_name */
376 YYSYMBOL_arg_validation = 181, /* arg_validation */
377 YYSYMBOL_size_spec = 182, /* size_spec */
378 YYSYMBOL_class_name = 183, /* class_name */
379 YYSYMBOL_validation_fcns = 184, /* validation_fcns */
380 YYSYMBOL_classdef_beg = 185, /* classdef_beg */
381 YYSYMBOL_classdef = 186, /* classdef */
382 YYSYMBOL_attr_list = 187, /* attr_list */
383 YYSYMBOL_attr_list1 = 188, /* attr_list1 */
384 YYSYMBOL_attr = 189, /* attr */
385 YYSYMBOL_superclass_list = 190, /* superclass_list */
386 YYSYMBOL_superclass_list1 = 191, /* superclass_list1 */
387 YYSYMBOL_superclass = 192, /* superclass */
388 YYSYMBOL_class_body = 193, /* class_body */
389 YYSYMBOL_class_body1 = 194, /* class_body1 */
390 YYSYMBOL_properties_block = 195, /* properties_block */
391 YYSYMBOL_properties_beg = 196, /* properties_beg */
392 YYSYMBOL_property_list = 197, /* property_list */
393 YYSYMBOL_property_list1 = 198, /* property_list1 */
394 YYSYMBOL_class_property = 199, /* class_property */
395 YYSYMBOL_methods_block = 200, /* methods_block */
396 YYSYMBOL_methods_beg = 201, /* methods_beg */
397 YYSYMBOL_method_decl1 = 202, /* method_decl1 */
398 YYSYMBOL_method_decl = 203, /* method_decl */
399 YYSYMBOL_204_1 = 204, /* $@1 */
400 YYSYMBOL_method = 205, /* method */
401 YYSYMBOL_method_list = 206, /* method_list */
402 YYSYMBOL_method_list1 = 207, /* method_list1 */
403 YYSYMBOL_events_block = 208, /* events_block */
404 YYSYMBOL_events_beg = 209, /* events_beg */
405 YYSYMBOL_event_list = 210, /* event_list */
406 YYSYMBOL_event_list1 = 211, /* event_list1 */
407 YYSYMBOL_class_event = 212, /* class_event */
408 YYSYMBOL_enum_block = 213, /* enum_block */
409 YYSYMBOL_enumeration_beg = 214, /* enumeration_beg */
410 YYSYMBOL_enum_list = 215, /* enum_list */
411 YYSYMBOL_enum_list1 = 216, /* enum_list1 */
412 YYSYMBOL_class_enum = 217, /* class_enum */
413 YYSYMBOL_stmt_begin = 218, /* stmt_begin */
414 YYSYMBOL_anon_fcn_begin = 219, /* anon_fcn_begin */
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_sep = 223, /* sep */
419 YYSYMBOL_opt_sep = 224 /* opt_sep */
422
423
424
425
426#ifdef short
427# undef short
428#endif
429
430/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
431 <limits.h> and (if available) <stdint.h> are included
432 so that the code can choose integer types of a good width. */
433
434#ifndef __PTRDIFF_MAX__
435# include <limits.h> /* INFRINGES ON USER NAME SPACE */
436# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
437# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
438# define YY_STDINT_H
439# endif
440#endif
441
442/* Narrow types that promote to a signed type and that can represent a
443 signed or unsigned integer of at least N bits. In tables they can
444 save space and decrease cache pressure. Promoting to a signed type
445 helps avoid bugs in integer arithmetic. */
446
447#ifdef __INT_LEAST8_MAX__
448typedef __INT_LEAST8_TYPE__ yytype_int8;
449#elif defined YY_STDINT_H
450typedef int_least8_t yytype_int8;
451#else
452typedef signed char yytype_int8;
453#endif
454
455#ifdef __INT_LEAST16_MAX__
456typedef __INT_LEAST16_TYPE__ yytype_int16;
457#elif defined YY_STDINT_H
458typedef int_least16_t yytype_int16;
459#else
460typedef short yytype_int16;
461#endif
462
463/* Work around bug in HP-UX 11.23, which defines these macros
464 incorrectly for preprocessor constants. This workaround can likely
465 be removed in 2023, as HPE has promised support for HP-UX 11.23
466 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
467 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
468#ifdef __hpux
469# undef UINT_LEAST8_MAX
470# undef UINT_LEAST16_MAX
471# define UINT_LEAST8_MAX 255
472# define UINT_LEAST16_MAX 65535
473#endif
474
475#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
476typedef __UINT_LEAST8_TYPE__ yytype_uint8;
477#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
478 && UINT_LEAST8_MAX <= INT_MAX)
479typedef uint_least8_t yytype_uint8;
480#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
481typedef unsigned char yytype_uint8;
482#else
483typedef short yytype_uint8;
484#endif
485
486#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
487typedef __UINT_LEAST16_TYPE__ yytype_uint16;
488#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
489 && UINT_LEAST16_MAX <= INT_MAX)
490typedef uint_least16_t yytype_uint16;
491#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
492typedef unsigned short yytype_uint16;
493#else
494typedef int yytype_uint16;
495#endif
496
497#ifndef YYPTRDIFF_T
498# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
499# define YYPTRDIFF_T __PTRDIFF_TYPE__
500# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
501# elif defined PTRDIFF_MAX
502# ifndef ptrdiff_t
503# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
504# endif
505# define YYPTRDIFF_T ptrdiff_t
506# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
507# else
508# define YYPTRDIFF_T long
509# define YYPTRDIFF_MAXIMUM LONG_MAX
510# endif
511#endif
512
513#ifndef YYSIZE_T
514# ifdef __SIZE_TYPE__
515# define YYSIZE_T __SIZE_TYPE__
516# elif defined size_t
517# define YYSIZE_T size_t
518# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
519# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
520# define YYSIZE_T size_t
521# else
522# define YYSIZE_T unsigned
523# endif
524#endif
525
526#define YYSIZE_MAXIMUM \
527 YY_CAST (YYPTRDIFF_T, \
528 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
529 ? YYPTRDIFF_MAXIMUM \
530 : YY_CAST (YYSIZE_T, -1)))
531
532#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
533
534
535/* Stored state numbers (used for stacks). */
537
538/* State numbers in computations. */
539typedef int yy_state_fast_t;
540
541#ifndef YY_
542# if defined YYENABLE_NLS && YYENABLE_NLS
543# if ENABLE_NLS
544# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
545# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
546# endif
547# endif
548# ifndef YY_
549# define YY_(Msgid) Msgid
550# endif
551#endif
552
553
554#ifndef YY_ATTRIBUTE_PURE
555# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
556# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
557# else
558# define YY_ATTRIBUTE_PURE
559# endif
560#endif
561
562#ifndef YY_ATTRIBUTE_UNUSED
563# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
564# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
565# else
566# define YY_ATTRIBUTE_UNUSED
567# endif
568#endif
569
570/* Suppress unused-variable warnings by "using" E. */
571#if ! defined lint || defined __GNUC__
572# define YY_USE(E) ((void) (E))
573#else
574# define YY_USE(E) /* empty */
575#endif
576
577/* Suppress an incorrect diagnostic about yylval being uninitialized. */
578#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
579# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
580# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
581 _Pragma ("GCC diagnostic push") \
582 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
583# else
584# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
585 _Pragma ("GCC diagnostic push") \
586 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
587 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
588# endif
589# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
590 _Pragma ("GCC diagnostic pop")
591#else
592# define YY_INITIAL_VALUE(Value) Value
593#endif
594#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
595# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
596# define YY_IGNORE_MAYBE_UNINITIALIZED_END
597#endif
598#ifndef YY_INITIAL_VALUE
599# define YY_INITIAL_VALUE(Value) /* Nothing. */
600#endif
601
602#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
603# define YY_IGNORE_USELESS_CAST_BEGIN \
604 _Pragma ("GCC diagnostic push") \
605 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
606# define YY_IGNORE_USELESS_CAST_END \
607 _Pragma ("GCC diagnostic pop")
608#endif
609#ifndef YY_IGNORE_USELESS_CAST_BEGIN
610# define YY_IGNORE_USELESS_CAST_BEGIN
611# define YY_IGNORE_USELESS_CAST_END
612#endif
613
614
615#define YY_ASSERT(E) ((void) (0 && (E)))
616
617#if !defined yyoverflow
618
619/* The parser invokes alloca or malloc; define the necessary symbols. */
620
621# ifdef YYSTACK_ALLOC
622 /* Pacify GCC's 'empty if-body' warning. */
623# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
624# ifndef YYSTACK_ALLOC_MAXIMUM
625 /* The OS might guarantee only one guard page at the bottom of the stack,
626 and a page size can be as small as 4096 bytes. So we cannot safely
627 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
628 to allow for a few compiler-allocated temporary stack slots. */
629# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
630# endif
631# else
632# define YYSTACK_ALLOC YYMALLOC
633# define YYSTACK_FREE YYFREE
634# ifndef YYSTACK_ALLOC_MAXIMUM
635# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
636# endif
637# if (defined __cplusplus && ! defined EXIT_SUCCESS \
638 && ! ((defined YYMALLOC || defined malloc) \
639 && (defined YYFREE || defined free)))
640# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
641# ifndef EXIT_SUCCESS
642# define EXIT_SUCCESS 0
643# endif
644# endif
645# ifndef YYMALLOC
646# define YYMALLOC malloc
647# if ! defined malloc && ! defined EXIT_SUCCESS
648void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
649# endif
650# endif
651# ifndef YYFREE
652# define YYFREE free
653# if ! defined free && ! defined EXIT_SUCCESS
654void free (void *); /* INFRINGES ON USER NAME SPACE */
655# endif
656# endif
657# endif
658#endif /* !defined yyoverflow */
659
660#if (! defined yyoverflow \
661 && (! defined __cplusplus \
662 || (defined OCTAVE_STYPE_IS_TRIVIAL && OCTAVE_STYPE_IS_TRIVIAL)))
663
664/* A type that is properly aligned for any stack member. */
665union yyalloc
666{
667 yy_state_t yyss_alloc;
668 YYSTYPE yyvs_alloc;
669};
670
671/* The size of the maximum gap between one aligned stack and the next. */
672# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
673
674/* The size of an array large to enough to hold all stacks, each with
675 N elements. */
676# define YYSTACK_BYTES(N) \
677 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
678 + YYSTACK_GAP_MAXIMUM)
679
680# define YYCOPY_NEEDED 1
681
682/* Relocate STACK from its old location to the new one. The
683 local variables YYSIZE and YYSTACKSIZE give the old and new number of
684 elements in the stack, and YYPTR gives the new location of the
685 stack. Advance YYPTR to a properly aligned location for the next
686 stack. */
687# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
688 do \
689 { \
690 YYPTRDIFF_T yynewbytes; \
691 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
692 Stack = &yyptr->Stack_alloc; \
693 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
694 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
695 } \
696 while (0)
697
698#endif
699
700#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
701/* Copy COUNT objects from SRC to DST. The source and destination do
702 not overlap. */
703# ifndef YYCOPY
704# if defined __GNUC__ && 1 < __GNUC__
705# define YYCOPY(Dst, Src, Count) \
706 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
707# else
708# define YYCOPY(Dst, Src, Count) \
709 do \
710 { \
711 YYPTRDIFF_T yyi; \
712 for (yyi = 0; yyi < (Count); yyi++) \
713 (Dst)[yyi] = (Src)[yyi]; \
714 } \
715 while (0)
716# endif
717# endif
718#endif /* !YYCOPY_NEEDED */
719
720/* YYFINAL -- State number of the termination state. */
721#define YYFINAL 120
722/* YYLAST -- Last index in YYTABLE. */
723#define YYLAST 1520
724
725/* YYNTOKENS -- Number of terminals. */
726#define YYNTOKENS 99
727/* YYNNTS -- Number of nonterminals. */
728#define YYNNTS 126
729/* YYNRULES -- Number of rules. */
730#define YYNRULES 309
731/* YYNSTATES -- Number of states. */
732#define YYNSTATES 529
733
734/* YYMAXUTOK -- Last valid token kind. */
735#define YYMAXUTOK 334
736
737
738/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
739 as returned by yylex, with out-of-bounds checking. */
740#define YYTRANSLATE(YYX) \
741 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
742 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
743 : YYSYMBOL_YYUNDEF)
744
745/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
746 as returned by yylex. */
747static const yytype_int8 yytranslate[] =
748{
749 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750 21, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752 2, 2, 2, 10, 2, 2, 2, 2, 2, 2,
753 11, 12, 7, 6, 19, 5, 17, 8, 2, 2,
754 2, 2, 2, 2, 2, 2, 2, 2, 4, 20,
755 2, 3, 2, 2, 18, 2, 2, 2, 2, 2,
756 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
758 2, 13, 2, 14, 2, 2, 2, 2, 2, 2,
759 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
761 2, 2, 2, 15, 2, 16, 9, 2, 2, 2,
762 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
764 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766 2, 2, 2, 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, 1, 2, 22, 23,
775 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
776 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
777 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
778 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
779 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
780 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
781 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
782 94, 95, 96, 97, 98
783};
784
785#if OCTAVE_DEBUG
786/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
787static const yytype_int16 yyrline[] =
788{
789 0, 411, 411, 422, 433, 440, 447, 456, 460, 462,
790 466, 477, 478, 482, 492, 494, 499, 500, 504, 514,
791 516, 520, 522, 524, 536, 546, 548, 556, 561, 565,
792 569, 571, 575, 577, 581, 585, 587, 591, 595, 597,
793 610, 611, 618, 620, 627, 634, 643, 651, 662, 675,
794 677, 679, 681, 686, 688, 690, 692, 696, 700, 704,
795 706, 708, 710, 712, 714, 718, 725, 727, 729, 731,
796 739, 747, 755, 763, 765, 767, 769, 771, 773, 775,
797 777, 779, 781, 783, 785, 787, 789, 791, 793, 795,
798 797, 799, 801, 805, 807, 809, 811, 819, 827, 835,
799 843, 845, 847, 849, 851, 853, 855, 857, 861, 869,
800 879, 881, 883, 885, 887, 889, 891, 893, 895, 897,
801 899, 901, 905, 917, 919, 921, 923, 925, 927, 929,
802 931, 933, 935, 937, 939, 941, 945, 960, 967, 975,
803 977, 979, 981, 983, 985, 987, 995, 1000, 1007, 1009,
804 1013, 1015, 1023, 1025, 1033, 1043, 1045, 1049, 1053, 1058,
805 1059, 1067, 1082, 1083, 1085, 1087, 1091, 1093, 1097, 1107,
806 1115, 1125, 1129, 1137, 1148, 1159, 1176, 1181, 1186, 1194,
807 1208, 1216, 1224, 1239, 1251, 1268, 1278, 1279, 1283, 1290,
808 1302, 1303, 1320, 1322, 1326, 1328, 1336, 1344, 1362, 1379,
809 1381, 1391, 1395, 1404, 1408, 1435, 1465, 1474, 1484, 1493,
810 1504, 1516, 1550, 1554, 1560, 1564, 1571, 1577, 1585, 1602,
811 1611, 1612, 1626, 1631, 1646, 1650, 1658, 1669, 1670, 1683,
812 1684, 1690, 1691, 1707, 1725, 1742, 1743, 1753, 1755, 1759,
813 1761, 1763, 1765, 1770, 1775, 1788, 1790, 1794, 1799, 1803,
814 1814, 1816, 1818, 1820, 1822, 1830, 1838, 1846, 1857, 1871,
815 1879, 1883, 1895, 1897, 1930, 1934, 1948, 1955, 1960, 1967,
816 1970, 1969, 1983, 1985, 1990, 1994, 2005, 2007, 2017, 2031,
817 2039, 2043, 2054, 2056, 2066, 2070, 2084, 2092, 2096, 2107,
818 2109, 2119, 2128, 2135, 2142, 2148, 2152, 2154, 2156, 2158,
819 2163, 2164, 2168, 2170, 2172, 2174, 2176, 2178, 2183, 2184
820};
821#endif
822
823/** Accessing symbol of state STATE. */
824#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
825
826#if OCTAVE_DEBUG || 0
827/* The user-facing name of the symbol whose (internal) number is
828 YYSYMBOL. No bounds checking. */
829static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
830
831/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
832 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
833static const char *const yytname[] =
834{
835 "\"end of file\"", "error", "\"invalid token\"", "'='", "':'", "'-'",
836 "'+'", "'*'", "'/'", "'~'", "'!'", "'('", "')'", "'['", "']'", "'{'",
837 "'}'", "'.'", "'@'", "','", "';'", "'\\n'", "ADD_EQ", "SUB_EQ", "MUL_EQ",
838 "DIV_EQ", "LEFTDIV_EQ", "POW_EQ", "EMUL_EQ", "EDIV_EQ", "ELEFTDIV_EQ",
839 "EPOW_EQ", "AND_EQ", "OR_EQ", "EXPR_AND_AND", "EXPR_OR_OR", "EXPR_AND",
840 "EXPR_OR", "EXPR_LT", "EXPR_LE", "EXPR_EQ", "EXPR_NE", "EXPR_GE",
841 "EXPR_GT", "LEFTDIV", "EMUL", "EDIV", "ELEFTDIV", "HERMITIAN",
842 "TRANSPOSE", "PLUS_PLUS", "MINUS_MINUS", "POW", "EPOW", "NUMBER",
843 "CONSTANT", "STRUCT_ELT", "NAME", "END", "DQ_STRING", "SQ_STRING", "FOR",
844 "PARFOR", "WHILE", "DO", "UNTIL", "SPMD", "IF", "ELSEIF", "ELSE",
845 "SWITCH", "CASE", "OTHERWISE", "BREAK", "CONTINUE", "RETURN", "UNWIND",
846 "CLEANUP", "TRY", "CATCH", "GLOBAL", "PERSISTENT", "FCN_HANDLE",
847 "CLASSDEF", "PROPERTIES", "METHODS", "EVENTS", "ENUMERATION",
848 "METAQUERY", "SUPERCLASSREF", "FQ_IDENT", "GET", "SET", "FUNCTION",
849 "ARGUMENTS", "LEXICAL_ERROR", "END_OF_INPUT", "INPUT_FILE", "UNARY",
850 "$accept", "input", "simple_list", "simple_list1", "statement_list",
851 "opt_list", "list", "list1", "opt_fcn_list", "fcn_list", "fcn_list1",
852 "statement", "word_list_cmd", "word_list", "identifier",
853 "superclass_identifier", "meta_identifier", "string", "constant",
854 "matrix", "matrix_rows", "cell", "cell_rows", "cell_or_matrix_row",
855 "fcn_handle", "anon_fcn_handle", "primary_expr", "magic_colon",
856 "magic_tilde", "arg_list", "indirect_ref_op", "oper_expr", "power_expr",
857 "colon_expr", "simple_expr", "assign_lhs", "assign_expr", "expression",
858 "command", "declaration", "decl_init_list", "decl_elt", "select_command",
859 "if_command", "if_clause_list", "if_clause", "elseif_clause",
860 "else_clause", "switch_command", "case_list", "case_list1",
861 "switch_case", "default_case", "loop_command", "jump_command",
862 "spmd_command", "except_command", "push_fcn_symtab", "param_list_beg",
863 "param_list_end", "opt_param_list", "param_list", "param_list1",
864 "param_list2", "param_list_elt", "return_list", "return_list1",
865 "parsing_local_fcns", "push_script_symtab", "begin_file", "file",
866 "function_beg", "fcn_name", "function_end", "function", "function_body",
867 "arguments_block_list", "arguments_block", "arguments_beg",
868 "args_attr_list", "args_validation_list", "arg_name", "arg_validation",
869 "size_spec", "class_name", "validation_fcns", "classdef_beg", "classdef",
870 "attr_list", "attr_list1", "attr", "superclass_list", "superclass_list1",
871 "superclass", "class_body", "class_body1", "properties_block",
872 "properties_beg", "property_list", "property_list1", "class_property",
873 "methods_block", "methods_beg", "method_decl1", "method_decl", "$@1",
874 "method", "method_list", "method_list1", "events_block", "events_beg",
875 "event_list", "event_list1", "class_event", "enum_block",
876 "enumeration_beg", "enum_list", "enum_list1", "class_enum", "stmt_begin",
877 "anon_fcn_begin", "parse_error", "sep_no_nl", "opt_sep_no_nl", "sep",
878 "opt_sep", YY_NULLPTR
879};
880
881static const char *
882yysymbol_name (yysymbol_kind_t yysymbol)
883{
884 return yytname[yysymbol];
885}
886#endif
887
888#define YYPACT_NINF (-376)
889
890#define yypact_value_is_default(Yyn) \
891 ((Yyn) == YYPACT_NINF)
892
893#define YYTABLE_NINF (-301)
894
895#define yytable_value_is_error(Yyn) \
896 0
897
898/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
899 STATE-NUM. */
900static const yytype_int16 yypact[] =
901{
902 516, -376, 1292, 1292, 1292, 1292, 1281, 1038, 1038, 6,
903 -376, -376, 1292, 1292, -376, -376, -376, -376, 1351, 1362,
904 1281, 113, 113, 113, 1281, -376, -376, -376, 113, 113,
905 1, 1, -376, -376, -376, -376, 68, -3, 175, -376,
906 -376, -12, -376, -376, -376, -376, -376, -376, -376, -376,
907 -376, 1441, -376, 607, 696, -376, -376, -376, -376, -376,
908 -376, 151, -376, -376, -376, -376, -376, -376, 14, -27,
909 113, -376, 20, -376, -376, 204, -376, -376, 275, 275,
910 275, 275, 79, -376, 1292, 1266, 102, -376, -376, -376,
911 101, -376, 131, -376, -376, 28, -376, 275, 275, 1281,
912 321, 145, 1281, 147, -376, -376, -376, -376, 89, 121,
913 938, 100, 1281, 113, 97, -19, 187, 1, -376, 1,
914 -376, -376, -376, 776, -376, -12, -376, 1292, 1292, 1292,
915 1292, 1292, 1104, 1119, -376, 1292, 1292, 1292, 1292, -376,
916 -376, -376, -376, 1377, 1377, 17, 1292, 1292, 1292, 1292,
917 1292, 1292, 1292, 1292, 1292, 1292, 1281, 1281, 1281, 1281,
918 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 113,
919 113, -376, 120, -376, -376, 115, 857, 18, 179, 192,
920 218, 222, 6, -376, -376, -376, 211, -376, 1038, 1266,
921 -376, 1038, -376, -376, -376, -376, 228, 231, -376, 1023,
922 708, 1281, 775, 1281, 113, 1281, -376, -376, -376, -376,
923 -376, 113, -376, -376, -376, 167, 113, -376, 113, 1281,
924 -376, -376, -376, 1456, 1467, 1467, 275, 275, -376, 34,
925 -376, 136, 275, 275, 275, 275, 1377, 1377, 1377, 1377,
926 1377, 1377, -376, 176, 176, 1281, -376, 226, 310, 343,
927 333, -376, -376, -376, -376, -376, -376, -376, -376, -376,
928 -376, -376, -376, -376, -376, -376, -376, -376, -376, -376,
929 1281, -376, -376, -376, -376, 240, -376, -376, -376, 65,
930 1, 1, 37, 113, -376, 1266, -376, -376, -376, -376,
931 -376, -376, -376, -1, -376, -376, 1281, -376, 1281, -376,
932 212, -376, 695, -376, 113, 113, 113, 214, 167, -376,
933 -376, 216, 938, -376, 1292, -376, 1266, -376, 176, 176,
934 176, 176, 176, 176, 1185, 1200, -376, -376, 30, 264,
935 -376, 25, 1, 113, -376, 1, -376, -376, -376, 6,
936 -376, -39, 609, -376, 265, 113, 260, 113, -376, -376,
937 -376, 1281, -376, -376, -376, -376, -376, 225, 440, -376,
938 55, -376, 156, 1281, -376, -376, 113, 1, 1, 281,
939 57, -376, 113, 194, -376, 113, -376, -376, -376, -376,
940 113, -376, 113, 113, 227, 1281, 233, -376, -376, -376,
941 -376, 277, -376, -376, -376, 1281, 113, 25, 256, 199,
942 -376, 113, -376, -39, -376, 609, 285, 239, -376, 286,
943 -376, 113, -376, -376, -376, -376, 210, 114, 45, -376,
944 194, -376, -376, 1, 1, -376, 113, -376, -376, -376,
945 -376, -376, -376, -376, 245, 113, -376, 113, -376, 113,
946 -376, 113, -376, 113, 210, -376, -376, 292, -376, 113,
947 296, 250, -376, 114, 240, 240, 240, 240, -376, -376,
948 23, 251, 1266, -376, 1, -376, -376, -376, -376, -376,
949 1, 32, 1, 1, 296, -376, 59, -376, 295, 296,
950 253, 113, -376, 48, 311, -376, -376, -376, -376, 255,
951 113, -376, 258, 113, -376, 306, 262, 113, -376, -376,
952 -376, 1266, 315, -376, -376, 23, -376, -376, -376, -376,
953 39, -376, 1, 1281, -376, 1, 191, 1281, -376, 1,
954 -376, -376, 309, -376, -376, -376, 6, -376, -376
955};
956
957/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
958 Performed when YYTABLE does not specify something else to do. Zero
959 means the default is an error. */
960static const yytype_int16 yydefact[] =
961{
962 0, 295, 0, 0, 0, 0, 0, 40, 40, 0,
963 296, 297, 0, 0, 32, 27, 30, 31, 0, 0,
964 0, 308, 308, 308, 0, 176, 177, 178, 308, 308,
965 0, 0, 46, 29, 28, 294, 0, 0, 300, 8,
966 23, 49, 55, 54, 33, 50, 52, 53, 51, 138,
967 66, 110, 111, 136, 0, 137, 21, 22, 139, 140,
968 152, 159, 155, 153, 141, 142, 143, 144, 0, 0,
969 308, 4, 0, 145, 5, 301, 6, 49, 82, 81,
970 79, 80, 0, 57, 58, 41, 0, 35, 60, 61,
971 42, 59, 0, 38, 184, 0, 293, 77, 78, 0,
972 122, 0, 0, 0, 292, 302, 303, 304, 0, 309,
973 11, 0, 0, 308, 0, 0, 150, 146, 148, 147,
974 1, 2, 3, 301, 7, 24, 25, 0, 0, 0,
975 0, 0, 0, 0, 65, 0, 0, 0, 0, 73,
976 74, 67, 68, 0, 0, 0, 0, 0, 0, 0,
977 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
978 0, 0, 0, 0, 0, 0, 0, 0, 0, 308,
979 308, 156, 0, 206, 203, 0, 11, 0, 0, 0,
980 207, 0, 186, 298, 299, 56, 44, 34, 40, 43,
981 37, 40, 189, 58, 195, 194, 0, 191, 192, 0,
982 0, 0, 0, 0, 308, 0, 305, 306, 307, 10,
983 12, 308, 14, 179, 292, 162, 308, 182, 308, 0,
984 149, 9, 26, 108, 86, 85, 87, 88, 69, 0,
985 71, 0, 91, 89, 90, 92, 0, 0, 0, 0,
986 0, 0, 93, 83, 84, 0, 75, 120, 121, 118,
987 119, 112, 113, 114, 117, 115, 116, 123, 124, 125,
988 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
989 0, 160, 154, 204, 233, 235, 201, 196, 199, 0,
990 0, 0, 0, 308, 187, 45, 36, 62, 63, 64,
991 39, 185, 188, 0, 48, 47, 0, 292, 0, 292,
992 0, 171, 309, 13, 308, 308, 308, 0, 164, 166,
993 163, 0, 11, 151, 0, 70, 0, 72, 107, 106,
994 104, 105, 102, 103, 0, 0, 94, 95, 0, 0,
995 292, 0, 0, 308, 198, 0, 208, 209, 207, 186,
996 214, 0, 11, 193, 0, 308, 123, 308, 170, 15,
997 157, 0, 169, 161, 167, 165, 180, 0, 109, 96,
998 0, 98, 0, 0, 100, 76, 308, 0, 0, 239,
999 0, 237, 308, 16, 200, 308, 210, 211, 212, 219,
1000 308, 216, 308, 308, 0, 0, 0, 292, 181, 97,
1001 99, 0, 158, 241, 242, 0, 308, 0, 243, 0,
1002 17, 308, 19, 0, 215, 11, 220, 0, 172, 0,
1003 174, 308, 101, 240, 236, 238, 0, 248, 308, 205,
1004 18, 213, 217, 0, 0, 173, 308, 168, 247, 245,
1005 259, 266, 279, 286, 0, 308, 250, 308, 251, 308,
1006 252, 308, 253, 308, 0, 244, 20, 0, 224, 308,
1007 227, 0, 234, 249, 235, 235, 235, 235, 246, 221,
1008 309, 0, 0, 222, 229, 175, 254, 255, 256, 257,
1009 260, 183, 280, 287, 227, 218, 0, 230, 231, 227,
1010 0, 308, 262, 267, 0, 273, 269, 272, 276, 0,
1011 308, 284, 0, 308, 282, 0, 0, 308, 289, 223,
1012 228, 0, 225, 264, 258, 309, 261, 268, 270, 265,
1013 183, 278, 281, 0, 285, 288, 0, 0, 263, 0,
1014 277, 283, 0, 290, 232, 226, 267, 271, 291
1015};
1016
1017/* YYPGOTO[NTERM-NUM]. */
1018static const yytype_int16 yypgoto[] =
1019{
1020 -376, -376, -376, -376, 33, 21, -376, -376, -376, -376,
1021 -376, 4, -376, -376, 0, -376, -376, -17, -376, -376,
1022 -376, -376, -376, -2, -376, -376, -56, -167, -88, -83,
1023 -87, 8, -23, -376, 106, 7, -376, 3, -376, -376,
1024 298, -81, -376, -376, -376, -376, -376, -376, -376, -376,
1025 -376, 22, 26, -376, -376, -376, -376, -376, -376, -376,
1026 2, -8, -376, -376, 43, 266, -376, -376, -376, -376,
1027 -376, -376, 58, -33, -357, 12, -376, -28, -376, -376,
1028 -376, -71, -375, -376, -376, -376, -376, -376, -210, -376,
1029 -7, -376, -376, -53, -376, -376, -61, -376, -376, -376,
1030 -111, -58, -376, -123, -376, -376, -110, -376, -376, -52,
1031 -376, -376, -376, -109, -51, -376, -376, -376, -108, -199,
1032 -376, -376, 366, 368, -206, 60
1033};
1034
1035/* YYDEFGOTO[NTERM-NUM]. */
1036static const yytype_int16 yydefgoto[] =
1037{
1038 0, 36, 37, 38, 340, 209, 210, 211, 399, 400,
1039 401, 212, 40, 125, 77, 42, 43, 44, 45, 46,
1040 86, 47, 92, 87, 48, 49, 50, 88, 89, 90,
1041 145, 51, 243, 52, 53, 54, 55, 91, 57, 58,
1042 117, 118, 59, 60, 61, 62, 171, 172, 63, 307,
1043 308, 309, 310, 64, 65, 66, 67, 68, 95, 292,
1044 283, 284, 196, 197, 198, 484, 279, 333, 69, 70,
1045 71, 72, 182, 378, 73, 341, 380, 381, 382, 424,
1046 449, 450, 463, 464, 478, 502, 275, 276, 332, 370,
1047 371, 417, 418, 429, 434, 435, 436, 437, 480, 481,
1048 482, 438, 439, 486, 487, 519, 488, 489, 490, 440,
1049 441, 492, 493, 494, 442, 443, 496, 497, 498, 204,
1050 199, 74, 75, 76, 109, 110
1051};
1052
1053/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1054 positive, shift that token. If negative, reduce the rule whose
1055 number is the opposite. If YYTABLE_NINF, syntax error. */
1056static const yytype_int16 yytable[] =
1057{
1058 41, 96, 186, 56, 39, 302, 93, 194, 193, 82,
1059 78, 79, 80, 81, 195, 304, 402, 94, 121, 376,
1060 97, 98, 287, 104, 126, 101, 103, 113, 245, 192,
1061 116, 116, 277, 177, 367, 368, 220, 193, 220, 217,
1062 -190, 363, 206, 207, 208, 177, 315, 16, 17, 229,
1063 231, -197, 177, 316, 108, 111, 15, 377, 15, 94,
1064 218, 114, 115, 446, 105, 106, 107, 389, 120, 396,
1065 174, 500, 180, 246, 316, 15, 397, 15, 316, 334,
1066 15, 444, 15, 112, 335, 15, 364, 242, 242, 15,
1067 -274, 185, 80, 122, 15, 116, 15, -275, 345, 499,
1068 347, 288, 82, 175, 503, 82, 200, 173, 222, 202,
1069 41, 178, 179, 56, 485, 214, 187, 116, 287, 116,
1070 189, 244, 188, 41, 100, 100, 56, 221, 178, 179,
1071 176, 366, 105, 106, 107, 223, 224, 225, 226, 227,
1072 206, 207, 208, 232, 233, 234, 235, 190, 201, 287,
1073 203, 191, 317, 485, 205, 316, 328, 328, 213, 257,
1074 258, 259, 260, 261, 262, 263, 264, 265, 266, 267,
1075 268, 269, 390, 215, 216, 316, 41, 278, 272, 56,
1076 242, 242, 242, 242, 242, 242, 286, 324, 411, 290,
1077 219, 325, 289, 134, 10, 11, 280, 288, 430, 431,
1078 432, 433, 295, 271, 297, 194, 299, 524, 301, 281,
1079 316, 273, 195, 318, 319, 320, 321, 322, 323, 169,
1080 170, -197, 313, 183, 184, 282, 326, 327, 288, 270,
1081 285, 328, 328, 328, 328, 328, 328, 300, 305, 306,
1082 291, 360, 362, 460, 470, 471, 472, 473, 329, 311,
1083 293, 331, 247, 248, 249, 250, 251, 252, 253, 254,
1084 255, 256, 148, 149, 150, 151, 152, 153, 154, 155,
1085 348, 303, 353, 330, 356, 505, 365, 383, 312, 385,
1086 336, 337, 338, 388, 395, 408, 132, -183, 289, 412,
1087 133, 410, 134, 116, 416, 419, 423, 425, 426, 344,
1088 428, 346, 41, 452, 459, 56, 349, 462, 465, 475,
1089 501, 504, 41, 509, 508, 56, 511, 513, 517, 289,
1090 514, 528, 358, 139, 140, 141, 142, 143, 144, 119,
1091 354, 369, 372, 357, 355, 374, 343, 350, 181, 352,
1092 339, 375, 41, 342, 146, 56, 148, 149, 150, 151,
1093 152, 153, 154, 155, 387, 146, 147, 148, 149, 150,
1094 151, 152, 153, 154, 155, 351, 391, 393, 394, 148,
1095 421, 150, 151, 152, 153, 154, 155, 422, 384, 476,
1096 386, 150, 151, 152, 153, 154, 155, 403, 409, 474,
1097 415, 458, 466, 373, 518, 467, 527, 369, 413, 392,
1098 520, 468, 469, 521, 123, 41, 124, 523, 56, 0,
1099 0, 0, 0, 404, 0, 0, 407, 0, 516, 0,
1100 0, 0, 0, 447, 448, 0, 0, 0, 0, 0,
1101 0, 0, 398, 0, 0, 342, 0, 0, 0, 0,
1102 405, 0, 406, 0, 427, 128, 129, 130, 131, 0,
1103 0, 132, 0, 0, 0, 133, 414, 134, 0, 451,
1104 448, 420, 0, 0, 477, 0, 0, 0, 0, 0,
1105 479, 483, 491, 495, 0, 507, 0, 0, 445, 0,
1106 0, 0, 0, 0, 135, 136, 137, 138, 139, 140,
1107 141, 142, 143, 144, 0, 453, 0, 454, 0, 455,
1108 0, 456, 0, 457, 0, 479, 0, 0, 0, 461,
1109 483, 0, 491, 0, 0, 495, 522, 1, 507, 526,
1110 525, 2, 3, 0, 0, 4, 5, 6, 0, 7,
1111 0, 8, 0, 0, 9, 10, 11, -300, 0, 0,
1112 0, 506, 0, 0, 0, 0, 0, 0, 0, 0,
1113 510, 0, 0, 512, 0, 0, 0, 515, 0, 0,
1114 0, 0, 0, 0, 0, 0, 12, 13, 0, 0,
1115 14, 0, 0, 15, 0, 16, 17, 18, 19, 20,
1116 21, 0, 22, 23, 0, 0, 24, 0, 0, 25,
1117 26, 27, 28, 0, 29, 0, 30, 31, 32, 0,
1118 0, 0, 0, 0, 33, 34, 0, 0, 0, -183,
1119 -122, 35, -300, -202, 2, 3, 0, 0, 4, 5,
1120 6, 0, 7, 0, 8, 0, 0, 9, 0, -122,
1121 -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
1122 -122, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1123 155, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1124 13, 0, 0, 14, 0, 0, 15, 0, 16, 17,
1125 18, 19, 20, 21, 0, 22, 23, 0, 0, 24,
1126 0, 0, 25, 26, 27, 28, 0, 29, 0, 30,
1127 31, 32, 0, 0, 0, 0, 0, 33, 34, 156,
1128 2, 3, -183, 379, 4, 5, 6, 0, 7, 0,
1129 8, 296, 0, 9, 206, 207, 208, 0, 157, 158,
1130 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1131 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
1132 167, 168, 0, 0, 0, 12, 13, 0, 0, 14,
1133 0, 0, 15, 0, 16, 17, 18, 19, 20, 21,
1134 0, 22, 23, 0, 0, 24, 0, 0, 25, 26,
1135 27, 28, 0, 29, 0, 30, 31, 32, 298, 0,
1136 0, 2, 3, 33, 34, 4, 5, 6, -183, 7,
1137 0, 8, 0, 0, 9, 183, 184, 157, 158, 159,
1138 160, 161, 162, 163, 164, 165, 166, 167, 168, 0,
1139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1140 0, 0, 0, 0, 0, 0, 12, 13, 0, 0,
1141 14, 0, 0, 15, 0, 16, 17, 18, 19, 20,
1142 21, 0, 22, 23, 0, 0, 24, 0, 0, 25,
1143 26, 27, 28, 0, 29, 0, 30, 31, 32, 0,
1144 0, 0, 2, 3, 33, 34, 4, 5, 6, -183,
1145 7, 0, 8, 0, 0, 9, 0, 0, 0, 0,
1146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1148 0, 0, 0, 0, 0, 0, 0, 12, 13, 0,
1149 0, 14, 0, 0, 15, 0, 16, 17, 18, 19,
1150 20, 21, 0, 22, 23, 0, 0, 24, 0, 0,
1151 25, 26, 27, 28, 0, 29, 0, 30, 31, 32,
1152 274, 0, 0, 2, 3, 33, 34, 4, 5, 6,
1153 -183, 7, 0, 8, 0, 0, 9, 0, 0, 0,
1154 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1156 0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
1157 0, 0, 14, 0, 0, 15, 0, 16, 17, 18,
1158 19, 20, 21, 0, 22, 23, 0, 0, 24, 0,
1159 0, 25, 26, 27, 28, 0, 29, 0, 30, 31,
1160 32, 0, 0, 0, 294, 0, 33, 34, 2, 3,
1161 0, -183, 4, 5, 6, 0, 7, 0, 8, 0,
1162 0, 9, 83, 2, 3, 0, 0, 84, 5, 6,
1163 0, 7, 0, 8, 0, 0, 9, 85, 0, 0,
1164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1165 0, 0, 0, 12, 13, 0, 0, 14, 0, 0,
1166 15, 0, 16, 17, 0, 0, 0, 0, 12, 13,
1167 0, 0, 14, 0, 0, 15, 0, 16, 17, 0,
1168 0, 0, 0, 0, 0, 32, 0, 0, 83, 2,
1169 3, 33, 34, 84, 5, 6, 228, 7, 0, 8,
1170 32, 0, 9, 83, 2, 3, 33, 34, 84, 5,
1171 6, 0, 7, 0, 8, 230, 0, 9, 0, 0,
1172 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1173 0, 0, 0, 0, 12, 13, 0, 0, 14, 0,
1174 0, 15, 0, 16, 17, 0, 0, 0, 0, 12,
1175 13, 0, 0, 14, 0, 0, 15, 0, 16, 17,
1176 0, 0, 0, 0, 0, 0, 32, 0, 0, 83,
1177 2, 3, 33, 34, 84, 5, 6, 359, 7, 0,
1178 8, 32, 0, 9, 83, 2, 3, 33, 34, 84,
1179 5, 6, 0, 7, 0, 8, 361, 0, 9, 0,
1180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1181 0, 0, 0, 0, 0, 12, 13, 0, 0, 14,
1182 0, 0, 15, 0, 16, 17, 0, 0, 0, 0,
1183 12, 13, 0, 0, 14, 0, 0, 15, 0, 16,
1184 17, 0, 0, 0, 0, 0, 0, 32, 0, 0,
1185 83, 2, 3, 33, 34, 84, 5, 6, 0, 7,
1186 0, 8, 32, 0, 9, 0, 2, 3, 33, 34,
1187 4, 5, 6, 0, 7, 0, 8, 2, 3, 9,
1188 0, 4, 5, 6, 0, 7, 0, 8, 0, 0,
1189 0, 0, 0, 0, 0, 0, 12, 13, 0, 0,
1190 14, 0, 0, 15, 0, 16, 17, 0, 0, 0,
1191 0, 12, 13, 0, 0, 14, 0, 0, 15, 0,
1192 16, 17, 12, 13, 0, 0, 14, 0, 32, 15,
1193 0, 16, 17, 0, 33, 34, 2, 3, 0, 0,
1194 4, 5, 99, 32, 7, 0, 8, 2, 3, 33,
1195 34, 4, 5, 102, 32, 7, 0, 8, 0, 0,
1196 33, 34, 236, 237, 0, 0, 238, 239, 6, 0,
1197 7, 0, 8, 0, 0, 0, 0, 0, 0, 0,
1198 0, 12, 13, 0, 0, 14, 0, 0, 15, 0,
1199 16, 17, 12, 13, 0, 0, 14, 0, 0, 15,
1200 0, 16, 17, 0, 0, 0, 0, 240, 241, 0,
1201 0, 14, 0, 32, 15, 0, 16, 17, 0, 33,
1202 34, 0, 0, 0, 32, 127, 128, 129, 130, 131,
1203 33, 34, 132, 0, 0, 0, 133, 0, 134, 32,
1204 314, 128, 129, 130, 131, 33, 34, 132, 0, 0,
1205 0, 133, 0, 134, 130, 131, 0, 0, 132, 0,
1206 0, 0, 133, 0, 134, 135, 136, 137, 138, 139,
1207 140, 141, 142, 143, 144, 0, 0, 0, 0, 0,
1208 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1209 0, 135, 136, 137, 138, 139, 140, 141, 142, 143,
1210 144
1211};
1212
1213static const yytype_int16 yycheck[] =
1214{
1215 0, 9, 85, 0, 0, 211, 8, 95, 9, 6,
1216 2, 3, 4, 5, 95, 214, 373, 11, 21, 58,
1217 12, 13, 189, 20, 41, 18, 19, 24, 11, 1,
1218 30, 31, 14, 13, 9, 10, 117, 9, 119, 58,
1219 12, 11, 19, 20, 21, 13, 12, 59, 60, 132,
1220 133, 3, 13, 19, 21, 22, 57, 96, 57, 11,
1221 79, 28, 29, 420, 19, 20, 21, 12, 0, 12,
1222 97, 12, 72, 56, 19, 57, 19, 57, 19, 14,
1223 57, 36, 57, 23, 19, 57, 56, 143, 144, 57,
1224 58, 12, 84, 96, 57, 95, 57, 58, 297, 474,
1225 299, 189, 99, 70, 479, 102, 99, 93, 125, 102,
1226 110, 91, 92, 110, 471, 112, 14, 117, 285, 119,
1227 19, 144, 20, 123, 18, 19, 123, 123, 91, 92,
1228 70, 330, 19, 20, 21, 127, 128, 129, 130, 131,
1229 19, 20, 21, 135, 136, 137, 138, 16, 3, 316,
1230 3, 20, 16, 510, 65, 19, 243, 244, 58, 156,
1231 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
1232 167, 168, 16, 113, 77, 19, 176, 177, 58, 176,
1233 236, 237, 238, 239, 240, 241, 188, 11, 387, 191,
1234 3, 15, 189, 17, 19, 20, 17, 285, 84, 85,
1235 86, 87, 199, 170, 201, 293, 203, 16, 205, 17,
1236 19, 96, 293, 236, 237, 238, 239, 240, 241, 68,
1237 69, 3, 219, 19, 20, 3, 50, 51, 316, 169,
1238 19, 318, 319, 320, 321, 322, 323, 204, 71, 72,
1239 12, 324, 325, 449, 454, 455, 456, 457, 245, 216,
1240 19, 11, 146, 147, 148, 149, 150, 151, 152, 153,
1241 154, 155, 36, 37, 38, 39, 40, 41, 42, 43,
1242 58, 211, 58, 270, 58, 481, 12, 12, 218, 19,
1243 280, 281, 282, 58, 3, 58, 11, 93, 285, 12,
1244 15, 58, 17, 293, 38, 96, 11, 58, 12, 296,
1245 90, 298, 302, 58, 12, 302, 302, 11, 58, 58,
1246 15, 58, 312, 58, 3, 312, 58, 11, 3, 316,
1247 58, 12, 314, 48, 49, 50, 51, 52, 53, 31,
1248 308, 331, 332, 312, 308, 335, 293, 304, 72, 306,
1249 282, 339, 342, 283, 34, 342, 36, 37, 38, 39,
1250 40, 41, 42, 43, 351, 34, 35, 36, 37, 38,
1251 39, 40, 41, 42, 43, 305, 363, 367, 368, 36,
1252 403, 38, 39, 40, 41, 42, 43, 405, 345, 462,
1253 347, 38, 39, 40, 41, 42, 43, 375, 385, 460,
1254 397, 444, 453, 333, 505, 453, 519, 397, 395, 366,
1255 510, 453, 453, 512, 38, 405, 38, 515, 405, -1,
1256 -1, -1, -1, 380, -1, -1, 383, -1, 501, -1,
1257 -1, -1, -1, 423, 424, -1, -1, -1, -1, -1,
1258 -1, -1, 372, -1, -1, 375, -1, -1, -1, -1,
1259 380, -1, 382, -1, 411, 5, 6, 7, 8, -1,
1260 -1, 11, -1, -1, -1, 15, 396, 17, -1, 426,
1261 460, 401, -1, -1, 464, -1, -1, -1, -1, -1,
1262 470, 471, 472, 473, -1, 483, -1, -1, 418, -1,
1263 -1, -1, -1, -1, 44, 45, 46, 47, 48, 49,
1264 50, 51, 52, 53, -1, 435, -1, 437, -1, 439,
1265 -1, 441, -1, 443, -1, 505, -1, -1, -1, 449,
1266 510, -1, 512, -1, -1, 515, 513, 1, 526, 519,
1267 517, 5, 6, -1, -1, 9, 10, 11, -1, 13,
1268 -1, 15, -1, -1, 18, 19, 20, 21, -1, -1,
1269 -1, 481, -1, -1, -1, -1, -1, -1, -1, -1,
1270 490, -1, -1, 493, -1, -1, -1, 497, -1, -1,
1271 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1272 54, -1, -1, 57, -1, 59, 60, 61, 62, 63,
1273 64, -1, 66, 67, -1, -1, 70, -1, -1, 73,
1274 74, 75, 76, -1, 78, -1, 80, 81, 82, -1,
1275 -1, -1, -1, -1, 88, 89, -1, -1, -1, 93,
1276 3, 95, 96, 97, 5, 6, -1, -1, 9, 10,
1277 11, -1, 13, -1, 15, -1, -1, 18, -1, 22,
1278 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1279 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
1280 43, -1, -1, -1, -1, -1, -1, -1, -1, 50,
1281 51, -1, -1, 54, -1, -1, 57, -1, 59, 60,
1282 61, 62, 63, 64, -1, 66, 67, -1, -1, 70,
1283 -1, -1, 73, 74, 75, 76, -1, 78, -1, 80,
1284 81, 82, -1, -1, -1, -1, -1, 88, 89, 3,
1285 5, 6, 93, 94, 9, 10, 11, -1, 13, -1,
1286 15, 3, -1, 18, 19, 20, 21, -1, 22, 23,
1287 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1288 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1289 32, 33, -1, -1, -1, 50, 51, -1, -1, 54,
1290 -1, -1, 57, -1, 59, 60, 61, 62, 63, 64,
1291 -1, 66, 67, -1, -1, 70, -1, -1, 73, 74,
1292 75, 76, -1, 78, -1, 80, 81, 82, 3, -1,
1293 -1, 5, 6, 88, 89, 9, 10, 11, 93, 13,
1294 -1, 15, -1, -1, 18, 19, 20, 22, 23, 24,
1295 25, 26, 27, 28, 29, 30, 31, 32, 33, -1,
1296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1297 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1298 54, -1, -1, 57, -1, 59, 60, 61, 62, 63,
1299 64, -1, 66, 67, -1, -1, 70, -1, -1, 73,
1300 74, 75, 76, -1, 78, -1, 80, 81, 82, -1,
1301 -1, -1, 5, 6, 88, 89, 9, 10, 11, 93,
1302 13, -1, 15, -1, -1, 18, -1, -1, -1, -1,
1303 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1304 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1305 -1, -1, -1, -1, -1, -1, -1, 50, 51, -1,
1306 -1, 54, -1, -1, 57, -1, 59, 60, 61, 62,
1307 63, 64, -1, 66, 67, -1, -1, 70, -1, -1,
1308 73, 74, 75, 76, -1, 78, -1, 80, 81, 82,
1309 83, -1, -1, 5, 6, 88, 89, 9, 10, 11,
1310 93, 13, -1, 15, -1, -1, 18, -1, -1, -1,
1311 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1312 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1313 -1, -1, -1, -1, -1, -1, -1, -1, 50, 51,
1314 -1, -1, 54, -1, -1, 57, -1, 59, 60, 61,
1315 62, 63, 64, -1, 66, 67, -1, -1, 70, -1,
1316 -1, 73, 74, 75, 76, -1, 78, -1, 80, 81,
1317 82, -1, -1, -1, 1, -1, 88, 89, 5, 6,
1318 -1, 93, 9, 10, 11, -1, 13, -1, 15, -1,
1319 -1, 18, 4, 5, 6, -1, -1, 9, 10, 11,
1320 -1, 13, -1, 15, -1, -1, 18, 19, -1, -1,
1321 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1322 -1, -1, -1, 50, 51, -1, -1, 54, -1, -1,
1323 57, -1, 59, 60, -1, -1, -1, -1, 50, 51,
1324 -1, -1, 54, -1, -1, 57, -1, 59, 60, -1,
1325 -1, -1, -1, -1, -1, 82, -1, -1, 4, 5,
1326 6, 88, 89, 9, 10, 11, 12, 13, -1, 15,
1327 82, -1, 18, 4, 5, 6, 88, 89, 9, 10,
1328 11, -1, 13, -1, 15, 16, -1, 18, -1, -1,
1329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1330 -1, -1, -1, -1, 50, 51, -1, -1, 54, -1,
1331 -1, 57, -1, 59, 60, -1, -1, -1, -1, 50,
1332 51, -1, -1, 54, -1, -1, 57, -1, 59, 60,
1333 -1, -1, -1, -1, -1, -1, 82, -1, -1, 4,
1334 5, 6, 88, 89, 9, 10, 11, 12, 13, -1,
1335 15, 82, -1, 18, 4, 5, 6, 88, 89, 9,
1336 10, 11, -1, 13, -1, 15, 16, -1, 18, -1,
1337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1338 -1, -1, -1, -1, -1, 50, 51, -1, -1, 54,
1339 -1, -1, 57, -1, 59, 60, -1, -1, -1, -1,
1340 50, 51, -1, -1, 54, -1, -1, 57, -1, 59,
1341 60, -1, -1, -1, -1, -1, -1, 82, -1, -1,
1342 4, 5, 6, 88, 89, 9, 10, 11, -1, 13,
1343 -1, 15, 82, -1, 18, -1, 5, 6, 88, 89,
1344 9, 10, 11, -1, 13, -1, 15, 5, 6, 18,
1345 -1, 9, 10, 11, -1, 13, -1, 15, -1, -1,
1346 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1347 54, -1, -1, 57, -1, 59, 60, -1, -1, -1,
1348 -1, 50, 51, -1, -1, 54, -1, -1, 57, -1,
1349 59, 60, 50, 51, -1, -1, 54, -1, 82, 57,
1350 -1, 59, 60, -1, 88, 89, 5, 6, -1, -1,
1351 9, 10, 11, 82, 13, -1, 15, 5, 6, 88,
1352 89, 9, 10, 11, 82, 13, -1, 15, -1, -1,
1353 88, 89, 5, 6, -1, -1, 9, 10, 11, -1,
1354 13, -1, 15, -1, -1, -1, -1, -1, -1, -1,
1355 -1, 50, 51, -1, -1, 54, -1, -1, 57, -1,
1356 59, 60, 50, 51, -1, -1, 54, -1, -1, 57,
1357 -1, 59, 60, -1, -1, -1, -1, 50, 51, -1,
1358 -1, 54, -1, 82, 57, -1, 59, 60, -1, 88,
1359 89, -1, -1, -1, 82, 4, 5, 6, 7, 8,
1360 88, 89, 11, -1, -1, -1, 15, -1, 17, 82,
1361 4, 5, 6, 7, 8, 88, 89, 11, -1, -1,
1362 -1, 15, -1, 17, 7, 8, -1, -1, 11, -1,
1363 -1, -1, 15, -1, 17, 44, 45, 46, 47, 48,
1364 49, 50, 51, 52, 53, -1, -1, -1, -1, -1,
1365 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1366 -1, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1367 53
1368};
1369
1370/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1371 state STATE-NUM. */
1372static const yytype_uint8 yystos[] =
1373{
1374 0, 1, 5, 6, 9, 10, 11, 13, 15, 18,
1375 19, 20, 50, 51, 54, 57, 59, 60, 61, 62,
1376 63, 64, 66, 67, 70, 73, 74, 75, 76, 78,
1377 80, 81, 82, 88, 89, 95, 100, 101, 102, 110,
1378 111, 113, 114, 115, 116, 117, 118, 120, 123, 124,
1379 125, 130, 132, 133, 134, 135, 136, 137, 138, 141,
1380 142, 143, 144, 147, 152, 153, 154, 155, 156, 167,
1381 168, 169, 170, 173, 220, 221, 222, 113, 130, 130,
1382 130, 130, 136, 4, 9, 19, 119, 122, 126, 127,
1383 128, 136, 121, 122, 11, 157, 160, 130, 130, 11,
1384 133, 134, 11, 134, 136, 19, 20, 21, 103, 223,
1385 224, 103, 224, 136, 103, 103, 113, 139, 140, 139,
1386 0, 21, 96, 221, 222, 112, 116, 4, 5, 6,
1387 7, 8, 11, 15, 17, 44, 45, 46, 47, 48,
1388 49, 50, 51, 52, 53, 129, 34, 35, 36, 37,
1389 38, 39, 40, 41, 42, 43, 3, 22, 23, 24,
1390 25, 26, 27, 28, 29, 30, 31, 32, 33, 68,
1391 69, 145, 146, 93, 97, 103, 224, 13, 91, 92,
1392 113, 164, 171, 19, 20, 12, 128, 14, 20, 19,
1393 16, 20, 1, 9, 127, 140, 161, 162, 163, 219,
1394 134, 3, 134, 3, 218, 65, 19, 20, 21, 104,
1395 105, 106, 110, 58, 136, 224, 77, 58, 79, 3,
1396 140, 110, 116, 130, 130, 130, 130, 130, 12, 128,
1397 16, 128, 130, 130, 130, 130, 5, 6, 9, 10,
1398 50, 51, 125, 131, 131, 11, 56, 133, 133, 133,
1399 133, 133, 133, 133, 133, 133, 133, 136, 136, 136,
1400 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1401 224, 103, 58, 96, 83, 185, 186, 14, 113, 165,
1402 17, 17, 3, 159, 160, 19, 122, 126, 127, 136,
1403 122, 12, 158, 19, 1, 136, 3, 136, 3, 136,
1404 103, 136, 223, 224, 218, 71, 72, 148, 149, 150,
1405 151, 103, 224, 136, 4, 12, 19, 16, 131, 131,
1406 131, 131, 131, 131, 11, 15, 50, 51, 129, 136,
1407 136, 11, 187, 166, 14, 19, 113, 113, 113, 171,
1408 103, 174, 224, 163, 136, 218, 136, 218, 58, 110,
1409 103, 224, 103, 58, 150, 151, 58, 104, 130, 12,
1410 128, 16, 128, 11, 56, 12, 218, 9, 10, 113,
1411 188, 189, 113, 224, 113, 159, 58, 96, 172, 94,
1412 175, 176, 177, 12, 103, 19, 103, 136, 58, 12,
1413 16, 136, 103, 113, 113, 3, 12, 19, 224, 107,
1414 108, 109, 173, 174, 103, 224, 224, 103, 58, 136,
1415 58, 218, 12, 136, 224, 189, 38, 190, 191, 96,
1416 224, 172, 176, 11, 178, 58, 12, 103, 90, 192,
1417 84, 85, 86, 87, 193, 194, 195, 196, 200, 201,
1418 208, 209, 213, 214, 36, 224, 173, 113, 113, 179,
1419 180, 103, 58, 224, 224, 224, 224, 224, 192, 12,
1420 223, 224, 11, 181, 182, 58, 195, 200, 208, 213,
1421 187, 187, 187, 187, 180, 58, 128, 113, 183, 113,
1422 197, 198, 199, 113, 164, 173, 202, 203, 205, 206,
1423 207, 113, 210, 211, 212, 113, 215, 216, 217, 181,
1424 12, 15, 184, 181, 58, 223, 224, 160, 3, 58,
1425 224, 58, 224, 11, 58, 224, 128, 3, 199, 204,
1426 205, 212, 136, 217, 16, 136, 113, 202, 12
1427};
1428
1429/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1430static const yytype_uint8 yyr1[] =
1431{
1432 0, 99, 100, 100, 100, 100, 101, 101, 102, 102,
1433 103, 104, 104, 105, 106, 106, 107, 107, 108, 109,
1434 109, 110, 110, 110, 111, 112, 112, 113, 114, 115,
1435 116, 116, 117, 117, 118, 119, 119, 120, 121, 121,
1436 122, 122, 122, 122, 122, 122, 123, 124, 124, 125,
1437 125, 125, 125, 125, 125, 125, 125, 126, 127, 128,
1438 128, 128, 128, 128, 128, 129, 130, 130, 130, 130,
1439 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
1440 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
1441 130, 130, 130, 131, 131, 131, 131, 131, 131, 131,
1442 131, 131, 131, 131, 131, 131, 131, 131, 132, 132,
1443 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
1444 133, 133, 134, 135, 135, 135, 135, 135, 135, 135,
1445 135, 135, 135, 135, 135, 135, 136, 136, 136, 137,
1446 137, 137, 137, 137, 137, 137, 138, 138, 139, 139,
1447 140, 140, 141, 141, 142, 143, 143, 144, 145, 146,
1448 146, 147, 148, 148, 148, 148, 149, 149, 150, 151,
1449 152, 152, 152, 152, 152, 152, 153, 153, 153, 154,
1450 155, 155, 155, 156, 157, 158, 159, 159, 160, 160,
1451 161, 161, 162, 162, 163, 163, 164, 164, 164, 165,
1452 165, 166, 167, 168, 169, 169, 170, 171, 171, 171,
1453 172, 172, 173, 173, 174, 174, 175, 175, 176, 177,
1454 178, 178, 179, 179, 180, 181, 181, 182, 182, 183,
1455 183, 184, 184, 185, 186, 187, 187, 188, 188, 189,
1456 189, 189, 189, 190, 190, 191, 191, 192, 193, 193,
1457 194, 194, 194, 194, 194, 194, 194, 194, 195, 196,
1458 197, 197, 198, 198, 199, 200, 201, 202, 202, 203,
1459 204, 203, 205, 205, 206, 206, 207, 207, 208, 209,
1460 210, 210, 211, 211, 212, 213, 214, 215, 215, 216,
1461 216, 217, 218, 219, 220, 220, 221, 221, 221, 221,
1462 222, 222, 223, 223, 223, 223, 223, 223, 224, 224
1463};
1464
1465/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1466static const yytype_int8 yyr2[] =
1467{
1468 0, 2, 2, 2, 1, 1, 1, 2, 1, 3,
1469 2, 0, 1, 2, 1, 3, 0, 1, 2, 1,
1470 3, 1, 1, 1, 2, 1, 2, 1, 1, 1,
1471 1, 1, 1, 1, 3, 1, 3, 3, 1, 3,
1472 0, 1, 1, 2, 2, 3, 1, 4, 4, 1,
1473 1, 1, 1, 1, 1, 1, 3, 1, 1, 1,
1474 1, 1, 3, 3, 3, 1, 1, 2, 2, 3,
1475 4, 3, 4, 2, 2, 3, 5, 2, 2, 2,
1476 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
1477 3, 3, 3, 1, 2, 2, 3, 4, 3, 4,
1478 3, 5, 2, 2, 2, 2, 2, 2, 3, 5,
1479 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1480 3, 3, 1, 3, 3, 3, 3, 3, 3, 3,
1481 3, 3, 3, 3, 3, 3, 1, 1, 1, 1,
1482 1, 1, 1, 1, 1, 1, 2, 2, 1, 2,
1483 1, 3, 1, 1, 3, 1, 2, 5, 5, 0,
1484 2, 5, 0, 1, 1, 2, 1, 2, 5, 2,
1485 5, 4, 7, 8, 7, 10, 1, 1, 1, 3,
1486 5, 6, 3, 0, 1, 1, 0, 1, 3, 2,
1487 0, 1, 1, 3, 1, 1, 2, 1, 3, 1,
1488 3, 0, 0, 2, 3, 7, 2, 1, 3, 3,
1489 1, 1, 5, 7, 1, 3, 1, 3, 6, 1,
1490 0, 3, 2, 4, 1, 3, 5, 0, 3, 0,
1491 1, 0, 3, 1, 7, 0, 4, 1, 3, 1,
1492 3, 2, 2, 0, 2, 2, 3, 1, 0, 2,
1493 1, 1, 1, 1, 3, 3, 3, 3, 5, 1,
1494 0, 2, 1, 3, 2, 5, 1, 1, 2, 1,
1495 0, 4, 1, 1, 0, 2, 1, 3, 5, 1,
1496 0, 2, 1, 3, 1, 5, 1, 0, 2, 1,
1497 3, 4, 0, 0, 1, 1, 1, 1, 2, 2,
1498 0, 1, 1, 1, 1, 2, 2, 2, 0, 1
1499};
1500
1501
1502enum { YYENOMEM = -2 };
1503
1504#define yyerrok (yyerrstatus = 0)
1505#define yyclearin (yychar = OCTAVE_EMPTY)
1506
1507#define YYACCEPT goto yyacceptlab
1508#define YYABORT goto yyabortlab
1509#define YYERROR goto yyerrorlab
1510#define YYNOMEM goto yyexhaustedlab
1511
1512
1513#define YYRECOVERING() (!!yyerrstatus)
1514
1515#define YYBACKUP(Token, Value) \
1516 do \
1517 if (yychar == OCTAVE_EMPTY) \
1518 { \
1519 yychar = (Token); \
1520 yylval = (Value); \
1521 YYPOPSTACK (yylen); \
1522 yystate = *yyssp; \
1523 goto yybackup; \
1524 } \
1525 else \
1526 { \
1527 yyerror (parser, YY_("syntax error: cannot back up")); \
1528 YYERROR; \
1529 } \
1530 while (0)
1531
1532/* Backward compatibility with an undocumented macro.
1533 Use OCTAVE_error or OCTAVE_UNDEF. */
1534#define YYERRCODE OCTAVE_UNDEF
1535
1536
1537/* Enable debugging if requested. */
1538#if OCTAVE_DEBUG
1539
1540# ifndef YYFPRINTF
1541# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1542# define YYFPRINTF fprintf
1543# endif
1544
1545# define YYDPRINTF(Args) \
1546do { \
1547 if (yydebug) \
1548 YYFPRINTF Args; \
1549} while (0)
1550
1551
1552
1553
1554# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1555do { \
1556 if (yydebug) \
1557 { \
1558 YYFPRINTF (stderr, "%s ", Title); \
1559 yy_symbol_print (stderr, \
1560 Kind, Value, parser); \
1561 YYFPRINTF (stderr, "\n"); \
1562 } \
1563} while (0)
1564
1565
1566/*-----------------------------------.
1567| Print this symbol's value on YYO. |
1568`-----------------------------------*/
1569
1570static void
1571yy_symbol_value_print (FILE *yyo,
1572 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, octave::base_parser& parser)
1573{
1574 FILE *yyoutput = yyo;
1575 YY_USE (yyoutput);
1576 YY_USE (parser);
1577 if (!yyvaluep)
1578 return;
1580 YY_USE (yykind);
1582}
1583
1584
1585/*---------------------------.
1586| Print this symbol on YYO. |
1587`---------------------------*/
1588
1589static void
1590yy_symbol_print (FILE *yyo,
1591 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, octave::base_parser& parser)
1592{
1593 YYFPRINTF (yyo, "%s %s (",
1594 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1595
1596 yy_symbol_value_print (yyo, yykind, yyvaluep, parser);
1597 YYFPRINTF (yyo, ")");
1598}
1599
1600/*------------------------------------------------------------------.
1601| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1602| TOP (included). |
1603`------------------------------------------------------------------*/
1604
1605static void
1606yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1607{
1608 YYFPRINTF (stderr, "Stack now");
1609 for (; yybottom <= yytop; yybottom++)
1610 {
1611 int yybot = *yybottom;
1612 YYFPRINTF (stderr, " %d", yybot);
1613 }
1614 YYFPRINTF (stderr, "\n");
1615}
1616
1617# define YY_STACK_PRINT(Bottom, Top) \
1618do { \
1619 if (yydebug) \
1620 yy_stack_print ((Bottom), (Top)); \
1621} while (0)
1622
1623
1624/*------------------------------------------------.
1625| Report that the YYRULE is going to be reduced. |
1626`------------------------------------------------*/
1627
1628static void
1629yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1630 int yyrule, octave::base_parser& parser)
1631{
1632 int yylno = yyrline[yyrule];
1633 int yynrhs = yyr2[yyrule];
1634 int yyi;
1635 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1636 yyrule - 1, yylno);
1637 /* The symbols being reduced. */
1638 for (yyi = 0; yyi < yynrhs; yyi++)
1639 {
1640 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1641 yy_symbol_print (stderr,
1642 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1643 &yyvsp[(yyi + 1) - (yynrhs)], parser);
1644 YYFPRINTF (stderr, "\n");
1645 }
1646}
1647
1648# define YY_REDUCE_PRINT(Rule) \
1649do { \
1650 if (yydebug) \
1651 yy_reduce_print (yyssp, yyvsp, Rule, parser); \
1652} while (0)
1653
1654/* Nonzero means print parse trace. It is left uninitialized so that
1655 multiple parsers can coexist. */
1656int yydebug;
1657#else /* !OCTAVE_DEBUG */
1658# define YYDPRINTF(Args) ((void) 0)
1659# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1660# define YY_STACK_PRINT(Bottom, Top)
1661# define YY_REDUCE_PRINT(Rule)
1662#endif /* !OCTAVE_DEBUG */
1663
1664
1665/* YYINITDEPTH -- initial size of the parser's stacks. */
1666#ifndef YYINITDEPTH
1667# define YYINITDEPTH 200
1668#endif
1669
1670/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1671 if the built-in stack extension method is used).
1672
1673 Do not make this value too large; the results are undefined if
1674 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1675 evaluated with infinite-precision integer arithmetic. */
1676
1677#ifndef YYMAXDEPTH
1678# define YYMAXDEPTH 10000
1679#endif
1680/* Parser data structure. */
1681struct yypstate
1682 {
1683 /* Number of syntax errors so far. */
1684 int yynerrs;
1685
1687 /* Number of tokens to shift before error messages enabled. */
1688 int yyerrstatus;
1689
1690 /* Refer to the stacks through separate pointers, to allow yyoverflow
1691 to reallocate them elsewhere. */
1692
1693 /* Their size. */
1695
1696 /* The state stack: array, bottom, top. */
1700
1701 /* The semantic value stack: array, bottom, top. */
1703 YYSTYPE *yyvs;
1704 YYSTYPE *yyvsp;
1705 /* Whether this instance has not started parsing yet.
1706 * If 2, it corresponds to a finished parsing. */
1707 int yynew;
1708 };
1709
1710
1711
1712
1713
1714
1715/*-----------------------------------------------.
1716| Release the memory associated to this symbol. |
1717`-----------------------------------------------*/
1718
1719static void
1720yydestruct (const char *yymsg,
1721 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, octave::base_parser& parser)
1722{
1723 YY_USE (yyvaluep);
1724 YY_USE (parser);
1725 if (!yymsg)
1726 yymsg = "Deleting";
1727 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1728
1730 switch (yykind)
1731 {
1732 case YYSYMBOL_3_: /* '=' */
1733#line 340 "../libinterp/parse-tree/oct-parse.yy"
1734 { }
1735#line 1736 "libinterp/parse-tree/oct-parse.cc"
1736 break;
1737
1738 case YYSYMBOL_4_: /* ':' */
1739#line 340 "../libinterp/parse-tree/oct-parse.yy"
1740 { }
1741#line 1742 "libinterp/parse-tree/oct-parse.cc"
1742 break;
1743
1744 case YYSYMBOL_5_: /* '-' */
1745#line 340 "../libinterp/parse-tree/oct-parse.yy"
1746 { }
1747#line 1748 "libinterp/parse-tree/oct-parse.cc"
1748 break;
1749
1750 case YYSYMBOL_6_: /* '+' */
1751#line 340 "../libinterp/parse-tree/oct-parse.yy"
1752 { }
1753#line 1754 "libinterp/parse-tree/oct-parse.cc"
1754 break;
1755
1756 case YYSYMBOL_7_: /* '*' */
1757#line 340 "../libinterp/parse-tree/oct-parse.yy"
1758 { }
1759#line 1760 "libinterp/parse-tree/oct-parse.cc"
1760 break;
1761
1762 case YYSYMBOL_8_: /* '/' */
1763#line 340 "../libinterp/parse-tree/oct-parse.yy"
1764 { }
1765#line 1766 "libinterp/parse-tree/oct-parse.cc"
1766 break;
1767
1768 case YYSYMBOL_9_: /* '~' */
1769#line 340 "../libinterp/parse-tree/oct-parse.yy"
1770 { }
1771#line 1772 "libinterp/parse-tree/oct-parse.cc"
1772 break;
1773
1774 case YYSYMBOL_10_: /* '!' */
1775#line 340 "../libinterp/parse-tree/oct-parse.yy"
1776 { }
1777#line 1778 "libinterp/parse-tree/oct-parse.cc"
1778 break;
1779
1780 case YYSYMBOL_11_: /* '(' */
1781#line 340 "../libinterp/parse-tree/oct-parse.yy"
1782 { }
1783#line 1784 "libinterp/parse-tree/oct-parse.cc"
1784 break;
1785
1786 case YYSYMBOL_12_: /* ')' */
1787#line 340 "../libinterp/parse-tree/oct-parse.yy"
1788 { }
1789#line 1790 "libinterp/parse-tree/oct-parse.cc"
1790 break;
1791
1792 case YYSYMBOL_13_: /* '[' */
1793#line 340 "../libinterp/parse-tree/oct-parse.yy"
1794 { }
1795#line 1796 "libinterp/parse-tree/oct-parse.cc"
1796 break;
1797
1798 case YYSYMBOL_14_: /* ']' */
1799#line 340 "../libinterp/parse-tree/oct-parse.yy"
1800 { }
1801#line 1802 "libinterp/parse-tree/oct-parse.cc"
1802 break;
1803
1804 case YYSYMBOL_15_: /* '{' */
1805#line 340 "../libinterp/parse-tree/oct-parse.yy"
1806 { }
1807#line 1808 "libinterp/parse-tree/oct-parse.cc"
1808 break;
1809
1810 case YYSYMBOL_16_: /* '}' */
1811#line 340 "../libinterp/parse-tree/oct-parse.yy"
1812 { }
1813#line 1814 "libinterp/parse-tree/oct-parse.cc"
1814 break;
1815
1816 case YYSYMBOL_17_: /* '.' */
1817#line 340 "../libinterp/parse-tree/oct-parse.yy"
1818 { }
1819#line 1820 "libinterp/parse-tree/oct-parse.cc"
1820 break;
1821
1822 case YYSYMBOL_18_: /* '@' */
1823#line 340 "../libinterp/parse-tree/oct-parse.yy"
1824 { }
1825#line 1826 "libinterp/parse-tree/oct-parse.cc"
1826 break;
1827
1828 case YYSYMBOL_19_: /* ',' */
1829#line 340 "../libinterp/parse-tree/oct-parse.yy"
1830 { }
1831#line 1832 "libinterp/parse-tree/oct-parse.cc"
1832 break;
1833
1834 case YYSYMBOL_20_: /* ';' */
1835#line 340 "../libinterp/parse-tree/oct-parse.yy"
1836 { }
1837#line 1838 "libinterp/parse-tree/oct-parse.cc"
1838 break;
1839
1840 case YYSYMBOL_21_n_: /* '\n' */
1841#line 340 "../libinterp/parse-tree/oct-parse.yy"
1842 { }
1843#line 1844 "libinterp/parse-tree/oct-parse.cc"
1844 break;
1845
1846 case YYSYMBOL_ADD_EQ: /* ADD_EQ */
1847#line 340 "../libinterp/parse-tree/oct-parse.yy"
1848 { }
1849#line 1850 "libinterp/parse-tree/oct-parse.cc"
1850 break;
1851
1852 case YYSYMBOL_SUB_EQ: /* SUB_EQ */
1853#line 340 "../libinterp/parse-tree/oct-parse.yy"
1854 { }
1855#line 1856 "libinterp/parse-tree/oct-parse.cc"
1856 break;
1857
1858 case YYSYMBOL_MUL_EQ: /* MUL_EQ */
1859#line 340 "../libinterp/parse-tree/oct-parse.yy"
1860 { }
1861#line 1862 "libinterp/parse-tree/oct-parse.cc"
1862 break;
1863
1864 case YYSYMBOL_DIV_EQ: /* DIV_EQ */
1865#line 340 "../libinterp/parse-tree/oct-parse.yy"
1866 { }
1867#line 1868 "libinterp/parse-tree/oct-parse.cc"
1868 break;
1869
1870 case YYSYMBOL_LEFTDIV_EQ: /* LEFTDIV_EQ */
1871#line 340 "../libinterp/parse-tree/oct-parse.yy"
1872 { }
1873#line 1874 "libinterp/parse-tree/oct-parse.cc"
1874 break;
1875
1876 case YYSYMBOL_POW_EQ: /* POW_EQ */
1877#line 340 "../libinterp/parse-tree/oct-parse.yy"
1878 { }
1879#line 1880 "libinterp/parse-tree/oct-parse.cc"
1880 break;
1881
1882 case YYSYMBOL_EMUL_EQ: /* EMUL_EQ */
1883#line 340 "../libinterp/parse-tree/oct-parse.yy"
1884 { }
1885#line 1886 "libinterp/parse-tree/oct-parse.cc"
1886 break;
1887
1888 case YYSYMBOL_EDIV_EQ: /* EDIV_EQ */
1889#line 340 "../libinterp/parse-tree/oct-parse.yy"
1890 { }
1891#line 1892 "libinterp/parse-tree/oct-parse.cc"
1892 break;
1893
1894 case YYSYMBOL_ELEFTDIV_EQ: /* ELEFTDIV_EQ */
1895#line 340 "../libinterp/parse-tree/oct-parse.yy"
1896 { }
1897#line 1898 "libinterp/parse-tree/oct-parse.cc"
1898 break;
1899
1900 case YYSYMBOL_EPOW_EQ: /* EPOW_EQ */
1901#line 340 "../libinterp/parse-tree/oct-parse.yy"
1902 { }
1903#line 1904 "libinterp/parse-tree/oct-parse.cc"
1904 break;
1905
1906 case YYSYMBOL_AND_EQ: /* AND_EQ */
1907#line 340 "../libinterp/parse-tree/oct-parse.yy"
1908 { }
1909#line 1910 "libinterp/parse-tree/oct-parse.cc"
1910 break;
1911
1912 case YYSYMBOL_OR_EQ: /* OR_EQ */
1913#line 340 "../libinterp/parse-tree/oct-parse.yy"
1914 { }
1915#line 1916 "libinterp/parse-tree/oct-parse.cc"
1916 break;
1917
1918 case YYSYMBOL_EXPR_AND_AND: /* EXPR_AND_AND */
1919#line 340 "../libinterp/parse-tree/oct-parse.yy"
1920 { }
1921#line 1922 "libinterp/parse-tree/oct-parse.cc"
1922 break;
1923
1924 case YYSYMBOL_EXPR_OR_OR: /* EXPR_OR_OR */
1925#line 340 "../libinterp/parse-tree/oct-parse.yy"
1926 { }
1927#line 1928 "libinterp/parse-tree/oct-parse.cc"
1928 break;
1929
1930 case YYSYMBOL_EXPR_AND: /* EXPR_AND */
1931#line 340 "../libinterp/parse-tree/oct-parse.yy"
1932 { }
1933#line 1934 "libinterp/parse-tree/oct-parse.cc"
1934 break;
1935
1936 case YYSYMBOL_EXPR_OR: /* EXPR_OR */
1937#line 340 "../libinterp/parse-tree/oct-parse.yy"
1938 { }
1939#line 1940 "libinterp/parse-tree/oct-parse.cc"
1940 break;
1941
1942 case YYSYMBOL_EXPR_LT: /* EXPR_LT */
1943#line 340 "../libinterp/parse-tree/oct-parse.yy"
1944 { }
1945#line 1946 "libinterp/parse-tree/oct-parse.cc"
1946 break;
1947
1948 case YYSYMBOL_EXPR_LE: /* EXPR_LE */
1949#line 340 "../libinterp/parse-tree/oct-parse.yy"
1950 { }
1951#line 1952 "libinterp/parse-tree/oct-parse.cc"
1952 break;
1953
1954 case YYSYMBOL_EXPR_EQ: /* EXPR_EQ */
1955#line 340 "../libinterp/parse-tree/oct-parse.yy"
1956 { }
1957#line 1958 "libinterp/parse-tree/oct-parse.cc"
1958 break;
1959
1960 case YYSYMBOL_EXPR_NE: /* EXPR_NE */
1961#line 340 "../libinterp/parse-tree/oct-parse.yy"
1962 { }
1963#line 1964 "libinterp/parse-tree/oct-parse.cc"
1964 break;
1965
1966 case YYSYMBOL_EXPR_GE: /* EXPR_GE */
1967#line 340 "../libinterp/parse-tree/oct-parse.yy"
1968 { }
1969#line 1970 "libinterp/parse-tree/oct-parse.cc"
1970 break;
1971
1972 case YYSYMBOL_EXPR_GT: /* EXPR_GT */
1973#line 340 "../libinterp/parse-tree/oct-parse.yy"
1974 { }
1975#line 1976 "libinterp/parse-tree/oct-parse.cc"
1976 break;
1977
1978 case YYSYMBOL_LEFTDIV: /* LEFTDIV */
1979#line 340 "../libinterp/parse-tree/oct-parse.yy"
1980 { }
1981#line 1982 "libinterp/parse-tree/oct-parse.cc"
1982 break;
1983
1984 case YYSYMBOL_EMUL: /* EMUL */
1985#line 340 "../libinterp/parse-tree/oct-parse.yy"
1986 { }
1987#line 1988 "libinterp/parse-tree/oct-parse.cc"
1988 break;
1989
1990 case YYSYMBOL_EDIV: /* EDIV */
1991#line 340 "../libinterp/parse-tree/oct-parse.yy"
1992 { }
1993#line 1994 "libinterp/parse-tree/oct-parse.cc"
1994 break;
1995
1996 case YYSYMBOL_ELEFTDIV: /* ELEFTDIV */
1997#line 340 "../libinterp/parse-tree/oct-parse.yy"
1998 { }
1999#line 2000 "libinterp/parse-tree/oct-parse.cc"
2000 break;
2001
2002 case YYSYMBOL_HERMITIAN: /* HERMITIAN */
2003#line 340 "../libinterp/parse-tree/oct-parse.yy"
2004 { }
2005#line 2006 "libinterp/parse-tree/oct-parse.cc"
2006 break;
2007
2008 case YYSYMBOL_TRANSPOSE: /* TRANSPOSE */
2009#line 340 "../libinterp/parse-tree/oct-parse.yy"
2010 { }
2011#line 2012 "libinterp/parse-tree/oct-parse.cc"
2012 break;
2013
2014 case YYSYMBOL_PLUS_PLUS: /* PLUS_PLUS */
2015#line 340 "../libinterp/parse-tree/oct-parse.yy"
2016 { }
2017#line 2018 "libinterp/parse-tree/oct-parse.cc"
2018 break;
2019
2020 case YYSYMBOL_MINUS_MINUS: /* MINUS_MINUS */
2021#line 340 "../libinterp/parse-tree/oct-parse.yy"
2022 { }
2023#line 2024 "libinterp/parse-tree/oct-parse.cc"
2024 break;
2025
2026 case YYSYMBOL_POW: /* POW */
2027#line 340 "../libinterp/parse-tree/oct-parse.yy"
2028 { }
2029#line 2030 "libinterp/parse-tree/oct-parse.cc"
2030 break;
2031
2032 case YYSYMBOL_EPOW: /* EPOW */
2033#line 340 "../libinterp/parse-tree/oct-parse.yy"
2034 { }
2035#line 2036 "libinterp/parse-tree/oct-parse.cc"
2036 break;
2037
2038 case YYSYMBOL_NUMBER: /* NUMBER */
2039#line 340 "../libinterp/parse-tree/oct-parse.yy"
2040 { }
2041#line 2042 "libinterp/parse-tree/oct-parse.cc"
2042 break;
2043
2044 case YYSYMBOL_CONSTANT: /* CONSTANT */
2045#line 340 "../libinterp/parse-tree/oct-parse.yy"
2046 { }
2047#line 2048 "libinterp/parse-tree/oct-parse.cc"
2048 break;
2049
2050 case YYSYMBOL_STRUCT_ELT: /* STRUCT_ELT */
2051#line 340 "../libinterp/parse-tree/oct-parse.yy"
2052 { }
2053#line 2054 "libinterp/parse-tree/oct-parse.cc"
2054 break;
2055
2056 case YYSYMBOL_NAME: /* NAME */
2057#line 340 "../libinterp/parse-tree/oct-parse.yy"
2058 { }
2059#line 2060 "libinterp/parse-tree/oct-parse.cc"
2060 break;
2061
2062 case YYSYMBOL_END: /* END */
2063#line 340 "../libinterp/parse-tree/oct-parse.yy"
2064 { }
2065#line 2066 "libinterp/parse-tree/oct-parse.cc"
2066 break;
2067
2068 case YYSYMBOL_DQ_STRING: /* DQ_STRING */
2069#line 340 "../libinterp/parse-tree/oct-parse.yy"
2070 { }
2071#line 2072 "libinterp/parse-tree/oct-parse.cc"
2072 break;
2073
2074 case YYSYMBOL_SQ_STRING: /* SQ_STRING */
2075#line 340 "../libinterp/parse-tree/oct-parse.yy"
2076 { }
2077#line 2078 "libinterp/parse-tree/oct-parse.cc"
2078 break;
2079
2080 case YYSYMBOL_FOR: /* FOR */
2081#line 340 "../libinterp/parse-tree/oct-parse.yy"
2082 { }
2083#line 2084 "libinterp/parse-tree/oct-parse.cc"
2084 break;
2085
2086 case YYSYMBOL_PARFOR: /* PARFOR */
2087#line 340 "../libinterp/parse-tree/oct-parse.yy"
2088 { }
2089#line 2090 "libinterp/parse-tree/oct-parse.cc"
2090 break;
2091
2092 case YYSYMBOL_WHILE: /* WHILE */
2093#line 340 "../libinterp/parse-tree/oct-parse.yy"
2094 { }
2095#line 2096 "libinterp/parse-tree/oct-parse.cc"
2096 break;
2097
2098 case YYSYMBOL_DO: /* DO */
2099#line 340 "../libinterp/parse-tree/oct-parse.yy"
2100 { }
2101#line 2102 "libinterp/parse-tree/oct-parse.cc"
2102 break;
2103
2104 case YYSYMBOL_UNTIL: /* UNTIL */
2105#line 340 "../libinterp/parse-tree/oct-parse.yy"
2106 { }
2107#line 2108 "libinterp/parse-tree/oct-parse.cc"
2108 break;
2109
2110 case YYSYMBOL_SPMD: /* SPMD */
2111#line 340 "../libinterp/parse-tree/oct-parse.yy"
2112 { }
2113#line 2114 "libinterp/parse-tree/oct-parse.cc"
2114 break;
2115
2116 case YYSYMBOL_IF: /* IF */
2117#line 340 "../libinterp/parse-tree/oct-parse.yy"
2118 { }
2119#line 2120 "libinterp/parse-tree/oct-parse.cc"
2120 break;
2121
2122 case YYSYMBOL_ELSEIF: /* ELSEIF */
2123#line 340 "../libinterp/parse-tree/oct-parse.yy"
2124 { }
2125#line 2126 "libinterp/parse-tree/oct-parse.cc"
2126 break;
2127
2128 case YYSYMBOL_ELSE: /* ELSE */
2129#line 340 "../libinterp/parse-tree/oct-parse.yy"
2130 { }
2131#line 2132 "libinterp/parse-tree/oct-parse.cc"
2132 break;
2133
2134 case YYSYMBOL_SWITCH: /* SWITCH */
2135#line 340 "../libinterp/parse-tree/oct-parse.yy"
2136 { }
2137#line 2138 "libinterp/parse-tree/oct-parse.cc"
2138 break;
2139
2140 case YYSYMBOL_CASE: /* CASE */
2141#line 340 "../libinterp/parse-tree/oct-parse.yy"
2142 { }
2143#line 2144 "libinterp/parse-tree/oct-parse.cc"
2144 break;
2145
2146 case YYSYMBOL_OTHERWISE: /* OTHERWISE */
2147#line 340 "../libinterp/parse-tree/oct-parse.yy"
2148 { }
2149#line 2150 "libinterp/parse-tree/oct-parse.cc"
2150 break;
2151
2152 case YYSYMBOL_BREAK: /* BREAK */
2153#line 340 "../libinterp/parse-tree/oct-parse.yy"
2154 { }
2155#line 2156 "libinterp/parse-tree/oct-parse.cc"
2156 break;
2157
2158 case YYSYMBOL_CONTINUE: /* CONTINUE */
2159#line 340 "../libinterp/parse-tree/oct-parse.yy"
2160 { }
2161#line 2162 "libinterp/parse-tree/oct-parse.cc"
2162 break;
2163
2164 case YYSYMBOL_RETURN: /* RETURN */
2165#line 340 "../libinterp/parse-tree/oct-parse.yy"
2166 { }
2167#line 2168 "libinterp/parse-tree/oct-parse.cc"
2168 break;
2169
2170 case YYSYMBOL_UNWIND: /* UNWIND */
2171#line 340 "../libinterp/parse-tree/oct-parse.yy"
2172 { }
2173#line 2174 "libinterp/parse-tree/oct-parse.cc"
2174 break;
2175
2176 case YYSYMBOL_CLEANUP: /* CLEANUP */
2177#line 340 "../libinterp/parse-tree/oct-parse.yy"
2178 { }
2179#line 2180 "libinterp/parse-tree/oct-parse.cc"
2180 break;
2181
2182 case YYSYMBOL_TRY: /* TRY */
2183#line 340 "../libinterp/parse-tree/oct-parse.yy"
2184 { }
2185#line 2186 "libinterp/parse-tree/oct-parse.cc"
2186 break;
2187
2188 case YYSYMBOL_CATCH: /* CATCH */
2189#line 340 "../libinterp/parse-tree/oct-parse.yy"
2190 { }
2191#line 2192 "libinterp/parse-tree/oct-parse.cc"
2192 break;
2193
2194 case YYSYMBOL_GLOBAL: /* GLOBAL */
2195#line 340 "../libinterp/parse-tree/oct-parse.yy"
2196 { }
2197#line 2198 "libinterp/parse-tree/oct-parse.cc"
2198 break;
2199
2200 case YYSYMBOL_PERSISTENT: /* PERSISTENT */
2201#line 340 "../libinterp/parse-tree/oct-parse.yy"
2202 { }
2203#line 2204 "libinterp/parse-tree/oct-parse.cc"
2204 break;
2205
2206 case YYSYMBOL_FCN_HANDLE: /* FCN_HANDLE */
2207#line 340 "../libinterp/parse-tree/oct-parse.yy"
2208 { }
2209#line 2210 "libinterp/parse-tree/oct-parse.cc"
2210 break;
2211
2212 case YYSYMBOL_CLASSDEF: /* CLASSDEF */
2213#line 340 "../libinterp/parse-tree/oct-parse.yy"
2214 { }
2215#line 2216 "libinterp/parse-tree/oct-parse.cc"
2216 break;
2217
2218 case YYSYMBOL_PROPERTIES: /* PROPERTIES */
2219#line 340 "../libinterp/parse-tree/oct-parse.yy"
2220 { }
2221#line 2222 "libinterp/parse-tree/oct-parse.cc"
2222 break;
2223
2224 case YYSYMBOL_METHODS: /* METHODS */
2225#line 340 "../libinterp/parse-tree/oct-parse.yy"
2226 { }
2227#line 2228 "libinterp/parse-tree/oct-parse.cc"
2228 break;
2229
2230 case YYSYMBOL_EVENTS: /* EVENTS */
2231#line 340 "../libinterp/parse-tree/oct-parse.yy"
2232 { }
2233#line 2234 "libinterp/parse-tree/oct-parse.cc"
2234 break;
2235
2236 case YYSYMBOL_ENUMERATION: /* ENUMERATION */
2237#line 340 "../libinterp/parse-tree/oct-parse.yy"
2238 { }
2239#line 2240 "libinterp/parse-tree/oct-parse.cc"
2240 break;
2241
2242 case YYSYMBOL_METAQUERY: /* METAQUERY */
2243#line 340 "../libinterp/parse-tree/oct-parse.yy"
2244 { }
2245#line 2246 "libinterp/parse-tree/oct-parse.cc"
2246 break;
2247
2248 case YYSYMBOL_SUPERCLASSREF: /* SUPERCLASSREF */
2249#line 340 "../libinterp/parse-tree/oct-parse.yy"
2250 { }
2251#line 2252 "libinterp/parse-tree/oct-parse.cc"
2252 break;
2253
2254 case YYSYMBOL_FQ_IDENT: /* FQ_IDENT */
2255#line 340 "../libinterp/parse-tree/oct-parse.yy"
2256 { }
2257#line 2258 "libinterp/parse-tree/oct-parse.cc"
2258 break;
2259
2260 case YYSYMBOL_GET: /* GET */
2261#line 340 "../libinterp/parse-tree/oct-parse.yy"
2262 { }
2263#line 2264 "libinterp/parse-tree/oct-parse.cc"
2264 break;
2265
2266 case YYSYMBOL_SET: /* SET */
2267#line 340 "../libinterp/parse-tree/oct-parse.yy"
2268 { }
2269#line 2270 "libinterp/parse-tree/oct-parse.cc"
2270 break;
2271
2272 case YYSYMBOL_FUNCTION: /* FUNCTION */
2273#line 340 "../libinterp/parse-tree/oct-parse.yy"
2274 { }
2275#line 2276 "libinterp/parse-tree/oct-parse.cc"
2276 break;
2277
2278 case YYSYMBOL_ARGUMENTS: /* ARGUMENTS */
2279#line 340 "../libinterp/parse-tree/oct-parse.yy"
2280 { }
2281#line 2282 "libinterp/parse-tree/oct-parse.cc"
2282 break;
2283
2284 case YYSYMBOL_LEXICAL_ERROR: /* LEXICAL_ERROR */
2285#line 340 "../libinterp/parse-tree/oct-parse.yy"
2286 { }
2287#line 2288 "libinterp/parse-tree/oct-parse.cc"
2288 break;
2289
2290 case YYSYMBOL_END_OF_INPUT: /* END_OF_INPUT */
2291#line 340 "../libinterp/parse-tree/oct-parse.yy"
2292 { }
2293#line 2294 "libinterp/parse-tree/oct-parse.cc"
2294 break;
2295
2296 case YYSYMBOL_UNARY: /* UNARY */
2297#line 341 "../libinterp/parse-tree/oct-parse.yy"
2298 { }
2299#line 2300 "libinterp/parse-tree/oct-parse.cc"
2300 break;
2301
2302 case YYSYMBOL_input: /* input */
2303#line 343 "../libinterp/parse-tree/oct-parse.yy"
2304 { delete ((*yyvaluep).tree_type); }
2305#line 2306 "libinterp/parse-tree/oct-parse.cc"
2306 break;
2307
2308 case YYSYMBOL_simple_list: /* simple_list */
2309#line 368 "../libinterp/parse-tree/oct-parse.yy"
2310 { delete ((*yyvaluep).tree_statement_list_type); }
2311#line 2312 "libinterp/parse-tree/oct-parse.cc"
2312 break;
2313
2314 case YYSYMBOL_simple_list1: /* simple_list1 */
2315#line 368 "../libinterp/parse-tree/oct-parse.yy"
2316 { delete ((*yyvaluep).tree_statement_list_type); }
2317#line 2318 "libinterp/parse-tree/oct-parse.cc"
2318 break;
2319
2320 case YYSYMBOL_statement_list: /* statement_list */
2321#line 368 "../libinterp/parse-tree/oct-parse.yy"
2322 { delete ((*yyvaluep).tree_statement_list_type); }
2323#line 2324 "libinterp/parse-tree/oct-parse.cc"
2324 break;
2325
2326 case YYSYMBOL_opt_list: /* opt_list */
2327#line 368 "../libinterp/parse-tree/oct-parse.yy"
2328 { delete ((*yyvaluep).tree_statement_list_type); }
2329#line 2330 "libinterp/parse-tree/oct-parse.cc"
2330 break;
2331
2332 case YYSYMBOL_list: /* list */
2333#line 368 "../libinterp/parse-tree/oct-parse.yy"
2334 { delete ((*yyvaluep).tree_statement_list_type); }
2335#line 2336 "libinterp/parse-tree/oct-parse.cc"
2336 break;
2337
2338 case YYSYMBOL_list1: /* list1 */
2339#line 368 "../libinterp/parse-tree/oct-parse.yy"
2340 { delete ((*yyvaluep).tree_statement_list_type); }
2341#line 2342 "libinterp/parse-tree/oct-parse.cc"
2342 break;
2343
2344 case YYSYMBOL_opt_fcn_list: /* opt_fcn_list */
2345#line 368 "../libinterp/parse-tree/oct-parse.yy"
2346 { delete ((*yyvaluep).tree_statement_list_type); }
2347#line 2348 "libinterp/parse-tree/oct-parse.cc"
2348 break;
2349
2350 case YYSYMBOL_fcn_list: /* fcn_list */
2351#line 368 "../libinterp/parse-tree/oct-parse.yy"
2352 { delete ((*yyvaluep).tree_statement_list_type); }
2353#line 2354 "libinterp/parse-tree/oct-parse.cc"
2354 break;
2355
2356 case YYSYMBOL_fcn_list1: /* fcn_list1 */
2357#line 368 "../libinterp/parse-tree/oct-parse.yy"
2358 { delete ((*yyvaluep).tree_statement_list_type); }
2359#line 2360 "libinterp/parse-tree/oct-parse.cc"
2360 break;
2361
2362 case YYSYMBOL_statement: /* statement */
2363#line 367 "../libinterp/parse-tree/oct-parse.yy"
2364 { delete ((*yyvaluep).tree_statement_type); }
2365#line 2366 "libinterp/parse-tree/oct-parse.cc"
2366 break;
2367
2368 case YYSYMBOL_word_list_cmd: /* word_list_cmd */
2369#line 354 "../libinterp/parse-tree/oct-parse.yy"
2370 { delete ((*yyvaluep).tree_index_expression_type); }
2371#line 2372 "libinterp/parse-tree/oct-parse.cc"
2372 break;
2373
2374 case YYSYMBOL_word_list: /* word_list */
2375#line 355 "../libinterp/parse-tree/oct-parse.yy"
2376 { delete ((*yyvaluep).tree_argument_list_type); }
2377#line 2378 "libinterp/parse-tree/oct-parse.cc"
2378 break;
2379
2380 case YYSYMBOL_identifier: /* identifier */
2381#line 353 "../libinterp/parse-tree/oct-parse.yy"
2382 { delete ((*yyvaluep).tree_identifier_type); }
2383#line 2384 "libinterp/parse-tree/oct-parse.cc"
2384 break;
2385
2386 case YYSYMBOL_superclass_identifier: /* superclass_identifier */
2387#line 349 "../libinterp/parse-tree/oct-parse.yy"
2388 { delete ((*yyvaluep).tree_superclass_ref_type); }
2389#line 2390 "libinterp/parse-tree/oct-parse.cc"
2390 break;
2391
2392 case YYSYMBOL_meta_identifier: /* meta_identifier */
2393#line 350 "../libinterp/parse-tree/oct-parse.yy"
2394 { delete ((*yyvaluep).tree_metaclass_query_type); }
2395#line 2396 "libinterp/parse-tree/oct-parse.cc"
2396 break;
2397
2398 case YYSYMBOL_string: /* string */
2399#line 347 "../libinterp/parse-tree/oct-parse.yy"
2400 { delete ((*yyvaluep).tree_constant_type); }
2401#line 2402 "libinterp/parse-tree/oct-parse.cc"
2402 break;
2403
2404 case YYSYMBOL_constant: /* constant */
2405#line 347 "../libinterp/parse-tree/oct-parse.yy"
2406 { delete ((*yyvaluep).tree_constant_type); }
2407#line 2408 "libinterp/parse-tree/oct-parse.cc"
2408 break;
2409
2410 case YYSYMBOL_matrix: /* matrix */
2411#line 346 "../libinterp/parse-tree/oct-parse.yy"
2412 { delete ((*yyvaluep).tree_expression_type); }
2413#line 2414 "libinterp/parse-tree/oct-parse.cc"
2414 break;
2415
2416 case YYSYMBOL_matrix_rows: /* matrix_rows */
2417#line 344 "../libinterp/parse-tree/oct-parse.yy"
2418 { delete ((*yyvaluep).tree_matrix_type); }
2419#line 2420 "libinterp/parse-tree/oct-parse.cc"
2420 break;
2421
2422 case YYSYMBOL_cell: /* cell */
2423#line 346 "../libinterp/parse-tree/oct-parse.yy"
2424 { delete ((*yyvaluep).tree_expression_type); }
2425#line 2426 "libinterp/parse-tree/oct-parse.cc"
2426 break;
2427
2428 case YYSYMBOL_cell_rows: /* cell_rows */
2429#line 345 "../libinterp/parse-tree/oct-parse.yy"
2430 { delete ((*yyvaluep).tree_cell_type); }
2431#line 2432 "libinterp/parse-tree/oct-parse.cc"
2432 break;
2433
2434 case YYSYMBOL_cell_or_matrix_row: /* cell_or_matrix_row */
2435#line 355 "../libinterp/parse-tree/oct-parse.yy"
2436 { delete ((*yyvaluep).tree_argument_list_type); }
2437#line 2438 "libinterp/parse-tree/oct-parse.cc"
2438 break;
2439
2440 case YYSYMBOL_fcn_handle: /* fcn_handle */
2441#line 348 "../libinterp/parse-tree/oct-parse.yy"
2442 { delete ((*yyvaluep).tree_fcn_handle_type); }
2443#line 2444 "libinterp/parse-tree/oct-parse.cc"
2444 break;
2445
2446 case YYSYMBOL_anon_fcn_handle: /* anon_fcn_handle */
2447#line 352 "../libinterp/parse-tree/oct-parse.yy"
2448 { delete ((*yyvaluep).tree_anon_fcn_handle_type); }
2449#line 2450 "libinterp/parse-tree/oct-parse.cc"
2450 break;
2451
2452 case YYSYMBOL_primary_expr: /* primary_expr */
2453#line 346 "../libinterp/parse-tree/oct-parse.yy"
2454 { delete ((*yyvaluep).tree_expression_type); }
2455#line 2456 "libinterp/parse-tree/oct-parse.cc"
2456 break;
2457
2458 case YYSYMBOL_magic_colon: /* magic_colon */
2459#line 347 "../libinterp/parse-tree/oct-parse.yy"
2460 { delete ((*yyvaluep).tree_constant_type); }
2461#line 2462 "libinterp/parse-tree/oct-parse.cc"
2462 break;
2463
2464 case YYSYMBOL_magic_tilde: /* magic_tilde */
2465#line 353 "../libinterp/parse-tree/oct-parse.yy"
2466 { delete ((*yyvaluep).tree_identifier_type); }
2467#line 2468 "libinterp/parse-tree/oct-parse.cc"
2468 break;
2469
2470 case YYSYMBOL_arg_list: /* arg_list */
2471#line 355 "../libinterp/parse-tree/oct-parse.yy"
2472 { delete ((*yyvaluep).tree_argument_list_type); }
2473#line 2474 "libinterp/parse-tree/oct-parse.cc"
2474 break;
2475
2476 case YYSYMBOL_indirect_ref_op: /* indirect_ref_op */
2477#line 340 "../libinterp/parse-tree/oct-parse.yy"
2478 { }
2479#line 2480 "libinterp/parse-tree/oct-parse.cc"
2480 break;
2481
2482 case YYSYMBOL_oper_expr: /* oper_expr */
2483#line 346 "../libinterp/parse-tree/oct-parse.yy"
2484 { delete ((*yyvaluep).tree_expression_type); }
2485#line 2486 "libinterp/parse-tree/oct-parse.cc"
2486 break;
2487
2488 case YYSYMBOL_power_expr: /* power_expr */
2489#line 346 "../libinterp/parse-tree/oct-parse.yy"
2490 { delete ((*yyvaluep).tree_expression_type); }
2491#line 2492 "libinterp/parse-tree/oct-parse.cc"
2492 break;
2493
2494 case YYSYMBOL_colon_expr: /* colon_expr */
2495#line 346 "../libinterp/parse-tree/oct-parse.yy"
2496 { delete ((*yyvaluep).tree_expression_type); }
2497#line 2498 "libinterp/parse-tree/oct-parse.cc"
2498 break;
2499
2500 case YYSYMBOL_simple_expr: /* simple_expr */
2501#line 346 "../libinterp/parse-tree/oct-parse.yy"
2502 { delete ((*yyvaluep).tree_expression_type); }
2503#line 2504 "libinterp/parse-tree/oct-parse.cc"
2504 break;
2505
2506 case YYSYMBOL_assign_lhs: /* assign_lhs */
2507#line 355 "../libinterp/parse-tree/oct-parse.yy"
2508 { delete ((*yyvaluep).tree_argument_list_type); }
2509#line 2510 "libinterp/parse-tree/oct-parse.cc"
2510 break;
2511
2512 case YYSYMBOL_assign_expr: /* assign_expr */
2513#line 346 "../libinterp/parse-tree/oct-parse.yy"
2514 { delete ((*yyvaluep).tree_expression_type); }
2515#line 2516 "libinterp/parse-tree/oct-parse.cc"
2516 break;
2517
2518 case YYSYMBOL_expression: /* expression */
2519#line 346 "../libinterp/parse-tree/oct-parse.yy"
2520 { delete ((*yyvaluep).tree_expression_type); }
2521#line 2522 "libinterp/parse-tree/oct-parse.cc"
2522 break;
2523
2524 case YYSYMBOL_command: /* command */
2525#line 357 "../libinterp/parse-tree/oct-parse.yy"
2526 { delete ((*yyvaluep).tree_command_type); }
2527#line 2528 "libinterp/parse-tree/oct-parse.cc"
2528 break;
2529
2530 case YYSYMBOL_declaration: /* declaration */
2531#line 366 "../libinterp/parse-tree/oct-parse.yy"
2532 { delete ((*yyvaluep).tree_decl_command_type); }
2533#line 2534 "libinterp/parse-tree/oct-parse.cc"
2534 break;
2535
2536 case YYSYMBOL_decl_init_list: /* decl_init_list */
2537#line 365 "../libinterp/parse-tree/oct-parse.yy"
2538 { delete ((*yyvaluep).tree_decl_init_list_type); }
2539#line 2540 "libinterp/parse-tree/oct-parse.cc"
2540 break;
2541
2542 case YYSYMBOL_decl_elt: /* decl_elt */
2543#line 364 "../libinterp/parse-tree/oct-parse.yy"
2544 { delete ((*yyvaluep).tree_decl_elt_type); }
2545#line 2546 "libinterp/parse-tree/oct-parse.cc"
2546 break;
2547
2548 case YYSYMBOL_select_command: /* select_command */
2549#line 357 "../libinterp/parse-tree/oct-parse.yy"
2550 { delete ((*yyvaluep).tree_command_type); }
2551#line 2552 "libinterp/parse-tree/oct-parse.cc"
2552 break;
2553
2554 case YYSYMBOL_if_command: /* if_command */
2555#line 358 "../libinterp/parse-tree/oct-parse.yy"
2556 { delete ((*yyvaluep).tree_if_command_type); }
2557#line 2558 "libinterp/parse-tree/oct-parse.cc"
2558 break;
2559
2560 case YYSYMBOL_if_clause_list: /* if_clause_list */
2561#line 360 "../libinterp/parse-tree/oct-parse.yy"
2562 { delete ((*yyvaluep).tree_if_command_list_type); }
2563#line 2564 "libinterp/parse-tree/oct-parse.cc"
2564 break;
2565
2566 case YYSYMBOL_if_clause: /* if_clause */
2567#line 359 "../libinterp/parse-tree/oct-parse.yy"
2568 { delete ((*yyvaluep).tree_if_clause_type); }
2569#line 2570 "libinterp/parse-tree/oct-parse.cc"
2570 break;
2571
2572 case YYSYMBOL_elseif_clause: /* elseif_clause */
2573#line 359 "../libinterp/parse-tree/oct-parse.yy"
2574 { delete ((*yyvaluep).tree_if_clause_type); }
2575#line 2576 "libinterp/parse-tree/oct-parse.cc"
2576 break;
2577
2578 case YYSYMBOL_else_clause: /* else_clause */
2579#line 359 "../libinterp/parse-tree/oct-parse.yy"
2580 { delete ((*yyvaluep).tree_if_clause_type); }
2581#line 2582 "libinterp/parse-tree/oct-parse.cc"
2582 break;
2583
2584 case YYSYMBOL_switch_command: /* switch_command */
2585#line 361 "../libinterp/parse-tree/oct-parse.yy"
2586 { delete ((*yyvaluep).tree_switch_command_type); }
2587#line 2588 "libinterp/parse-tree/oct-parse.cc"
2588 break;
2589
2590 case YYSYMBOL_case_list: /* case_list */
2591#line 363 "../libinterp/parse-tree/oct-parse.yy"
2592 { delete ((*yyvaluep).tree_switch_case_list_type); }
2593#line 2594 "libinterp/parse-tree/oct-parse.cc"
2594 break;
2595
2596 case YYSYMBOL_case_list1: /* case_list1 */
2597#line 363 "../libinterp/parse-tree/oct-parse.yy"
2598 { delete ((*yyvaluep).tree_switch_case_list_type); }
2599#line 2600 "libinterp/parse-tree/oct-parse.cc"
2600 break;
2601
2602 case YYSYMBOL_switch_case: /* switch_case */
2603#line 362 "../libinterp/parse-tree/oct-parse.yy"
2604 { delete ((*yyvaluep).tree_switch_case_type); }
2605#line 2606 "libinterp/parse-tree/oct-parse.cc"
2606 break;
2607
2608 case YYSYMBOL_default_case: /* default_case */
2609#line 362 "../libinterp/parse-tree/oct-parse.yy"
2610 { delete ((*yyvaluep).tree_switch_case_type); }
2611#line 2612 "libinterp/parse-tree/oct-parse.cc"
2612 break;
2613
2614 case YYSYMBOL_loop_command: /* loop_command */
2615#line 357 "../libinterp/parse-tree/oct-parse.yy"
2616 { delete ((*yyvaluep).tree_command_type); }
2617#line 2618 "libinterp/parse-tree/oct-parse.cc"
2618 break;
2619
2620 case YYSYMBOL_jump_command: /* jump_command */
2621#line 357 "../libinterp/parse-tree/oct-parse.yy"
2622 { delete ((*yyvaluep).tree_command_type); }
2623#line 2624 "libinterp/parse-tree/oct-parse.cc"
2624 break;
2625
2626 case YYSYMBOL_spmd_command: /* spmd_command */
2627#line 357 "../libinterp/parse-tree/oct-parse.yy"
2628 { delete ((*yyvaluep).tree_command_type); }
2629#line 2630 "libinterp/parse-tree/oct-parse.cc"
2630 break;
2631
2632 case YYSYMBOL_except_command: /* except_command */
2633#line 357 "../libinterp/parse-tree/oct-parse.yy"
2634 { delete ((*yyvaluep).tree_command_type); }
2635#line 2636 "libinterp/parse-tree/oct-parse.cc"
2636 break;
2637
2638 case YYSYMBOL_param_list_beg: /* param_list_beg */
2639#line 340 "../libinterp/parse-tree/oct-parse.yy"
2640 { }
2641#line 2642 "libinterp/parse-tree/oct-parse.cc"
2642 break;
2643
2644 case YYSYMBOL_param_list_end: /* param_list_end */
2645#line 340 "../libinterp/parse-tree/oct-parse.yy"
2646 { }
2647#line 2648 "libinterp/parse-tree/oct-parse.cc"
2648 break;
2649
2650 case YYSYMBOL_opt_param_list: /* opt_param_list */
2651#line 356 "../libinterp/parse-tree/oct-parse.yy"
2652 { delete ((*yyvaluep).tree_parameter_list_type); }
2653#line 2654 "libinterp/parse-tree/oct-parse.cc"
2654 break;
2655
2656 case YYSYMBOL_param_list: /* param_list */
2657#line 356 "../libinterp/parse-tree/oct-parse.yy"
2658 { delete ((*yyvaluep).tree_parameter_list_type); }
2659#line 2660 "libinterp/parse-tree/oct-parse.cc"
2660 break;
2661
2662 case YYSYMBOL_param_list1: /* param_list1 */
2663#line 356 "../libinterp/parse-tree/oct-parse.yy"
2664 { delete ((*yyvaluep).tree_parameter_list_type); }
2665#line 2666 "libinterp/parse-tree/oct-parse.cc"
2666 break;
2667
2668 case YYSYMBOL_param_list2: /* param_list2 */
2669#line 356 "../libinterp/parse-tree/oct-parse.yy"
2670 { delete ((*yyvaluep).tree_parameter_list_type); }
2671#line 2672 "libinterp/parse-tree/oct-parse.cc"
2672 break;
2673
2674 case YYSYMBOL_param_list_elt: /* param_list_elt */
2675#line 364 "../libinterp/parse-tree/oct-parse.yy"
2676 { delete ((*yyvaluep).tree_decl_elt_type); }
2677#line 2678 "libinterp/parse-tree/oct-parse.cc"
2678 break;
2679
2680 case YYSYMBOL_return_list: /* return_list */
2681#line 356 "../libinterp/parse-tree/oct-parse.yy"
2682 { delete ((*yyvaluep).tree_parameter_list_type); }
2683#line 2684 "libinterp/parse-tree/oct-parse.cc"
2684 break;
2685
2686 case YYSYMBOL_return_list1: /* return_list1 */
2687#line 356 "../libinterp/parse-tree/oct-parse.yy"
2688 { delete ((*yyvaluep).tree_parameter_list_type); }
2689#line 2690 "libinterp/parse-tree/oct-parse.cc"
2690 break;
2691
2692 case YYSYMBOL_file: /* file */
2693#line 357 "../libinterp/parse-tree/oct-parse.yy"
2694 { delete ((*yyvaluep).tree_command_type); }
2695#line 2696 "libinterp/parse-tree/oct-parse.cc"
2696 break;
2697
2698 case YYSYMBOL_function_beg: /* function_beg */
2699#line 340 "../libinterp/parse-tree/oct-parse.yy"
2700 { }
2701#line 2702 "libinterp/parse-tree/oct-parse.cc"
2702 break;
2703
2704 case YYSYMBOL_fcn_name: /* fcn_name */
2705#line 353 "../libinterp/parse-tree/oct-parse.yy"
2706 { delete ((*yyvaluep).tree_identifier_type); }
2707#line 2708 "libinterp/parse-tree/oct-parse.cc"
2708 break;
2709
2710 case YYSYMBOL_function_end: /* function_end */
2711#line 367 "../libinterp/parse-tree/oct-parse.yy"
2712 { delete ((*yyvaluep).tree_statement_type); }
2713#line 2714 "libinterp/parse-tree/oct-parse.cc"
2714 break;
2715
2716 case YYSYMBOL_function: /* function */
2717#line 351 "../libinterp/parse-tree/oct-parse.yy"
2718 { delete ((*yyvaluep).tree_function_def_type); }
2719#line 2720 "libinterp/parse-tree/oct-parse.cc"
2720 break;
2721
2722 case YYSYMBOL_function_body: /* function_body */
2723#line 368 "../libinterp/parse-tree/oct-parse.yy"
2724 { delete ((*yyvaluep).tree_statement_list_type); }
2725#line 2726 "libinterp/parse-tree/oct-parse.cc"
2726 break;
2727
2728 case YYSYMBOL_arguments_block_list: /* arguments_block_list */
2729#line 368 "../libinterp/parse-tree/oct-parse.yy"
2730 { delete ((*yyvaluep).tree_statement_list_type); }
2731#line 2732 "libinterp/parse-tree/oct-parse.cc"
2732 break;
2733
2734 case YYSYMBOL_arguments_block: /* arguments_block */
2735#line 369 "../libinterp/parse-tree/oct-parse.yy"
2736 { delete ((*yyvaluep).tree_arguments_block_type); }
2737#line 2738 "libinterp/parse-tree/oct-parse.cc"
2738 break;
2739
2740 case YYSYMBOL_arguments_beg: /* arguments_beg */
2741#line 340 "../libinterp/parse-tree/oct-parse.yy"
2742 { }
2743#line 2744 "libinterp/parse-tree/oct-parse.cc"
2744 break;
2745
2746 case YYSYMBOL_args_attr_list: /* args_attr_list */
2747#line 370 "../libinterp/parse-tree/oct-parse.yy"
2748 { delete ((*yyvaluep).tree_args_block_attribute_list_type); }
2749#line 2750 "libinterp/parse-tree/oct-parse.cc"
2750 break;
2751
2752 case YYSYMBOL_args_validation_list: /* args_validation_list */
2753#line 371 "../libinterp/parse-tree/oct-parse.yy"
2754 { delete ((*yyvaluep).tree_args_block_validation_list_type); }
2755#line 2756 "libinterp/parse-tree/oct-parse.cc"
2756 break;
2757
2758 case YYSYMBOL_arg_name: /* arg_name */
2759#line 346 "../libinterp/parse-tree/oct-parse.yy"
2760 { delete ((*yyvaluep).tree_expression_type); }
2761#line 2762 "libinterp/parse-tree/oct-parse.cc"
2762 break;
2763
2764 case YYSYMBOL_arg_validation: /* arg_validation */
2765#line 372 "../libinterp/parse-tree/oct-parse.yy"
2766 { delete ((*yyvaluep).tree_arg_validation_type); }
2767#line 2768 "libinterp/parse-tree/oct-parse.cc"
2768 break;
2769
2770 case YYSYMBOL_size_spec: /* size_spec */
2771#line 373 "../libinterp/parse-tree/oct-parse.yy"
2772 { delete ((*yyvaluep).tree_arg_size_spec_type); }
2773#line 2774 "libinterp/parse-tree/oct-parse.cc"
2774 break;
2775
2776 case YYSYMBOL_class_name: /* class_name */
2777#line 353 "../libinterp/parse-tree/oct-parse.yy"
2778 { delete ((*yyvaluep).tree_identifier_type); }
2779#line 2780 "libinterp/parse-tree/oct-parse.cc"
2780 break;
2781
2782 case YYSYMBOL_validation_fcns: /* validation_fcns */
2783#line 374 "../libinterp/parse-tree/oct-parse.yy"
2784 { delete ((*yyvaluep).tree_arg_validation_fcns_type); }
2785#line 2786 "libinterp/parse-tree/oct-parse.cc"
2786 break;
2787
2788 case YYSYMBOL_classdef_beg: /* classdef_beg */
2789#line 340 "../libinterp/parse-tree/oct-parse.yy"
2790 { }
2791#line 2792 "libinterp/parse-tree/oct-parse.cc"
2792 break;
2793
2794 case YYSYMBOL_classdef: /* classdef */
2795#line 377 "../libinterp/parse-tree/oct-parse.yy"
2796 { delete ((*yyvaluep).tree_classdef_type); }
2797#line 2798 "libinterp/parse-tree/oct-parse.cc"
2798 break;
2799
2800 case YYSYMBOL_attr_list: /* attr_list */
2801#line 379 "../libinterp/parse-tree/oct-parse.yy"
2802 { delete ((*yyvaluep).tree_classdef_attribute_list_type); }
2803#line 2804 "libinterp/parse-tree/oct-parse.cc"
2804 break;
2805
2806 case YYSYMBOL_attr_list1: /* attr_list1 */
2807#line 379 "../libinterp/parse-tree/oct-parse.yy"
2808 { delete ((*yyvaluep).tree_classdef_attribute_list_type); }
2809#line 2810 "libinterp/parse-tree/oct-parse.cc"
2810 break;
2811
2812 case YYSYMBOL_attr: /* attr */
2813#line 378 "../libinterp/parse-tree/oct-parse.yy"
2814 { delete ((*yyvaluep).tree_classdef_attribute_type); }
2815#line 2816 "libinterp/parse-tree/oct-parse.cc"
2816 break;
2817
2818 case YYSYMBOL_superclass_list: /* superclass_list */
2819#line 381 "../libinterp/parse-tree/oct-parse.yy"
2820 { delete ((*yyvaluep).tree_classdef_superclass_list_type); }
2821#line 2822 "libinterp/parse-tree/oct-parse.cc"
2822 break;
2823
2824 case YYSYMBOL_superclass_list1: /* superclass_list1 */
2825#line 381 "../libinterp/parse-tree/oct-parse.yy"
2826 { delete ((*yyvaluep).tree_classdef_superclass_list_type); }
2827#line 2828 "libinterp/parse-tree/oct-parse.cc"
2828 break;
2829
2830 case YYSYMBOL_superclass: /* superclass */
2831#line 380 "../libinterp/parse-tree/oct-parse.yy"
2832 { delete ((*yyvaluep).tree_classdef_superclass_type); }
2833#line 2834 "libinterp/parse-tree/oct-parse.cc"
2834 break;
2835
2836 case YYSYMBOL_class_body: /* class_body */
2837#line 382 "../libinterp/parse-tree/oct-parse.yy"
2838 { delete ((*yyvaluep).tree_classdef_body_type); }
2839#line 2840 "libinterp/parse-tree/oct-parse.cc"
2840 break;
2841
2842 case YYSYMBOL_class_body1: /* class_body1 */
2843#line 382 "../libinterp/parse-tree/oct-parse.yy"
2844 { delete ((*yyvaluep).tree_classdef_body_type); }
2845#line 2846 "libinterp/parse-tree/oct-parse.cc"
2846 break;
2847
2848 case YYSYMBOL_properties_block: /* properties_block */
2849#line 385 "../libinterp/parse-tree/oct-parse.yy"
2850 { delete ((*yyvaluep).tree_classdef_properties_block_type); }
2851#line 2852 "libinterp/parse-tree/oct-parse.cc"
2852 break;
2853
2854 case YYSYMBOL_properties_beg: /* properties_beg */
2855#line 340 "../libinterp/parse-tree/oct-parse.yy"
2856 { }
2857#line 2858 "libinterp/parse-tree/oct-parse.cc"
2858 break;
2859
2860 case YYSYMBOL_property_list: /* property_list */
2861#line 384 "../libinterp/parse-tree/oct-parse.yy"
2862 { delete ((*yyvaluep).tree_classdef_property_list_type); }
2863#line 2864 "libinterp/parse-tree/oct-parse.cc"
2864 break;
2865
2866 case YYSYMBOL_property_list1: /* property_list1 */
2867#line 384 "../libinterp/parse-tree/oct-parse.yy"
2868 { delete ((*yyvaluep).tree_classdef_property_list_type); }
2869#line 2870 "libinterp/parse-tree/oct-parse.cc"
2870 break;
2871
2872 case YYSYMBOL_class_property: /* class_property */
2873#line 383 "../libinterp/parse-tree/oct-parse.yy"
2874 { delete ((*yyvaluep).tree_classdef_property_type); }
2875#line 2876 "libinterp/parse-tree/oct-parse.cc"
2876 break;
2877
2878 case YYSYMBOL_methods_block: /* methods_block */
2879#line 387 "../libinterp/parse-tree/oct-parse.yy"
2880 { delete ((*yyvaluep).tree_classdef_methods_block_type); }
2881#line 2882 "libinterp/parse-tree/oct-parse.cc"
2882 break;
2883
2884 case YYSYMBOL_methods_beg: /* methods_beg */
2885#line 340 "../libinterp/parse-tree/oct-parse.yy"
2886 { }
2887#line 2888 "libinterp/parse-tree/oct-parse.cc"
2888 break;
2889
2890 case YYSYMBOL_method_decl1: /* method_decl1 */
2891#line 375 "../libinterp/parse-tree/oct-parse.yy"
2892 { delete ((*yyvaluep).octave_user_function_type); }
2893#line 2894 "libinterp/parse-tree/oct-parse.cc"
2894 break;
2895
2896 case YYSYMBOL_method_decl: /* method_decl */
2897#line 351 "../libinterp/parse-tree/oct-parse.yy"
2898 { delete ((*yyvaluep).tree_function_def_type); }
2899#line 2900 "libinterp/parse-tree/oct-parse.cc"
2900 break;
2901
2902 case YYSYMBOL_method: /* method */
2903#line 351 "../libinterp/parse-tree/oct-parse.yy"
2904 { delete ((*yyvaluep).tree_function_def_type); }
2905#line 2906 "libinterp/parse-tree/oct-parse.cc"
2906 break;
2907
2908 case YYSYMBOL_method_list: /* method_list */
2909#line 386 "../libinterp/parse-tree/oct-parse.yy"
2910 { delete ((*yyvaluep).tree_classdef_method_list_type); }
2911#line 2912 "libinterp/parse-tree/oct-parse.cc"
2912 break;
2913
2914 case YYSYMBOL_method_list1: /* method_list1 */
2915#line 386 "../libinterp/parse-tree/oct-parse.yy"
2916 { delete ((*yyvaluep).tree_classdef_method_list_type); }
2917#line 2918 "libinterp/parse-tree/oct-parse.cc"
2918 break;
2919
2920 case YYSYMBOL_events_block: /* events_block */
2921#line 390 "../libinterp/parse-tree/oct-parse.yy"
2922 { delete ((*yyvaluep).tree_classdef_events_block_type); }
2923#line 2924 "libinterp/parse-tree/oct-parse.cc"
2924 break;
2925
2926 case YYSYMBOL_events_beg: /* events_beg */
2927#line 340 "../libinterp/parse-tree/oct-parse.yy"
2928 { }
2929#line 2930 "libinterp/parse-tree/oct-parse.cc"
2930 break;
2931
2932 case YYSYMBOL_event_list: /* event_list */
2933#line 389 "../libinterp/parse-tree/oct-parse.yy"
2934 { delete ((*yyvaluep).tree_classdef_event_list_type); }
2935#line 2936 "libinterp/parse-tree/oct-parse.cc"
2936 break;
2937
2938 case YYSYMBOL_event_list1: /* event_list1 */
2939#line 389 "../libinterp/parse-tree/oct-parse.yy"
2940 { delete ((*yyvaluep).tree_classdef_event_list_type); }
2941#line 2942 "libinterp/parse-tree/oct-parse.cc"
2942 break;
2943
2944 case YYSYMBOL_class_event: /* class_event */
2945#line 388 "../libinterp/parse-tree/oct-parse.yy"
2946 { delete ((*yyvaluep).tree_classdef_event_type); }
2947#line 2948 "libinterp/parse-tree/oct-parse.cc"
2948 break;
2949
2950 case YYSYMBOL_enum_block: /* enum_block */
2951#line 393 "../libinterp/parse-tree/oct-parse.yy"
2952 { delete ((*yyvaluep).tree_classdef_enum_block_type); }
2953#line 2954 "libinterp/parse-tree/oct-parse.cc"
2954 break;
2955
2956 case YYSYMBOL_enumeration_beg: /* enumeration_beg */
2957#line 340 "../libinterp/parse-tree/oct-parse.yy"
2958 { }
2959#line 2960 "libinterp/parse-tree/oct-parse.cc"
2960 break;
2961
2962 case YYSYMBOL_enum_list: /* enum_list */
2963#line 392 "../libinterp/parse-tree/oct-parse.yy"
2964 { delete ((*yyvaluep).tree_classdef_enum_list_type); }
2965#line 2966 "libinterp/parse-tree/oct-parse.cc"
2966 break;
2967
2968 case YYSYMBOL_enum_list1: /* enum_list1 */
2969#line 392 "../libinterp/parse-tree/oct-parse.yy"
2970 { delete ((*yyvaluep).tree_classdef_enum_list_type); }
2971#line 2972 "libinterp/parse-tree/oct-parse.cc"
2972 break;
2973
2974 case YYSYMBOL_class_enum: /* class_enum */
2975#line 391 "../libinterp/parse-tree/oct-parse.yy"
2976 { delete ((*yyvaluep).tree_classdef_enum_type); }
2977#line 2978 "libinterp/parse-tree/oct-parse.cc"
2978 break;
2979
2980 default:
2981 break;
2982 }
2984}
2985
2986
2987
2988
2989
2990int
2991yyparse (octave::base_parser& parser)
2992{
2993 yypstate *yyps = yypstate_new ();
2994 if (!yyps)
2995 {
2996 yyerror (parser, YY_("memory exhausted"));
2997 return 2;
2998 }
2999 int yystatus = yypull_parse (yyps, parser);
3000 yypstate_delete (yyps);
3001 return yystatus;
3002}
3003
3004int
3005yypull_parse (yypstate *yyps, octave::base_parser& parser)
3006{
3007 YY_ASSERT (yyps);
3008 int yystatus;
3009 do {
3011 int yychar = yylex (&yylval, scanner);
3012 yystatus = yypush_parse (yyps, yychar, &yylval, parser);
3013 } while (yystatus == YYPUSH_MORE);
3014 return yystatus;
3015}
3016
3017#define octave_nerrs yyps->octave_nerrs
3018#define yystate yyps->yystate
3019#define yyerrstatus yyps->yyerrstatus
3020#define yyssa yyps->yyssa
3021#define yyss yyps->yyss
3022#define yyssp yyps->yyssp
3023#define yyvsa yyps->yyvsa
3024#define yyvs yyps->yyvs
3025#define yyvsp yyps->yyvsp
3026#define yystacksize yyps->yystacksize
3027
3028/* Initialize the parser data structure. */
3029static void
3031{
3032 yynerrs = 0;
3033 yystate = 0;
3034 yyerrstatus = 0;
3035
3036 yyssp = yyss;
3037 yyvsp = yyvs;
3038
3039 /* Initialize the state stack, in case yypcontext_expected_tokens is
3040 called before the first call to yyparse. */
3041 *yyssp = 0;
3042 yyps->yynew = 1;
3043}
3044
3045/* Initialize the parser data structure. */
3046yypstate *
3048{
3049 yypstate *yyps;
3050 yyps = YY_CAST (yypstate *, YYMALLOC (sizeof *yyps));
3051 if (!yyps)
3052 return YY_NULLPTR;
3054 yyss = yyssa;
3055 yyvs = yyvsa;
3056 yypstate_clear (yyps);
3057 return yyps;
3058}
3059
3060void
3062{
3063 if (yyps)
3064 {
3065#ifndef yyoverflow
3066 /* If the stack was reallocated but the parse did not complete, then the
3067 stack still needs to be freed. */
3068 if (yyss != yyssa)
3070#endif
3071 YYFREE (yyps);
3072 }
3073}
3074
3075
3076
3077/*---------------.
3078| yypush_parse. |
3079`---------------*/
3080
3081int
3083 int yypushed_char, YYSTYPE const *yypushed_val, octave::base_parser& parser)
3084{
3085/* Lookahead token kind. */
3086int yychar;
3087
3088
3089/* The semantic value of the lookahead symbol. */
3090/* Default value used for initialization, for pacifying older GCCs
3091 or non-GCC compilers. */
3092YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
3093YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
3094
3095 int yyn;
3096 /* The return value of yyparse. */
3097 int yyresult;
3098 /* Lookahead symbol kind. */
3100 /* The variables used to return semantic value and location from the
3101 action routines. */
3102 YYSTYPE yyval;
3103
3104
3105
3106#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3107
3108 /* The number of symbols on the RHS of the reduced rule.
3109 Keep to zero when no symbol should be popped. */
3110 int yylen = 0;
3111
3112 switch (yyps->yynew)
3113 {
3114 case 0:
3115 yyn = yypact[yystate];
3116 goto yyread_pushed_token;
3117
3118 case 2:
3119 yypstate_clear (yyps);
3120 break;
3121
3122 default:
3123 break;
3124 }
3125
3126 YYDPRINTF ((stderr, "Starting parse\n"));
3127
3128 yychar = OCTAVE_EMPTY; /* Cause a token to be read. */
3129
3130 goto yysetstate;
3131
3132
3133/*------------------------------------------------------------.
3134| yynewstate -- push a new state, which is found in yystate. |
3135`------------------------------------------------------------*/
3136yynewstate:
3137 /* In all cases, when you get here, the value and location stacks
3138 have just been pushed. So pushing a state here evens the stacks. */
3139 yyssp++;
3140
3141
3142/*--------------------------------------------------------------------.
3143| yysetstate -- set current state (the top of the stack) to yystate. |
3144`--------------------------------------------------------------------*/
3145yysetstate:
3146 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3147 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
3152
3153 if (yyss + yystacksize - 1 <= yyssp)
3154#if !defined yyoverflow && !defined YYSTACK_RELOCATE
3155 YYNOMEM;
3156#else
3157 {
3158 /* Get the current used size of the three stacks, in elements. */
3159 YYPTRDIFF_T yysize = yyssp - yyss + 1;
3160
3161# if defined yyoverflow
3162 {
3163 /* Give user a chance to reallocate the stack. Use copies of
3164 these so that the &'s don't force the real ones into
3165 memory. */
3166 yy_state_t *yyss1 = yyss;
3167 YYSTYPE *yyvs1 = yyvs;
3168
3169 /* Each stack pointer address is followed by the size of the
3170 data in use in that stack, in bytes. This used to be a
3171 conditional around just the two extra args, but that might
3172 be undefined if yyoverflow is a macro. */
3173 yyoverflow (YY_("memory exhausted"),
3174 &yyss1, yysize * YYSIZEOF (*yyssp),
3175 &yyvs1, yysize * YYSIZEOF (*yyvsp),
3176 &yystacksize);
3177 yyss = yyss1;
3178 yyvs = yyvs1;
3179 }
3180# else /* defined YYSTACK_RELOCATE */
3181 /* Extend the stack our own way. */
3182 if (YYMAXDEPTH <= yystacksize)
3183 YYNOMEM;
3184 yystacksize *= 2;
3185 if (YYMAXDEPTH < yystacksize)
3187
3188 {
3189 yy_state_t *yyss1 = yyss;
3190 union yyalloc *yyptr =
3191 YY_CAST (union yyalloc *,
3193 if (! yyptr)
3194 YYNOMEM;
3195 YYSTACK_RELOCATE (yyss_alloc, yyss);
3196 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3197# undef YYSTACK_RELOCATE
3198 if (yyss1 != yyssa)
3199 YYSTACK_FREE (yyss1);
3200 }
3201# endif
3202
3203 yyssp = yyss + yysize - 1;
3204 yyvsp = yyvs + yysize - 1;
3205
3207 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
3208 YY_CAST (long, yystacksize)));
3210
3211 if (yyss + yystacksize - 1 <= yyssp)
3212 YYABORT;
3213 }
3214#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
3215
3216
3217 if (yystate == YYFINAL)
3218 YYACCEPT;
3219
3220 goto yybackup;
3221
3222
3223/*-----------.
3224| yybackup. |
3225`-----------*/
3226yybackup:
3227 /* Do appropriate processing given the current state. Read a
3228 lookahead token if we need one and don't already have one. */
3229
3230 /* First try to decide what to do without reference to lookahead token. */
3231 yyn = yypact[yystate];
3232 if (yypact_value_is_default (yyn))
3233 goto yydefault;
3234
3235 /* Not known => get a lookahead token if don't already have one. */
3236
3237 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
3238 if (yychar == OCTAVE_EMPTY)
3239 {
3240 if (!yyps->yynew)
3241 {
3242 YYDPRINTF ((stderr, "Return for a new token:\n"));
3243 yyresult = YYPUSH_MORE;
3244 goto yypushreturn;
3245 }
3246 yyps->yynew = 0;
3247yyread_pushed_token:
3248 YYDPRINTF ((stderr, "Reading a token\n"));
3249 yychar = yypushed_char;
3250 if (yypushed_val)
3251 yylval = *yypushed_val;
3252 }
3253
3254 if (yychar <= OCTAVE_EOF)
3255 {
3256 yychar = OCTAVE_EOF;
3257 yytoken = YYSYMBOL_YYEOF;
3258 YYDPRINTF ((stderr, "Now at end of input.\n"));
3259 }
3260 else if (yychar == OCTAVE_error)
3261 {
3262 /* The scanner already issued an error message, process directly
3263 to error recovery. But do not keep the error token as
3264 lookahead, it is too special and may lead us to an endless
3265 loop in error recovery. */
3266 yychar = OCTAVE_UNDEF;
3267 yytoken = YYSYMBOL_YYerror;
3268 goto yyerrlab1;
3269 }
3270 else
3271 {
3272 yytoken = YYTRANSLATE (yychar);
3273 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3274 }
3275
3276 /* If the proper action on seeing token YYTOKEN is to reduce or to
3277 detect an error, take that action. */
3278 yyn += yytoken;
3279 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3280 goto yydefault;
3281 yyn = yytable[yyn];
3282 if (yyn <= 0)
3283 {
3284 if (yytable_value_is_error (yyn))
3285 goto yyerrlab;
3286 yyn = -yyn;
3287 goto yyreduce;
3288 }
3289
3290 /* Count tokens shifted since error; after three, turn off error
3291 status. */
3292 if (yyerrstatus)
3293 yyerrstatus--;
3294
3295 /* Shift the lookahead token. */
3296 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3297 yystate = yyn;
3299 *++yyvsp = yylval;
3301
3302 /* Discard the shifted token. */
3303 yychar = OCTAVE_EMPTY;
3304 goto yynewstate;
3305
3306
3307/*-----------------------------------------------------------.
3308| yydefault -- do the default action for the current state. |
3309`-----------------------------------------------------------*/
3310yydefault:
3311 yyn = yydefact[yystate];
3312 if (yyn == 0)
3313 goto yyerrlab;
3314 goto yyreduce;
3315
3316
3317/*-----------------------------.
3318| yyreduce -- do a reduction. |
3319`-----------------------------*/
3320yyreduce:
3321 /* yyn is the number of a rule to reduce with. */
3322 yylen = yyr2[yyn];
3323
3324 /* If YYLEN is nonzero, implement the default value of the action:
3325 '$$ = $1'.
3326
3327 Otherwise, the following line sets YYVAL to garbage.
3328 This behavior is undocumented and Bison
3329 users should not rely upon it. Assigning to YYVAL
3330 unconditionally makes the parser a bit smaller, and it avoids a
3331 GCC warning that YYVAL may be used uninitialized. */
3332 yyval = yyvsp[1-yylen];
3333
3334
3335 YY_REDUCE_PRINT (yyn);
3336 switch (yyn)
3337 {
3338 case 2: /* input: simple_list '\n' */
3339#line 412 "../libinterp/parse-tree/oct-parse.yy"
3340 {
3341 OCTAVE_YYUSE ((yyvsp[0].tok));
3342
3343 (yyval.tree_type) = nullptr;
3344
3345 if (! parser.finish_input ((yyvsp[-1].tree_statement_list_type)))
3346 YYABORT;
3347 else
3348 YYACCEPT;
3349 }
3350#line 3351 "libinterp/parse-tree/oct-parse.cc"
3351 break;
3352
3353 case 3: /* input: simple_list END_OF_INPUT */
3354#line 423 "../libinterp/parse-tree/oct-parse.yy"
3355 {
3356 OCTAVE_YYUSE ((yyvsp[0].tok));
3357
3358 (yyval.tree_type) = nullptr;
3359
3360 if (! parser.finish_input ((yyvsp[-1].tree_statement_list_type), true))
3361 YYABORT;
3362 else
3363 YYACCEPT;
3364 }
3365#line 3366 "libinterp/parse-tree/oct-parse.cc"
3366 break;
3367
3368 case 4: /* input: file */
3369#line 434 "../libinterp/parse-tree/oct-parse.yy"
3370 {
3371 lexer.m_end_of_input = true;
3372
3373 (yyval.tree_type) = (yyvsp[0].tree_command_type);
3374 YYACCEPT;
3375 }
3376#line 3377 "libinterp/parse-tree/oct-parse.cc"
3377 break;
3378
3379 case 5: /* input: parse_error */
3380#line 441 "../libinterp/parse-tree/oct-parse.yy"
3381 {
3382 (yyval.tree_type) = nullptr;
3383 YYABORT;
3384 }
3385#line 3386 "libinterp/parse-tree/oct-parse.cc"
3386 break;
3387
3388 case 6: /* simple_list: opt_sep_no_nl */
3389#line 448 "../libinterp/parse-tree/oct-parse.yy"
3390 {
3391 // FIXME: should we return an empty statement list
3392 // with the separators attached? For now, delete
3393 // the unused list.
3394 delete (yyvsp[0].sep_list_type);
3395
3396 (yyval.tree_statement_list_type) = nullptr;
3397 }
3398#line 3399 "libinterp/parse-tree/oct-parse.cc"
3399 break;
3400
3401 case 7: /* simple_list: simple_list1 opt_sep_no_nl */
3402#line 457 "../libinterp/parse-tree/oct-parse.yy"
3403 { (yyval.tree_statement_list_type) = parser.set_stmt_print_flag ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].sep_list_type), false); }
3404#line 3405 "libinterp/parse-tree/oct-parse.cc"
3405 break;
3406
3407 case 8: /* simple_list1: statement */
3408#line 461 "../libinterp/parse-tree/oct-parse.yy"
3409 { (yyval.tree_statement_list_type) = parser.make_statement_list ((yyvsp[0].tree_statement_type)); }
3410#line 3411 "libinterp/parse-tree/oct-parse.cc"
3411 break;
3412
3413 case 9: /* simple_list1: simple_list1 sep_no_nl statement */
3414#line 463 "../libinterp/parse-tree/oct-parse.yy"
3415 { (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), (yyvsp[0].tree_statement_type), false); }
3416#line 3417 "libinterp/parse-tree/oct-parse.cc"
3417 break;
3418
3419 case 10: /* statement_list: opt_sep opt_list */
3420#line 467 "../libinterp/parse-tree/oct-parse.yy"
3421 {
3422 // FIXME: Need to capture separator list here.
3423 // For now, delete the unused list.
3424 delete (yyvsp[-1].sep_list_type);
3425
3426 (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type);
3427 }
3428#line 3429 "libinterp/parse-tree/oct-parse.cc"
3429 break;
3430
3431 case 11: /* opt_list: %empty */
3432#line 477 "../libinterp/parse-tree/oct-parse.yy"
3433 { (yyval.tree_statement_list_type) = nullptr; }
3434#line 3435 "libinterp/parse-tree/oct-parse.cc"
3435 break;
3436
3437 case 12: /* opt_list: list */
3438#line 479 "../libinterp/parse-tree/oct-parse.yy"
3439 { (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type); }
3440#line 3441 "libinterp/parse-tree/oct-parse.cc"
3441 break;
3442
3443 case 13: /* list: list1 opt_sep */
3444#line 483 "../libinterp/parse-tree/oct-parse.yy"
3445 {
3446 (yyval.tree_statement_list_type) = parser.set_stmt_print_flag ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].sep_list_type), true);
3447
3448 // FIXME: Need to capture separator list here.
3449 // For now, delete the unused list.
3450 delete (yyvsp[0].sep_list_type);
3451 }
3452#line 3453 "libinterp/parse-tree/oct-parse.cc"
3453 break;
3454
3455 case 14: /* list1: statement */
3456#line 493 "../libinterp/parse-tree/oct-parse.yy"
3457 { (yyval.tree_statement_list_type) = parser.make_statement_list ((yyvsp[0].tree_statement_type)); }
3458#line 3459 "libinterp/parse-tree/oct-parse.cc"
3459 break;
3460
3461 case 15: /* list1: list1 sep statement */
3462#line 495 "../libinterp/parse-tree/oct-parse.yy"
3463 { (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), (yyvsp[0].tree_statement_type), true); }
3464#line 3465 "libinterp/parse-tree/oct-parse.cc"
3465 break;
3466
3467 case 16: /* opt_fcn_list: %empty */
3468#line 499 "../libinterp/parse-tree/oct-parse.yy"
3469 { (yyval.tree_statement_list_type) = nullptr; }
3470#line 3471 "libinterp/parse-tree/oct-parse.cc"
3471 break;
3472
3473 case 17: /* opt_fcn_list: fcn_list */
3474#line 501 "../libinterp/parse-tree/oct-parse.yy"
3475 { (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type); }
3476#line 3477 "libinterp/parse-tree/oct-parse.cc"
3477 break;
3478
3479 case 18: /* fcn_list: fcn_list1 opt_sep */
3480#line 505 "../libinterp/parse-tree/oct-parse.yy"
3481 {
3482 // FIXME: Need to capture separator list here.
3483 // For now, delete the unused list.
3484 delete (yyvsp[0].sep_list_type);
3485
3486 (yyval.tree_statement_list_type) = (yyvsp[-1].tree_statement_list_type);
3487 }
3488#line 3489 "libinterp/parse-tree/oct-parse.cc"
3489 break;
3490
3491 case 19: /* fcn_list1: function */
3492#line 515 "../libinterp/parse-tree/oct-parse.yy"
3493 { (yyval.tree_statement_list_type) = parser.make_function_def_list ((yyvsp[0].tree_function_def_type)); }
3494#line 3495 "libinterp/parse-tree/oct-parse.cc"
3495 break;
3496
3497 case 20: /* fcn_list1: fcn_list1 opt_sep function */
3498#line 517 "../libinterp/parse-tree/oct-parse.yy"
3499 { (yyval.tree_statement_list_type) = parser.append_function_def_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), (yyvsp[0].tree_function_def_type)); }
3500#line 3501 "libinterp/parse-tree/oct-parse.cc"
3501 break;
3502
3503 case 21: /* statement: expression */
3504#line 521 "../libinterp/parse-tree/oct-parse.yy"
3505 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_expression_type)); }
3506#line 3507 "libinterp/parse-tree/oct-parse.cc"
3507 break;
3508
3509 case 22: /* statement: command */
3510#line 523 "../libinterp/parse-tree/oct-parse.yy"
3511 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_command_type)); }
3512#line 3513 "libinterp/parse-tree/oct-parse.cc"
3513 break;
3514
3515 case 23: /* statement: word_list_cmd */
3516#line 525 "../libinterp/parse-tree/oct-parse.yy"
3517 { (yyval.tree_statement_type) = parser.make_statement ((yyvsp[0].tree_index_expression_type)); }
3518#line 3519 "libinterp/parse-tree/oct-parse.cc"
3519 break;
3520
3521 case 24: /* word_list_cmd: identifier word_list */
3522#line 537 "../libinterp/parse-tree/oct-parse.yy"
3523 {
3524 if (! ((yyval.tree_index_expression_type) = parser.make_word_list_command ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_argument_list_type))))
3525 {
3526 // make_index_expression deleted $1 and $2.
3527 YYABORT;
3528 }
3529 }
3530#line 3531 "libinterp/parse-tree/oct-parse.cc"
3531 break;
3532
3533 case 25: /* word_list: string */
3534#line 547 "../libinterp/parse-tree/oct-parse.yy"
3535 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_constant_type)); }
3536#line 3537 "libinterp/parse-tree/oct-parse.cc"
3537 break;
3538
3539 case 26: /* word_list: word_list string */
3540#line 549 "../libinterp/parse-tree/oct-parse.yy"
3541 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-1].tree_argument_list_type), (yyvsp[0].tree_constant_type)); }
3542#line 3543 "libinterp/parse-tree/oct-parse.cc"
3543 break;
3544
3545 case 27: /* identifier: NAME */
3546#line 557 "../libinterp/parse-tree/oct-parse.yy"
3547 { (yyval.tree_identifier_type) = parser.make_identifier ((yyvsp[0].tok)); }
3548#line 3549 "libinterp/parse-tree/oct-parse.cc"
3549 break;
3550
3551 case 28: /* superclass_identifier: SUPERCLASSREF */
3552#line 562 "../libinterp/parse-tree/oct-parse.yy"
3553 { (yyval.tree_superclass_ref_type) = parser.make_superclass_ref ((yyvsp[0].tok)); }
3554#line 3555 "libinterp/parse-tree/oct-parse.cc"
3555 break;
3556
3557 case 29: /* meta_identifier: METAQUERY */
3558#line 566 "../libinterp/parse-tree/oct-parse.yy"
3559 { (yyval.tree_metaclass_query_type) = parser.make_metaclass_query ((yyvsp[0].tok)); }
3560#line 3561 "libinterp/parse-tree/oct-parse.cc"
3561 break;
3562
3563 case 30: /* string: DQ_STRING */
3564#line 570 "../libinterp/parse-tree/oct-parse.yy"
3565 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3566#line 3567 "libinterp/parse-tree/oct-parse.cc"
3567 break;
3568
3569 case 31: /* string: SQ_STRING */
3570#line 572 "../libinterp/parse-tree/oct-parse.yy"
3571 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3572#line 3573 "libinterp/parse-tree/oct-parse.cc"
3573 break;
3574
3575 case 32: /* constant: NUMBER */
3576#line 576 "../libinterp/parse-tree/oct-parse.yy"
3577 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3578#line 3579 "libinterp/parse-tree/oct-parse.cc"
3579 break;
3580
3581 case 33: /* constant: string */
3582#line 578 "../libinterp/parse-tree/oct-parse.yy"
3583 { (yyval.tree_constant_type) = (yyvsp[0].tree_constant_type); }
3584#line 3585 "libinterp/parse-tree/oct-parse.cc"
3585 break;
3586
3587 case 34: /* matrix: '[' matrix_rows ']' */
3588#line 582 "../libinterp/parse-tree/oct-parse.yy"
3589 { (yyval.tree_expression_type) = parser.finish_matrix ((yyvsp[-2].tok), (yyvsp[-1].tree_matrix_type), (yyvsp[0].tok)); }
3590#line 3591 "libinterp/parse-tree/oct-parse.cc"
3591 break;
3592
3593 case 35: /* matrix_rows: cell_or_matrix_row */
3594#line 586 "../libinterp/parse-tree/oct-parse.yy"
3595 { (yyval.tree_matrix_type) = parser.make_matrix ((yyvsp[0].tree_argument_list_type)); }
3596#line 3597 "libinterp/parse-tree/oct-parse.cc"
3597 break;
3598
3599 case 36: /* matrix_rows: matrix_rows ';' cell_or_matrix_row */
3600#line 588 "../libinterp/parse-tree/oct-parse.yy"
3601 { (yyval.tree_matrix_type) = parser.append_matrix_row ((yyvsp[-2].tree_matrix_type), (yyvsp[-1].tok), (yyvsp[0].tree_argument_list_type)); }
3602#line 3603 "libinterp/parse-tree/oct-parse.cc"
3603 break;
3604
3605 case 37: /* cell: '{' cell_rows '}' */
3606#line 592 "../libinterp/parse-tree/oct-parse.yy"
3607 { (yyval.tree_expression_type) = parser.finish_cell ((yyvsp[-2].tok), (yyvsp[-1].tree_cell_type), (yyvsp[0].tok)); }
3608#line 3609 "libinterp/parse-tree/oct-parse.cc"
3609 break;
3610
3611 case 38: /* cell_rows: cell_or_matrix_row */
3612#line 596 "../libinterp/parse-tree/oct-parse.yy"
3613 { (yyval.tree_cell_type) = parser.make_cell ((yyvsp[0].tree_argument_list_type)); }
3614#line 3615 "libinterp/parse-tree/oct-parse.cc"
3615 break;
3616
3617 case 39: /* cell_rows: cell_rows ';' cell_or_matrix_row */
3618#line 598 "../libinterp/parse-tree/oct-parse.yy"
3619 { (yyval.tree_cell_type) = parser.append_cell_row ((yyvsp[-2].tree_cell_type), (yyvsp[-1].tok), (yyvsp[0].tree_argument_list_type)); }
3620#line 3621 "libinterp/parse-tree/oct-parse.cc"
3621 break;
3622
3623 case 40: /* cell_or_matrix_row: %empty */
3624#line 610 "../libinterp/parse-tree/oct-parse.yy"
3625 { (yyval.tree_argument_list_type) = nullptr; }
3626#line 3627 "libinterp/parse-tree/oct-parse.cc"
3627 break;
3628
3629 case 41: /* cell_or_matrix_row: ',' */
3630#line 612 "../libinterp/parse-tree/oct-parse.yy"
3631 {
3632 // FIXME: Need to capture separator token info here.
3633 OCTAVE_YYUSE ((yyvsp[0].tok));
3634
3635 (yyval.tree_argument_list_type) = nullptr;
3636 }
3637#line 3638 "libinterp/parse-tree/oct-parse.cc"
3638 break;
3639
3640 case 42: /* cell_or_matrix_row: arg_list */
3641#line 619 "../libinterp/parse-tree/oct-parse.yy"
3642 { (yyval.tree_argument_list_type) = (yyvsp[0].tree_argument_list_type); }
3643#line 3644 "libinterp/parse-tree/oct-parse.cc"
3644 break;
3645
3646 case 43: /* cell_or_matrix_row: arg_list ',' */
3647#line 621 "../libinterp/parse-tree/oct-parse.yy"
3648 {
3649 // FIXME: Need to capture separator token info here.
3650 OCTAVE_YYUSE ((yyvsp[0].tok));
3651
3652 (yyval.tree_argument_list_type) = (yyvsp[-1].tree_argument_list_type);
3653 }
3654#line 3655 "libinterp/parse-tree/oct-parse.cc"
3655 break;
3656
3657 case 44: /* cell_or_matrix_row: ',' arg_list */
3658#line 628 "../libinterp/parse-tree/oct-parse.yy"
3659 {
3660 // FIXME: Need to capture separator token info here.
3661 OCTAVE_YYUSE ((yyvsp[-1].tok));
3662
3663 (yyval.tree_argument_list_type) = (yyvsp[0].tree_argument_list_type);
3664 }
3665#line 3666 "libinterp/parse-tree/oct-parse.cc"
3666 break;
3667
3668 case 45: /* cell_or_matrix_row: ',' arg_list ',' */
3669#line 635 "../libinterp/parse-tree/oct-parse.yy"
3670 {
3671 // FIXME: Need to capture separator token info here.
3672 OCTAVE_YYUSE ((yyvsp[-2].tok), (yyvsp[0].tok));
3673
3674 (yyval.tree_argument_list_type) = (yyvsp[-1].tree_argument_list_type);
3675 }
3676#line 3677 "libinterp/parse-tree/oct-parse.cc"
3677 break;
3678
3679 case 46: /* fcn_handle: FCN_HANDLE */
3680#line 644 "../libinterp/parse-tree/oct-parse.yy"
3681 { (yyval.tree_fcn_handle_type) = parser.make_fcn_handle ((yyvsp[0].tok)); }
3682#line 3683 "libinterp/parse-tree/oct-parse.cc"
3683 break;
3684
3685 case 47: /* anon_fcn_handle: '@' param_list anon_fcn_begin expression */
3686#line 652 "../libinterp/parse-tree/oct-parse.yy"
3687 {
3688 if (! ((yyval.tree_anon_fcn_handle_type) = parser.make_anon_fcn_handle ((yyvsp[-3].tok), (yyvsp[-2].tree_parameter_list_type), (yyvsp[0].tree_expression_type))))
3689 {
3690 // make_anon_fcn_handle deleted $2 and $4.
3691 YYABORT;
3692 }
3693
3696 }
3697#line 3698 "libinterp/parse-tree/oct-parse.cc"
3698 break;
3699
3700 case 48: /* anon_fcn_handle: '@' param_list anon_fcn_begin error */
3701#line 663 "../libinterp/parse-tree/oct-parse.yy"
3702 {
3703 OCTAVE_YYUSE ((yyvsp[-3].tok), (yyvsp[-2].tree_parameter_list_type));
3704
3706
3707 (yyval.tree_anon_fcn_handle_type) = nullptr;
3708
3709 parser.bison_error ("anonymous function bodies must be single expressions");
3710 YYABORT;
3711 }
3712#line 3713 "libinterp/parse-tree/oct-parse.cc"
3713 break;
3714
3715 case 49: /* primary_expr: identifier */
3716#line 676 "../libinterp/parse-tree/oct-parse.yy"
3717 { (yyval.tree_expression_type) = (yyvsp[0].tree_identifier_type); }
3718#line 3719 "libinterp/parse-tree/oct-parse.cc"
3719 break;
3720
3721 case 50: /* primary_expr: constant */
3722#line 678 "../libinterp/parse-tree/oct-parse.yy"
3723 { (yyval.tree_expression_type) = (yyvsp[0].tree_constant_type); }
3724#line 3725 "libinterp/parse-tree/oct-parse.cc"
3725 break;
3726
3727 case 51: /* primary_expr: fcn_handle */
3728#line 680 "../libinterp/parse-tree/oct-parse.yy"
3729 { (yyval.tree_expression_type) = (yyvsp[0].tree_fcn_handle_type); }
3730#line 3731 "libinterp/parse-tree/oct-parse.cc"
3731 break;
3732
3733 case 52: /* primary_expr: matrix */
3734#line 682 "../libinterp/parse-tree/oct-parse.yy"
3735 {
3737 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
3738 }
3739#line 3740 "libinterp/parse-tree/oct-parse.cc"
3740 break;
3741
3742 case 53: /* primary_expr: cell */
3743#line 687 "../libinterp/parse-tree/oct-parse.yy"
3744 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
3745#line 3746 "libinterp/parse-tree/oct-parse.cc"
3746 break;
3747
3748 case 54: /* primary_expr: meta_identifier */
3749#line 689 "../libinterp/parse-tree/oct-parse.yy"
3750 { (yyval.tree_expression_type) = (yyvsp[0].tree_metaclass_query_type); }
3751#line 3752 "libinterp/parse-tree/oct-parse.cc"
3752 break;
3753
3754 case 55: /* primary_expr: superclass_identifier */
3755#line 691 "../libinterp/parse-tree/oct-parse.yy"
3756 { (yyval.tree_expression_type) = (yyvsp[0].tree_superclass_ref_type); }
3757#line 3758 "libinterp/parse-tree/oct-parse.cc"
3758 break;
3759
3760 case 56: /* primary_expr: '(' expression ')' */
3761#line 693 "../libinterp/parse-tree/oct-parse.yy"
3762 { (yyval.tree_expression_type) = (yyvsp[-1].tree_expression_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok))); }
3763#line 3764 "libinterp/parse-tree/oct-parse.cc"
3764 break;
3765
3766 case 57: /* magic_colon: ':' */
3767#line 697 "../libinterp/parse-tree/oct-parse.yy"
3768 { (yyval.tree_constant_type) = parser.make_constant ((yyvsp[0].tok)); }
3769#line 3770 "libinterp/parse-tree/oct-parse.cc"
3770 break;
3771
3772 case 58: /* magic_tilde: '~' */
3773#line 701 "../libinterp/parse-tree/oct-parse.yy"
3774 { (yyval.tree_identifier_type) = parser.make_black_hole ((yyvsp[0].tok)); }
3775#line 3776 "libinterp/parse-tree/oct-parse.cc"
3776 break;
3777
3778 case 59: /* arg_list: expression */
3779#line 705 "../libinterp/parse-tree/oct-parse.yy"
3780 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_expression_type)); }
3781#line 3782 "libinterp/parse-tree/oct-parse.cc"
3782 break;
3783
3784 case 60: /* arg_list: magic_colon */
3785#line 707 "../libinterp/parse-tree/oct-parse.yy"
3786 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_constant_type)); }
3787#line 3788 "libinterp/parse-tree/oct-parse.cc"
3788 break;
3789
3790 case 61: /* arg_list: magic_tilde */
3791#line 709 "../libinterp/parse-tree/oct-parse.yy"
3792 { (yyval.tree_argument_list_type) = parser.make_argument_list ((yyvsp[0].tree_identifier_type)); }
3793#line 3794 "libinterp/parse-tree/oct-parse.cc"
3794 break;
3795
3796 case 62: /* arg_list: arg_list ',' magic_colon */
3797#line 711 "../libinterp/parse-tree/oct-parse.yy"
3798 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_constant_type)); }
3799#line 3800 "libinterp/parse-tree/oct-parse.cc"
3800 break;
3801
3802 case 63: /* arg_list: arg_list ',' magic_tilde */
3803#line 713 "../libinterp/parse-tree/oct-parse.yy"
3804 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
3805#line 3806 "libinterp/parse-tree/oct-parse.cc"
3806 break;
3807
3808 case 64: /* arg_list: arg_list ',' expression */
3809#line 715 "../libinterp/parse-tree/oct-parse.yy"
3810 { (yyval.tree_argument_list_type) = parser.append_argument_list ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3811#line 3812 "libinterp/parse-tree/oct-parse.cc"
3812 break;
3813
3814 case 65: /* indirect_ref_op: '.' */
3815#line 719 "../libinterp/parse-tree/oct-parse.yy"
3816 {
3818 (yyval.tok) = (yyvsp[0].tok);
3819 }
3820#line 3821 "libinterp/parse-tree/oct-parse.cc"
3821 break;
3822
3823 case 66: /* oper_expr: primary_expr */
3824#line 726 "../libinterp/parse-tree/oct-parse.yy"
3825 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
3826#line 3827 "libinterp/parse-tree/oct-parse.cc"
3827 break;
3828
3829 case 67: /* oper_expr: oper_expr PLUS_PLUS */
3830#line 728 "../libinterp/parse-tree/oct-parse.yy"
3831 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3832#line 3833 "libinterp/parse-tree/oct-parse.cc"
3833 break;
3834
3835 case 68: /* oper_expr: oper_expr MINUS_MINUS */
3836#line 730 "../libinterp/parse-tree/oct-parse.yy"
3837 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3838#line 3839 "libinterp/parse-tree/oct-parse.cc"
3839 break;
3840
3841 case 69: /* oper_expr: oper_expr '(' ')' */
3842#line 732 "../libinterp/parse-tree/oct-parse.yy"
3843 {
3844 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '(')))
3845 {
3846 // make_index_expression deleted $1.
3847 YYABORT;
3848 }
3849 }
3850#line 3851 "libinterp/parse-tree/oct-parse.cc"
3851 break;
3852
3853 case 70: /* oper_expr: oper_expr '(' arg_list ')' */
3854#line 740 "../libinterp/parse-tree/oct-parse.yy"
3855 {
3856 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '(')))
3857 {
3858 // make_index_expression deleted $1 and $3.
3859 YYABORT;
3860 }
3861 }
3862#line 3863 "libinterp/parse-tree/oct-parse.cc"
3863 break;
3864
3865 case 71: /* oper_expr: oper_expr '{' '}' */
3866#line 748 "../libinterp/parse-tree/oct-parse.yy"
3867 {
3868 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '{')))
3869 {
3870 // make_index_expression deleted $1.
3871 YYABORT;
3872 }
3873 }
3874#line 3875 "libinterp/parse-tree/oct-parse.cc"
3875 break;
3876
3877 case 72: /* oper_expr: oper_expr '{' arg_list '}' */
3878#line 756 "../libinterp/parse-tree/oct-parse.yy"
3879 {
3880 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '{')))
3881 {
3882 // make_index_expression deleted $1 and $3.
3883 YYABORT;
3884 }
3885 }
3886#line 3887 "libinterp/parse-tree/oct-parse.cc"
3887 break;
3888
3889 case 73: /* oper_expr: oper_expr HERMITIAN */
3890#line 764 "../libinterp/parse-tree/oct-parse.yy"
3891 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3892#line 3893 "libinterp/parse-tree/oct-parse.cc"
3893 break;
3894
3895 case 74: /* oper_expr: oper_expr TRANSPOSE */
3896#line 766 "../libinterp/parse-tree/oct-parse.yy"
3897 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3898#line 3899 "libinterp/parse-tree/oct-parse.cc"
3899 break;
3900
3901 case 75: /* oper_expr: oper_expr indirect_ref_op STRUCT_ELT */
3902#line 768 "../libinterp/parse-tree/oct-parse.yy"
3903 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tok)); }
3904#line 3905 "libinterp/parse-tree/oct-parse.cc"
3905 break;
3906
3907 case 76: /* oper_expr: oper_expr indirect_ref_op '(' expression ')' */
3908#line 770 "../libinterp/parse-tree/oct-parse.yy"
3909 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-4].tree_expression_type), (yyvsp[-3].tok), (yyvsp[-2].tok), (yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
3910#line 3911 "libinterp/parse-tree/oct-parse.cc"
3911 break;
3912
3913 case 77: /* oper_expr: PLUS_PLUS oper_expr */
3914#line 772 "../libinterp/parse-tree/oct-parse.yy"
3915 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3916#line 3917 "libinterp/parse-tree/oct-parse.cc"
3917 break;
3918
3919 case 78: /* oper_expr: MINUS_MINUS oper_expr */
3920#line 774 "../libinterp/parse-tree/oct-parse.yy"
3921 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3922#line 3923 "libinterp/parse-tree/oct-parse.cc"
3923 break;
3924
3925 case 79: /* oper_expr: '~' oper_expr */
3926#line 776 "../libinterp/parse-tree/oct-parse.yy"
3927 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3928#line 3929 "libinterp/parse-tree/oct-parse.cc"
3929 break;
3930
3931 case 80: /* oper_expr: '!' oper_expr */
3932#line 778 "../libinterp/parse-tree/oct-parse.yy"
3933 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3934#line 3935 "libinterp/parse-tree/oct-parse.cc"
3935 break;
3936
3937 case 81: /* oper_expr: '+' oper_expr */
3938#line 780 "../libinterp/parse-tree/oct-parse.yy"
3939 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3940#line 3941 "libinterp/parse-tree/oct-parse.cc"
3941 break;
3942
3943 case 82: /* oper_expr: '-' oper_expr */
3944#line 782 "../libinterp/parse-tree/oct-parse.yy"
3945 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3946#line 3947 "libinterp/parse-tree/oct-parse.cc"
3947 break;
3948
3949 case 83: /* oper_expr: oper_expr POW power_expr */
3950#line 784 "../libinterp/parse-tree/oct-parse.yy"
3951 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3952#line 3953 "libinterp/parse-tree/oct-parse.cc"
3953 break;
3954
3955 case 84: /* oper_expr: oper_expr EPOW power_expr */
3956#line 786 "../libinterp/parse-tree/oct-parse.yy"
3957 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3958#line 3959 "libinterp/parse-tree/oct-parse.cc"
3959 break;
3960
3961 case 85: /* oper_expr: oper_expr '+' oper_expr */
3962#line 788 "../libinterp/parse-tree/oct-parse.yy"
3963 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3964#line 3965 "libinterp/parse-tree/oct-parse.cc"
3965 break;
3966
3967 case 86: /* oper_expr: oper_expr '-' oper_expr */
3968#line 790 "../libinterp/parse-tree/oct-parse.yy"
3969 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3970#line 3971 "libinterp/parse-tree/oct-parse.cc"
3971 break;
3972
3973 case 87: /* oper_expr: oper_expr '*' oper_expr */
3974#line 792 "../libinterp/parse-tree/oct-parse.yy"
3975 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3976#line 3977 "libinterp/parse-tree/oct-parse.cc"
3977 break;
3978
3979 case 88: /* oper_expr: oper_expr '/' oper_expr */
3980#line 794 "../libinterp/parse-tree/oct-parse.yy"
3981 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3982#line 3983 "libinterp/parse-tree/oct-parse.cc"
3983 break;
3984
3985 case 89: /* oper_expr: oper_expr EMUL oper_expr */
3986#line 796 "../libinterp/parse-tree/oct-parse.yy"
3987 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3988#line 3989 "libinterp/parse-tree/oct-parse.cc"
3989 break;
3990
3991 case 90: /* oper_expr: oper_expr EDIV oper_expr */
3992#line 798 "../libinterp/parse-tree/oct-parse.yy"
3993 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
3994#line 3995 "libinterp/parse-tree/oct-parse.cc"
3995 break;
3996
3997 case 91: /* oper_expr: oper_expr LEFTDIV oper_expr */
3998#line 800 "../libinterp/parse-tree/oct-parse.yy"
3999 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4000#line 4001 "libinterp/parse-tree/oct-parse.cc"
4001 break;
4002
4003 case 92: /* oper_expr: oper_expr ELEFTDIV oper_expr */
4004#line 802 "../libinterp/parse-tree/oct-parse.yy"
4005 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4006#line 4007 "libinterp/parse-tree/oct-parse.cc"
4007 break;
4008
4009 case 93: /* power_expr: primary_expr */
4010#line 806 "../libinterp/parse-tree/oct-parse.yy"
4011 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4012#line 4013 "libinterp/parse-tree/oct-parse.cc"
4013 break;
4014
4015 case 94: /* power_expr: power_expr PLUS_PLUS */
4016#line 808 "../libinterp/parse-tree/oct-parse.yy"
4017 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
4018#line 4019 "libinterp/parse-tree/oct-parse.cc"
4019 break;
4020
4021 case 95: /* power_expr: power_expr MINUS_MINUS */
4022#line 810 "../libinterp/parse-tree/oct-parse.yy"
4023 { (yyval.tree_expression_type) = parser.make_postfix_op ((yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
4024#line 4025 "libinterp/parse-tree/oct-parse.cc"
4025 break;
4026
4027 case 96: /* power_expr: power_expr '(' ')' */
4028#line 812 "../libinterp/parse-tree/oct-parse.yy"
4029 {
4030 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '(')))
4031 {
4032 // make_index_expression deleted $1.
4033 YYABORT;
4034 }
4035 }
4036#line 4037 "libinterp/parse-tree/oct-parse.cc"
4037 break;
4038
4039 case 97: /* power_expr: power_expr '(' arg_list ')' */
4040#line 820 "../libinterp/parse-tree/oct-parse.yy"
4041 {
4042 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '(')))
4043 {
4044 // make_index_expression deleted $1 and $3.
4045 YYABORT;
4046 }
4047 }
4048#line 4049 "libinterp/parse-tree/oct-parse.cc"
4049 break;
4050
4051 case 98: /* power_expr: power_expr '{' '}' */
4052#line 828 "../libinterp/parse-tree/oct-parse.yy"
4053 {
4054 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), nullptr, (yyvsp[0].tok), '{')))
4055 {
4056 // make_index_expression deleted $1.
4057 YYABORT;
4058 }
4059 }
4060#line 4061 "libinterp/parse-tree/oct-parse.cc"
4061 break;
4062
4063 case 99: /* power_expr: power_expr '{' arg_list '}' */
4064#line 836 "../libinterp/parse-tree/oct-parse.yy"
4065 {
4066 if (! ((yyval.tree_expression_type) = parser.make_index_expression ((yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_argument_list_type), (yyvsp[0].tok), '{')))
4067 {
4068 // make_index_expression deleted $1 and $3.
4069 YYABORT;
4070 }
4071 }
4072#line 4073 "libinterp/parse-tree/oct-parse.cc"
4073 break;
4074
4075 case 100: /* power_expr: power_expr indirect_ref_op STRUCT_ELT */
4076#line 844 "../libinterp/parse-tree/oct-parse.yy"
4077 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tok)); }
4078#line 4079 "libinterp/parse-tree/oct-parse.cc"
4079 break;
4080
4081 case 101: /* power_expr: power_expr indirect_ref_op '(' expression ')' */
4082#line 846 "../libinterp/parse-tree/oct-parse.yy"
4083 { (yyval.tree_expression_type) = parser.make_indirect_ref ((yyvsp[-4].tree_expression_type), (yyvsp[-3].tok), (yyvsp[-2].tok), (yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
4084#line 4085 "libinterp/parse-tree/oct-parse.cc"
4085 break;
4086
4087 case 102: /* power_expr: PLUS_PLUS power_expr */
4088#line 848 "../libinterp/parse-tree/oct-parse.yy"
4089 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4090#line 4091 "libinterp/parse-tree/oct-parse.cc"
4091 break;
4092
4093 case 103: /* power_expr: MINUS_MINUS power_expr */
4094#line 850 "../libinterp/parse-tree/oct-parse.yy"
4095 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4096#line 4097 "libinterp/parse-tree/oct-parse.cc"
4097 break;
4098
4099 case 104: /* power_expr: '~' power_expr */
4100#line 852 "../libinterp/parse-tree/oct-parse.yy"
4101 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4102#line 4103 "libinterp/parse-tree/oct-parse.cc"
4103 break;
4104
4105 case 105: /* power_expr: '!' power_expr */
4106#line 854 "../libinterp/parse-tree/oct-parse.yy"
4107 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4108#line 4109 "libinterp/parse-tree/oct-parse.cc"
4109 break;
4110
4111 case 106: /* power_expr: '+' power_expr */
4112#line 856 "../libinterp/parse-tree/oct-parse.yy"
4113 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4114#line 4115 "libinterp/parse-tree/oct-parse.cc"
4115 break;
4116
4117 case 107: /* power_expr: '-' power_expr */
4118#line 858 "../libinterp/parse-tree/oct-parse.yy"
4119 { (yyval.tree_expression_type) = parser.make_prefix_op ((yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4120#line 4121 "libinterp/parse-tree/oct-parse.cc"
4121 break;
4122
4123 case 108: /* colon_expr: oper_expr ':' oper_expr */
4124#line 862 "../libinterp/parse-tree/oct-parse.yy"
4125 {
4126 if (! ((yyval.tree_expression_type) = parser.make_colon_expression ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type))))
4127 {
4128 // make_colon_expression deleted $1 and $3.
4129 YYABORT;
4130 }
4131 }
4132#line 4133 "libinterp/parse-tree/oct-parse.cc"
4133 break;
4134
4135 case 109: /* colon_expr: oper_expr ':' oper_expr ':' oper_expr */
4136#line 870 "../libinterp/parse-tree/oct-parse.yy"
4137 {
4138 if (! ((yyval.tree_expression_type) = parser.make_colon_expression ((yyvsp[-4].tree_expression_type), (yyvsp[-3].tok), (yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type))))
4139 {
4140 // make_colon_expression deleted $1, $3, and $5.
4141 YYABORT;
4142 }
4143 }
4144#line 4145 "libinterp/parse-tree/oct-parse.cc"
4145 break;
4146
4147 case 110: /* simple_expr: oper_expr */
4148#line 880 "../libinterp/parse-tree/oct-parse.yy"
4149 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4150#line 4151 "libinterp/parse-tree/oct-parse.cc"
4151 break;
4152
4153 case 111: /* simple_expr: colon_expr */
4154#line 882 "../libinterp/parse-tree/oct-parse.yy"
4155 { (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type); }
4156#line 4157 "libinterp/parse-tree/oct-parse.cc"
4157 break;
4158
4159 case 112: /* simple_expr: simple_expr EXPR_LT simple_expr */
4160#line 884 "../libinterp/parse-tree/oct-parse.yy"
4161 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4162#line 4163 "libinterp/parse-tree/oct-parse.cc"
4163 break;
4164
4165 case 113: /* simple_expr: simple_expr EXPR_LE simple_expr */
4166#line 886 "../libinterp/parse-tree/oct-parse.yy"
4167 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4168#line 4169 "libinterp/parse-tree/oct-parse.cc"
4169 break;
4170
4171 case 114: /* simple_expr: simple_expr EXPR_EQ simple_expr */
4172#line 888 "../libinterp/parse-tree/oct-parse.yy"
4173 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4174#line 4175 "libinterp/parse-tree/oct-parse.cc"
4175 break;
4176
4177 case 115: /* simple_expr: simple_expr EXPR_GE simple_expr */
4178#line 890 "../libinterp/parse-tree/oct-parse.yy"
4179 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4180#line 4181 "libinterp/parse-tree/oct-parse.cc"
4181 break;
4182
4183 case 116: /* simple_expr: simple_expr EXPR_GT simple_expr */
4184#line 892 "../libinterp/parse-tree/oct-parse.yy"
4185 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4186#line 4187 "libinterp/parse-tree/oct-parse.cc"
4187 break;
4188
4189 case 117: /* simple_expr: simple_expr EXPR_NE simple_expr */
4190#line 894 "../libinterp/parse-tree/oct-parse.yy"
4191 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4192#line 4193 "libinterp/parse-tree/oct-parse.cc"
4193 break;
4194
4195 case 118: /* simple_expr: simple_expr EXPR_AND simple_expr */
4196#line 896 "../libinterp/parse-tree/oct-parse.yy"
4197 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4198#line 4199 "libinterp/parse-tree/oct-parse.cc"
4199 break;
4200
4201 case 119: /* simple_expr: simple_expr EXPR_OR simple_expr */
4202#line 898 "../libinterp/parse-tree/oct-parse.yy"
4203 { (yyval.tree_expression_type) = parser.make_binary_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4204#line 4205 "libinterp/parse-tree/oct-parse.cc"
4205 break;
4206
4207 case 120: /* simple_expr: simple_expr EXPR_AND_AND simple_expr */
4208#line 900 "../libinterp/parse-tree/oct-parse.yy"
4209 { (yyval.tree_expression_type) = parser.make_boolean_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4210#line 4211 "libinterp/parse-tree/oct-parse.cc"
4211 break;
4212
4213 case 121: /* simple_expr: simple_expr EXPR_OR_OR simple_expr */
4214#line 902 "../libinterp/parse-tree/oct-parse.yy"
4215 { (yyval.tree_expression_type) = parser.make_boolean_op ((yyvsp[-2].tree_expression_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4216#line 4217 "libinterp/parse-tree/oct-parse.cc"
4217 break;
4218
4219 case 122: /* assign_lhs: simple_expr */
4220#line 906 "../libinterp/parse-tree/oct-parse.yy"
4221 {
4222 if (! ((yyval.tree_argument_list_type) = parser.validate_matrix_for_assignment ((yyvsp[0].tree_expression_type))))
4223 {
4224 // validate_matrix_for_assignment deleted $1.
4225 YYABORT;
4226 }
4227
4229 }
4230#line 4231 "libinterp/parse-tree/oct-parse.cc"
4231 break;
4232
4233 case 123: /* assign_expr: assign_lhs '=' expression */
4234#line 918 "../libinterp/parse-tree/oct-parse.yy"
4235 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4236#line 4237 "libinterp/parse-tree/oct-parse.cc"
4237 break;
4238
4239 case 124: /* assign_expr: assign_lhs ADD_EQ expression */
4240#line 920 "../libinterp/parse-tree/oct-parse.yy"
4241 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4242#line 4243 "libinterp/parse-tree/oct-parse.cc"
4243 break;
4244
4245 case 125: /* assign_expr: assign_lhs SUB_EQ expression */
4246#line 922 "../libinterp/parse-tree/oct-parse.yy"
4247 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4248#line 4249 "libinterp/parse-tree/oct-parse.cc"
4249 break;
4250
4251 case 126: /* assign_expr: assign_lhs MUL_EQ expression */
4252#line 924 "../libinterp/parse-tree/oct-parse.yy"
4253 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4254#line 4255 "libinterp/parse-tree/oct-parse.cc"
4255 break;
4256
4257 case 127: /* assign_expr: assign_lhs DIV_EQ expression */
4258#line 926 "../libinterp/parse-tree/oct-parse.yy"
4259 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4260#line 4261 "libinterp/parse-tree/oct-parse.cc"
4261 break;
4262
4263 case 128: /* assign_expr: assign_lhs LEFTDIV_EQ expression */
4264#line 928 "../libinterp/parse-tree/oct-parse.yy"
4265 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4266#line 4267 "libinterp/parse-tree/oct-parse.cc"
4267 break;
4268
4269 case 129: /* assign_expr: assign_lhs POW_EQ expression */
4270#line 930 "../libinterp/parse-tree/oct-parse.yy"
4271 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4272#line 4273 "libinterp/parse-tree/oct-parse.cc"
4273 break;
4274
4275 case 130: /* assign_expr: assign_lhs EMUL_EQ expression */
4276#line 932 "../libinterp/parse-tree/oct-parse.yy"
4277 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4278#line 4279 "libinterp/parse-tree/oct-parse.cc"
4279 break;
4280
4281 case 131: /* assign_expr: assign_lhs EDIV_EQ expression */
4282#line 934 "../libinterp/parse-tree/oct-parse.yy"
4283 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4284#line 4285 "libinterp/parse-tree/oct-parse.cc"
4285 break;
4286
4287 case 132: /* assign_expr: assign_lhs ELEFTDIV_EQ expression */
4288#line 936 "../libinterp/parse-tree/oct-parse.yy"
4289 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4290#line 4291 "libinterp/parse-tree/oct-parse.cc"
4291 break;
4292
4293 case 133: /* assign_expr: assign_lhs EPOW_EQ expression */
4294#line 938 "../libinterp/parse-tree/oct-parse.yy"
4295 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4296#line 4297 "libinterp/parse-tree/oct-parse.cc"
4297 break;
4298
4299 case 134: /* assign_expr: assign_lhs AND_EQ expression */
4300#line 940 "../libinterp/parse-tree/oct-parse.yy"
4301 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4302#line 4303 "libinterp/parse-tree/oct-parse.cc"
4303 break;
4304
4305 case 135: /* assign_expr: assign_lhs OR_EQ expression */
4306#line 942 "../libinterp/parse-tree/oct-parse.yy"
4307 { (yyval.tree_expression_type) = parser.make_assign_op ((yyvsp[-2].tree_argument_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4308#line 4309 "libinterp/parse-tree/oct-parse.cc"
4309 break;
4310
4311 case 136: /* expression: simple_expr */
4312#line 946 "../libinterp/parse-tree/oct-parse.yy"
4313 {
4314 if ((yyvsp[0].tree_expression_type) && ((yyvsp[0].tree_expression_type)->is_matrix () || (yyvsp[0].tree_expression_type)->iscell ()))
4315 {
4316 if (parser.validate_array_list ((yyvsp[0].tree_expression_type)))
4317 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4318 else
4319 {
4320 delete (yyvsp[0].tree_expression_type);
4321 YYABORT;
4322 }
4323 }
4324 else
4325 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4326 }
4327#line 4328 "libinterp/parse-tree/oct-parse.cc"
4328 break;
4329
4330 case 137: /* expression: assign_expr */
4331#line 961 "../libinterp/parse-tree/oct-parse.yy"
4332 {
4333 if (! (yyvsp[0].tree_expression_type))
4334 YYABORT;
4335
4336 (yyval.tree_expression_type) = (yyvsp[0].tree_expression_type);
4337 }
4338#line 4339 "libinterp/parse-tree/oct-parse.cc"
4339 break;
4340
4341 case 138: /* expression: anon_fcn_handle */
4342#line 968 "../libinterp/parse-tree/oct-parse.yy"
4343 { (yyval.tree_expression_type) = (yyvsp[0].tree_anon_fcn_handle_type); }
4344#line 4345 "libinterp/parse-tree/oct-parse.cc"
4345 break;
4346
4347 case 139: /* command: declaration */
4348#line 976 "../libinterp/parse-tree/oct-parse.yy"
4349 { (yyval.tree_command_type) = (yyvsp[0].tree_decl_command_type); }
4350#line 4351 "libinterp/parse-tree/oct-parse.cc"
4351 break;
4352
4353 case 140: /* command: select_command */
4354#line 978 "../libinterp/parse-tree/oct-parse.yy"
4355 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4356#line 4357 "libinterp/parse-tree/oct-parse.cc"
4357 break;
4358
4359 case 141: /* command: loop_command */
4360#line 980 "../libinterp/parse-tree/oct-parse.yy"
4361 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4362#line 4363 "libinterp/parse-tree/oct-parse.cc"
4363 break;
4364
4365 case 142: /* command: jump_command */
4366#line 982 "../libinterp/parse-tree/oct-parse.yy"
4367 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4368#line 4369 "libinterp/parse-tree/oct-parse.cc"
4369 break;
4370
4371 case 143: /* command: spmd_command */
4372#line 984 "../libinterp/parse-tree/oct-parse.yy"
4373 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4374#line 4375 "libinterp/parse-tree/oct-parse.cc"
4375 break;
4376
4377 case 144: /* command: except_command */
4378#line 986 "../libinterp/parse-tree/oct-parse.yy"
4379 { (yyval.tree_command_type) = (yyvsp[0].tree_command_type); }
4380#line 4381 "libinterp/parse-tree/oct-parse.cc"
4381 break;
4382
4383 case 145: /* command: function */
4384#line 988 "../libinterp/parse-tree/oct-parse.yy"
4385 { (yyval.tree_command_type) = (yyvsp[0].tree_function_def_type); }
4386#line 4387 "libinterp/parse-tree/oct-parse.cc"
4387 break;
4388
4389 case 146: /* declaration: GLOBAL decl_init_list */
4390#line 996 "../libinterp/parse-tree/oct-parse.yy"
4391 {
4392 (yyval.tree_decl_command_type) = parser.make_decl_command ((yyvsp[-1].tok), (yyvsp[0].tree_decl_init_list_type));
4394 }
4395#line 4396 "libinterp/parse-tree/oct-parse.cc"
4396 break;
4397
4398 case 147: /* declaration: PERSISTENT decl_init_list */
4399#line 1001 "../libinterp/parse-tree/oct-parse.yy"
4400 {
4401 (yyval.tree_decl_command_type) = parser.make_decl_command ((yyvsp[-1].tok), (yyvsp[0].tree_decl_init_list_type));
4403 }
4404#line 4405 "libinterp/parse-tree/oct-parse.cc"
4405 break;
4406
4407 case 148: /* decl_init_list: decl_elt */
4408#line 1008 "../libinterp/parse-tree/oct-parse.yy"
4409 { (yyval.tree_decl_init_list_type) = parser.make_decl_init_list ((yyvsp[0].tree_decl_elt_type)); }
4410#line 4411 "libinterp/parse-tree/oct-parse.cc"
4411 break;
4412
4413 case 149: /* decl_init_list: decl_init_list decl_elt */
4414#line 1010 "../libinterp/parse-tree/oct-parse.yy"
4415 { (yyval.tree_decl_init_list_type) = parser.append_decl_init_list ((yyvsp[-1].tree_decl_init_list_type), (yyvsp[0].tree_decl_elt_type)); }
4416#line 4417 "libinterp/parse-tree/oct-parse.cc"
4417 break;
4418
4419 case 150: /* decl_elt: identifier */
4420#line 1014 "../libinterp/parse-tree/oct-parse.yy"
4421 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[0].tree_identifier_type)); }
4422#line 4423 "libinterp/parse-tree/oct-parse.cc"
4423 break;
4424
4425 case 151: /* decl_elt: identifier '=' expression */
4426#line 1016 "../libinterp/parse-tree/oct-parse.yy"
4427 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[-2].tree_identifier_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
4428#line 4429 "libinterp/parse-tree/oct-parse.cc"
4429 break;
4430
4431 case 152: /* select_command: if_command */
4432#line 1024 "../libinterp/parse-tree/oct-parse.yy"
4433 { (yyval.tree_command_type) = (yyvsp[0].tree_if_command_type); }
4434#line 4435 "libinterp/parse-tree/oct-parse.cc"
4435 break;
4436
4437 case 153: /* select_command: switch_command */
4438#line 1026 "../libinterp/parse-tree/oct-parse.yy"
4439 { (yyval.tree_command_type) = (yyvsp[0].tree_switch_command_type); }
4440#line 4441 "libinterp/parse-tree/oct-parse.cc"
4441 break;
4442
4443 case 154: /* if_command: if_clause_list else_clause END */
4444#line 1034 "../libinterp/parse-tree/oct-parse.yy"
4445 {
4446 if (! ((yyval.tree_if_command_type) = parser.finish_if_command ((yyvsp[-2].tree_if_command_list_type), (yyvsp[-1].tree_if_clause_type), (yyvsp[0].tok))))
4447 {
4448 // finish_if_command deleted $1 and $2.
4449 YYABORT;
4450 }
4451 }
4452#line 4453 "libinterp/parse-tree/oct-parse.cc"
4453 break;
4454
4455 case 155: /* if_clause_list: if_clause */
4456#line 1044 "../libinterp/parse-tree/oct-parse.yy"
4457 { (yyval.tree_if_command_list_type) = parser.start_if_command ((yyvsp[0].tree_if_clause_type)); }
4458#line 4459 "libinterp/parse-tree/oct-parse.cc"
4459 break;
4460
4461 case 156: /* if_clause_list: if_clause_list elseif_clause */
4462#line 1046 "../libinterp/parse-tree/oct-parse.yy"
4463 { (yyval.tree_if_command_list_type) = parser.append_if_clause ((yyvsp[-1].tree_if_command_list_type), (yyvsp[0].tree_if_clause_type)); }
4464#line 4465 "libinterp/parse-tree/oct-parse.cc"
4465 break;
4466
4467 case 157: /* if_clause: IF opt_sep expression stmt_begin statement_list */
4468#line 1050 "../libinterp/parse-tree/oct-parse.yy"
4469 { (yyval.tree_if_clause_type) = parser.make_if_clause ((yyvsp[-4].tok), (yyvsp[-3].sep_list_type), (yyvsp[-2].tree_expression_type), (yyvsp[0].tree_statement_list_type)); }
4470#line 4471 "libinterp/parse-tree/oct-parse.cc"
4471 break;
4472
4473 case 158: /* elseif_clause: ELSEIF opt_sep expression stmt_begin statement_list */
4474#line 1054 "../libinterp/parse-tree/oct-parse.yy"
4475 { (yyval.tree_if_clause_type) = parser.make_if_clause ((yyvsp[-4].tok), (yyvsp[-3].sep_list_type), (yyvsp[-2].tree_expression_type), (yyvsp[0].tree_statement_list_type)); }
4476#line 4477 "libinterp/parse-tree/oct-parse.cc"
4477 break;
4478
4479 case 159: /* else_clause: %empty */
4480#line 1058 "../libinterp/parse-tree/oct-parse.yy"
4481 { (yyval.tree_if_clause_type) = nullptr; }
4482#line 4483 "libinterp/parse-tree/oct-parse.cc"
4483 break;
4484
4485 case 160: /* else_clause: ELSE statement_list */
4486#line 1060 "../libinterp/parse-tree/oct-parse.yy"
4487 { (yyval.tree_if_clause_type) = parser.make_if_clause ((yyvsp[-1].tok), nullptr, nullptr, (yyvsp[0].tree_statement_list_type)); }
4488#line 4489 "libinterp/parse-tree/oct-parse.cc"
4489 break;
4490
4491 case 161: /* switch_command: SWITCH expression opt_sep case_list END */
4492#line 1068 "../libinterp/parse-tree/oct-parse.yy"
4493 {
4494 // FIXME: Need to capture separator list here.
4495 // For now, delete the unused list.
4496 delete (yyvsp[-2].sep_list_type);
4497
4498 if (! ((yyval.tree_switch_command_type) = parser.finish_switch_command ((yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tok))))
4499 {
4500 // finish_switch_command deleted $2 and $4.
4501 YYABORT;
4502 }
4503 }
4504#line 4505 "libinterp/parse-tree/oct-parse.cc"
4505 break;
4506
4507 case 162: /* case_list: %empty */
4508#line 1082 "../libinterp/parse-tree/oct-parse.yy"
4509 { (yyval.tree_switch_case_list_type) = nullptr; }
4510#line 4511 "libinterp/parse-tree/oct-parse.cc"
4511 break;
4512
4513 case 163: /* case_list: default_case */
4514#line 1084 "../libinterp/parse-tree/oct-parse.yy"
4515 { (yyval.tree_switch_case_list_type) = parser.make_switch_case_list ((yyvsp[0].tree_switch_case_type)); }
4516#line 4517 "libinterp/parse-tree/oct-parse.cc"
4517 break;
4518
4519 case 164: /* case_list: case_list1 */
4520#line 1086 "../libinterp/parse-tree/oct-parse.yy"
4521 { (yyval.tree_switch_case_list_type) = (yyvsp[0].tree_switch_case_list_type); }
4522#line 4523 "libinterp/parse-tree/oct-parse.cc"
4523 break;
4524
4525 case 165: /* case_list: case_list1 default_case */
4526#line 1088 "../libinterp/parse-tree/oct-parse.yy"
4527 { (yyval.tree_switch_case_list_type) = parser.append_switch_case ((yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tree_switch_case_type)); }
4528#line 4529 "libinterp/parse-tree/oct-parse.cc"
4529 break;
4530
4531 case 166: /* case_list1: switch_case */
4532#line 1092 "../libinterp/parse-tree/oct-parse.yy"
4533 { (yyval.tree_switch_case_list_type) = parser.make_switch_case_list ((yyvsp[0].tree_switch_case_type)); }
4534#line 4535 "libinterp/parse-tree/oct-parse.cc"
4535 break;
4536
4537 case 167: /* case_list1: case_list1 switch_case */
4538#line 1094 "../libinterp/parse-tree/oct-parse.yy"
4539 { (yyval.tree_switch_case_list_type) = parser.append_switch_case ((yyvsp[-1].tree_switch_case_list_type), (yyvsp[0].tree_switch_case_type)); }
4540#line 4541 "libinterp/parse-tree/oct-parse.cc"
4541 break;
4542
4543 case 168: /* switch_case: CASE opt_sep expression stmt_begin statement_list */
4544#line 1098 "../libinterp/parse-tree/oct-parse.yy"
4545 {
4546 // FIXME: Need to capture separator list here.
4547 // For now, delete the unused list.
4548 delete (yyvsp[-3].sep_list_type);
4549
4550 (yyval.tree_switch_case_type) = parser.make_switch_case ((yyvsp[-4].tok), (yyvsp[-2].tree_expression_type), (yyvsp[0].tree_statement_list_type));
4551 }
4552#line 4553 "libinterp/parse-tree/oct-parse.cc"
4553 break;
4554
4555 case 169: /* default_case: OTHERWISE statement_list */
4556#line 1108 "../libinterp/parse-tree/oct-parse.yy"
4557 { (yyval.tree_switch_case_type) = parser.make_default_switch_case ((yyvsp[-1].tok), (yyvsp[0].tree_statement_list_type)); }
4558#line 4559 "libinterp/parse-tree/oct-parse.cc"
4559 break;
4560
4561 case 170: /* loop_command: WHILE expression stmt_begin statement_list END */
4562#line 1116 "../libinterp/parse-tree/oct-parse.yy"
4563 {
4564 parser.maybe_convert_to_braindead_shortcircuit ((yyvsp[-3].tree_expression_type));
4565
4566 if (! ((yyval.tree_command_type) = parser.make_while_command ((yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4567 {
4568 // make_while_command deleted $2 and $4.
4569 YYABORT;
4570 }
4571 }
4572#line 4573 "libinterp/parse-tree/oct-parse.cc"
4573 break;
4574
4575 case 171: /* loop_command: DO statement_list UNTIL expression */
4576#line 1126 "../libinterp/parse-tree/oct-parse.yy"
4577 {
4578 (yyval.tree_command_type) = parser.make_do_until_command ((yyvsp[-3].tok), (yyvsp[-2].tree_statement_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type));
4579 }
4580#line 4581 "libinterp/parse-tree/oct-parse.cc"
4581 break;
4582
4583 case 172: /* loop_command: FOR assign_lhs '=' expression stmt_begin statement_list END */
4584#line 1130 "../libinterp/parse-tree/oct-parse.yy"
4585 {
4586 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-6].tok), nullptr, (yyvsp[-5].tree_argument_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), nullptr, nullptr, nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4587 {
4588 // make_for_command deleted $2, $4, and $6.
4589 YYABORT;
4590 }
4591 }
4592#line 4593 "libinterp/parse-tree/oct-parse.cc"
4593 break;
4594
4595 case 173: /* loop_command: FOR '(' assign_lhs '=' expression ')' statement_list END */
4596#line 1138 "../libinterp/parse-tree/oct-parse.yy"
4597 {
4598 // FIXME: Need to capture token info here.
4599 OCTAVE_YYUSE ((yyvsp[-6].tok), (yyvsp[-4].tok), (yyvsp[-2].tok));
4600
4601 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-7].tok), (yyvsp[-6].tok), (yyvsp[-5].tree_argument_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), nullptr, nullptr, (yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4602 {
4603 // make_for_command deleted $3, $5, and $7.
4604 YYABORT;
4605 }
4606 }
4607#line 4608 "libinterp/parse-tree/oct-parse.cc"
4608 break;
4609
4610 case 174: /* loop_command: PARFOR assign_lhs '=' expression stmt_begin statement_list END */
4611#line 1149 "../libinterp/parse-tree/oct-parse.yy"
4612 {
4613 // FIXME: Need to capture token info here.
4614 OCTAVE_YYUSE ((yyvsp[-4].tok));
4615
4616 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-6].tok), nullptr, (yyvsp[-5].tree_argument_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), nullptr, nullptr, nullptr, (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4617 {
4618 // make_for_command deleted $2, $4, and $6.
4619 YYABORT;
4620 }
4621 }
4622#line 4623 "libinterp/parse-tree/oct-parse.cc"
4623 break;
4624
4625 case 175: /* loop_command: PARFOR '(' assign_lhs '=' expression ',' expression ')' statement_list END */
4626#line 1160 "../libinterp/parse-tree/oct-parse.yy"
4627 {
4628 // FIXME: Need to capture token info here.
4629 OCTAVE_YYUSE ((yyvsp[-8].tok), (yyvsp[-6].tok), (yyvsp[-4].tok), (yyvsp[-2].tok));
4630
4631 if (! ((yyval.tree_command_type) = parser.make_for_command ((yyvsp[-9].tok), (yyvsp[-8].tok), (yyvsp[-7].tree_argument_list_type), (yyvsp[-6].tok), (yyvsp[-5].tree_expression_type), (yyvsp[-4].tok), (yyvsp[-3].tree_expression_type), (yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4632 {
4633 // make_for_command deleted $3, $5, $7, and $9.
4634 YYABORT;
4635 }
4636 }
4637#line 4638 "libinterp/parse-tree/oct-parse.cc"
4638 break;
4639
4640 case 176: /* jump_command: BREAK */
4641#line 1177 "../libinterp/parse-tree/oct-parse.yy"
4642 {
4643 if (! ((yyval.tree_command_type) = parser.make_break_command ((yyvsp[0].tok))))
4644 YYABORT;
4645 }
4646#line 4647 "libinterp/parse-tree/oct-parse.cc"
4647 break;
4648
4649 case 177: /* jump_command: CONTINUE */
4650#line 1182 "../libinterp/parse-tree/oct-parse.yy"
4651 {
4652 if (! ((yyval.tree_command_type) = parser.make_continue_command ((yyvsp[0].tok))))
4653 YYABORT;
4654 }
4655#line 4656 "libinterp/parse-tree/oct-parse.cc"
4656 break;
4657
4658 case 178: /* jump_command: RETURN */
4659#line 1187 "../libinterp/parse-tree/oct-parse.yy"
4660 { (yyval.tree_command_type) = parser.make_return_command ((yyvsp[0].tok)); }
4661#line 4662 "libinterp/parse-tree/oct-parse.cc"
4662 break;
4663
4664 case 179: /* spmd_command: SPMD statement_list END */
4665#line 1195 "../libinterp/parse-tree/oct-parse.yy"
4666 {
4667 if (! ((yyval.tree_command_type) = parser.make_spmd_command ((yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4668 {
4669 // make_spmd_command deleted $2.
4670 YYABORT;
4671 }
4672 }
4673#line 4674 "libinterp/parse-tree/oct-parse.cc"
4674 break;
4675
4676 case 180: /* except_command: UNWIND statement_list CLEANUP statement_list END */
4677#line 1209 "../libinterp/parse-tree/oct-parse.yy"
4678 {
4679 if (! ((yyval.tree_command_type) = parser.make_unwind_command ((yyvsp[-4].tok), (yyvsp[-3].tree_statement_list_type), (yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4680 {
4681 // make_unwind_command deleted $2 and $4.
4682 YYABORT;
4683 }
4684 }
4685#line 4686 "libinterp/parse-tree/oct-parse.cc"
4686 break;
4687
4688 case 181: /* except_command: TRY statement_list CATCH opt_sep opt_list END */
4689#line 1217 "../libinterp/parse-tree/oct-parse.yy"
4690 {
4691 if (! ((yyval.tree_command_type) = parser.make_try_command ((yyvsp[-5].tok), (yyvsp[-4].tree_statement_list_type), (yyvsp[-3].tok), (yyvsp[-2].sep_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok))))
4692 {
4693 // make_try_command deleted $2, $4, and $5.
4694 YYABORT;
4695 }
4696 }
4697#line 4698 "libinterp/parse-tree/oct-parse.cc"
4698 break;
4699
4700 case 182: /* except_command: TRY statement_list END */
4701#line 1225 "../libinterp/parse-tree/oct-parse.yy"
4702 {
4703 if (! ((yyval.tree_command_type) = parser.make_try_command ((yyvsp[-2].tok), (yyvsp[-1].tree_statement_list_type), nullptr, nullptr, nullptr, (yyvsp[0].tok))))
4704 {
4705 // make_try_command deleted $2.
4706 YYABORT;
4707 }
4708 }
4709#line 4710 "libinterp/parse-tree/oct-parse.cc"
4710 break;
4711
4712 case 183: /* push_fcn_symtab: %empty */
4713#line 1239 "../libinterp/parse-tree/oct-parse.yy"
4714 {
4715 if (! parser.push_fcn_symtab ())
4716 YYABORT;
4717
4718 (yyval.dummy_type) = 0;
4719 }
4720#line 4721 "libinterp/parse-tree/oct-parse.cc"
4721 break;
4722
4723 case 184: /* param_list_beg: '(' */
4724#line 1252 "../libinterp/parse-tree/oct-parse.yy"
4725 {
4728
4730 {
4731 // Will get a real name later.
4732 lexer.m_symtab_context.push (octave::symbol_scope ("parser:param_list_beg"));
4735 }
4736
4737 (yyval.tok) = (yyvsp[0].tok);
4738 }
4739#line 4740 "libinterp/parse-tree/oct-parse.cc"
4740 break;
4741
4742 case 185: /* param_list_end: ')' */
4743#line 1269 "../libinterp/parse-tree/oct-parse.yy"
4744 {
4748 (yyval.tok) = (yyvsp[0].tok);
4749 }
4750#line 4751 "libinterp/parse-tree/oct-parse.cc"
4751 break;
4752
4753 case 186: /* opt_param_list: %empty */
4754#line 1278 "../libinterp/parse-tree/oct-parse.yy"
4755 { (yyval.tree_parameter_list_type) = nullptr; }
4756#line 4757 "libinterp/parse-tree/oct-parse.cc"
4757 break;
4758
4759 case 187: /* opt_param_list: param_list */
4760#line 1280 "../libinterp/parse-tree/oct-parse.yy"
4761 { (yyval.tree_parameter_list_type) = (yyvsp[0].tree_parameter_list_type); }
4762#line 4763 "libinterp/parse-tree/oct-parse.cc"
4763 break;
4764
4765 case 188: /* param_list: param_list_beg param_list1 param_list_end */
4766#line 1284 "../libinterp/parse-tree/oct-parse.yy"
4767 {
4768 if ((yyvsp[-1].tree_parameter_list_type))
4769 lexer.mark_as_variables ((yyvsp[-1].tree_parameter_list_type)->variable_names ());
4770
4771 (yyval.tree_parameter_list_type) = (yyvsp[-1].tree_parameter_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
4772 }
4773#line 4774 "libinterp/parse-tree/oct-parse.cc"
4774 break;
4775
4776 case 189: /* param_list: param_list_beg error */
4777#line 1291 "../libinterp/parse-tree/oct-parse.yy"
4778 {
4779 OCTAVE_YYUSE ((yyvsp[-1].tok));
4780
4781 (yyval.tree_parameter_list_type) = nullptr;
4782
4783 parser.bison_error ("invalid parameter list");
4784 YYABORT;
4785 }
4786#line 4787 "libinterp/parse-tree/oct-parse.cc"
4787 break;
4788
4789 case 190: /* param_list1: %empty */
4790#line 1302 "../libinterp/parse-tree/oct-parse.yy"
4791 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::in); }
4792#line 4793 "libinterp/parse-tree/oct-parse.cc"
4793 break;
4794
4795 case 191: /* param_list1: param_list2 */
4796#line 1304 "../libinterp/parse-tree/oct-parse.yy"
4797 {
4798 (yyvsp[0].tree_parameter_list_type)->mark_as_formal_parameters ();
4799
4800 if (parser.validate_param_list ((yyvsp[0].tree_parameter_list_type), octave::tree_parameter_list::in))
4801 {
4802 lexer.mark_as_variables ((yyvsp[0].tree_parameter_list_type)->variable_names ());
4803 (yyval.tree_parameter_list_type) = (yyvsp[0].tree_parameter_list_type);
4804 }
4805 else
4806 {
4807 delete (yyvsp[0].tree_parameter_list_type);
4808 YYABORT;
4809 }
4810 }
4811#line 4812 "libinterp/parse-tree/oct-parse.cc"
4812 break;
4813
4814 case 192: /* param_list2: param_list_elt */
4815#line 1321 "../libinterp/parse-tree/oct-parse.yy"
4816 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::in, (yyvsp[0].tree_decl_elt_type)); }
4817#line 4818 "libinterp/parse-tree/oct-parse.cc"
4818 break;
4819
4820 case 193: /* param_list2: param_list2 ',' param_list_elt */
4821#line 1323 "../libinterp/parse-tree/oct-parse.yy"
4822 { (yyval.tree_parameter_list_type) = parser.append_parameter_list ((yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_decl_elt_type)); }
4823#line 4824 "libinterp/parse-tree/oct-parse.cc"
4824 break;
4825
4826 case 194: /* param_list_elt: decl_elt */
4827#line 1327 "../libinterp/parse-tree/oct-parse.yy"
4828 { (yyval.tree_decl_elt_type) = (yyvsp[0].tree_decl_elt_type); }
4829#line 4830 "libinterp/parse-tree/oct-parse.cc"
4830 break;
4831
4832 case 195: /* param_list_elt: magic_tilde */
4833#line 1329 "../libinterp/parse-tree/oct-parse.yy"
4834 { (yyval.tree_decl_elt_type) = parser.make_decl_elt ((yyvsp[0].tree_identifier_type)); }
4835#line 4836 "libinterp/parse-tree/oct-parse.cc"
4836 break;
4837
4838 case 196: /* return_list: '[' ']' */
4839#line 1337 "../libinterp/parse-tree/oct-parse.yy"
4840 {
4842
4843 octave::tree_parameter_list *tmp = parser.make_parameter_list (octave::tree_parameter_list::out);
4844
4845 (yyval.tree_parameter_list_type) = tmp->mark_in_delims (*((yyvsp[-1].tok)), *((yyvsp[0].tok)));
4846 }
4847#line 4848 "libinterp/parse-tree/oct-parse.cc"
4848 break;
4849
4850 case 197: /* return_list: identifier */
4851#line 1345 "../libinterp/parse-tree/oct-parse.yy"
4852 {
4854
4855 octave::tree_parameter_list *tmp = parser.make_parameter_list (octave::tree_parameter_list::out, (yyvsp[0].tree_identifier_type));
4856
4857 // Even though this parameter list can contain only
4858 // a single identifier, we still need to validate it
4859 // to check for varargin or varargout.
4860
4861 if (parser.validate_param_list (tmp, octave::tree_parameter_list::out))
4862 (yyval.tree_parameter_list_type) = tmp;
4863 else
4864 {
4865 delete tmp;
4866 YYABORT;
4867 }
4868 }
4869#line 4870 "libinterp/parse-tree/oct-parse.cc"
4870 break;
4871
4872 case 198: /* return_list: '[' return_list1 ']' */
4873#line 1363 "../libinterp/parse-tree/oct-parse.yy"
4874 {
4876
4877 // Check for duplicate parameter names, varargin,
4878 // or varargout.
4879
4880 if (parser.validate_param_list ((yyvsp[-1].tree_parameter_list_type), octave::tree_parameter_list::out))
4881 (yyval.tree_parameter_list_type) = (yyvsp[-1].tree_parameter_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
4882 else
4883 {
4884 delete (yyvsp[-1].tree_parameter_list_type);
4885 YYABORT;
4886 }
4887 }
4888#line 4889 "libinterp/parse-tree/oct-parse.cc"
4889 break;
4890
4891 case 199: /* return_list1: identifier */
4892#line 1380 "../libinterp/parse-tree/oct-parse.yy"
4893 { (yyval.tree_parameter_list_type) = parser.make_parameter_list (octave::tree_parameter_list::out, (yyvsp[0].tree_identifier_type)); }
4894#line 4895 "libinterp/parse-tree/oct-parse.cc"
4895 break;
4896
4897 case 200: /* return_list1: return_list1 ',' identifier */
4898#line 1382 "../libinterp/parse-tree/oct-parse.yy"
4899 { (yyval.tree_parameter_list_type) = parser.append_parameter_list ((yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
4900#line 4901 "libinterp/parse-tree/oct-parse.cc"
4901 break;
4902
4903 case 201: /* parsing_local_fcns: %empty */
4904#line 1391 "../libinterp/parse-tree/oct-parse.yy"
4906#line 4907 "libinterp/parse-tree/oct-parse.cc"
4907 break;
4908
4909 case 202: /* push_script_symtab: %empty */
4910#line 1395 "../libinterp/parse-tree/oct-parse.yy"
4911 {
4912 (yyval.dummy_type) = 0;
4913
4914 // This scope may serve as the parent scope for local
4915 // functions in classdef files..
4916 lexer.m_symtab_context.push (octave::symbol_scope ("parser:push_script_symtab"));
4917 }
4918#line 4919 "libinterp/parse-tree/oct-parse.cc"
4919 break;
4920
4921 case 203: /* begin_file: push_script_symtab INPUT_FILE */
4922#line 1405 "../libinterp/parse-tree/oct-parse.yy"
4923 { (yyval.dummy_type) = 0; }
4924#line 4925 "libinterp/parse-tree/oct-parse.cc"
4925 break;
4926
4927 case 204: /* file: begin_file statement_list END_OF_INPUT */
4928#line 1409 "../libinterp/parse-tree/oct-parse.yy"
4929 {
4931 {
4932 // Delete the dummy statement_list we created
4933 // after parsing the function. Any function
4934 // definitions found in the file have already
4935 // been stored in the symbol table or in
4936 // base_parser::m_primary_fcn.
4937
4938 // Unused symbol table context.
4940
4941 delete (yyvsp[-1].tree_statement_list_type);
4942 }
4943 else
4944 {
4945 octave::tree_statement *end_of_script = parser.make_end ("endscript", true, (yyvsp[0].tok));
4946
4947 parser.make_script ((yyvsp[-1].tree_statement_list_type), end_of_script);
4948 }
4949
4951 YYABORT;
4952
4953 (yyval.tree_command_type) = nullptr;
4954 }
4955#line 4956 "libinterp/parse-tree/oct-parse.cc"
4956 break;
4957
4958 case 205: /* file: begin_file opt_sep classdef parsing_local_fcns opt_sep opt_fcn_list END_OF_INPUT */
4959#line 1436 "../libinterp/parse-tree/oct-parse.yy"
4960 {
4961 // We need to skip whitespace before the classdef
4962 // keyword. The opt_sep rule is more liberal than
4963 // we need to be because it accepts ';' and ',' in
4964 // addition to '\n', but we need to use it to avoid
4965 // creating a reduce/reduce conflict with the rule
4966 // above. Matching the extra ';' and ',' characters
4967 // doesn't cause trouble because the lexer ensures
4968 // that classdef is the first token in the file.
4969
4970 // FIXME: Need to capture separator lists here.
4971 // For now, delete the unused lists.
4972 delete (yyvsp[-5].sep_list_type);
4973 delete (yyvsp[-2].sep_list_type);
4974
4975 // Unused symbol table context.
4977
4978 if (! parser.finish_classdef_file ((yyvsp[-4].tree_classdef_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tok)))
4979 YYABORT;
4980
4981 (yyval.tree_command_type) = nullptr;
4982 }
4983#line 4984 "libinterp/parse-tree/oct-parse.cc"
4984 break;
4985
4986 case 206: /* function_beg: push_fcn_symtab FUNCTION */
4987#line 1466 "../libinterp/parse-tree/oct-parse.yy"
4988 {
4991
4992 (yyval.tok) = (yyvsp[0].tok);
4993 }
4994#line 4995 "libinterp/parse-tree/oct-parse.cc"
4995 break;
4996
4997 case 207: /* fcn_name: identifier */
4998#line 1475 "../libinterp/parse-tree/oct-parse.yy"
4999 {
5000 if (! ((yyval.tree_identifier_type) = parser.make_fcn_name ((yyvsp[0].tree_identifier_type))))
5001 {
5002 // make_fcn_name deleted $1.
5003 YYABORT;
5004 }
5005
5007 }
5008#line 5009 "libinterp/parse-tree/oct-parse.cc"
5009 break;
5010
5011 case 208: /* fcn_name: GET '.' identifier */
5012#line 1485 "../libinterp/parse-tree/oct-parse.yy"
5013 {
5014 (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type)->mark_get_set (*((yyvsp[-2].tok)), *((yyvsp[-1].tok)));
5015
5016 lexer.m_parsed_function_name.top () = true;
5020 }
5021#line 5022 "libinterp/parse-tree/oct-parse.cc"
5022 break;
5023
5024 case 209: /* fcn_name: SET '.' identifier */
5025#line 1494 "../libinterp/parse-tree/oct-parse.yy"
5026 {
5027 (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type)->mark_get_set (*((yyvsp[-2].tok)), *((yyvsp[-1].tok)));
5028
5029 lexer.m_parsed_function_name.top () = true;
5033 }
5034#line 5035 "libinterp/parse-tree/oct-parse.cc"
5035 break;
5036
5037 case 210: /* function_end: END */
5038#line 1505 "../libinterp/parse-tree/oct-parse.yy"
5039 {
5041
5042 if (parser.end_token_ok ((yyvsp[0].tok), octave::token::function_end))
5043 (yyval.tree_statement_type) = parser.make_end ("endfunction", false, (yyvsp[0].tok));
5044 else
5045 {
5046 parser.end_token_error ((yyvsp[0].tok), octave::token::function_end);
5047 YYABORT;
5048 }
5049 }
5050#line 5051 "libinterp/parse-tree/oct-parse.cc"
5051 break;
5052
5053 case 211: /* function_end: END_OF_INPUT */
5054#line 1517 "../libinterp/parse-tree/oct-parse.yy"
5055 {
5056// A lot of tests are based on the assumption that this is OK
5057// if (lexer.m_reading_script_file)
5058// {
5059// parser.bison_error ("function body open at end of script");
5060// YYABORT;
5061// }
5062
5064 {
5065 parser.bison_error ("inconsistent function endings -- "
5066 "if one function is explicitly ended, "
5067 "so must all the others");
5068 YYABORT;
5069 }
5070
5073 {
5074 parser.bison_error ("function body open at end of input");
5075 YYABORT;
5076 }
5077
5079 {
5080 parser.bison_error ("classdef body open at end of input");
5081 YYABORT;
5082 }
5083
5084 (yyval.tree_statement_type) = parser.make_end ("endfunction", true, (yyvsp[0].tok));
5085 }
5086#line 5087 "libinterp/parse-tree/oct-parse.cc"
5087 break;
5088
5089 case 212: /* function: function_beg fcn_name opt_param_list function_body function_end */
5090#line 1551 "../libinterp/parse-tree/oct-parse.yy"
5091 {
5092 (yyval.tree_function_def_type) = parser.make_function ((yyvsp[-4].tok), nullptr, nullptr, (yyvsp[-3].tree_identifier_type), (yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_type));
5093 }
5094#line 5095 "libinterp/parse-tree/oct-parse.cc"
5095 break;
5096
5097 case 213: /* function: function_beg return_list '=' fcn_name opt_param_list function_body function_end */
5098#line 1555 "../libinterp/parse-tree/oct-parse.yy"
5099 {
5100 (yyval.tree_function_def_type) = parser.make_function ((yyvsp[-6].tok), (yyvsp[-5].tree_parameter_list_type), (yyvsp[-4].tok), (yyvsp[-3].tree_identifier_type), (yyvsp[-2].tree_parameter_list_type), (yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_type));
5101 }
5102#line 5103 "libinterp/parse-tree/oct-parse.cc"
5103 break;
5104
5105 case 214: /* function_body: statement_list */
5106#line 1561 "../libinterp/parse-tree/oct-parse.yy"
5107 {
5108 (yyval.tree_statement_list_type) = (yyvsp[0].tree_statement_list_type);
5109 }
5110#line 5111 "libinterp/parse-tree/oct-parse.cc"
5111 break;
5112
5113 case 215: /* function_body: opt_sep arguments_block_list statement_list */
5114#line 1565 "../libinterp/parse-tree/oct-parse.yy"
5115 {
5116 (yyval.tree_statement_list_type) = parser.append_function_body ((yyvsp[-1].tree_statement_list_type), (yyvsp[0].tree_statement_list_type));
5117 }
5118#line 5119 "libinterp/parse-tree/oct-parse.cc"
5119 break;
5120
5121 case 216: /* arguments_block_list: arguments_block */
5122#line 1572 "../libinterp/parse-tree/oct-parse.yy"
5123 {
5124 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_arguments_block_type));
5125
5126 (yyval.tree_statement_list_type) = parser.make_statement_list (stmt);
5127 }
5128#line 5129 "libinterp/parse-tree/oct-parse.cc"
5129 break;
5130
5131 case 217: /* arguments_block_list: arguments_block_list opt_sep arguments_block */
5132#line 1578 "../libinterp/parse-tree/oct-parse.yy"
5133 {
5134 octave::tree_statement *stmt = parser.make_statement ((yyvsp[0].tree_arguments_block_type));
5135
5136 (yyval.tree_statement_list_type) = parser.append_statement_list ((yyvsp[-2].tree_statement_list_type), (yyvsp[-1].sep_list_type), stmt, false);
5137 }
5138#line 5139 "libinterp/parse-tree/oct-parse.cc"
5139 break;
5140
5141 case 218: /* arguments_block: arguments_beg opt_sep args_attr_list args_validation_list opt_sep END */
5142#line 1586 "../libinterp/parse-tree/oct-parse.yy"
5143 {
5144 // FIXME: Need to capture separator list here.
5145 // For now, delete the unused lists.
5146 delete (yyvsp[-4].sep_list_type);
5147 delete (yyvsp[-1].sep_list_type);
5148
5149 if (! ((yyval.tree_arguments_block_type) = parser.make_arguments_block ((yyvsp[-5].tok), (yyvsp[-3].tree_args_block_attribute_list_type), (yyvsp[-2].tree_args_block_validation_list_type), (yyvsp[0].tok))))
5150 {
5151 // make_arguments_block deleted $3, and $4.
5152 YYABORT;
5153 }
5154
5156 }
5157#line 5158 "libinterp/parse-tree/oct-parse.cc"
5158 break;
5159
5160 case 219: /* arguments_beg: ARGUMENTS */
5161#line 1603 "../libinterp/parse-tree/oct-parse.yy"
5162 {
5163 (yyval.tok) = (yyvsp[0].tok);
5164
5166 }
5167#line 5168 "libinterp/parse-tree/oct-parse.cc"
5168 break;
5169
5170 case 220: /* args_attr_list: %empty */
5171#line 1611 "../libinterp/parse-tree/oct-parse.yy"
5172 { (yyval.tree_args_block_attribute_list_type) = nullptr; }
5173#line 5174 "libinterp/parse-tree/oct-parse.cc"
5174 break;
5175
5176 case 221: /* args_attr_list: '(' identifier ')' */
5177#line 1613 "../libinterp/parse-tree/oct-parse.yy"
5178 {
5179 (yyvsp[-1].tree_identifier_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
5180
5181 // Error if $$ is nullptr.
5182 if (! ((yyval.tree_args_block_attribute_list_type) = parser.make_args_attribute_list ((yyvsp[-1].tree_identifier_type))))
5183 {
5184 // make_args_attribute_list deleted $2.
5185 YYABORT;
5186 }
5187 }
5188#line 5189 "libinterp/parse-tree/oct-parse.cc"
5189 break;
5190
5191 case 222: /* args_validation_list: arg_name arg_validation */
5192#line 1627 "../libinterp/parse-tree/oct-parse.yy"
5193 {
5194 (yyvsp[0].tree_arg_validation_type)->arg_name ((yyvsp[-1].tree_expression_type));
5195 (yyval.tree_args_block_validation_list_type) = parser.make_args_validation_list ((yyvsp[0].tree_arg_validation_type));
5196 }
5197#line 5198 "libinterp/parse-tree/oct-parse.cc"
5198 break;
5199
5200 case 223: /* args_validation_list: args_validation_list sep arg_name arg_validation */
5201#line 1632 "../libinterp/parse-tree/oct-parse.yy"
5202 {
5203 // FIXME: Need to capture SEP here.
5204 // For now, delete the unused list.
5205 delete (yyvsp[-2].sep_list_type);
5206
5207 (yyvsp[0].tree_arg_validation_type)->arg_name ((yyvsp[-1].tree_expression_type));
5208 (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));
5209 }
5210#line 5211 "libinterp/parse-tree/oct-parse.cc"
5211 break;
5212
5213 case 224: /* arg_name: identifier */
5214#line 1647 "../libinterp/parse-tree/oct-parse.yy"
5215 { (yyval.tree_expression_type) = (yyvsp[0].tree_identifier_type); }
5216#line 5217 "libinterp/parse-tree/oct-parse.cc"
5217 break;
5218
5219 case 225: /* arg_validation: size_spec class_name validation_fcns */
5220#line 1651 "../libinterp/parse-tree/oct-parse.yy"
5221 {
5222 if (! ((yyval.tree_arg_validation_type) = parser.make_arg_validation ((yyvsp[-2].tree_arg_size_spec_type), (yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_arg_validation_fcns_type))))
5223 {
5224 // make_arg_validation deleted ...
5225 YYABORT;
5226 }
5227 }
5228#line 5229 "libinterp/parse-tree/oct-parse.cc"
5229 break;
5230
5231 case 226: /* arg_validation: size_spec class_name validation_fcns '=' expression */
5232#line 1659 "../libinterp/parse-tree/oct-parse.yy"
5233 {
5234 if (! ((yyval.tree_arg_validation_type) = parser.make_arg_validation ((yyvsp[-4].tree_arg_size_spec_type), (yyvsp[-3].tree_identifier_type), (yyvsp[-2].tree_arg_validation_fcns_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type))))
5235 {
5236 // make_arg_validation deleted ...
5237 YYABORT;
5238 }
5239 }
5240#line 5241 "libinterp/parse-tree/oct-parse.cc"
5241 break;
5242
5243 case 227: /* size_spec: %empty */
5244#line 1669 "../libinterp/parse-tree/oct-parse.yy"
5245 { (yyval.tree_arg_size_spec_type) = nullptr; }
5246#line 5247 "libinterp/parse-tree/oct-parse.cc"
5247 break;
5248
5249 case 228: /* size_spec: '(' arg_list ')' */
5250#line 1671 "../libinterp/parse-tree/oct-parse.yy"
5251 {
5252 (yyvsp[-1].tree_argument_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
5253
5254 if (! ((yyval.tree_arg_size_spec_type) = parser.make_arg_size_spec ((yyvsp[-1].tree_argument_list_type))))
5255 {
5256 // make_arg_size_spec deleted $2.
5257 YYABORT;
5258 }
5259 }
5260#line 5261 "libinterp/parse-tree/oct-parse.cc"
5261 break;
5262
5263 case 229: /* class_name: %empty */
5264#line 1683 "../libinterp/parse-tree/oct-parse.yy"
5265 { (yyval.tree_identifier_type) = nullptr; }
5266#line 5267 "libinterp/parse-tree/oct-parse.cc"
5267 break;
5268
5269 case 230: /* class_name: identifier */
5270#line 1685 "../libinterp/parse-tree/oct-parse.yy"
5271 { (yyval.tree_identifier_type) = (yyvsp[0].tree_identifier_type); }
5272#line 5273 "libinterp/parse-tree/oct-parse.cc"
5273 break;
5274
5275 case 231: /* validation_fcns: %empty */
5276#line 1690 "../libinterp/parse-tree/oct-parse.yy"
5277 { (yyval.tree_arg_validation_fcns_type) = nullptr; }
5278#line 5279 "libinterp/parse-tree/oct-parse.cc"
5279 break;
5280
5281 case 232: /* validation_fcns: '{' arg_list '}' */
5282#line 1692 "../libinterp/parse-tree/oct-parse.yy"
5283 {
5284 (yyvsp[-1].tree_argument_list_type)->mark_in_delims (*((yyvsp[-2].tok)), *((yyvsp[0].tok)));
5285
5286 if (! ((yyval.tree_arg_validation_fcns_type) = parser.make_arg_validation_fcns ((yyvsp[-1].tree_argument_list_type))))
5287 {
5288 // make_arg_validation_fcns deleted $2.
5289 YYABORT;
5290 }
5291 }
5292#line 5293 "libinterp/parse-tree/oct-parse.cc"
5293 break;
5294
5295 case 233: /* classdef_beg: CLASSDEF */
5296#line 1708 "../libinterp/parse-tree/oct-parse.yy"
5297 {
5299 {
5300 parser.bison_error ("classdef must appear inside a file containing only a class definition");
5301 YYABORT;
5302 }
5303
5304 // Create invalid parent scope.
5305 lexer.m_symtab_context.push (octave::symbol_scope::anonymous ());
5309
5310 (yyval.tok) = (yyvsp[0].tok);
5311 }
5312#line 5313 "libinterp/parse-tree/oct-parse.cc"
5313 break;
5314
5315 case 234: /* classdef: classdef_beg attr_list identifier opt_sep superclass_list class_body END */
5316#line 1726 "../libinterp/parse-tree/oct-parse.yy"
5317 {
5318 // FIXME: Need to capture separator list here.
5319 // For now, delete the unused list.
5320 delete (yyvsp[-3].sep_list_type);
5321
5322 lexer.m_parsing_classdef = false;
5323
5324 if (! ((yyval.tree_classdef_type) = parser.make_classdef ((yyvsp[-6].tok), (yyvsp[-5].tree_classdef_attribute_list_type), (yyvsp[-4].tree_identifier_type), (yyvsp[-2].tree_classdef_superclass_list_type), (yyvsp[-1].tree_classdef_body_type), (yyvsp[0].tok))))
5325 {
5326 // make_classdef deleted $2, $3, $5, $6
5327 YYABORT;
5328 }
5329 }
5330#line 5331 "libinterp/parse-tree/oct-parse.cc"
5331 break;
5332
5333 case 235: /* attr_list: %empty */
5334#line 1742 "../libinterp/parse-tree/oct-parse.yy"
5335 { (yyval.tree_classdef_attribute_list_type) = nullptr; }
5336#line 5337 "libinterp/parse-tree/oct-parse.cc"
5337 break;
5338
5339 case 236: /* attr_list: '(' attr_list1 ')' opt_sep */
5340#line 1744 "../libinterp/parse-tree/oct-parse.yy"
5341 {
5342 // FIXME: Need to capture separator list here.
5343 // For now, delete the unused list.
5344 delete (yyvsp[0].sep_list_type);
5345
5346 (yyval.tree_classdef_attribute_list_type) = (yyvsp[-2].tree_classdef_attribute_list_type)->mark_in_delims (*((yyvsp[-3].tok)), *((yyvsp[-1].tok)));
5347 }
5348#line 5349 "libinterp/parse-tree/oct-parse.cc"
5349 break;
5350
5351 case 237: /* attr_list1: attr */
5352#line 1754 "../libinterp/parse-tree/oct-parse.yy"
5353 { (yyval.tree_classdef_attribute_list_type) = parser.make_classdef_attribute_list ((yyvsp[0].tree_classdef_attribute_type)); }
5354#line 5355 "libinterp/parse-tree/oct-parse.cc"
5355 break;
5356
5357 case 238: /* attr_list1: attr_list1 ',' attr */
5358#line 1756 "../libinterp/parse-tree/oct-parse.yy"
5359 { (yyval.tree_classdef_attribute_list_type) = parser.append_classdef_attribute ((yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_classdef_attribute_type)); }
5360#line 5361 "libinterp/parse-tree/oct-parse.cc"
5361 break;
5362
5363 case 239: /* attr: identifier */
5364#line 1760 "../libinterp/parse-tree/oct-parse.yy"
5365 { (yyval.tree_classdef_attribute_type) = parser.make_classdef_attribute ((yyvsp[0].tree_identifier_type)); }
5366#line 5367 "libinterp/parse-tree/oct-parse.cc"
5367 break;
5368
5369 case 240: /* attr: identifier '=' expression */
5370#line 1762 "../libinterp/parse-tree/oct-parse.yy"
5371 { (yyval.tree_classdef_attribute_type) = parser.make_classdef_attribute ((yyvsp[-2].tree_identifier_type), (yyvsp[-1].tok), (yyvsp[0].tree_expression_type)); }
5372#line 5373 "libinterp/parse-tree/oct-parse.cc"
5373 break;
5374
5375 case 241: /* attr: '~' identifier */
5376#line 1764 "../libinterp/parse-tree/oct-parse.yy"
5377 { (yyval.tree_classdef_attribute_type) = parser.make_not_classdef_attribute ((yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
5378#line 5379 "libinterp/parse-tree/oct-parse.cc"
5379 break;
5380
5381 case 242: /* attr: '!' identifier */
5382#line 1766 "../libinterp/parse-tree/oct-parse.yy"
5383 { (yyval.tree_classdef_attribute_type) = parser.make_not_classdef_attribute ((yyvsp[-1].tok), (yyvsp[0].tree_identifier_type)); }
5384#line 5385 "libinterp/parse-tree/oct-parse.cc"
5385 break;
5386
5387 case 243: /* superclass_list: %empty */
5388#line 1770 "../libinterp/parse-tree/oct-parse.yy"
5389 {
5392 (yyval.tree_classdef_superclass_list_type) = nullptr;
5393 }
5394#line 5395 "libinterp/parse-tree/oct-parse.cc"
5395 break;
5396
5397 case 244: /* superclass_list: superclass_list1 opt_sep */
5398#line 1776 "../libinterp/parse-tree/oct-parse.yy"
5399 {
5400 // FIXME: Need to capture separator list here.
5401 // For now, delete the unused list.
5402 delete (yyvsp[0].sep_list_type);
5403
5406 (yyval.tree_classdef_superclass_list_type) = (yyvsp[-1].tree_classdef_superclass_list_type);
5407 }
5408#line 5409 "libinterp/parse-tree/oct-parse.cc"
5409 break;
5410
5411 case 245: /* superclass_list1: EXPR_LT superclass */
5412#line 1789 "../libinterp/parse-tree/oct-parse.yy"
5413 { (yyval.tree_classdef_superclass_list_type) = parser.make_classdef_superclass_list ((yyvsp[-1].tok), (yyvsp[0].tree_classdef_superclass_type)); }
5414#line 5415 "libinterp/parse-tree/oct-parse.cc"
5415 break;
5416
5417 case 246: /* superclass_list1: superclass_list1 EXPR_AND superclass */
5418#line 1791 "../libinterp/parse-tree/oct-parse.yy"
5419 { (yyval.tree_classdef_superclass_list_type) = parser.append_classdef_superclass ((yyvsp[-2].tree_classdef_superclass_list_type), (yyvsp[-1].tok), (yyvsp[0].tree_classdef_superclass_type)); }
5420#line 5421 "libinterp/parse-tree/oct-parse.cc"
5421 break;
5422
5423 case 247: /* superclass: FQ_IDENT */
5424#line 1795 "../libinterp/parse-tree/oct-parse.yy"
5425 { (yyval.tree_classdef_superclass_type) = parser.make_classdef_superclass ((yyvsp[0].tok)); }
5426#line 5427 "libinterp/parse-tree/oct-parse.cc"
5427 break;
5428
5429 case 248: /* class_body: %empty */
5430#line 1799 "../libinterp/parse-tree/oct-parse.yy"
5431 {
5433 (yyval.tree_classdef_body_type) = nullptr;
5434 }
5435#line 5436 "libinterp/parse-tree/oct-parse.cc"
5436 break;
5437
5438 case 249: /* class_body: class_body1 opt_sep */
5439#line 1804 "../libinterp/parse-tree/oct-parse.yy"
5440 {
5441 // FIXME: Need to capture separator list here.
5442 // For now, delete the unused list.
5443 delete (yyvsp[0].sep_list_type);
5444
5446 (yyval.tree_classdef_body_type) = (yyvsp[-1].tree_classdef_body_type);
5447 }
5448#line 5449 "libinterp/parse-tree/oct-parse.cc"
5449 break;
5450
5451 case 250: /* class_body1: properties_block */
5452#line 1815 "../libinterp/parse-tree/oct-parse.yy"
5453 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_properties_block_type)); }
5454#line 5455 "libinterp/parse-tree/oct-parse.cc"
5455 break;
5456
5457 case 251: /* class_body1: methods_block */
5458#line 1817 "../libinterp/parse-tree/oct-parse.yy"
5459 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_methods_block_type)); }
5460#line 5461 "libinterp/parse-tree/oct-parse.cc"
5461 break;
5462
5463 case 252: /* class_body1: events_block */
5464#line 1819 "../libinterp/parse-tree/oct-parse.yy"
5465 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_events_block_type)); }
5466#line 5467 "libinterp/parse-tree/oct-parse.cc"
5467 break;
5468
5469 case 253: /* class_body1: enum_block */
5470#line 1821 "../libinterp/parse-tree/oct-parse.yy"
5471 { (yyval.tree_classdef_body_type) = parser.make_classdef_body ((yyvsp[0].tree_classdef_enum_block_type)); }
5472#line 5473 "libinterp/parse-tree/oct-parse.cc"
5473 break;
5474
5475 case 254: /* class_body1: class_body1 opt_sep properties_block */
5476#line 1823 "../libinterp/parse-tree/oct-parse.yy"
5477 {
5478 // FIXME: Need to capture separator list here.
5479 // For now, delete the unused list.
5480 delete (yyvsp[-1].sep_list_type);
5481
5482 (yyval.tree_classdef_body_type) = parser.append_classdef_properties_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_properties_block_type));
5483 }
5484#line 5485 "libinterp/parse-tree/oct-parse.cc"
5485 break;
5486
5487 case 255: /* class_body1: class_body1 opt_sep methods_block */
5488#line 1831 "../libinterp/parse-tree/oct-parse.yy"
5489 {
5490 // FIXME: Need to capture separator list here.
5491 // For now, delete the unused list.
5492 delete (yyvsp[-1].sep_list_type);
5493
5494 (yyval.tree_classdef_body_type) = parser.append_classdef_methods_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_methods_block_type));
5495 }
5496#line 5497 "libinterp/parse-tree/oct-parse.cc"
5497 break;
5498
5499 case 256: /* class_body1: class_body1 opt_sep events_block */
5500#line 1839 "../libinterp/parse-tree/oct-parse.yy"
5501 {
5502 // FIXME: Need to capture separator list here.
5503 // For now, delete the unused list.
5504 delete (yyvsp[-1].sep_list_type);
5505
5506 (yyval.tree_classdef_body_type) = parser.append_classdef_events_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_events_block_type));
5507 }
5508#line 5509 "libinterp/parse-tree/oct-parse.cc"
5509 break;
5510
5511 case 257: /* class_body1: class_body1 opt_sep enum_block */
5512#line 1847 "../libinterp/parse-tree/oct-parse.yy"
5513 {
5514 // FIXME: Need to capture separator list here.
5515 // For now, delete the unused list.
5516 delete (yyvsp[-1].sep_list_type);
5517
5518 (yyval.tree_classdef_body_type) = parser.append_classdef_enum_block ((yyvsp[-2].tree_classdef_body_type), (yyvsp[0].tree_classdef_enum_block_type));
5519 }
5520#line 5521 "libinterp/parse-tree/oct-parse.cc"
5521 break;
5522
5523 case 258: /* properties_block: properties_beg opt_sep attr_list property_list END */
5524#line 1858 "../libinterp/parse-tree/oct-parse.yy"
5525 {
5526 // FIXME: Need to capture separator list here.
5527 // For now, delete the unused list.
5528 delete (yyvsp[-3].sep_list_type);
5529
5530 if (! ((yyval.tree_classdef_properties_block_type) = parser.make_classdef_properties_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_property_list_type), (yyvsp[0].tok))))
5531 {
5532 // make_classdef_properties_block deleted $3 and $4.
5533 YYABORT;
5534 }
5535 }
5536#line 5537 "libinterp/parse-tree/oct-parse.cc"
5537 break;
5538
5539 case 259: /* properties_beg: PROPERTIES */
5540#line 1872 "../libinterp/parse-tree/oct-parse.yy"
5541 {
5543 (yyval.tok) = (yyvsp[0].tok);
5544 }
5545#line 5546 "libinterp/parse-tree/oct-parse.cc"
5546 break;
5547
5548 case 260: /* property_list: %empty */
5549#line 1879 "../libinterp/parse-tree/oct-parse.yy"
5550 {
5552 (yyval.tree_classdef_property_list_type) = nullptr;
5553 }
5554#line 5555 "libinterp/parse-tree/oct-parse.cc"
5555 break;
5556
5557 case 261: /* property_list: property_list1 opt_sep */
5558#line 1884 "../libinterp/parse-tree/oct-parse.yy"
5559 {
5560 // FIXME: Need to capture separator list here.
5561 // For now, delete the unused list.
5562 delete (yyvsp[0].sep_list_type);
5563
5565 (yyval.tree_classdef_property_list_type) = (yyvsp[-1].tree_classdef_property_list_type);
5566 }
5567#line 5568 "libinterp/parse-tree/oct-parse.cc"
5568 break;
5569
5570 case 262: /* property_list1: class_property */
5571#line 1896 "../libinterp/parse-tree/oct-parse.yy"
5572 { (yyval.tree_classdef_property_list_type) = parser.make_classdef_property_list ((yyvsp[0].tree_classdef_property_type)); }
5573#line 5574 "libinterp/parse-tree/oct-parse.cc"
5574 break;
5575
5576 case 263: /* property_list1: property_list1 sep class_property */
5577#line 1898 "../libinterp/parse-tree/oct-parse.yy"
5578 {
5579 // FIXME: Need to capture SEP here.
5580 // For now, delete the unused list.
5581 delete (yyvsp[-1].sep_list_type);
5582
5583 // We don't look ahead to grab end-of-line comments.
5584 // Instead, they are grabbed when we see the
5585 // identifier that becomes the next element in the
5586 // list. If the element at the end of the list
5587 // doesn't have a doc string, see whether the
5588 // element we are adding is storing an end-of-line
5589 // comment for us to use.
5590
5591 octave::tree_classdef_property *last_elt = (yyvsp[-2].tree_classdef_property_list_type)->back ();
5592
5593 if (! last_elt->have_doc_string ())
5594 {
5595 octave::comment_list comments = (yyvsp[0].tree_classdef_property_type)->leading_comments ();
5596
5597 if (! comments.empty ())
5598 {
5599 octave::comment_elt elt = comments.front ();
5600
5601 if (elt.is_end_of_line ())
5602 last_elt->doc_string (elt.text ());
5603 }
5604 }
5605
5606 (yyval.tree_classdef_property_list_type) = parser.append_classdef_property ((yyvsp[-2].tree_classdef_property_list_type), (yyvsp[0].tree_classdef_property_type));
5607 }
5608#line 5609 "libinterp/parse-tree/oct-parse.cc"
5609 break;
5610
5611 case 264: /* class_property: identifier arg_validation */
5612#line 1931 "../libinterp/parse-tree/oct-parse.yy"
5613 { (yyval.tree_classdef_property_type) = parser.make_classdef_property ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_arg_validation_type)); }
5614#line 5615 "libinterp/parse-tree/oct-parse.cc"
5615 break;
5616
5617 case 265: /* methods_block: methods_beg opt_sep attr_list method_list END */
5618#line 1935 "../libinterp/parse-tree/oct-parse.yy"
5619 {
5620 // FIXME: Need to capture separator list here.
5621 // For now, delete the unused list.
5622 delete (yyvsp[-3].sep_list_type);
5623
5624 if (! ((yyval.tree_classdef_methods_block_type) = parser.make_classdef_methods_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_method_list_type), (yyvsp[0].tok))))
5625 {
5626 // make_classdef_methods_block deleted $3 and $4.
5627 YYABORT;
5628 }
5629 }
5630#line 5631 "libinterp/parse-tree/oct-parse.cc"
5631 break;
5632
5633 case 266: /* methods_beg: METHODS */
5634#line 1949 "../libinterp/parse-tree/oct-parse.yy"
5635 {
5637 (yyval.tok) = (yyvsp[0].tok);
5638 }
5639#line 5640 "libinterp/parse-tree/oct-parse.cc"
5640 break;
5641
5642 case 267: /* method_decl1: identifier */
5643#line 1956 "../libinterp/parse-tree/oct-parse.yy"
5644 {
5645 if (! ((yyval.octave_user_function_type) = parser.start_classdef_external_method ((yyvsp[0].tree_identifier_type))))
5646 YYABORT;
5647 }
5648#line 5649 "libinterp/parse-tree/oct-parse.cc"
5649 break;
5650
5651 case 268: /* method_decl1: identifier param_list */
5652#line 1961 "../libinterp/parse-tree/oct-parse.yy"
5653 {
5654 if (! ((yyval.octave_user_function_type) = parser.start_classdef_external_method ((yyvsp[-1].tree_identifier_type), (yyvsp[0].tree_parameter_list_type))))
5655 YYABORT;
5656 }
5657#line 5658 "libinterp/parse-tree/oct-parse.cc"
5658 break;
5659
5660 case 269: /* method_decl: method_decl1 */
5661#line 1968 "../libinterp/parse-tree/oct-parse.yy"
5662 { (yyval.tree_function_def_type) = parser.finish_classdef_external_method ((yyvsp[0].octave_user_function_type)); }
5663#line 5664 "libinterp/parse-tree/oct-parse.cc"
5664 break;
5665
5666 case 270: /* $@1: %empty */
5667#line 1970 "../libinterp/parse-tree/oct-parse.yy"
5668 {
5670 lexer.m_parsed_function_name.push (false);
5671 }
5672#line 5673 "libinterp/parse-tree/oct-parse.cc"
5673 break;
5674
5675 case 271: /* method_decl: return_list '=' $@1 method_decl1 */
5676#line 1975 "../libinterp/parse-tree/oct-parse.yy"
5677 {
5680
5681 (yyval.tree_function_def_type) = parser.finish_classdef_external_method ((yyvsp[0].octave_user_function_type), (yyvsp[-3].tree_parameter_list_type), (yyvsp[-2].tok));
5682 }
5683#line 5684 "libinterp/parse-tree/oct-parse.cc"
5684 break;
5685
5686 case 272: /* method: method_decl */
5687#line 1984 "../libinterp/parse-tree/oct-parse.yy"
5688 { (yyval.tree_function_def_type) = (yyvsp[0].tree_function_def_type); }
5689#line 5690 "libinterp/parse-tree/oct-parse.cc"
5690 break;
5691
5692 case 273: /* method: function */
5693#line 1986 "../libinterp/parse-tree/oct-parse.yy"
5694 { (yyval.tree_function_def_type) = (yyvsp[0].tree_function_def_type); }
5695#line 5696 "libinterp/parse-tree/oct-parse.cc"
5696 break;
5697
5698 case 274: /* method_list: %empty */
5699#line 1990 "../libinterp/parse-tree/oct-parse.yy"
5700 {
5702 (yyval.tree_classdef_method_list_type) = nullptr;
5703 }
5704#line 5705 "libinterp/parse-tree/oct-parse.cc"
5705 break;
5706
5707 case 275: /* method_list: method_list1 opt_sep */
5708#line 1995 "../libinterp/parse-tree/oct-parse.yy"
5709 {
5710 // FIXME: Need to capture separator list here.
5711 // For now, delete the unused list.
5712 delete (yyvsp[0].sep_list_type);
5713
5715 (yyval.tree_classdef_method_list_type) = (yyvsp[-1].tree_classdef_method_list_type);
5716 }
5717#line 5718 "libinterp/parse-tree/oct-parse.cc"
5718 break;
5719
5720 case 276: /* method_list1: method */
5721#line 2006 "../libinterp/parse-tree/oct-parse.yy"
5722 { (yyval.tree_classdef_method_list_type) = parser.make_classdef_method_list ((yyvsp[0].tree_function_def_type)); }
5723#line 5724 "libinterp/parse-tree/oct-parse.cc"
5724 break;
5725
5726 case 277: /* method_list1: method_list1 opt_sep method */
5727#line 2008 "../libinterp/parse-tree/oct-parse.yy"
5728 {
5729 // FIXME: Need to capture separator list here.
5730 // For now, delete the unused list.
5731 delete (yyvsp[-1].sep_list_type);
5732
5733 (yyval.tree_classdef_method_list_type) = parser.append_classdef_method ((yyvsp[-2].tree_classdef_method_list_type), (yyvsp[0].tree_function_def_type));
5734 }
5735#line 5736 "libinterp/parse-tree/oct-parse.cc"
5736 break;
5737
5738 case 278: /* events_block: events_beg opt_sep attr_list event_list END */
5739#line 2018 "../libinterp/parse-tree/oct-parse.yy"
5740 {
5741 // FIXME: Need to capture separator list here.
5742 // For now, delete the unused list.
5743 delete (yyvsp[-3].sep_list_type);
5744
5745 if (! ((yyval.tree_classdef_events_block_type) = parser.make_classdef_events_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_event_list_type), (yyvsp[0].tok))))
5746 {
5747 // make_classdef_events_block deleted $4 and $5.
5748 YYABORT;
5749 }
5750 }
5751#line 5752 "libinterp/parse-tree/oct-parse.cc"
5752 break;
5753
5754 case 279: /* events_beg: EVENTS */
5755#line 2032 "../libinterp/parse-tree/oct-parse.yy"
5756 {
5758 (yyval.tok) = (yyvsp[0].tok);
5759 }
5760#line 5761 "libinterp/parse-tree/oct-parse.cc"
5761 break;
5762
5763 case 280: /* event_list: %empty */
5764#line 2039 "../libinterp/parse-tree/oct-parse.yy"
5765 {
5767 (yyval.tree_classdef_event_list_type) = nullptr;
5768 }
5769#line 5770 "libinterp/parse-tree/oct-parse.cc"
5770 break;
5771
5772 case 281: /* event_list: event_list1 opt_sep */
5773#line 2044 "../libinterp/parse-tree/oct-parse.yy"
5774 {
5775 // FIXME: Need to capture separator list here.
5776 // For now, delete the unused list.
5777 delete (yyvsp[0].sep_list_type);
5778
5780 (yyval.tree_classdef_event_list_type) = (yyvsp[-1].tree_classdef_event_list_type);
5781 }
5782#line 5783 "libinterp/parse-tree/oct-parse.cc"
5783 break;
5784
5785 case 282: /* event_list1: class_event */
5786#line 2055 "../libinterp/parse-tree/oct-parse.yy"
5787 { (yyval.tree_classdef_event_list_type) = parser.make_classdef_event_list ((yyvsp[0].tree_classdef_event_type)); }
5788#line 5789 "libinterp/parse-tree/oct-parse.cc"
5789 break;
5790
5791 case 283: /* event_list1: event_list1 opt_sep class_event */
5792#line 2057 "../libinterp/parse-tree/oct-parse.yy"
5793 {
5794 // FIXME: Need to capture separator list here.
5795 // For now, delete the unused list.
5796 delete (yyvsp[-1].sep_list_type);
5797
5798 (yyval.tree_classdef_event_list_type) = parser.append_classdef_event ((yyvsp[-2].tree_classdef_event_list_type), (yyvsp[0].tree_classdef_event_type));
5799 }
5800#line 5801 "libinterp/parse-tree/oct-parse.cc"
5801 break;
5802
5803 case 284: /* class_event: identifier */
5804#line 2067 "../libinterp/parse-tree/oct-parse.yy"
5805 { (yyval.tree_classdef_event_type) = parser.make_classdef_event ((yyvsp[0].tree_identifier_type)); }
5806#line 5807 "libinterp/parse-tree/oct-parse.cc"
5807 break;
5808
5809 case 285: /* enum_block: enumeration_beg opt_sep attr_list enum_list END */
5810#line 2071 "../libinterp/parse-tree/oct-parse.yy"
5811 {
5812 // FIXME: Need to capture separator list here.
5813 // For now, delete the unused list.
5814 delete (yyvsp[-3].sep_list_type);
5815
5816 if (! ((yyval.tree_classdef_enum_block_type) = parser.make_classdef_enum_block ((yyvsp[-4].tok), (yyvsp[-2].tree_classdef_attribute_list_type), (yyvsp[-1].tree_classdef_enum_list_type), (yyvsp[0].tok))))
5817 {
5818 // make_classdef_enum_block deleted $3 and $4.
5819 YYABORT;
5820 }
5821 }
5822#line 5823 "libinterp/parse-tree/oct-parse.cc"
5823 break;
5824
5825 case 286: /* enumeration_beg: ENUMERATION */
5826#line 2085 "../libinterp/parse-tree/oct-parse.yy"
5827 {
5829 (yyval.tok) = (yyvsp[0].tok);
5830 }
5831#line 5832 "libinterp/parse-tree/oct-parse.cc"
5832 break;
5833
5834 case 287: /* enum_list: %empty */
5835#line 2092 "../libinterp/parse-tree/oct-parse.yy"
5836 {
5838 (yyval.tree_classdef_enum_list_type) = nullptr;
5839 }
5840#line 5841 "libinterp/parse-tree/oct-parse.cc"
5841 break;
5842
5843 case 288: /* enum_list: enum_list1 opt_sep */
5844#line 2097 "../libinterp/parse-tree/oct-parse.yy"
5845 {
5846 // FIXME: Need to capture separator list here.
5847 // For now, delete the unused list.
5848 delete (yyvsp[0].sep_list_type);
5849
5851 (yyval.tree_classdef_enum_list_type) = (yyvsp[-1].tree_classdef_enum_list_type);
5852 }
5853#line 5854 "libinterp/parse-tree/oct-parse.cc"
5854 break;
5855
5856 case 289: /* enum_list1: class_enum */
5857#line 2108 "../libinterp/parse-tree/oct-parse.yy"
5858 { (yyval.tree_classdef_enum_list_type) = parser.make_classdef_enum_list ((yyvsp[0].tree_classdef_enum_type)); }
5859#line 5860 "libinterp/parse-tree/oct-parse.cc"
5860 break;
5861
5862 case 290: /* enum_list1: enum_list1 opt_sep class_enum */
5863#line 2110 "../libinterp/parse-tree/oct-parse.yy"
5864 {
5865 // FIXME: Need to capture separator list here.
5866 // For now, delete the unused list.
5867 delete (yyvsp[-1].sep_list_type);
5868
5869 (yyval.tree_classdef_enum_list_type) = parser.append_classdef_enum ((yyvsp[-2].tree_classdef_enum_list_type), (yyvsp[0].tree_classdef_enum_type));
5870 }
5871#line 5872 "libinterp/parse-tree/oct-parse.cc"
5872 break;
5873
5874 case 291: /* class_enum: identifier '(' expression ')' */
5875#line 2120 "../libinterp/parse-tree/oct-parse.yy"
5876 { (yyval.tree_classdef_enum_type) = parser.make_classdef_enum ((yyvsp[-3].tree_identifier_type), (yyvsp[-2].tok), (yyvsp[-1].tree_expression_type), (yyvsp[0].tok)); }
5877#line 5878 "libinterp/parse-tree/oct-parse.cc"
5878 break;
5879
5880 case 292: /* stmt_begin: %empty */
5881#line 2128 "../libinterp/parse-tree/oct-parse.yy"
5882 {
5883 (yyval.dummy_type) = 0;
5885 }
5886#line 5887 "libinterp/parse-tree/oct-parse.cc"
5887 break;
5888
5889 case 293: /* anon_fcn_begin: %empty */
5890#line 2135 "../libinterp/parse-tree/oct-parse.yy"
5891 {
5892 (yyval.dummy_type) = 0;
5895 }
5896#line 5897 "libinterp/parse-tree/oct-parse.cc"
5897 break;
5898
5899 case 294: /* parse_error: LEXICAL_ERROR */
5900#line 2143 "../libinterp/parse-tree/oct-parse.yy"
5901 {
5902 (yyval.dummy_type) = 0;
5903 std::string msg = (yyvsp[0].tok)->text ();
5904 parser.bison_error (msg.c_str ());
5905 }
5906#line 5907 "libinterp/parse-tree/oct-parse.cc"
5907 break;
5908
5909 case 295: /* parse_error: error */
5910#line 2149 "../libinterp/parse-tree/oct-parse.yy"
5911 { (yyval.dummy_type) = 0; }
5912#line 5913 "libinterp/parse-tree/oct-parse.cc"
5913 break;
5914
5915 case 296: /* sep_no_nl: ',' */
5916#line 2153 "../libinterp/parse-tree/oct-parse.yy"
5917 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5918#line 5919 "libinterp/parse-tree/oct-parse.cc"
5919 break;
5920
5921 case 297: /* sep_no_nl: ';' */
5922#line 2155 "../libinterp/parse-tree/oct-parse.yy"
5923 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5924#line 5925 "libinterp/parse-tree/oct-parse.cc"
5925 break;
5926
5927 case 298: /* sep_no_nl: sep_no_nl ',' */
5928#line 2157 "../libinterp/parse-tree/oct-parse.yy"
5929 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5930#line 5931 "libinterp/parse-tree/oct-parse.cc"
5931 break;
5932
5933 case 299: /* sep_no_nl: sep_no_nl ';' */
5934#line 2159 "../libinterp/parse-tree/oct-parse.yy"
5935 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5936#line 5937 "libinterp/parse-tree/oct-parse.cc"
5937 break;
5938
5939 case 300: /* opt_sep_no_nl: %empty */
5940#line 2163 "../libinterp/parse-tree/oct-parse.yy"
5941 { (yyval.sep_list_type) = nullptr; }
5942#line 5943 "libinterp/parse-tree/oct-parse.cc"
5943 break;
5944
5945 case 301: /* opt_sep_no_nl: sep_no_nl */
5946#line 2165 "../libinterp/parse-tree/oct-parse.yy"
5947 { (yyval.sep_list_type) = (yyvsp[0].sep_list_type); }
5948#line 5949 "libinterp/parse-tree/oct-parse.cc"
5949 break;
5950
5951 case 302: /* sep: ',' */
5952#line 2169 "../libinterp/parse-tree/oct-parse.yy"
5953 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5954#line 5955 "libinterp/parse-tree/oct-parse.cc"
5955 break;
5956
5957 case 303: /* sep: ';' */
5958#line 2171 "../libinterp/parse-tree/oct-parse.yy"
5959 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5960#line 5961 "libinterp/parse-tree/oct-parse.cc"
5961 break;
5962
5963 case 304: /* sep: '\n' */
5964#line 2173 "../libinterp/parse-tree/oct-parse.yy"
5965 { (yyval.sep_list_type) = new octave::separator_list (*((yyvsp[0].tok))); }
5966#line 5967 "libinterp/parse-tree/oct-parse.cc"
5967 break;
5968
5969 case 305: /* sep: sep ',' */
5970#line 2175 "../libinterp/parse-tree/oct-parse.yy"
5971 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5972#line 5973 "libinterp/parse-tree/oct-parse.cc"
5973 break;
5974
5975 case 306: /* sep: sep ';' */
5976#line 2177 "../libinterp/parse-tree/oct-parse.yy"
5977 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5978#line 5979 "libinterp/parse-tree/oct-parse.cc"
5979 break;
5980
5981 case 307: /* sep: sep '\n' */
5982#line 2179 "../libinterp/parse-tree/oct-parse.yy"
5983 { (yyval.sep_list_type) = (yyvsp[-1].sep_list_type)->append (*((yyvsp[0].tok))); }
5984#line 5985 "libinterp/parse-tree/oct-parse.cc"
5985 break;
5986
5987 case 308: /* opt_sep: %empty */
5988#line 2183 "../libinterp/parse-tree/oct-parse.yy"
5989 { (yyval.sep_list_type) = nullptr; }
5990#line 5991 "libinterp/parse-tree/oct-parse.cc"
5991 break;
5992
5993 case 309: /* opt_sep: sep */
5994#line 2185 "../libinterp/parse-tree/oct-parse.yy"
5995 { (yyval.sep_list_type) = (yyvsp[0].sep_list_type); }
5996#line 5997 "libinterp/parse-tree/oct-parse.cc"
5997 break;
5998
5999
6000#line 6001 "libinterp/parse-tree/oct-parse.cc"
6001
6002 default: break;
6003 }
6004 /* User semantic actions sometimes alter yychar, and that requires
6005 that yytoken be updated with the new translation. We take the
6006 approach of translating immediately before every use of yytoken.
6007 One alternative is translating here after every semantic action,
6008 but that translation would be missed if the semantic action invokes
6009 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
6010 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
6011 incorrect destructor might then be invoked immediately. In the
6012 case of YYERROR or YYBACKUP, subsequent parser actions might lead
6013 to an incorrect destructor call or verbose syntax error message
6014 before the lookahead is translated. */
6015 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
6016
6017 YYPOPSTACK (yylen);
6018 yylen = 0;
6019
6020 *++yyvsp = yyval;
6021
6022 /* Now 'shift' the result of the reduction. Determine what state
6023 that goes to, based on the state we popped back to and the rule
6024 number reduced by. */
6025 {
6026 const int yylhs = yyr1[yyn] - YYNTOKENS;
6027 const int yyi = yypgoto[yylhs] + *yyssp;
6028 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
6029 ? yytable[yyi]
6030 : yydefgoto[yylhs]);
6031 }
6032
6033 goto yynewstate;
6034
6035
6036/*--------------------------------------.
6037| yyerrlab -- here on detecting error. |
6038`--------------------------------------*/
6039yyerrlab:
6040 /* Make sure we have latest lookahead translation. See comments at
6041 user semantic actions for why this is necessary. */
6042 yytoken = yychar == OCTAVE_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
6043 /* If not already recovering from an error, report this error. */
6044 if (!yyerrstatus)
6045 {
6046 ++yynerrs;
6047 yyerror (parser, YY_("syntax error"));
6048 }
6049
6050 if (yyerrstatus == 3)
6051 {
6052 /* If just tried and failed to reuse lookahead token after an
6053 error, discard it. */
6054
6055 if (yychar <= OCTAVE_EOF)
6056 {
6057 /* Return failure if at end of input. */
6058 if (yychar == OCTAVE_EOF)
6059 YYABORT;
6060 }
6061 else
6062 {
6063 yydestruct ("Error: discarding",
6064 yytoken, &yylval, parser);
6065 yychar = OCTAVE_EMPTY;
6066 }
6067 }
6068
6069 /* Else will try to reuse lookahead token after shifting the error
6070 token. */
6071 goto yyerrlab1;
6072
6073
6074/*---------------------------------------------------.
6075| yyerrorlab -- error raised explicitly by YYERROR. |
6076`---------------------------------------------------*/
6077yyerrorlab:
6078 /* Pacify compilers when the user code never invokes YYERROR and the
6079 label yyerrorlab therefore never appears in user code. */
6080 if (0)
6081 YYERROR;
6082 ++yynerrs;
6083
6084 /* Do not reclaim the symbols of the rule whose action triggered
6085 this YYERROR. */
6086 YYPOPSTACK (yylen);
6087 yylen = 0;
6089 yystate = *yyssp;
6090 goto yyerrlab1;
6091
6092
6093/*-------------------------------------------------------------.
6094| yyerrlab1 -- common code for both syntax error and YYERROR. |
6095`-------------------------------------------------------------*/
6096yyerrlab1:
6097 yyerrstatus = 3; /* Each real token shifted decrements this. */
6098
6099 /* Pop stack until we find a state that shifts the error token. */
6100 for (;;)
6101 {
6102 yyn = yypact[yystate];
6103 if (!yypact_value_is_default (yyn))
6104 {
6105 yyn += YYSYMBOL_YYerror;
6106 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
6107 {
6108 yyn = yytable[yyn];
6109 if (0 < yyn)
6110 break;
6111 }
6112 }
6113
6114 /* Pop the current state because it cannot handle the error token. */
6115 if (yyssp == yyss)
6116 YYABORT;
6117
6118
6119 yydestruct ("Error: popping",
6121 YYPOPSTACK (1);
6122 yystate = *yyssp;
6124 }
6125
6127 *++yyvsp = yylval;
6129
6130
6131 /* Shift the error token. */
6132 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
6133
6134 yystate = yyn;
6135 goto yynewstate;
6136
6137
6138/*-------------------------------------.
6139| yyacceptlab -- YYACCEPT comes here. |
6140`-------------------------------------*/
6141yyacceptlab:
6142 yyresult = 0;
6143 goto yyreturnlab;
6144
6145
6146/*-----------------------------------.
6147| yyabortlab -- YYABORT comes here. |
6148`-----------------------------------*/
6149yyabortlab:
6150 yyresult = 1;
6151 goto yyreturnlab;
6152
6153
6154/*-----------------------------------------------------------.
6155| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
6156`-----------------------------------------------------------*/
6157yyexhaustedlab:
6158 yyerror (parser, YY_("memory exhausted"));
6159 yyresult = 2;
6160 goto yyreturnlab;
6161
6162
6163/*----------------------------------------------------------.
6164| yyreturnlab -- parsing is finished, clean up and return. |
6165`----------------------------------------------------------*/
6166yyreturnlab:
6167 if (yychar != OCTAVE_EMPTY)
6168 {
6169 /* Make sure we have latest lookahead translation. See comments at
6170 user semantic actions for why this is necessary. */
6171 yytoken = YYTRANSLATE (yychar);
6172 yydestruct ("Cleanup: discarding lookahead",
6173 yytoken, &yylval, parser);
6174 }
6175 /* Do not reclaim the symbols of the rule whose action triggered
6176 this YYABORT or YYACCEPT. */
6177 YYPOPSTACK (yylen);
6179 while (yyssp != yyss)
6180 {
6181 yydestruct ("Cleanup: popping",
6183 YYPOPSTACK (1);
6184 }
6185 yyps->yynew = 2;
6186 goto yypushreturn;
6187
6188
6189/*-------------------------.
6190| yypushreturn -- return. |
6191`-------------------------*/
6192yypushreturn:
6193
6194 return yyresult;
6195}
6196#undef octave_nerrs
6197#undef yystate
6198#undef yyerrstatus
6199#undef yyssa
6200#undef yyss
6201#undef yyssp
6202#undef yyvsa
6203#undef yyvs
6204#undef yyvsp
6205#undef yystacksize
6206#line 2188 "../libinterp/parse-tree/oct-parse.yy"
6207
6208
6209#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
6210 // Restore prevailing warning state for remainder of the file.
6211# pragma GCC diagnostic pop
6212#endif
6213
6214// Generic error messages.
6215
6216#undef lexer
6217#undef scanner
6218
6219static void
6220yyerror (octave::base_parser& parser, const char *s)
6221{
6222 parser.bison_error (s);
6223}
6224
6226
6227class OCTINTERP_EXCEPTION_API parse_exception : public std::runtime_error
6228{
6229public:
6230
6231 parse_exception () = delete;
6232
6233 parse_exception (const std::string& message, const std::string& fcn_name = "", const std::string& file_name = "", const filepos& pos = filepos ())
6234 : runtime_error (message), m_message (message), m_fcn_name (fcn_name), m_file_name (file_name), m_pos (pos)
6235 { }
6236
6237 OCTAVE_DEFAULT_COPY_MOVE_DELETE (parse_exception)
6238
6239 std::string message () const { return m_message; }
6240
6241 // Provided for std::exception interface.
6242 const char * what () const noexcept { return m_message.c_str (); }
6243
6244 std::string fcn_name () const { return m_fcn_name; }
6245 std::string file_name () const { return m_file_name; }
6246
6247 filepos pos () const { return m_pos; }
6248
6249 // virtual void display (std::ostream& os) const;
6250
6251private:
6252
6253 std::string m_message;
6254
6255 std::string m_fcn_name;
6256 std::string m_file_name;
6257 filepos m_pos;
6258};
6259
6260class parse_tree_validator : public tree_walker
6261{
6262public:
6263
6264 parse_tree_validator ()
6265 : m_scope (symbol_scope::anonymous ()), m_error_list ()
6266 { }
6267
6268 OCTAVE_DISABLE_COPY_MOVE (parse_tree_validator)
6269
6270 ~parse_tree_validator () = default;
6271
6272 symbol_scope get_scope () const { return m_scope; }
6273
6274 bool ok () const { return m_error_list.empty (); }
6275
6276 std::list<parse_exception> error_list () const
6277 {
6278 return m_error_list;
6279 }
6280
6282 {
6283 unwind_protect_var<symbol_scope> restore_var (m_scope, script.scope ());
6284
6285 tree_statement_list *stmt_list = script.body ();
6286
6287 if (stmt_list)
6288 stmt_list->accept (*this);
6289 }
6290
6292 {
6293 unwind_protect_var<symbol_scope> restore_var (m_scope, fcn.scope ());
6294
6295 tree_statement_list *stmt_list = fcn.body ();
6296
6297 if (stmt_list)
6298 stmt_list->accept (*this);
6299
6300 std::map<std::string, octave_value> subfcns = fcn.subfunctions ();
6301
6302 if (! subfcns.empty ())
6303 {
6304 for (auto& nm_val : subfcns)
6305 {
6306 octave_user_function *subfcn = nm_val.second.user_function_value ();
6307
6308 if (subfcn)
6309 subfcn->accept (*this);
6310 }
6311 }
6312 }
6313
6315 {
6316 if (idx_expr.is_word_list_cmd ())
6317 {
6318 std::string sym_nm = idx_expr.name ();
6319
6320 if (m_scope.is_variable (sym_nm))
6321 {
6322 std::string message = sym_nm + ": invalid use of symbol as both variable and command";
6323 parse_exception pe (message, m_scope.fcn_name (), m_scope.fcn_file_name (), idx_expr.beg_pos ());
6324
6325 m_error_list.push_back (pe);
6326 }
6327 }
6328 }
6329
6330private:
6331
6332 symbol_scope m_scope;
6333
6334 std::list<parse_exception> m_error_list;
6335};
6336
6337template <typename LIST_T, typename ELT_T>
6338static LIST_T *
6339list_append (LIST_T *list, ELT_T elt)
6340{
6341 list->push_back (elt);
6342 return list;
6343}
6344
6345template <typename LIST_T, typename ELT_T>
6346static LIST_T *
6347list_append (LIST_T *list, const token& /*sep_tok*/, ELT_T elt)
6348{
6349 // FIXME: Need to capture SEP_TOK here
6350 list->push_back (elt);
6351 return list;
6352}
6353
6354std::size_t
6355base_parser::parent_scope_info::size () const
6356{
6357 return m_info.size ();
6358}
6359
6360void
6361base_parser::parent_scope_info::push (const value_type& elt)
6362{
6363 m_info.push_back (elt);
6364}
6365
6366void
6367base_parser::parent_scope_info::push (const symbol_scope& scope)
6368{
6369 push (value_type (scope, ""));
6370}
6371
6372void
6373base_parser::parent_scope_info::pop ()
6374{
6375 m_info.pop_back ();
6376}
6377
6378bool
6379base_parser::parent_scope_info::name_ok (const std::string& name)
6380{
6381 // Name can't be the same as any parent function or any other
6382 // function we've already seen. We could maintain a complex
6383 // tree structure of names, or we can just store the set of
6384 // full names of all the functions, which must be unique.
6385
6386 std::string full_name;
6387
6388 for (std::size_t i = 0; i < size()-1; i++)
6389 {
6390 const value_type& elt = m_info[i];
6391
6392 if (name == elt.second)
6393 return false;
6394
6395 full_name += elt.second + ">";
6396 }
6397
6398 full_name += name;
6399
6400 if (m_all_names.find (full_name) != m_all_names.end ())
6401 {
6402 // Return false (failure) if we are parsing a subfunction, local
6403 // function, or nested function. Otherwise, it is OK to have a
6404 // duplicate name.
6405
6406 return ! (m_parser.parsing_subfunctions () || m_parser.parsing_local_functions () || m_parser.curr_fcn_depth () > 0);
6407 }
6408
6409 m_all_names.insert (full_name);
6410
6411 return true;
6412}
6413
6414bool
6415base_parser::parent_scope_info::name_current_scope (const std::string& name)
6416{
6417 if (! name_ok (name))
6418 return false;
6419
6420 if (size () > 0)
6421 m_info.back().second = name;
6422
6423 return true;
6424}
6425
6427base_parser::parent_scope_info::parent_scope () const
6428{
6429 return size () > 1 ? m_info[size()-2].first : symbol_scope::invalid ();
6430}
6431
6432std::string
6433base_parser::parent_scope_info::parent_name () const
6434{
6435 return m_info[size()-2].second;
6436}
6437
6438void base_parser::parent_scope_info::clear ()
6439{
6440 m_info.clear ();
6441 m_all_names.clear ();
6442}
6443
6445 : m_endfunction_found (false), m_autoloading (false),
6446 m_fcn_file_from_relative_lookup (false),
6447 m_parsing_subfunctions (false), m_parsing_local_functions (false),
6448 m_max_fcn_depth (-1), m_curr_fcn_depth (-1),
6449 m_primary_fcn_scope (symbol_scope::invalid ()),
6450 m_curr_class_name (), m_curr_package_name (), m_function_scopes (*this),
6451 m_primary_fcn (), m_subfunction_names (), m_classdef_object (),
6452 m_stmt_list (), m_lexer (lxr), m_parser_state (yypstate_new ())
6453{ }
6454
6456{
6457 delete &m_lexer;
6458
6459 // FIXME: Deleting the internal Bison parser state structure does
6460 // not clean up any partial parse trees in the event of an interrupt or
6461 // error. It's not clear how to safely do that with the C language
6462 // parser that Bison generates. The C++ language parser that Bison
6463 // generates would do it for us automatically whenever an exception
6464 // is thrown while parsing input, but there is currently no C++
6465 // interface for a push parser.
6466
6467 yypstate_delete (static_cast<yypstate *> (m_parser_state));
6468}
6469
6470void
6472{
6473 m_endfunction_found = false;
6474 m_autoloading = false;
6476 m_parsing_subfunctions = false;
6478 m_max_fcn_depth = -1;
6479 m_curr_fcn_depth = -1;
6481 m_curr_class_name = "";
6483 m_function_scopes.clear ();
6485 m_subfunction_names.clear ();
6486 m_classdef_object.reset ();
6487 m_stmt_list.reset ();
6488
6489 m_lexer.reset ();
6490
6491 yypstate_delete (static_cast<yypstate *> (m_parser_state));
6493}
6494
6495OCTAVE_NORETURN static void
6496unexpected_token (int tok_id, const char *where)
6497{
6498 error ("unexpected token (= %d) in %s - please report this bug", tok_id, where);
6499}
6500
6501// Error messages for mismatched end tokens.
6502
6503static std::string
6504end_token_as_string (token::end_tok_type ettype)
6505{
6506 std::string retval = "<unknown>";
6507
6508 switch (ettype)
6509 {
6510 case token::simple_end:
6511 retval = "end";
6512 break;
6513
6515 retval = "endarguments";
6516 break;
6517
6519 retval = "endclassdef";
6520 break;
6521
6523 retval = "endenumeration";
6524 break;
6525
6526 case token::events_end:
6527 retval = "endevents";
6528 break;
6529
6530 case token::for_end:
6531 retval = "endfor";
6532 break;
6533
6535 retval = "endfunction";
6536 break;
6537
6538 case token::if_end:
6539 retval = "endif";
6540 break;
6541
6542 case token::methods_end:
6543 retval = "endmethods";
6544 break;
6545
6546 case token::parfor_end:
6547 retval = "endparfor";
6548 break;
6549
6551 retval = "endproperties";
6552 break;
6553
6554 case token::spmd_end:
6555 retval = "endspmd";
6556 break;
6557
6558 case token::switch_end:
6559 retval = "endswitch";
6560 break;
6561
6563 retval = "end_try_catch";
6564 break;
6565
6567 retval = "end_unwind_protect";
6568 break;
6569
6570 case token::while_end:
6571 retval = "endwhile";
6572 break;
6573
6574 // We should have handled all possible enum values above. Rely on
6575 // compiler diagnostics to warn if we haven't. For example, GCC's
6576 // -Wswitch option, enabled by -Wall, will provide a warning.
6577 }
6578
6579 return retval;
6580}
6581
6582void
6583base_parser::statement_list (std::shared_ptr<tree_statement_list>& lst)
6584{
6585 if (! lst)
6586 return;
6587
6588 if (m_stmt_list)
6589 {
6590 // Append additional code to existing statement list.
6591
6592 while (! lst->empty ())
6593 {
6594 m_stmt_list->push_back (lst->front ());
6595 lst->pop_front ();
6596 }
6597 }
6598 else
6599 m_stmt_list = lst;
6600}
6601
6602void
6604{
6605 std::string msg = ("'" + end_token_as_string (expected) + "' command matched by '" + end_token_as_string (tok->ettype ()) + "'");
6606
6607 bison_error (msg, tok->beg_pos ());
6608}
6609
6610// Check to see that end tokens are properly matched.
6611
6612bool
6614{
6615 token::end_tok_type ettype = tok->ettype ();
6616
6617 return ettype == expected || ettype == token::simple_end;
6618}
6619
6620bool
6622{
6624
6627
6628 // Will get a real name later.
6629 m_lexer.m_symtab_context.push (symbol_scope ("parser:push_fcn_symtab"));
6631
6633 {
6636 }
6637
6639 {
6640 bison_error ("nested functions not implemented in this context");
6641
6642 return false;
6643 }
6644
6645 return true;
6646}
6647
6648// Make a constant.
6649
6652{
6653 int tok_id = tok->token_id ();
6654
6655 tree_constant *retval = nullptr;
6656
6657 switch (tok_id)
6658 {
6659 case ':':
6661 break;
6662
6663 case NUMBER:
6664 retval = new tree_constant (tok->number (), tok->text_rep (), *tok);
6665 break;
6666
6667 case DQ_STRING:
6668 case SQ_STRING:
6669 {
6670 std::string txt = tok->text ();
6671
6672 char delim = tok_id == DQ_STRING ? '"' : '\'';
6673 octave_value tmp (txt, delim);
6674
6675 if (txt.empty ())
6676 {
6677 if (tok_id == DQ_STRING)
6679 else
6681 }
6682
6683 if (tok_id == DQ_STRING)
6684 txt = undo_string_escapes (txt);
6685
6686 // FIXME: maybe the addition of delims should be handled by
6687 // tok->text_rep () for character strings?
6688
6689 retval = new tree_constant (tmp, delim + txt + delim, *tok);
6690 }
6691 break;
6692
6693 default:
6694 unexpected_token (tok_id, "base_parser::make_constant");
6695 break;
6696 }
6697
6698 return retval;
6699}
6700
6703{
6704 return new tree_black_hole (*tilde);
6705}
6706
6707// Make a function handle.
6708
6711{
6712 tree_fcn_handle *retval = new tree_fcn_handle (*tok);
6713
6714 return retval;
6715}
6716
6717// Make an anonymous function handle.
6718
6721{
6722 // FIXME: We need to examine EXPR and issue an error if any
6723 // sub-expression contains an assignment, compound assignment,
6724 // increment, or decrement operator.
6725
6726 anon_fcn_validator validator (param_list, expr);
6727
6728 if (! validator.ok ())
6729 {
6730 delete param_list;
6731 delete expr;
6732
6733 bison_error (validator.message (), validator.beg_pos ());
6734
6735 return nullptr;
6736 }
6737
6740
6742
6743 expr->set_print_flag (false);
6744
6745 fcn_scope.mark_static ();
6746
6747 tree_anon_fcn_handle *retval = new tree_anon_fcn_handle (*at_tok, param_list, expr, fcn_scope, parent_scope);
6748
6749 std::ostringstream buf;
6750
6751 tree_print_code tpc (buf);
6752
6753 retval->accept (tpc);
6754
6755 std::string file = m_lexer.m_fcn_file_full_name;
6756 if (! file.empty ())
6757 buf << ": file: " << file;
6758 else if (m_lexer.input_from_terminal ())
6759 buf << ": *terminal input*";
6760 else if (m_lexer.input_from_eval_string ())
6761 buf << ": *eval string*";
6762
6763 filepos at_pos = at_tok->beg_pos ();
6764 buf << ": line: " << at_pos.line () << " column: " << at_pos.column ();
6765
6766 std::string scope_name = buf.str ();
6767
6768 fcn_scope.cache_name (scope_name);
6769
6770 // FIXME: Stash the filename. This does not work and produces
6771 // errors when executed.
6772 //retval->stash_file_name (m_lexer.m_fcn_file_name);
6773
6774 return retval;
6775}
6776
6777// Build a colon expression.
6778
6781{
6782 return make_colon_expression (base, colon_tok, nullptr, nullptr, limit);
6783}
6784
6787{
6788 tree_expression *retval = nullptr;
6789
6790 if (! base || ! limit)
6791 {
6792 delete base;
6793 delete limit;
6794 delete incr;
6795
6796 return retval;
6797 }
6798
6799 token tmp_colon_2_tok = colon_2_tok ? *colon_2_tok : token ();
6800
6801 tree_colon_expression *expr = new tree_colon_expression (base, *colon_1_tok, incr, tmp_colon_2_tok, limit);
6802
6803 retval = expr;
6804
6805 if (base->is_constant () && limit->is_constant () && (! incr || incr->is_constant ()))
6806 {
6808
6809 try
6810 {
6811 // If the evaluation generates a warning message, restore
6812 // the previous value of last_warning_message and skip the
6813 // conversion to a constant value.
6814
6815 error_system& es = interp.get_error_system ();
6816
6817 unwind_action restore_last_warning_message (&error_system::set_last_warning_message, &es, es.last_warning_message (""));
6818
6819 unwind_action restore_discard_warning_messages (&error_system::set_discard_warning_messages, &es, es.discard_warning_messages (true));
6820
6821 tree_evaluator& tw = interp.get_evaluator ();
6822
6823 octave_value tmp = expr->evaluate (tw);
6824
6825 std::string msg = es.last_warning_message ();
6826
6827 if (msg.empty ())
6828 {
6829 std::ostringstream buf;
6830
6831 tree_print_code tpc (buf);
6832
6833 expr->accept (tpc);
6834
6835 std::string orig_text = buf.str ();
6836
6837 token tok (CONSTANT, tmp, orig_text, expr->beg_pos (), expr->end_pos ());
6838
6839 tree_constant *tc_retval = new tree_constant (tmp, orig_text, tok);
6840
6841 delete expr;
6842
6843 retval = tc_retval;
6844 }
6845 }
6846 catch (const execution_exception&)
6847 {
6848 interp.recover_from_exception ();
6849 }
6850 }
6851
6852 return retval;
6853}
6854
6855// Build a binary expression.
6856
6859{
6861
6862 int tok_id = op_tok->token_id ();
6863
6864 switch (tok_id)
6865 {
6866 case POW:
6868 break;
6869
6870 case EPOW:
6872 break;
6873
6874 case '+':
6876 break;
6877
6878 case '-':
6880 break;
6881
6882 case '*':
6884 break;
6885
6886 case '/':
6888 break;
6889
6890 case EMUL:
6892 break;
6893
6894 case EDIV:
6896 break;
6897
6898 case LEFTDIV:
6900 break;
6901
6902 case ELEFTDIV:
6904 break;
6905
6906 case EXPR_LT:
6908 break;
6909
6910 case EXPR_LE:
6912 break;
6913
6914 case EXPR_EQ:
6916 break;
6917
6918 case EXPR_GE:
6920 break;
6921
6922 case EXPR_GT:
6924 break;
6925
6926 case EXPR_NE:
6928 break;
6929
6930 case EXPR_AND:
6932 break;
6933
6934 case EXPR_OR:
6936 break;
6937
6938 default:
6939 unexpected_token (tok_id, "base_parser::make_binary_op");
6940 break;
6941 }
6942
6943 return maybe_compound_binary_expression (op1, *op_tok, op2, t);
6944}
6945
6946void
6948{
6949 if (expr->is_binary_expression ())
6950 {
6951 tree_binary_expression *binexp = dynamic_cast<tree_binary_expression *> (expr);
6952
6953 token op_tok = binexp->operator_token ();
6954
6955 tree_expression *lhs = binexp->lhs ();
6956 tree_expression *rhs = binexp->rhs ();
6957
6960
6961 // Operands may have changed.
6962 binexp->lhs (lhs);
6963 binexp->rhs (rhs);
6964
6965 octave_value::binary_op op_type = binexp->op_type ();
6966 if (op_type == octave_value::op_el_and || op_type == octave_value::op_el_or)
6967 {
6968 binexp->preserve_operands ();
6969
6970 delete expr;
6971
6972 expr = new tree_braindead_shortcircuit_binary_expression (lhs, op_tok, rhs, op_type);
6973 }
6974 }
6975}
6976
6977// Build a boolean expression.
6978
6981{
6983
6984 int tok_id = op_tok->token_id ();
6985
6986 switch (tok_id)
6987 {
6988 case EXPR_AND_AND:
6990 break;
6991
6992 case EXPR_OR_OR:
6994 break;
6995
6996 default:
6997 unexpected_token (tok_id, "base_parser::make_boolean_op");
6998 break;
6999 }
7000
7001 return new tree_boolean_expression (op1, *op_tok, op2, t);
7002}
7003
7004// Build a prefix expression.
7005
7008{
7010
7011 int tok_id = op_tok->token_id ();
7012
7013 switch (tok_id)
7014 {
7015 case '~':
7016 case '!':
7018 break;
7019
7020 case '+':
7022 break;
7023
7024 case '-':
7026 break;
7027
7028 case PLUS_PLUS:
7030 break;
7031
7032 case MINUS_MINUS:
7034 break;
7035
7036 default:
7037 unexpected_token (tok_id, "base_parser::make_prefix_op");
7038 break;
7039 }
7040
7041 return new tree_prefix_expression (*op_tok, op1, t);
7042}
7043
7044// Build a postfix expression.
7045
7048{
7050
7051 int tok_id = op_tok->token_id ();
7052
7053 switch (tok_id)
7054 {
7055 case HERMITIAN:
7057 break;
7058
7059 case TRANSPOSE:
7061 break;
7062
7063 case PLUS_PLUS:
7065 break;
7066
7067 case MINUS_MINUS:
7069 break;
7070
7071 default:
7072 unexpected_token (tok_id, "base_parser::make_postfix_op");
7073 break;
7074 }
7075
7076 return new tree_postfix_expression (op1, *op_tok, t);
7077}
7078
7079// Build an unwind-protect command.
7080
7082base_parser::make_unwind_command (token *unwind_tok, tree_statement_list *body, token *cleanup_tok, tree_statement_list *cleanup_stmts, token *end_tok)
7083{
7084 tree_command *retval = nullptr;
7085
7087 {
7088 retval = new tree_unwind_protect_command (*unwind_tok, body, *cleanup_tok, cleanup_stmts, *end_tok);
7089 }
7090 else
7091 {
7092 delete body;
7093 delete cleanup_stmts;
7094
7096 }
7097
7098 return retval;
7099}
7100
7101// Build a try-catch command.
7102
7104base_parser::make_try_command (token *try_tok, tree_statement_list *body, token *catch_tok, separator_list *catch_sep_list, tree_statement_list *cleanup_stmts, token *end_tok)
7105{
7106 tree_command *retval = nullptr;
7107
7108 if (end_token_ok (end_tok, token::try_catch_end))
7109 {
7110 tree_identifier *id = nullptr;
7111
7112 // Look for exception ID. Note that adding a separate rule to
7113 // match
7114 //
7115 // try
7116 // try-body
7117 // catch IDENTIFIER
7118 // catch-body
7119 // end
7120 //
7121 // in the grammar leads to yet another shift-reduce conflict, so
7122 // instead we only match
7123 //
7124 // try
7125 // try-body
7126 // catch
7127 // catch-body
7128 // end
7129 //
7130 // and then recognize the first form above by checking that the
7131 // first element of CATCH-BODY is an identifier and that there is
7132 // is no separator (comma, semicolon, or newline) between the
7133 // CATCH token and the identifier.
7134
7135 if (! catch_sep_list && cleanup_stmts && ! cleanup_stmts->empty ())
7136 {
7137 tree_statement *stmt = cleanup_stmts->front ();
7138
7139 if (stmt)
7140 {
7141 tree_expression *expr = stmt->expression ();
7142
7143 if (expr && expr->is_identifier ())
7144 {
7145 id = dynamic_cast<tree_identifier *> (expr);
7146
7147 cleanup_stmts->pop_front ();
7148
7149 stmt->set_expression (nullptr);
7150 delete stmt;
7151 }
7152 }
7153 }
7154
7155 token tmp_catch_tok = catch_tok ? *catch_tok : token ();
7156
7157 // FIXME: Need to capture separator list here.
7158 // For now, delete the unused list.
7159 delete catch_sep_list;
7160
7161 retval = new tree_try_catch_command (*try_tok, body, tmp_catch_tok, id, cleanup_stmts, *end_tok);
7162 }
7163 else
7164 {
7165 delete body;
7166 delete catch_sep_list;
7167 delete cleanup_stmts;
7168
7170 }
7171
7172 return retval;
7173}
7174
7175// Build a while command.
7176
7179{
7180 tree_command *retval = nullptr;
7181
7182 maybe_warn_assign_as_truth_value (expr);
7183
7184 if (end_token_ok (end_tok, token::while_end))
7185 {
7187
7188 retval = new tree_while_command (*while_tok, expr, body, *end_tok);
7189 }
7190 else
7191 {
7192 delete expr;
7193 delete body;
7194
7196 }
7197
7198 return retval;
7199}
7200
7201// Build a do-until command.
7202
7205{
7206 maybe_warn_assign_as_truth_value (expr);
7207
7209
7210 return new tree_do_until_command (*do_tok, body, *until_tok, expr);
7211}
7212
7213// Build a for command.
7214
7216base_parser::make_for_command (token *for_tok, token *open_paren, tree_argument_list *lhs, token *eq_tok, tree_expression *expr, token *sep_tok, tree_expression *maxproc, token *close_paren, tree_statement_list *body, token *end_tok)
7217{
7218 tree_command *retval = nullptr;
7219
7220 bool parfor = for_tok->token_id () == PARFOR;
7221
7222 token tmp_open_paren = open_paren ? *open_paren : token ();
7223 token tmp_close_paren = close_paren ? *close_paren : token ();
7224 token tmp_sep_tok = sep_tok ? *sep_tok : token ();
7225
7226 if (end_token_ok (end_tok, parfor ? token::parfor_end : token::for_end))
7227 {
7228 expr->mark_as_for_cmd_expr ();
7229
7231
7232 if (lhs->size () == 1)
7233 {
7234 tree_expression *tmp = lhs->remove_front ();
7235
7236 m_lexer.mark_as_variable (tmp->name ());
7237
7238 retval = new tree_simple_for_command (parfor, *for_tok, tmp_open_paren, tmp, *eq_tok, expr, tmp_sep_tok, maxproc, tmp_close_paren, body, *end_tok);
7239
7240 delete lhs;
7241 }
7242 else if (parfor)
7243 {
7244 delete lhs;
7245 delete expr;
7246 delete maxproc;
7247 delete body;
7248
7249 bison_error ("invalid syntax for parfor statement");
7250 }
7251 else
7252 {
7254
7255 retval = new tree_complex_for_command (*for_tok, lhs, *eq_tok, expr, body, *end_tok);
7256 }
7257 }
7258 else
7259 {
7260 delete lhs;
7261 delete expr;
7262 delete maxproc;
7263 delete body;
7264
7265 end_token_error (end_tok, parfor ? token::parfor_end : token::for_end);
7266 }
7267
7268 return retval;
7269}
7270
7271// Build a break command.
7272
7275{
7276 if (! m_lexer.m_looping)
7277 {
7278 bison_error ("break must appear within a loop");
7279 return nullptr;
7280 }
7281 else
7282 return new tree_break_command (*break_tok);
7283}
7284
7285// Build a continue command.
7286
7289{
7290 if (! m_lexer.m_looping)
7291 {
7292 bison_error ("continue must appear within a loop");
7293 return nullptr;
7294 }
7295 else
7296 return new tree_continue_command (*continue_tok);
7297}
7298
7299// Build a return command.
7300
7303{
7304 return new tree_return_command (*return_tok);
7305}
7306
7307// Build an spmd command.
7308
7311{
7312 tree_spmd_command *retval = nullptr;
7313
7314 if (end_token_ok (end_tok, token::spmd_end))
7315 retval = new tree_spmd_command (*spmd_tok, body, *end_tok);
7316 else
7317 {
7318 delete body;
7319
7321 }
7322
7323 return retval;
7324}
7325
7326// Start an if command.
7327
7330{
7331 return new tree_if_command_list (clause);
7332}
7333
7334// Finish an if command.
7335
7338{
7339 tree_if_command *retval = nullptr;
7340
7341 if (end_token_ok (end_tok, token::if_end))
7342 {
7343 if (else_clause)
7344 list_append (list, else_clause);
7345
7346 token if_tok = list->if_token ();
7347
7348 retval = new tree_if_command (if_tok, list, *end_tok);
7349 }
7350 else
7351 {
7352 delete list;
7353 delete else_clause;
7354
7355 end_token_error (end_tok, token::if_end);
7356 }
7357
7358 return retval;
7359}
7360
7361// Build an if, elseif, or else clause.
7362
7365{
7366 if (expr)
7367 {
7368 maybe_warn_assign_as_truth_value (expr);
7369
7371 }
7372
7373 // FIXME: Need to capture separator list here.
7374 // For now, delete the unused list.
7375 delete if_sep_list;
7376
7377 return new tree_if_clause (*if_tok, expr, list);
7378}
7379
7382{
7383 return list_append (list, clause);
7384}
7385
7386// Finish a switch command.
7387
7390{
7391 tree_switch_command *retval = nullptr;
7392
7393 if (end_token_ok (end_tok, token::switch_end))
7394 retval = new tree_switch_command (*switch_tok, expr, list, *end_tok);
7395 else
7396 {
7397 delete expr;
7398 delete list;
7399
7401 }
7402
7403 return retval;
7404}
7405
7408{
7409 return new tree_switch_case_list (switch_case);
7410}
7411
7412// Build a switch case.
7413
7416{
7417 maybe_warn_variable_switch_label (expr);
7418
7419 return new tree_switch_case (*case_tok, expr, list);
7420}
7421
7424{
7425 return new tree_switch_case (*default_tok, list);
7426}
7427
7430{
7431 return list_append (list, elt);
7432}
7433
7434// Build an assignment to a variable.
7435
7438{
7440
7441 int tok_id = eq_tok->token_id ();
7442
7443 switch (tok_id)
7444 {
7445 case '=':
7447 break;
7448
7449 case ADD_EQ:
7451 break;
7452
7453 case SUB_EQ:
7455 break;
7456
7457 case MUL_EQ:
7459 break;
7460
7461 case DIV_EQ:
7463 break;
7464
7465 case LEFTDIV_EQ:
7467 break;
7468
7469 case POW_EQ:
7471 break;
7472
7473 case EMUL_EQ:
7475 break;
7476
7477 case EDIV_EQ:
7479 break;
7480
7481 case ELEFTDIV_EQ:
7483 break;
7484
7485 case EPOW_EQ:
7487 break;
7488
7489 case AND_EQ:
7491 break;
7492
7493 case OR_EQ:
7495 break;
7496
7497 default:
7498 unexpected_token (tok_id, "base_parser::make_assign_op");
7499 break;
7500 }
7501
7502 if (! lhs->is_simple_assign_lhs () && t != octave_value::op_asn_eq)
7503 {
7504 // Multiple assignments like [x,y] OP= rhs are only valid for
7505 // '=', not '+=', etc.
7506
7507 delete lhs;
7508 delete rhs;
7509
7510 bison_error ("computed multiple assignment not allowed", eq_tok->beg_pos ());
7511
7512 return nullptr;
7513 }
7514
7515 if (lhs->is_simple_assign_lhs ())
7516 {
7517 // We are looking at a simple assignment statement like x = rhs;
7518
7519 tree_expression *tmp = lhs->remove_front ();
7520
7521 if ((tmp->is_identifier () || tmp->is_index_expression ()) && iskeyword (tmp->name ()))
7522 {
7523 std::string kw = tmp->name ();
7524
7525 delete tmp;
7526 delete lhs;
7527 delete rhs;
7528
7529 bison_error ("invalid assignment to keyword \"" + kw + "\"", eq_tok->beg_pos ());
7530
7531 return nullptr;
7532 }
7533
7534 delete lhs;
7535
7536 m_lexer.mark_as_variable (tmp->name ());
7537
7538 return new tree_simple_assignment (tmp, rhs, false, t);
7539 }
7540 else
7541 {
7542 std::list<std::string> names = lhs->variable_names ();
7543
7544 for (const auto& kw : names)
7545 {
7546 if (iskeyword (kw))
7547 {
7548 delete lhs;
7549 delete rhs;
7550
7551 bison_error ("invalid assignment to keyword \"" + kw + "\"", eq_tok->beg_pos ());
7552
7553 return nullptr;
7554 }
7555 }
7556
7557 m_lexer.mark_as_variables (names);
7558
7559 return new tree_multi_assignment (lhs, rhs, false);
7560 }
7561}
7562
7563void
7565{
7566 // Any comments at the beginning of a script file should be
7567 // attached to the first statement in the file or the END_SCRIPT
7568 // statement created by the parser.
7569
7570 if (! cmds)
7571 cmds = new tree_statement_list ();
7572
7573 cmds->push_back (end_script);
7574
7576
7579 script_scope.cache_dir_name (m_lexer.m_dir_name);
7580
7581 // First non-copyright comment in classdef body, before first
7582 // properties, methods, etc. block.
7583
7584 comment_list leading_comments = cmds->leading_comments ();
7585
7586 std::string doc_string = leading_comments.find_doc_string ();
7587
7588 octave_user_script *script = new octave_user_script (m_lexer.m_fcn_file_full_name, m_lexer.m_fcn_file_name, script_scope, cmds, doc_string);
7589
7591
7592 sys::time now;
7593
7594 script->stash_fcn_file_time (now);
7596
7597 m_primary_fcn = octave_value (script);
7598}
7599
7602{
7603 std::string id_name = id->name ();
7604
7605 // Make classdef local functions unique from classdef methods.
7606
7608 id_name = m_lexer.m_fcn_file_name + ">" + id_name;
7609
7610 if (! m_function_scopes.name_current_scope (id_name))
7611 {
7612 // FIXME: is this correct? Before using position, the column
7613 // was incremented. Hmm.
7614
7615 filepos id_pos = id->beg_pos ();
7616 id_pos.increment_column ();
7617
7618 bison_error ("duplicate subfunction or nested function name", id_pos);
7619
7620 delete id;
7621 return nullptr;
7622 }
7623
7625 curr_scope.cache_name (id_name);
7626
7627 m_lexer.m_parsed_function_name.top () = true;
7629
7630 return id;
7631}
7632
7633// Define a function.
7634
7635// FIXME: combining start_function, finish_function, and
7636// recover_from_parsing_function should be possible, but it makes
7637// for a large mess. Maybe this could be a bit better organized?
7638
7641{
7642 // First non-copyright comments found above and below function keyword.
7643 comment_elt leading_doc_comment;
7644 comment_elt body_doc_comment;
7645
7646 comment_list lc = fcn_tok->leading_comments ();
7647
7648 if (! lc.empty ())
7649 leading_doc_comment = lc.find_doc_comment ();
7650
7651 if (body)
7652 {
7653 comment_list bc = body->leading_comments ();
7654
7655 if (! bc.empty ())
7656 body_doc_comment = bc.find_doc_comment ();
7657 }
7658 else if (end_fcn_stmt)
7659 {
7660 comment_list ec = end_fcn_stmt->leading_comments ();
7661
7662 if (! ec.empty ())
7663 body_doc_comment = ec.find_doc_comment ();
7664 }
7665
7666 // Choose which comment to use for doc string.
7667
7668 // For ordinary functions, use the first comment that isn't empty.
7669
7670 // If we are looking at a classdef method and there is a comment
7671 // prior to the function keyword and another after, then
7672 //
7673 // * Choose the one outside the function definition if either of
7674 // the comments use hash '#' characters. This is the preferred
7675 // Octave style.
7676 //
7677 // * Choose the one inside the function definition if both
7678 // comments use percent '%' characters. This is
7679 // Matlab-compatible behavior.
7680
7681 // FIXME: maybe choose which comment to used by checking whether
7682 // any language extensions are noticed in the entire source file,
7683 // not just in the comments that are candidates to become the
7684 // function doc string.
7685
7686 std::string doc_string;
7687
7688 if (leading_doc_comment.empty ()
7689 || (m_lexer.m_parsing_classdef && ! body_doc_comment.empty ()
7690 && (! (leading_doc_comment.uses_hash_char () || body_doc_comment.uses_hash_char ()))))
7691 doc_string = body_doc_comment.text ();
7692 else
7693 doc_string = leading_doc_comment.text ();
7694
7695 octave_user_function *tmp_fcn = start_function (id, param_list, body, end_fcn_stmt, doc_string);
7696
7697 tree_function_def *retval = finish_function (fcn_tok, ret_list, eq_tok, tmp_fcn);
7698
7700
7701 return retval;
7702}
7703
7704// Begin defining a function.
7705
7707base_parser::start_function (tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_fcn_stmt, const std::string& doc_string)
7708{
7709 // We'll fill in the return list later.
7710
7711 std::string id_name = id->name ();
7712
7714 id_name.insert (0, "get.");
7716 id_name.insert (0, "set.");
7717
7720
7721 if (! body)
7722 body = new tree_statement_list ();
7723
7724 body->push_back (end_fcn_stmt);
7725
7726 octave_user_function *fcn = new octave_user_function (m_lexer.m_symtab_context.curr_scope (), id, param_list, nullptr, body);
7727
7728 // If input is coming from a file, issue a warning if the name of
7729 // the file does not match the name of the function stated in the
7730 // file. Matlab doesn't provide a diagnostic (it ignores the stated
7731 // name).
7733 {
7734 // FIXME: should m_lexer.m_fcn_file_name already be
7735 // preprocessed when we get here? It seems to only be a
7736 // problem with relative filenames.
7737
7738 std::string nm = m_lexer.m_fcn_file_name;
7739
7740 std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ());
7741
7742 if (pos != std::string::npos)
7743 nm = m_lexer.m_fcn_file_name.substr (pos+1);
7744
7745 if (nm != id_name)
7746 {
7747 warning_with_id ("Octave:function-name-clash", "function name '%s' does not agree with function filename '%s'", id_name.c_str (), m_lexer.m_fcn_file_full_name.c_str ());
7748
7749 id_name = nm;
7750 }
7751 }
7752
7753 sys::time now;
7754
7756 fcn->stash_fcn_file_time (now);
7760 fcn->stash_function_name (id_name);
7761
7763 {
7765 fcn->mark_relative ();
7766
7768 {
7770 {
7771 if (m_curr_class_name == id_name)
7773 else
7775 }
7776 else
7777 {
7778 if (m_curr_class_name == id_name)
7780 else
7781 fcn->mark_as_legacy_method ();
7782 }
7783
7785 }
7786
7787 std::string nm = fcn->fcn_file_name ();
7788
7789 sys::file_stat fs (nm);
7790
7791 if (fs && fs.is_newer (now))
7792 warning_with_id ("Octave:future-time-stamp", "time stamp for '%s' is in the future", nm.c_str ());
7793 }
7795 warning ("function '%s' defined within script file '%s'", id_name.c_str (), m_lexer.m_fcn_file_full_name.c_str ());
7796
7797 // Record doc string for functions other than nested functions.
7798 // We cannot currently record help for nested functions (bug #46008)
7799 // because the doc_string of the outermost function is read first,
7800 // whereas this function is called for the innermost function first.
7801 // We could have a stack of doc_string objects in lexer.
7802 if (! doc_string.empty () && m_curr_fcn_depth == 0)
7803 fcn->document (doc_string);
7804
7805
7808
7809 return fcn;
7810}
7811
7813base_parser::make_end (const std::string& type, bool eof, token *end_tok)
7814{
7815 return make_statement (new tree_no_op_command (type, eof, *end_tok));
7816}
7817
7820{
7821 tree_function_def *retval = nullptr;
7822
7823 if (! ret_list)
7825
7826 ret_list->mark_as_formal_parameters ();
7827
7828 if (fcn)
7829 {
7830 fcn->set_fcn_tok (*fcn_tok);
7831
7832 if (eq_tok)
7833 fcn->set_eq_tok (*eq_tok);
7834
7835 std::string fcn_nm = fcn->name ();
7836 std::string file = fcn->fcn_file_name ();
7837
7838 std::string tmp = fcn_nm;
7839 if (! file.empty ())
7840 tmp += ": " + file;
7841
7842 symbol_scope fcn_scope = fcn->scope ();
7843 fcn_scope.cache_name (tmp);
7844 fcn_scope.cache_fcn_name (fcn_nm);
7845 fcn_scope.cache_fcn_file_name (file);
7846 fcn_scope.cache_dir_name (m_lexer.m_dir_name);
7847
7848 fcn->define_ret_list (ret_list);
7849
7851 {
7852 octave_value ov_fcn (fcn);
7853
7854 if (m_endfunction_found && m_function_scopes.size () > 1)
7855 {
7858
7860 fcn_scope.set_parent (pscope);
7862
7863 pscope.install_nestfunction (fcn_nm, ov_fcn, fcn_scope);
7864
7865 // For nested functions, the list of parent functions is
7866 // set in symbol_scope::update_nest.
7867 }
7868 else
7869 {
7870 fcn->mark_as_subfunction ();
7871 m_subfunction_names.push_back (fcn_nm);
7872
7873 fcn_scope.set_parent (m_primary_fcn_scope);
7876
7878 }
7879 }
7880
7881 if (m_curr_fcn_depth == 0)
7882 fcn_scope.update_nest ();
7883
7885 {
7886 // We are either reading a script file or defining a function
7887 // at the command line, so this definition creates a
7888 // tree_function object that is placed in the parse tree.
7889 // Otherwise, it is just inserted in the symbol table,
7890 // either as a subfunction or nested function (see above),
7891 // or as the primary function for the file, via
7892 // m_primary_fcn (see also load_fcn_from_file,,
7893 // parse_fcn_file, and
7894 // fcn_info::fcn_info_rep::find_user_function).
7895
7897 {
7900 }
7901
7902 retval = new tree_function_def (fcn);
7903 }
7904 }
7905
7906 return retval;
7907}
7908
7911{
7912 if (list)
7913 {
7914 for (const auto& elt : *list)
7915 list_append (body, elt);
7916
7917 list->clear ();
7918 delete (list);
7919 }
7920
7921 return body;
7922}
7923
7926{
7927 tree_arguments_block *retval = nullptr;
7928
7929 if (end_token_ok (end_tok, token::arguments_end))
7930 retval = new tree_arguments_block (*arguments_tok, attr_list, validation_list, *end_tok);
7931 else
7932 {
7933 delete attr_list;
7934 delete validation_list;
7935 }
7936
7937 return retval;
7938}
7939
7942{
7943 // FIXME: Validate arguments and convert to more specific types
7944 // (std::string for arg_name and class_name, etc).
7945
7946 token tmp_eq_tok = eq_tok ? *eq_tok : token ();
7947
7948 return new tree_arg_validation (size_spec, class_name, validation_fcns, tmp_eq_tok, default_value);
7949}
7950
7953{
7954 // FIXME: Validate argument and convert to more specific type
7955 // (std::string for attribute_name).
7956
7957 return new tree_args_block_attribute_list (attribute_name);
7958}
7959
7962{
7963 return new tree_args_block_validation_list (arg_validation);
7964}
7965
7968{
7969 return list_append (list, arg_validation);
7970}
7971
7974{
7975 // FIXME: Validate argument.
7976
7977 return new tree_arg_size_spec (size_args);
7978}
7979
7982{
7983 // FIXME: Validate argument.
7984
7985 return new tree_arg_validation_fcns (fcn_args);
7986}
7987
7988void
8004
8005// A CLASSDEF block defines a class that has a constructor and other
8006// methods, but it is not an executable command. Parsing the block
8007// makes some changes in the symbol table (inserting the constructor
8008// and methods, and adding to the list of known objects) and creates
8009// a parse tree containing meta information about the class.
8010
8013{
8014 tree_classdef *retval = nullptr;
8015
8017
8018 std::string cls_name = id->name ();
8019
8020 std::string full_name = m_lexer.m_fcn_file_full_name;
8021 std::string short_name = m_lexer.m_fcn_file_name;
8022
8023 std::size_t pos = short_name.find_last_of (sys::file_ops::dir_sep_chars ());
8024
8025 if (pos != std::string::npos)
8026 short_name = short_name.substr (pos+1);
8027
8028 if (short_name != cls_name)
8029 {
8030 filepos f_pos = id->beg_pos ();
8031
8032 delete a;
8033 delete id;
8034 delete sc;
8035 delete body;
8036
8037 bison_error ("invalid classdef definition, the class name must match the filename", f_pos);
8038
8039 }
8040 else
8041 {
8042 if (end_token_ok (end_tok, token::classdef_end))
8043 {
8044 if (! body)
8045 body = new tree_classdef_body ();
8046
8047 retval = new tree_classdef (m_lexer.m_symtab_context.curr_scope (), *cdef_tok, a, id, sc, body, *end_tok, m_curr_package_name, full_name);
8048 }
8049 else
8050 {
8051 delete a;
8052 delete id;
8053 delete sc;
8054 delete body;
8055
8057 }
8058 }
8059
8060 return retval;
8061}
8062
8065{
8066 tree_classdef_properties_block *retval = nullptr;
8067
8068 if (end_token_ok (end_tok, token::properties_end))
8069 {
8070 if (plist)
8071 {
8072 // If the element at the end of the list doesn't have a doc
8073 // string, see whether the first element of the comments
8074 // attached to the end token is an end-of-line comment for
8075 // us to use.
8076
8077 tree_classdef_property *last_elt = plist->back ();
8078
8079 if (last_elt && ! last_elt->have_doc_string ())
8080 {
8081 comment_list comments = end_tok->leading_comments ();
8082
8083 if (! comments.empty ())
8084 {
8085 comment_elt elt = comments.front ();
8086
8087 if (elt.is_end_of_line ())
8088 last_elt->doc_string (elt.text ());
8089 }
8090 }
8091 }
8092 else
8093 plist = new tree_classdef_property_list ();
8094
8095 retval = new tree_classdef_properties_block (*tok, a, plist, *end_tok);
8096 }
8097 else
8098 {
8099 delete a;
8100 delete plist;
8101
8103 }
8104
8105 return retval;
8106}
8107
8113
8116{
8117 av->arg_name (id);
8118
8119 if (av->size_spec () || av->class_name () || av->validation_fcns ())
8120 warning ("size, class, and validation function specifications are not yet supported for classdef properties; INCORRECT RESULTS ARE POSSIBLE!");
8121
8122 return new tree_classdef_property (av);
8123}
8124
8127{
8128 tree_classdef_methods_block *retval = nullptr;
8129
8130 if (end_token_ok (end_tok, token::methods_end))
8131 {
8132 if (! mlist)
8133 mlist = new tree_classdef_method_list ();
8134
8135 retval = new tree_classdef_methods_block (*tok, a, mlist, *end_tok);
8136 }
8137 else
8138 {
8139 delete a;
8140 delete mlist;
8141
8143 }
8144
8145 return retval;
8146}
8147
8150{
8151 tree_classdef_events_block *retval = nullptr;
8152
8153 if (end_token_ok (end_tok, token::events_end))
8154 {
8155 if (! elist)
8156 elist = new tree_classdef_event_list ();
8157
8158 retval = new tree_classdef_events_block (*tok, a, elist, *end_tok);
8159 }
8160 else
8161 {
8162 delete a;
8163 delete elist;
8164
8166 }
8167
8168 return retval;
8169}
8170
8176
8182
8185{
8186 tree_classdef_enum_block *retval = nullptr;
8187
8188 if (end_token_ok (end_tok, token::enumeration_end))
8189 {
8190 if (! elist)
8191 elist = new tree_classdef_enum_list ();
8192
8193 retval = new tree_classdef_enum_block (*tok, a, elist, *end_tok);
8194 }
8195 else
8196 {
8197 delete a;
8198 delete elist;
8199
8201 }
8202
8203 return retval;
8204}
8205
8211
8214{
8215 return new tree_classdef_enum (id, *open_paren, expr, *close_paren);
8216}
8217
8220{
8221 return list_append (list, elt);
8222}
8223
8226{
8227 return list_append (list, elt);
8228}
8229
8232{
8233 return list_append (list, elt);
8234}
8235
8238{
8239 sc->set_separator (*lt_tok);
8240
8241 return new tree_classdef_superclass_list (sc);
8242}
8243
8246{
8247 return new tree_classdef_superclass (*fqident);
8248}
8249
8252{
8253 elt->set_separator (*and_tok);
8254
8255 return list_append (list, elt);
8256}
8257
8263
8266{
8267 return make_classdef_attribute (id, nullptr, nullptr);
8268}
8269
8272{
8273 return (expr ? new tree_classdef_attribute (id, *eq_tok, expr) : new tree_classdef_attribute (id));
8274}
8275
8278{
8279 return new tree_classdef_attribute (*not_tok, id, false);
8280}
8281
8284{
8285 return list_append (list, *sep_tok, elt);
8286}
8287
8293
8299
8305
8311
8317
8323
8329
8335
8338{
8339 octave_user_function* retval = nullptr;
8340
8341 // External methods are only allowed within @-folders. In this case,
8342 // m_curr_class_name will be non-empty.
8343
8344 if (! m_curr_class_name.empty ())
8345 {
8346 std::string mname = id->name ();
8347
8348 // Methods that cannot be declared outside the classdef file:
8349 // - methods with '.' character (e.g. property accessors)
8350 // - class constructor
8351 // - 'delete'
8352
8353 if (mname.find_first_of (".") == std::string::npos && mname != "delete" && mname != m_curr_class_name)
8354 {
8355 // Create a dummy function that is used until the real method
8356 // is loaded.
8357
8358 retval = new octave_user_function (symbol_scope::anonymous (), id, pl);
8359
8360 retval->stash_function_name (mname);
8361 }
8362 else
8363 bison_error ("invalid external method declaration, an external method cannot be the class constructor, 'delete' or have a dot (.) character in its name");
8364 }
8365 else
8366 bison_error ("external methods are only allowed in @-folders");
8367
8368 return retval;
8369}
8370
8373{
8374 if (! ret_list)
8376
8377 fcn->define_ret_list (ret_list);
8378
8379 if (eq_tok)
8380 fcn->set_eq_tok (*eq_tok);
8381
8382 return new tree_function_def (fcn);
8383}
8384
8387{
8388 octave_value fcn;
8389
8390 if (fcn_def)
8391 fcn = fcn_def->function ();
8392
8393 delete fcn_def;
8394
8395 return new tree_classdef_method_list (fcn);
8396}
8397
8400{
8401 octave_value fcn;
8402
8403 if (fcn_def)
8404 {
8405 fcn = fcn_def->function ();
8406
8407 delete fcn_def;
8408 }
8409
8410 return list_append (list, fcn);
8411}
8412
8413bool
8415{
8416 parse_tree_validator validator;
8417
8418 cls->accept (validator);
8419
8420 if (local_fcns)
8421 {
8422 for (tree_statement *elt : *local_fcns)
8423 {
8424 tree_command *cmd = elt->command ();
8425
8426 tree_function_def *fcn_def = dynamic_cast<tree_function_def *> (cmd);
8427
8428 fcn_def->accept (validator);
8429 }
8430 }
8431
8432 if (! validator.ok ())
8433 {
8434 delete cls;
8435 delete local_fcns;
8436
8437 bison_error (validator.error_list ());
8438
8439 return false;
8440 }
8441
8442 // Require all validations to succeed before installing any local
8443 // functions or defining the classdef object for later use.
8444
8445 if (local_fcns)
8446 {
8448
8449 symbol_table& symtab = interp.get_symbol_table ();
8450
8451 for (tree_statement *elt : *local_fcns)
8452 {
8453 tree_command *cmd = elt->command ();
8454
8455 tree_function_def *fcn_def = dynamic_cast<tree_function_def *> (cmd);
8456
8457 octave_value ov_fcn = fcn_def->function ();
8459
8460 std::string nm = fcn->name ();
8461 std::string file = fcn->fcn_file_name ();
8462
8463 fcn->attach_trailing_comments (eof_tok->leading_comments ());
8464
8465 symtab.install_local_function (nm, ov_fcn, file);
8466 }
8467
8468 delete local_fcns;
8469 }
8470
8471 // FIXME: Is it possible for the following condition to be false?
8473 m_classdef_object = std::shared_ptr<tree_classdef> (cls);
8474
8475 return true;
8476}
8477
8478// Make a word list command.
8481{
8482 tree_index_expression *retval = make_index_expression (expr, nullptr, args, nullptr, '(');
8483
8484 if (retval)
8485 retval->mark_word_list_cmd ();
8486
8487 return retval;
8488}
8489
8490// Make an index expression.
8491
8493base_parser::make_index_expression (tree_expression *expr, token *open_delim, tree_argument_list *args, token *close_delim, char type)
8494{
8495 tree_index_expression *retval = nullptr;
8496
8497 if (! args)
8498 args = new tree_argument_list ();
8499
8500 if (args->has_magic_tilde ())
8501 {
8502 delete expr;
8503 delete args;
8504
8505 bison_error ("invalid use of empty argument (~) in index expression");
8506 }
8507 else
8508 {
8509 if (! expr->is_postfix_indexed ())
8510 expr->set_postfix_index (type);
8511
8512 token tmp_open_delim = open_delim ? *open_delim : token ();
8513 token tmp_close_delim = close_delim ? *close_delim : token ();
8514
8515 if (expr->is_index_expression ())
8516 {
8517 retval = dynamic_cast<tree_index_expression *> (expr);
8518
8519 retval->append (tmp_open_delim, args, tmp_close_delim, type);
8520 }
8521 else
8522 retval = new tree_index_expression (expr, tmp_open_delim, args, tmp_close_delim, type);
8523 }
8524
8525 return retval;
8526}
8527
8528// Make an indirect reference expression.
8529
8532{
8533 tree_index_expression *retval = nullptr;
8534
8535 if (! expr->is_postfix_indexed ())
8536 expr->set_postfix_index ('.');
8537
8538 if (expr->is_index_expression ())
8539 {
8540 retval = dynamic_cast<tree_index_expression *> (expr);
8541
8542 retval->append (*dot_tok, *struct_elt_tok);
8543 }
8544 else
8545 retval = new tree_index_expression (expr, *dot_tok, *struct_elt_tok);
8546
8548
8549 return retval;
8550}
8551
8552// Make an indirect reference expression with dynamic field name.
8553
8555base_parser::make_indirect_ref (tree_expression *expr, token *dot_tok, token *open_paren, tree_expression *elt, token *close_paren)
8556{
8557 tree_index_expression *retval = nullptr;
8558
8559 if (! expr->is_postfix_indexed ())
8560 expr->set_postfix_index ('.');
8561
8562 if (expr->is_index_expression ())
8563 {
8564 retval = dynamic_cast<tree_index_expression *> (expr);
8565
8566 retval->append (*dot_tok, *open_paren, elt, *close_paren);
8567 }
8568 else
8569 retval = new tree_index_expression (expr, *dot_tok, *open_paren, elt, *close_paren);
8570
8572
8573 return retval;
8574}
8575
8576// Make a declaration command.
8577
8580{
8581 tree_decl_command *retval = nullptr;
8582
8583 if (lst)
8585
8586 int tok_id = tok->token_id ();
8587
8588 switch (tok->token_id ())
8589 {
8590 case GLOBAL:
8591 {
8592 retval = new tree_decl_command ("global", *tok, lst);
8593 retval->mark_global ();
8594 }
8595 break;
8596
8597 case PERSISTENT:
8598 if (m_curr_fcn_depth >= 0)
8599 {
8600 retval = new tree_decl_command ("persistent", *tok, lst);
8601 retval->mark_persistent ();
8602 }
8603 else
8604 {
8605 filepos pos = tok->beg_pos ();
8606 int line = pos.line ();
8607
8609 warning ("ignoring persistent declaration near line %d of file '%s'", line, m_lexer.m_fcn_file_full_name.c_str ());
8610 else
8611 warning ("ignoring persistent declaration near line %d", line);
8612 }
8613 break;
8614
8615 default:
8616 unexpected_token (tok_id, "base_parser::make_decl_command");
8617 break;
8618 }
8619
8620 return retval;
8621}
8622
8628
8631{
8632 return list_append (list, elt);
8633}
8634
8637{
8638 // FIXME: Need to capture EQ_OP here.
8639 return expr ? new tree_decl_elt (id, expr) : new tree_decl_elt (id);
8640}
8641
8642bool
8644{
8645 std::set<std::string> dict;
8646
8647 for (tree_decl_elt *elt : *lst)
8648 {
8649 tree_identifier *id = elt->ident ();
8650
8651 if (id)
8652 {
8653 std::string name = id->name ();
8654
8655 if (id->is_black_hole ())
8656 {
8657 if (type != tree_parameter_list::in)
8658 {
8659 bison_error ("invalid use of ~ in output list");
8660 return false;
8661 }
8662 }
8663 else if (iskeyword (name))
8664 {
8665 bison_error ("invalid use of keyword '" + name + "' in parameter list");
8666 return false;
8667 }
8668 else if (dict.find (name) != dict.end ())
8669 {
8670 bison_error ("'" + name + "' appears more than once in parameter list");
8671 return false;
8672 }
8673 else
8674 dict.insert (name);
8675 }
8676 }
8677
8678 std::string va_type = (type == tree_parameter_list::in ? "varargin" : "varargout");
8679
8680 std::size_t len = lst->size ();
8681
8682 if (len > 0)
8683 {
8684 tree_decl_elt *elt = lst->back ();
8685
8686 tree_identifier *id = elt->ident ();
8687
8688 if (id && id->name () == va_type)
8689 {
8690 if (len == 1)
8691 lst->mark_varargs_only ();
8692 else
8693 lst->mark_varargs ();
8694
8695 tree_parameter_list::iterator p = lst->end ();
8696 --p;
8697 delete *p;
8698 lst->erase (p);
8699 }
8700 }
8701
8702 return true;
8703}
8704
8705bool
8707{
8708 bool retval = true;
8709
8710 tree_array_list *al = dynamic_cast<tree_array_list *> (e);
8711
8712 for (tree_argument_list* row : *al)
8713 {
8714 if (row && row->has_magic_tilde ())
8715 {
8716 retval = false;
8717
8718 if (e->is_matrix ())
8719 bison_error ("invalid use of tilde (~) in matrix expression");
8720 else
8721 bison_error ("invalid use of tilde (~) in cell expression");
8722
8723 break;
8724 }
8725 }
8726
8727 return retval;
8728}
8729
8732{
8733 tree_argument_list *retval = nullptr;
8734
8735 if (e->is_constant ())
8736 {
8738
8739 tree_evaluator& tw = interp.get_evaluator ();
8740
8741 octave_value ov = e->evaluate (tw);
8742
8743 delete e;
8744
8745 if (ov.isempty ())
8746 bison_error ("invalid empty left hand side of assignment");
8747 else
8748 bison_error ("invalid constant left hand side of assignment");
8749 }
8750 else
8751 {
8752 bool is_simple_assign = true;
8753
8754 tree_argument_list *tmp = nullptr;
8755
8756 if (e->is_matrix ())
8757 {
8758 tree_matrix *mat = dynamic_cast<tree_matrix *> (e);
8759
8760 if (mat && mat->size () == 1)
8761 {
8762 tmp = mat->front ();
8763 mat->pop_front ();
8764 delete e;
8765 is_simple_assign = false;
8766 }
8767 }
8768 else
8769 tmp = new tree_argument_list (e);
8770
8771 if (tmp && tmp->is_valid_lvalue_list ())
8772 {
8774 retval = tmp;
8775 }
8776 else
8777 {
8778 delete tmp;
8779
8780 bison_error ("invalid left hand side of assignment");
8781 }
8782
8783 if (retval && is_simple_assign)
8784 retval->mark_as_simple_assign_lhs ();
8785 }
8786
8787 return retval;
8788}
8789
8790// Finish building an array_list.
8791
8793base_parser::finish_array_list (token *open_delim, tree_array_list *array_list, token *close_delim)
8794{
8795 tree_expression *retval = array_list;
8796
8797 array_list->mark_in_delims (*open_delim, *close_delim);
8798
8799 if (array_list->all_elements_are_constant ())
8800 {
8802
8803 try
8804 {
8805 // If the evaluation generates a warning message, restore
8806 // the previous value of last_warning_message and skip the
8807 // conversion to a constant value.
8808
8809 error_system& es = interp.get_error_system ();
8810
8811 unwind_action restore_last_warning_message (&error_system::set_last_warning_message, &es, es.last_warning_message (""));
8812
8813 unwind_action restore_discard_warning_messages (&error_system::set_discard_warning_messages, &es, es.discard_warning_messages (true));
8814
8815 tree_evaluator& tw = interp.get_evaluator ();
8816
8817 octave_value tmp = array_list->evaluate (tw);
8818
8819 std::string msg = es.last_warning_message ();
8820
8821 if (msg.empty ())
8822 {
8823 std::ostringstream buf;
8824
8825 tree_print_code tpc (buf);
8826
8827 array_list->accept (tpc);
8828
8829 std::string orig_text = buf.str ();
8830
8831 token tok (CONSTANT, tmp, orig_text, open_delim->beg_pos (), close_delim->end_pos ());
8832
8833 tree_constant *tc_retval = new tree_constant (tmp, orig_text, tok);
8834
8835 delete array_list;
8836
8837 retval = tc_retval;
8838 }
8839 }
8840 catch (const execution_exception&)
8841 {
8842 interp.recover_from_exception ();
8843 }
8844 }
8845
8846 return retval;
8847}
8848
8849// Finish building a matrix list.
8850
8852base_parser::finish_matrix (token *open_delim, tree_matrix *m, token *close_delim)
8853{
8854 if (m)
8855 return finish_array_list (open_delim, m, close_delim);
8856
8858 std::string orig_text {"{}"};
8859
8860 token tok (CONSTANT, tmp, orig_text, open_delim->beg_pos (), close_delim->end_pos ());
8861
8862 return new tree_constant (tmp, orig_text, tok);
8863}
8864
8867{
8868 return row ? new tree_matrix (row) : nullptr;
8869}
8870
8873{
8874 if (! matrix)
8875 return make_matrix (row);
8876
8877 return row ? list_append (matrix, *sep_tok, row) : matrix;
8878}
8879
8880// Finish building a cell list.
8881
8883base_parser::finish_cell (token *open_delim, tree_cell *c, token *close_delim)
8884{
8885 if (c)
8886 return finish_array_list (open_delim, c, close_delim);
8887
8888 octave_value tmp {Cell ()};
8889 std::string orig_text {"{}"};
8890
8891 token tok (CONSTANT, tmp, orig_text, open_delim->beg_pos (), close_delim->end_pos ());
8892
8893 return new tree_constant (tmp, orig_text, tok);
8894}
8895
8896tree_cell *
8898{
8899 return row ? new tree_cell (row) : nullptr;
8900}
8901
8902tree_cell *
8904{
8905 if (! cell)
8906 return make_cell (row);
8907
8908 return row ? list_append (cell, *sep_tok, row) : cell;
8909}
8910
8913{
8915
8916 return new tree_identifier (scope, *ident);
8917}
8918
8921{
8922 std::string meth = superclassref->superclass_method_name ();
8923 std::string cls = superclassref->superclass_class_name ();
8924
8925 return new tree_superclass_ref (meth, cls, *superclassref);
8926}
8927
8930{
8931 std::string cls = metaquery->text ();
8932
8933 return new tree_metaclass_query (cls, *metaquery);
8934}
8935
8937base_parser::set_stmt_print_flag (tree_statement_list *list, int sep_char, bool warn_missing_semi)
8938{
8939 tree_statement *tmp = list->back ();
8940
8941 switch (sep_char)
8942 {
8943 case ';':
8944 tmp->set_print_flag (false);
8945 break;
8946
8947 case '\0':
8948 case ',':
8949 case '\n':
8950 tmp->set_print_flag (true);
8951 if (warn_missing_semi)
8952 maybe_warn_missing_semi (list);
8953 break;
8954
8955 default:
8956 warning ("unrecognized separator type!");
8957 break;
8958 }
8959
8960 // Even if a statement is null, we add it to the list then remove it
8961 // here so that the print flag is applied to the correct statement.
8962
8963 if (tmp->is_null_statement ())
8964 {
8965 list->pop_back ();
8966 delete tmp;
8967 }
8968
8969 return list;
8970}
8971
8973base_parser::set_stmt_print_flag (tree_statement_list *list, const token& sep_tok, bool warn_missing_semi)
8974{
8975 return set_stmt_print_flag (list, sep_tok.token_id (), warn_missing_semi);
8976}
8977
8980{
8981 return (sep_list
8982 ? set_stmt_print_flag (list, sep_list->front (), warn_missing_semi)
8983 : set_stmt_print_flag (list, '\0', warn_missing_semi));
8984}
8985
8986// Finish building a statement.
8987template <typename T>
8990{
8991 return new tree_statement (arg);
8992}
8993
8996{
8997 return new tree_statement_list (stmt);
8998}
8999
9001base_parser::append_statement_list (tree_statement_list *list, int sep_char, tree_statement *stmt, bool warn_missing_semi)
9002{
9003 set_stmt_print_flag (list, sep_char, warn_missing_semi);
9004
9005 // FIXME: need to capture SEP_CHAR here.
9006 return list_append (list, stmt);
9007}
9008
9010base_parser::append_statement_list (tree_statement_list *list, token *sep_tok, tree_statement *stmt, bool warn_missing_semi)
9011{
9012 if (sep_tok)
9013 set_stmt_print_flag (list, *sep_tok, warn_missing_semi);
9014 else
9015 set_stmt_print_flag (list, '\0', warn_missing_semi);
9016
9017 // FIXME: need to capture SEP_TOK here.
9018 return list_append (list, stmt);
9019}
9020
9023{
9024 set_stmt_print_flag (list, sep_list, warn_missing_semi);
9025
9026 // FIXME: need to capture separator list here.
9027 // For now, delete the unused list.
9028 delete sep_list;
9029
9030 return list_append (list, stmt);
9031}
9032
9035{
9036 tree_statement *stmt = make_statement (fcn_def);
9037
9038 return new tree_statement_list (stmt);
9039}
9040
9043{
9044 tree_statement *stmt = make_statement (fcn_def);
9045
9046 // FIXME: Need to capture separator list here.
9047 // For now, delete the unused list.
9048 delete sep_list;
9049
9050 return list_append (list, stmt);
9051}
9052
9055{
9056 return new tree_argument_list (expr);
9057}
9058
9061{
9062 return list_append (list, expr);
9063}
9064
9067{
9068 return list_append (list, *sep_tok, expr);
9069}
9070
9076
9082
9088
9091{
9092 return list_append (list, *sep_tok, t);
9093}
9094
9097{
9098 return list_append (list, *sep_tok, new tree_decl_elt (id));
9099}
9100
9101void
9106
9107void
9108base_parser::bison_error (const std::string& str)
9109{
9111}
9112
9113void
9114base_parser::bison_error (const std::string& str, const filepos& pos)
9115{
9116 std::ostringstream output_buf;
9117
9118 int err_line = pos.line ();
9119 int err_col = pos.column ();
9120
9122
9123 // Adjust the error column for display because it is 1-based in the
9124 // lexer for easier reporting.
9125 err_col--;
9126
9127 if (in_file)
9128 output_buf << str << " near line " << err_line << ", column " << err_col << " in file " << m_lexer.m_fcn_file_full_name << "\n";
9129 else
9130 {
9131 // On command line, point directly to error
9132 output_buf << str << "\n\n";
9133 std::string curr_line = m_lexer.m_current_input_line;
9134
9135 if (! curr_line.empty ())
9136 {
9137 // FIXME: we could do better if we just cached lines from the
9138 // input file in a list. See also functions for managing input
9139 // buffers in lex.ll.
9140 std::size_t len = curr_line.length ();
9141
9142 if (curr_line[len-1] == '\n')
9143 curr_line.resize (len-1);
9144
9145 // Print the line, maybe with a pointer near the error token.
9146 output_buf << ">>> " << curr_line << "\n";
9147
9148 if (err_col == 0)
9149 err_col = len;
9150
9151 for (int i = 0; i < err_col + 3; i++)
9152 output_buf << " ";
9153
9154 output_buf << "^" << "\n";
9155 }
9156
9157 }
9158
9159 m_parse_error_msg = output_buf.str ();
9160}
9161
9162void
9163base_parser::bison_error (const parse_exception& pe)
9164{
9165 bison_error (pe.message (), pe.pos ());
9166}
9167
9168void
9169base_parser::bison_error (const std::list<parse_exception>& pe_list)
9170{
9171 // For now, we just report the first error found. Reporting all
9172 // errors will require a bit more refactoring.
9173
9174 parse_exception pe = pe_list.front ();
9175
9176 bison_error (pe.message (), pe.pos ());
9177}
9178
9179int
9181{
9182 int status = -1;
9183
9184 yypstate *pstate = static_cast<yypstate *> (m_parser_state);
9185
9186 try
9187 {
9188 status = octave_pull_parse (pstate, *this);
9189 }
9190 catch (const execution_exception&)
9191 {
9192 // FIXME: In previous versions, we emitted a parse error here
9193 // but that is not always correct because the error could have
9194 // happened inside a GUI callback functions executing in the
9195 // readline event_hook loop. Maybe we need a separate exception
9196 // class for parse errors?
9197
9198 throw;
9199 }
9200 catch (const exit_exception&)
9201 {
9202 throw;
9203 }
9204 catch (const interrupt_exception&)
9205 {
9206 throw;
9207 }
9208 catch (...)
9209 {
9210 std::string file = m_lexer.m_fcn_file_full_name;
9211
9212 if (file.empty ())
9213 error ("unexpected exception while parsing input");
9214 else
9215 error ("unexpected exception while parsing %s", file.c_str ());
9216 }
9217
9218 if (status != 0)
9219 parse_error_with_id ("Octave:parse-error", "%s", m_parse_error_msg.c_str ());
9220
9221 return status;
9222}
9223
9224// Parse input from INPUT. Pass TRUE for EOF if the end of INPUT should
9225// finish the parse.
9226
9227int
9228push_parser::run (const std::string& input, bool eof)
9229{
9230 int status = -1;
9231
9232 dynamic_cast<push_lexer&> (m_lexer).append_input (input, eof);
9233
9234 do
9235 {
9236 YYSTYPE lval;
9237
9238 int tok_id = octave_lex (&lval, m_lexer.m_scanner);
9239
9240 if (tok_id < 0)
9241 {
9242 // TOKEN == -2 means that the lexer recognized a comment
9243 // and we should be at the end of the buffer but not the
9244 // end of the file so we should return 0 to indicate
9245 // "complete input" instead of -1 to request more input.
9246
9247 status = (tok_id == -2 ? 0 : -1);
9248
9249 if (! eof && m_lexer.at_end_of_buffer ())
9250 return status;
9251
9252 break;
9253 }
9254
9255 yypstate *pstate = static_cast<yypstate *> (m_parser_state);
9256
9257 try
9258 {
9259 status = octave_push_parse (pstate, tok_id, &lval, *this);
9260 }
9261 catch (execution_exception& e)
9262 {
9263 std::string file = m_lexer.m_fcn_file_full_name;
9264
9265 if (file.empty ())
9266 error (e, "parse error");
9267 else
9268 error (e, "parse error in %s", file.c_str ());
9269 }
9270 catch (const exit_exception&)
9271 {
9272 throw;
9273 }
9274 catch (interrupt_exception &)
9275 {
9276 throw;
9277 }
9278 catch (...)
9279 {
9280 std::string file = m_lexer.m_fcn_file_full_name;
9281
9282 if (file.empty ())
9283 error ("unexpected exception while parsing input");
9284 else
9285 error ("unexpected exception while parsing %s", file.c_str ());
9286 }
9287 }
9288 while (status == YYPUSH_MORE || ! m_lexer.at_end_of_buffer ());
9289
9290 if (status != 0)
9291 parse_error_with_id ("Octave:parse-error", "%s", m_parse_error_msg.c_str ());
9292
9293 return status;
9294}
9295
9296int
9298{
9299 if (! m_reader)
9300 error ("push_parser::run requires valid input_reader");
9301
9302 int exit_status = 0;
9303
9304 std::string prompt = command_editor::decode_prompt_string (m_interpreter.PS1 ());
9305
9306 do
9307 {
9308 // Reset status each time through the read loop so that
9309 // it won't be set to -1 and cause us to exit the outer
9310 // loop early if there is an exception while reading
9311 // input or parsing.
9312
9313 exit_status = 0;
9314
9315 bool eof = false;
9316 std::string input_line = m_reader->get_input (prompt, eof);
9317
9318 if (eof)
9319 {
9320 exit_status = EOF;
9321 break;
9322 }
9323
9324 exit_status = run (input_line, false);
9325
9326 prompt = command_editor::decode_prompt_string (m_interpreter.PS2 ());
9327 }
9328 while (exit_status < 0);
9329
9330 return exit_status;
9331}
9332
9334parse_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)
9335{
9336 octave_value retval;
9337
9338 FILE *ffile = nullptr;
9339
9340 if (! full_file.empty ())
9341 {
9342 // Check that m-file is not overly large which can segfault interpreter.
9343 const int max_file_size = 512 * 1024 * 1024; // 512 MB
9344 sys::file_stat fs (full_file);
9345
9346 if (fs && fs.size () > max_file_size)
9347 {
9348 error ("file '%s' is too large, > 512 MB", full_file.c_str ());
9349
9350 return octave_value ();
9351 }
9352
9353 ffile = sys::fopen (full_file, "rb");
9354 }
9355
9356 if (! ffile)
9357 {
9358 if (require_file)
9359 error ("no such file, '%s'", full_file.c_str ());
9360
9361 return octave_value ();
9362 }
9363
9364 unwind_action act ([ffile] () { ::fclose (ffile); });
9365
9366 // get the encoding for this folder
9367 input_system& input_sys = interp.get_input_system ();
9368 parser parser (ffile, interp, input_sys.dir_encoding (dir_name));
9369
9370 parser.m_curr_class_name = dispatch_type;
9371 parser.m_curr_package_name = package_name;
9372 parser.m_autoloading = autoload;
9373 parser.m_fcn_file_from_relative_lookup = relative_lookup;
9374
9375 parser.m_lexer.m_force_script = force_script;
9377 parser.m_lexer.m_parsing_class_method = ! dispatch_type.empty ();
9378
9381 parser.m_lexer.m_dir_name = dir_name;
9382 parser.m_lexer.m_package_name = package_name;
9383
9384 int err = parser.run ();
9385
9386 if (err)
9387 error ("parse error while reading file %s", full_file.c_str ());
9388
9390
9392 {
9393 // Convert parse tree for classdef object to
9394 // meta.class info (and stash it in the symbol
9395 // table?). Return pointer to constructor?
9396
9397 if (ov_fcn.is_defined ())
9398 error ("unexpected: defining classdef object but primary_fcn is already defined - please report this bug");
9399
9400 bool is_at_folder = ! dispatch_type.empty ();
9401
9402 std::shared_ptr<tree_classdef> cdef_obj = parser.classdef_object();
9403
9404 return cdef_obj->make_meta_class (interp, is_at_folder);
9405 }
9406 else if (ov_fcn.is_defined ())
9407 {
9408 octave_function *fcn = ov_fcn.function_value ();
9409
9410 fcn->maybe_relocate_end ();
9411
9413 {
9415 parser.m_subfunction_names.reverse ();
9416
9418 }
9419
9420 return ov_fcn;
9421 }
9422
9423 return octave_value ();
9424}
9425
9426bool
9428{
9429 m_lexer.m_end_of_input = at_eof;
9430
9431 if (lst)
9432 {
9433 parse_tree_validator validator;
9434
9435 lst->accept (validator);
9436
9437 if (! validator.ok ())
9438 {
9439 delete lst;
9440
9441 bison_error (validator.error_list ());
9442
9443 return false;
9444 }
9445 }
9446
9447 std::shared_ptr<tree_statement_list> tmp_lst (lst);
9448
9449 statement_list (tmp_lst);
9450
9451 return true;
9452}
9453
9454// Check script or function for semantic errors.
9455bool
9457{
9459
9460 if (code)
9461 {
9462 parse_tree_validator validator;
9463
9464 code->accept (validator);
9465
9466 if (! validator.ok ())
9467 {
9468 bison_error (validator.error_list ());
9469
9470 return false;
9471 }
9472 }
9473
9474 return true;
9475}
9476
9477// Maybe print a warning if an assignment expression is used as the
9478// test in a logical expression.
9479
9480void
9481base_parser::maybe_warn_assign_as_truth_value (tree_expression *expr)
9482{
9483 if (expr->is_assignment_expression () && expr->delim_count () < 2)
9484 {
9485 if (m_lexer.m_fcn_file_full_name.empty ())
9486 warning_with_id ("Octave:assign-as-truth-value", "suggest parenthesis around assignment used as truth value");
9487 else
9488 warning_with_id ("Octave:assign-as-truth-value", "suggest parenthesis around assignment used as truth value near line %d, column %d in file '%s'", expr->line (), expr->column (), m_lexer.m_fcn_file_full_name.c_str ());
9489 }
9490}
9491
9492// Maybe print a warning about switch labels that aren't constants.
9493
9494void
9495base_parser::maybe_warn_variable_switch_label (tree_expression *expr)
9496{
9497 if (! expr->is_constant ())
9498 {
9499 if (m_lexer.m_fcn_file_full_name.empty ())
9500 warning_with_id ("Octave:variable-switch-label", "variable switch label");
9501 else
9502 warning_with_id ("Octave:variable-switch-label", "variable switch label near line %d, column %d in file '%s'", expr->line (), expr->column (), m_lexer.m_fcn_file_full_name.c_str ());
9503 }
9504}
9505
9506void
9507base_parser::maybe_warn_missing_semi (tree_statement_list *t)
9508{
9509 if (m_curr_fcn_depth >= 0)
9510 {
9511 tree_statement *tmp = t->back ();
9512
9513 if (tmp->is_expression ())
9514 warning_with_id ("Octave:missing-semicolon", "missing semicolon near line %d, column %d in file '%s'", tmp->line (), tmp->column (), m_lexer.m_fcn_file_full_name.c_str ());
9515 }
9516}
9517
9518std::string
9519get_help_from_file (const std::string& nm, bool& symbol_found, std::string& full_file)
9520{
9521 std::string retval;
9522
9523 full_file = fcn_file_in_path (nm);
9524
9525 std::string file = full_file;
9526
9527 std::size_t file_len = file.length ();
9528
9529 if ((file_len > 4 && file.substr (file_len-4) == ".oct")
9530 || (file_len > 4 && file.substr (file_len-4) == ".mex")
9531 || (file_len > 2 && file.substr (file_len-2) == ".m"))
9532 {
9533 file = sys::env::base_pathname (file);
9534 file = file.substr (0, file.find_last_of ('.'));
9535
9536 std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ());
9537 if (pos != std::string::npos)
9538 file = file.substr (pos+1);
9539 }
9540
9541 if (! file.empty ())
9542 {
9543 interpreter& interp = __get_interpreter__ ();
9544
9545 symbol_found = true;
9546
9547 octave_value ov_fcn = parse_fcn_file (interp, full_file, file, "", "", "", true, false, false, false);
9548
9549 if (ov_fcn.is_defined ())
9550 {
9551 octave_function *fcn = ov_fcn.function_value ();
9552
9553 if (fcn)
9554 retval = fcn->doc_string ();
9555 }
9556 }
9557
9558 return retval;
9559}
9560
9561std::string
9562get_help_from_file (const std::string& nm, bool& symbol_found)
9563{
9564 std::string file;
9565 return get_help_from_file (nm, symbol_found, file);
9566}
9567
9569load_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)
9570{
9571 octave_value retval;
9572
9573 unwind_protect frame;
9574
9575 std::string nm = file_name;
9576
9577 std::size_t nm_len = nm.length ();
9578
9579 std::string file;
9580
9581 bool relative_lookup = false;
9582
9583 file = nm;
9584
9585 if ((nm_len > 4 && nm.substr (nm_len-4) == ".oct")
9586 || (nm_len > 4 && nm.substr (nm_len-4) == ".mex")
9587 || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))
9588 {
9589 nm = sys::env::base_pathname (file);
9590 nm = nm.substr (0, nm.find_last_of ('.'));
9591
9592 std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_str ());
9593 if (pos != std::string::npos)
9594 nm = nm.substr (pos+1);
9595 }
9596
9597 relative_lookup = ! sys::env::absolute_pathname (file);
9598
9599 file = sys::env::make_absolute (file);
9600
9601 int len = file.length ();
9602
9603 interpreter& interp = __get_interpreter__ ();
9604
9605 dynamic_loader& dyn_loader = interp.get_dynamic_loader ();
9606
9607 if (len > 4 && file.substr (len-4, len-1) == ".oct")
9608 {
9609 if (autoload && ! fcn_name.empty ())
9610 nm = fcn_name;
9611
9612 octave_function *tmpfcn = dyn_loader.load_oct (nm, file, relative_lookup);
9613
9614 if (tmpfcn)
9615 {
9616 tmpfcn->stash_package_name (package_name);
9617 retval = octave_value (tmpfcn);
9618 }
9619 }
9620 else if (len > 4 && file.substr (len-4, len-1) == ".mex")
9621 {
9622 // Temporarily load m-file version of mex-file, if it exists,
9623 // to get the help-string to use.
9624
9625 std::string doc_string;
9626
9627 octave_value ov_fcn = parse_fcn_file (interp, file.substr (0, len - 2), nm, dir_name, dispatch_type, package_name, false, autoload, autoload, relative_lookup);
9628
9629 if (ov_fcn.is_defined ())
9630 {
9631 octave_function *tmpfcn = ov_fcn.function_value ();
9632
9633 if (tmpfcn)
9634 doc_string = tmpfcn->doc_string ();
9635 }
9636
9637 octave_function *tmpfcn = dyn_loader.load_mex (nm, file, relative_lookup);
9638
9639 if (tmpfcn)
9640 {
9641 tmpfcn->document (doc_string);
9642 tmpfcn->stash_package_name (package_name);
9643
9644 retval = octave_value (tmpfcn);
9645 }
9646 }
9647 else if (len > 2)
9648 retval = parse_fcn_file (interp, file, nm, dir_name, dispatch_type, package_name, true, autoload, autoload, relative_lookup);
9649
9650 return retval;
9651}
9652
9653DEFMETHOD (autoload, interp, args, ,
9654 doc: /* -*- texinfo -*-
9655@deftypefn {} {@var{autoload_map} =} autoload ()
9656@deftypefnx {} {} autoload (@var{function}, @var{file})
9657@deftypefnx {} {} autoload (@dots{}, "remove")
9658Define @var{function} to autoload from @var{file}.
9659
9660The second argument, @var{file}, should be an absolute filename or a file
9661name in the same directory as the function or script from which the autoload
9662command was run. @var{file} @emph{should not} depend on the Octave load
9663path.
9664
9665Normally, calls to @code{autoload} appear in PKG_ADD script files that are
9666evaluated when a directory is added to Octave's load path. To avoid having
9667to hardcode directory names in @var{file}, if @var{file} is in the same
9668directory as the PKG_ADD script then
9669
9670@example
9671autoload ("foo", "bar.oct");
9672@end example
9673
9674@noindent
9675will load the function @code{foo} from the file @code{bar.oct}. The above
9676usage when @code{bar.oct} is not in the same directory, or usages such as
9677
9678@example
9679autoload ("foo", file_in_loadpath ("bar.oct"))
9680@end example
9681
9682@noindent
9683are strongly discouraged, as their behavior may be unpredictable.
9684
9685With no arguments, return a structure containing the current autoload map.
9686
9687If a third argument @qcode{"remove"} is given, the function is cleared and
9688not loaded anymore during the current Octave session.
9689
9690@seealso{PKG_ADD}
9691@end deftypefn */)
9692{
9693 int nargin = args.length ();
9694
9695 if (nargin == 1 || nargin > 3)
9696 print_usage ();
9697
9698 tree_evaluator& tw = interp.get_evaluator ();
9699
9700 if (nargin == 0)
9701 return octave_value (tw.get_autoload_map ());
9702 else
9703 {
9704 string_vector argv = args.make_argv ("autoload");
9705
9706 if (nargin == 2)
9707 tw.add_autoload (argv[1], argv[2]);
9708 else if (nargin == 3)
9709 {
9710 if (argv[3] != "remove")
9711 error_with_id ("Octave:invalid-input-arg", "autoload: third argument can only be 'remove'");
9712
9713 tw.remove_autoload (argv[1], argv[2]);
9714 }
9715 }
9716
9717 return octave_value_list ();
9718}
9719
9720DEFMETHOD (mfilename, interp, args, ,
9721 doc: /* -*- texinfo -*-
9722@deftypefn {} {} mfilename ()
9723@deftypefnx {} {} mfilename ("fullpath")
9724@deftypefnx {} {} mfilename ("fullpathext")
9725Return the name of the currently executing file.
9726
9727The base name of the currently executing script or function is returned without
9728any extension. If called from outside an m-file, such as the command line,
9729return the empty string.
9730
9731Given the argument @qcode{"fullpath"}, include the directory part of the
9732filename, but not the extension.
9733
9734Given the argument @qcode{"fullpathext"}, include the directory part of
9735the filename and the extension.
9736@seealso{inputname, dbstack}
9737@end deftypefn */)
9738{
9739 int nargin = args.length ();
9740
9741 if (nargin > 1)
9742 print_usage ();
9743
9744 std::string opt;
9745
9746 if (nargin == 1)
9747 opt = args(0).xstring_value ("mfilename: option argument must be a string");
9748
9749 return octave_value (interp.mfilename (opt));
9750}
9751
9752 // Execute the contents of a script file. For compatibility with
9753 // Matlab, also execute a function file by calling the function it
9754 // defines with no arguments and nargout = 0.
9755
9756 void
9757 source_file (const std::string& file_name, const std::string& context,
9758 bool verbose, bool require_file)
9759 {
9760 interpreter& interp = __get_interpreter__ ();
9761
9762 interp.source_file (file_name, context, verbose, require_file);
9763 }
9764
9765DEFMETHOD (source, interp, args, ,
9766 doc: /* -*- texinfo -*-
9767@deftypefn {} {} source (@var{file})
9768@deftypefnx {} {} source (@var{file}, @var{context})
9769Parse and execute the contents of @var{file}.
9770
9771Without specifying @var{context}, this is equivalent to executing commands
9772from a script file, but without requiring the file to be named
9773@file{@var{file}.m} or to be on the execution path.
9774
9775Instead of the current context, the script may be executed in either the
9776context of the function that called the present function
9777(@qcode{"caller"}), or the top-level context (@qcode{"base"}).
9778@seealso{run}
9779@end deftypefn */)
9780{
9781 int nargin = args.length ();
9782
9783 if (nargin < 1 || nargin > 2)
9784 print_usage ();
9785
9786 std::string file_name = args(0).xstring_value ("source: FILE must be a string");
9787
9788 std::string context;
9789 if (nargin == 2)
9790 context = args(1).xstring_value ("source: CONTEXT must be a string");
9791
9792 interp.source_file (file_name, context);
9793
9794 return octave_value_list ();
9795}
9796
9797 //! Evaluate an Octave function (built-in or interpreted) and return
9798 //! the list of result values.
9799 //!
9800 //! @param name The name of the function to call.
9801 //! @param args The arguments to the function.
9802 //! @param nargout The number of output arguments expected.
9803 //! @return A list of output values. The length of the list is not
9804 //! necessarily the same as @c nargout.
9805
9807 feval (const char *name, const octave_value_list& args, int nargout)
9808 {
9809 interpreter& interp = __get_interpreter__ ();
9810
9811 return interp.feval (name, args, nargout);
9812 }
9813
9815 feval (const std::string& name, const octave_value_list& args, int nargout)
9816 {
9817 interpreter& interp = __get_interpreter__ ();
9818
9819 return interp.feval (name, args, nargout);
9820 }
9821
9823 feval (octave_function *fcn, const octave_value_list& args, int nargout)
9824 {
9825 interpreter& interp = __get_interpreter__ ();
9826
9827 return interp.feval (fcn, args, nargout);
9828 }
9829
9831 feval (const octave_value& val, const octave_value_list& args, int nargout)
9832 {
9833 interpreter& interp = __get_interpreter__ ();
9834
9835 return interp.feval (val, args, nargout);
9836 }
9837
9839 feval (const octave_value_list& args, int nargout)
9840 {
9841 interpreter& interp = __get_interpreter__ ();
9842
9843 return interp.feval (args, nargout);
9844 }
9845
9846DEFMETHOD (feval, interp, args, nargout,
9847 doc: /* -*- texinfo -*-
9848@deftypefn {} {@var{retval} =} feval (@var{name}, @dots{})
9849Evaluate the function named @var{name}.
9850
9851Any arguments after the first are passed as inputs to the named function.
9852For example,
9853
9854@example
9855@group
9856feval ("acos", -1)
9857 @result{} 3.1416
9858@end group
9859@end example
9860
9861@noindent
9862calls the function @code{acos} with the argument @samp{-1}.
9863
9864The function @code{feval} can also be used with function handles of any sort
9865(@pxref{Function Handles}). Historically, @code{feval} was the only way to
9866call user-supplied functions in strings, but function handles are now
9867preferred due to the cleaner syntax they offer. For example,
9868
9869@example
9870@group
9871@var{f} = @@exp;
9872feval (@var{f}, 1)
9873 @result{} 2.7183
9874@var{f} (1)
9875 @result{} 2.7183
9876@end group
9877@end example
9878
9879@noindent
9880are equivalent ways to call the function referred to by @var{f}. If it
9881cannot be predicted beforehand whether @var{f} is a function handle,
9882function name in a string, or inline function then @code{feval} can be used
9883instead.
9884@end deftypefn */)
9885{
9886 if (args.length () == 0)
9887 print_usage ();
9888
9889 return interp.feval (args, nargout);
9890}
9891
9892DEFMETHOD (builtin, interp, args, nargout,
9893 doc: /* -*- texinfo -*-
9894@deftypefn {} {[@dots{}] =} builtin (@var{f}, @dots{})
9895Call the base function @var{f} even if @var{f} is overloaded to another
9896function for the given type signature.
9897
9898This is normally useful when doing object-oriented programming and there is
9899a requirement to call one of Octave's base functions rather than the
9900overloaded one of a new class.
9901
9902A trivial example which redefines the @code{sin} function to be the
9903@code{cos} function shows how @code{builtin} works.
9904
9905@example
9906@group
9907sin (0)
9908 @result{} 0
9909function y = sin (x), y = cos (x); endfunction
9910sin (0)
9911 @result{} 1
9912builtin ("sin", 0)
9913 @result{} 0
9914@end group
9915@end example
9916@end deftypefn */)
9917{
9918 octave_value_list retval;
9919
9920 if (args.length () == 0)
9921 print_usage ();
9922
9923 const std::string name (args(0).xstring_value ("builtin: function name (F) must be a string"));
9924
9925 symbol_table& symtab = interp.get_symbol_table ();
9926
9927 octave_value fcn = symtab.builtin_find (name);
9928
9929 if (fcn.is_defined ())
9930 retval = interp.feval (fcn.function_value (), args.splice (0, 1), nargout);
9931 else
9932 error ("builtin: lookup for symbol '%s' failed", name.c_str ());
9933
9934 return retval;
9935}
9936
9937DEFMETHOD (eval, interp, args, nargout,
9938 doc: /* -*- texinfo -*-
9939@deftypefn {} {} eval (@var{try})
9940@deftypefnx {} {} eval (@var{try}, @var{catch})
9941Parse the string @var{try} and evaluate it as if it were an Octave
9942program.
9943
9944If execution fails, evaluate the optional string @var{catch}.
9945
9946The string @var{try} is evaluated in the current context, so any results
9947remain available after @code{eval} returns.
9948
9949The following example creates the variable @var{A} with the approximate
9950value of 3.1416 in the current workspace.
9951
9952@example
9953eval ("A = acos(-1);");
9954@end example
9955
9956If an error occurs during the evaluation of @var{try} then the @var{catch}
9957string is evaluated, as the following example shows:
9958
9959@example
9960@group
9961eval ('error ("This is a bad example");',
9962 'printf ("This error occurred:\n%s\n", lasterr ());');
9963 @print{} This error occurred:
9964 This is a bad example
9965@end group
9966@end example
9967
9968Programming Note: if you are only using @code{eval} as an error-capturing
9969mechanism, rather than for the execution of arbitrary code strings,
9970Consider using try/catch blocks or unwind_protect/unwind_protect_cleanup
9971blocks instead. These techniques have higher performance and don't
9972introduce the security considerations that the evaluation of arbitrary code
9973does.
9974@seealso{evalin, evalc, assignin, feval}
9975@end deftypefn */)
9976{
9977 int nargin = args.length ();
9978
9979 if (nargin < 1 || nargin > 2)
9980 print_usage ();
9981
9982 if (! args(0).is_string () || args(0).rows () > 1 || args(0).ndims () != 2)
9983 error ("eval: TRY must be a string");
9984
9985 std::string try_code = args(0).string_value ();
9986
9987 if (nargin == 1)
9988 return interp.eval (try_code, nargout);
9989 else
9990 {
9991 if (! args(1).is_string () || args(1).rows () > 1 || args(1).ndims () != 2)
9992 error ("eval: CATCH must be a string");
9993
9994 std::string catch_code = args(1).string_value ();
9995
9996 return interp.eval (try_code, catch_code, nargout);
9997 }
9998}
9999
10000/*
10001
10002%!shared x
10003%! x = 1;
10004
10005%!assert (eval ("x"), 1)
10006%!assert (eval ("x;"))
10007%!assert (eval ("x;"), 1)
10008
10009%!test
10010%! y = eval ("x");
10011%! assert (y, 1);
10012
10013%!test
10014%! y = eval ("x;");
10015%! assert (y, 1);
10016
10017%!test
10018%! eval ("x = 1;");
10019%! assert (x,1);
10020
10021%!test
10022%! eval ("flipud = 2;");
10023%! assert (flipud, 2);
10024
10025%!function y = __f ()
10026%! eval ("flipud = 2;");
10027%! y = flipud;
10028%!endfunction
10029%!assert (__f(), 2)
10030
10031%!test <*35645>
10032%! [a,] = gcd (1,2);
10033%! [a,b,] = gcd (1, 2);
10034
10035## Can't assign to a keyword
10036%!error eval ("switch = 13;")
10037
10038%!shared str
10039%! str = "disp ('hello');";
10040%! str(:,:,2) = str(:,:,1);
10041
10042%!error <TRY must be a string> eval (1)
10043%!error <TRY must be a string> eval (['a';'b'])
10044%!error <TRY must be a string> eval (str)
10045
10046%!error <CATCH must be a string> eval (str(:,:,1), 1)
10047%!error <CATCH must be a string> eval (str(:,:,1), ['a';'b'])
10048%!error <CATCH must be a string> eval (str(:,:,1), str)
10049
10050*/
10051
10052DEFMETHOD (assignin, interp, args, ,
10053 doc: /* -*- texinfo -*-
10054@deftypefn {} {} assignin (@var{context}, @var{varname}, @var{value})
10055Assign @var{value} to @var{varname} in context @var{context}, which
10056may be either @qcode{"base"} or @qcode{"caller"}.
10057@seealso{evalin}
10058@end deftypefn */)
10059{
10060 if (args.length () != 3)
10061 print_usage ();
10062
10063 std::string context = args(0).xstring_value ("assignin: CONTEXT must be a string");
10064
10065 std::string varname = args(1).xstring_value ("assignin: VARNAME must be a string");
10066
10067 interp.assignin (context, varname, args(2));
10068
10069 return octave_value_list ();
10070}
10071
10072/*
10073
10074%!error assignin ("base", "switch", "13")
10075
10076*/
10077
10078DEFMETHOD (evalin, interp, args, nargout,
10079 doc: /* -*- texinfo -*-
10080@deftypefn {} {} evalin (@var{context}, @var{try})
10081@deftypefnx {} {} evalin (@var{context}, @var{try}, @var{catch})
10082Like @code{eval}, except that the expressions are evaluated in the context
10083@var{context}, which may be either @qcode{"caller"} or @qcode{"base"}.
10084@seealso{eval, assignin}
10085@end deftypefn */)
10086{
10087 int nargin = args.length ();
10088
10089 if (nargin < 2 || nargin > 3)
10090 print_usage ();
10091
10092 std::string context = args(0).xstring_value ("evalin: CONTEXT must be a string");
10093
10094 std::string try_code = args(1).xstring_value ("evalin: TRY must be a string");
10095
10096 if (nargin == 3)
10097 {
10098 std::string catch_code = args(2).xstring_value ("evalin: CATCH must be a string");
10099
10100 return interp.evalin (context, try_code, catch_code, nargout);
10101 }
10102
10103 return interp.evalin (context, try_code, nargout);
10104}
10105
10106DEFMETHOD (evalc, interp, args, nargout,
10107 doc: /* -*- texinfo -*-
10108@deftypefn {} {@var{s} =} evalc (@var{try})
10109@deftypefnx {} {@var{s} =} evalc (@var{try}, @var{catch})
10110Parse and evaluate the string @var{try} as if it were an Octave program,
10111while capturing the output into the return variable @var{s}.
10112
10113If execution fails, evaluate the optional string @var{catch}.
10114
10115This function behaves like @code{eval}, but any output or warning messages
10116which would normally be written to the console are captured and returned in
10117the string @var{s}.
10118
10119The @code{diary} is disabled during the execution of this function. When
10120@code{system} is used, any output produced by external programs is
10121@emph{not} captured, unless their output is captured by the @code{system}
10122function itself.
10123
10124@example
10125@group
10126s = evalc ("t = 42"), t
10127 @result{} s = t = 42
10128
10129 @result{} t = 42
10130@end group
10131@end example
10132@seealso{eval, diary}
10133@end deftypefn */)
10134{
10135 int nargin = args.length ();
10136
10137 if (nargin == 0 || nargin > 2)
10138 print_usage ();
10139
10140 // Flush pending output and redirect stdout/stderr to capturing
10141 // buffer.
10142
10143 octave_stdout.flush ();
10144 std::cerr.flush ();
10145
10146 std::stringbuf buffer;
10147
10148 std::streambuf *old_out_buf = octave_stdout.rdbuf (&buffer);
10149 std::streambuf *old_err_buf = std::cerr.rdbuf (&buffer);
10150
10151 // Restore previous output buffers no matter how control exits this
10152 // function. There's no need to flush here. That has already
10153 // happened for the normal execution path. If an error happens during
10154 // the eval, then the message is stored in the exception object and we
10155 // will display it later, after the buffers have been restored.
10156
10157 unwind_action act ([old_out_buf, old_err_buf] ()
10158 {
10159 octave_stdout.rdbuf (old_out_buf);
10160 std::cerr.rdbuf (old_err_buf);
10161 });
10162
10163 // Call standard eval function.
10164
10165 int eval_nargout = std::max (0, nargout - 1);
10166
10167 octave_value_list retval = Feval (interp, args, eval_nargout);
10168
10169 // Make sure we capture all pending output.
10170
10171 octave_stdout.flush ();
10172 std::cerr.flush ();
10173
10174 retval.prepend (buffer.str ());
10175
10176 return retval;
10177}
10178
10179/*
10180
10181%!test
10182%! [old_fmt, old_spacing] = format ();
10183%! unwind_protect
10184%! format short;
10185%! str = evalc ("1");
10186%! assert (str, "ans = 1\n");
10187%! unwind_protect_cleanup
10188%! format (old_fmt);
10189%! format (old_spacing);
10190%! end_unwind_protect
10191
10192%!assert (evalc ("1;"), "")
10193
10194%!test
10195%! [s, y] = evalc ("1");
10196%! assert (s, "");
10197%! assert (y, 1);
10198
10199%!test
10200%! [s, y] = evalc ("1;");
10201%! assert (s, "");
10202%! assert (y, 1);
10203
10204%!test
10205%! [old_fmt, old_spacing] = format ();
10206%! unwind_protect
10207%! format short;
10208%! str = evalc ("y = 2");
10209%! assert (str, "y = 2\n");
10210%! assert (y, 2);
10211%! unwind_protect_cleanup
10212%! format (old_fmt);
10213%! format (old_spacing);
10214%! end_unwind_protect
10215
10216%!test
10217%! assert (evalc ("y = 3;"), "");
10218%! assert (y, 3);
10219
10220%!test
10221%! [s, a, b] = evalc ("deal (1, 2)");
10222%! assert (s, "");
10223%! assert (a, 1);
10224%! assert (b, 2);
10225
10226%!function [a, b] = __f_evalc ()
10227%! printf ("foo");
10228%! fprintf (stdout, "bar ");
10229%! disp (pi);
10230%! a = 1;
10231%! b = 2;
10232%!endfunction
10233%!test
10234%! [old_fmt, old_spacing] = format ();
10235%! unwind_protect
10236%! format short;
10237%! [s, a, b] = evalc ("__f_evalc ()");
10238%! assert (s, "foobar 3.1416\n");
10239%! assert (a, 1);
10240%! assert (b, 2);
10241%! unwind_protect_cleanup
10242%! format (old_fmt);
10243%! format (old_spacing);
10244%! end_unwind_protect
10245
10246%!error <foo> (evalc ("error ('foo')"))
10247%!error <bar> (evalc ("error ('foo')", "error ('bar')"))
10248
10249%!test
10250%! warning ("off", "quiet", "local");
10251%! str = evalc ("warning ('foo')");
10252%! assert (str(1:13), "warning: foo\n");
10253
10254%!test
10255%! warning ("off", "quiet", "local");
10256%! str = evalc ("error ('foo')", "warning ('bar')");
10257%! assert (str(1:13), "warning: bar\n");
10258
10259%!error evalc ("switch = 13;")
10260
10261*/
10262
10263DEFUN (__parser_debug_flag__, args, nargout,
10264 doc: /* -*- texinfo -*-
10265@deftypefn {} {@var{val} =} __parser_debug_flag__ ()
10266@deftypefnx {} {@var{old_val} =} __parser_debug_flag__ (@var{new_val})
10267Query or set the internal flag that determines whether Octave's parser
10268prints debug information as it processes an expression.
10269@seealso{__lexer_debug_flag__}
10270@end deftypefn */)
10271{
10272 octave_value retval;
10273
10274 bool debug_flag = octave_debug;
10275
10276 retval = set_internal_variable (debug_flag, args, nargout,
10277 "__parser_debug_flag__");
10278
10279 octave_debug = debug_flag;
10280
10281 return retval;
10282}
10283
10284DEFMETHOD (__parse_file__, interp, args, ,
10285 doc: /* -*- texinfo -*-
10286@deftypefn {} {} __parse_file__ (@var{file}, @var{verbose})
10287Undocumented internal function.
10288@end deftypefn */)
10289{
10290 octave_value retval;
10291
10292 int nargin = args.length ();
10293
10294 if (nargin < 1 || nargin > 2)
10295 print_usage ();
10296
10297 std::string file = args(0).xstring_value ("__parse_file__: expecting filename as argument");
10298
10299 std::string full_file = sys::file_ops::tilde_expand (file);
10300
10301 full_file = sys::env::make_absolute (full_file);
10302
10303 std::string dir_name;
10304
10305 std::size_t file_len = file.length ();
10306
10307 if ((file_len > 4 && file.substr (file_len-4) == ".oct")
10308 || (file_len > 4 && file.substr (file_len-4) == ".mex")
10309 || (file_len > 2 && file.substr (file_len-2) == ".m"))
10310 {
10311 file = sys::env::base_pathname (file);
10312 file = file.substr (0, file.find_last_of ('.'));
10313
10314 std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ());
10315 if (pos != std::string::npos)
10316 {
10317 dir_name = file.substr (0, pos);
10318 file = file.substr (pos+1);
10319 }
10320 }
10321
10322 if (nargin == 2)
10323 octave_stdout << "parsing " << full_file << std::endl;
10324
10325 octave_value ov_fcn = parse_fcn_file (interp, full_file, file, dir_name, "", "", true, false, false, false);
10326
10327 return retval;
10328}
10329
10330OCTAVE_END_NAMESPACE(octave)
Definition Cell.h:41
std::string message() const
filepos beg_pos() const
bool at_end_of_buffer() const
Definition lex.h:584
bool input_from_tmp_history_file()
Definition lex.cc:6624
virtual bool input_from_terminal() const
Definition lex.h:686
void * m_scanner
Definition lex.h:676
void prep_for_file()
Definition lex.cc:5298
virtual bool input_from_eval_string() const
Definition lex.h:690
virtual void reset()
Definition lex.cc:5275
tree_index_expression * make_word_list_command(tree_expression *expr, tree_argument_list *args)
tree_argument_list * append_argument_list(tree_argument_list *list, tree_expression *expr)
tree_function_def * make_function(token *fcn_tok, tree_parameter_list *ret_list, token *eq_tok, tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_fcn_stmt)
std::shared_ptr< tree_statement_list > m_stmt_list
Definition parse.h:740
tree_classdef_attribute * make_not_classdef_attribute(token *not_tok, tree_identifier *id)
tree_cell * make_cell(tree_argument_list *row)
tree_classdef_enum_block * make_classdef_enum_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_enum_list *elist, token *end_tok)
int m_max_fcn_depth
Definition parse.h:704
tree_expression * finish_cell(token *open_delim, tree_cell *c, token *close_delim)
tree_switch_case * make_switch_case(token *case_tok, tree_expression *expr, tree_statement_list *list)
tree_switch_case_list * make_switch_case_list(tree_switch_case *switch_case)
void recover_from_parsing_function()
tree_classdef_attribute_list * append_classdef_attribute(tree_classdef_attribute_list *list, token *sep_tok, tree_classdef_attribute *elt)
tree_expression * make_postfix_op(tree_expression *op1, token *op_tok)
tree_argument_list * validate_matrix_for_assignment(tree_expression *e)
octave_value m_primary_fcn
Definition parse.h:729
tree_classdef_attribute_list * make_classdef_attribute_list(tree_classdef_attribute *attr)
tree_classdef_body * make_classdef_body(tree_classdef_properties_block *pb)
parent_scope_info m_function_scopes
Definition parse.h:726
tree_statement_list * append_statement_list(tree_statement_list *list, int sep_char, tree_statement *stmt, bool warn_missing_semi)
bool validate_array_list(tree_expression *e)
base_parser(base_lexer &lxr)
tree_identifier * make_identifier(token *ident)
tree_classdef_superclass_list * append_classdef_superclass(tree_classdef_superclass_list *list, token *and_tok, tree_classdef_superclass *elt)
tree_statement_list * make_function_def_list(tree_function_def *fcn_def)
tree_classdef_events_block * make_classdef_events_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_event_list *elist, token *end_tok)
tree_command * make_unwind_command(token *unwind_tok, tree_statement_list *body, token *cleanup_tok, tree_statement_list *cleanup, token *end_tok)
bool finish_input(tree_statement_list *lst, bool at_eof=false)
tree_classdef_properties_block * make_classdef_properties_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_property_list *plist, token *end_tok)
tree_function_def * finish_classdef_external_method(octave_user_function *fcn, tree_parameter_list *ret_list=nullptr, token *eq_tok=nullptr)
tree_parameter_list * make_parameter_list(tree_parameter_list::in_or_out io)
tree_classdef_attribute * make_classdef_attribute(tree_identifier *id)
tree_function_def * finish_function(token *fcn_tok, tree_parameter_list *ret_list, token *eq_tok, octave_user_function *fcn)
tree_expression * finish_array_list(token *open_delim, tree_array_list *a, token *close_delim)
tree_index_expression * make_index_expression(tree_expression *expr, token *open_paren, tree_argument_list *args, token *close_paren, char type)
tree_classdef_property * make_classdef_property(tree_identifier *id, tree_arg_validation *av)
tree_if_command_list * append_if_clause(tree_if_command_list *list, tree_if_clause *clause)
tree_command * make_return_command(token *return_tok)
octave_user_function * start_function(tree_identifier *id, tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_function, const std::string &doc_string)
bool m_endfunction_found
Definition parse.h:684
tree_identifier * make_fcn_name(tree_identifier *id)
tree_switch_command * finish_switch_command(token *switch_tok, tree_expression *expr, tree_switch_case_list *list, token *end_tok)
void disallow_command_syntax()
tree_matrix * make_matrix(tree_argument_list *row)
std::shared_ptr< tree_statement_list > statement_list() const
Definition parse.h:186
base_lexer & m_lexer
Definition parse.h:743
tree_if_clause * make_if_clause(token *if_tok, separator_list *if_sep_list, tree_expression *expr, tree_statement_list *list)
tree_decl_elt * make_decl_elt(tree_identifier *id, token *eq_op=nullptr, tree_expression *expr=nullptr)
tree_command * make_continue_command(token *continue_tok)
tree_if_command * finish_if_command(tree_if_command_list *list, tree_if_clause *else_clause, token *end_tok)
std::string m_curr_class_name
Definition parse.h:719
tree_switch_case_list * append_switch_case(tree_switch_case_list *list, tree_switch_case *elt)
tree_decl_command * make_decl_command(token *tok, tree_decl_init_list *lst)
tree_parameter_list * append_parameter_list(tree_parameter_list *list, token *sep_tok, tree_decl_elt *t)
tree_command * make_for_command(token *for_tok, token *open_paren, tree_argument_list *lhs, token *eq_tok, tree_expression *expr, token *sep_tok, tree_expression *maxproc, token *close_paren, tree_statement_list *body, token *end_tok)
tree_classdef_methods_block * make_classdef_methods_block(token *tok, tree_classdef_attribute_list *a, tree_classdef_method_list *mlist, token *end_tok)
tree_spmd_command * make_spmd_command(token *spmd_tok, tree_statement_list *body, token *end_tok)
tree_black_hole * make_black_hole(token *tilde)
tree_classdef_property_list * append_classdef_property(tree_classdef_property_list *list, tree_classdef_property *elt)
tree_anon_fcn_handle * make_anon_fcn_handle(token *at_tok, tree_parameter_list *param_list, tree_expression *expr)
bool m_parsing_local_functions
Definition parse.h:700
tree_command * make_try_command(token *try_tok, tree_statement_list *body, token *catch_tok, separator_list *catch_sep_list, tree_statement_list *cleanup, token *end_tok)
tree_classdef_body * append_classdef_enum_block(tree_classdef_body *body, tree_classdef_enum_block *block)
std::string m_curr_package_name
Definition parse.h:723
bool m_fcn_file_from_relative_lookup
Definition parse.h:691
tree_args_block_attribute_list * make_args_attribute_list(tree_identifier *attribute_name)
symbol_scope m_primary_fcn_scope
Definition parse.h:715
tree_statement_list * make_statement_list(tree_statement *stmt)
tree_expression * make_boolean_op(tree_expression *op1, token *op_tok, tree_expression *op2)
tree_fcn_handle * make_fcn_handle(token *tok)
tree_classdef * make_classdef(token *tok, tree_classdef_attribute_list *a, tree_identifier *id, tree_classdef_superclass_list *sc, tree_classdef_body *body, token *end_tok)
tree_classdef_enum_list * append_classdef_enum(tree_classdef_enum_list *list, tree_classdef_enum *elt)
tree_expression * finish_matrix(token *open_delim, tree_matrix *m, token *close_delim)
tree_classdef_method_list * append_classdef_method(tree_classdef_method_list *list, tree_function_def *fcn_def)
void end_token_error(token *tok, token::end_tok_type expected)
void maybe_convert_to_braindead_shortcircuit(tree_expression *&expr)
tree_metaclass_query * make_metaclass_query(token *metaquery)
tree_classdef_event_list * append_classdef_event(tree_classdef_event_list *list, tree_classdef_event *elt)
tree_classdef_event_list * make_classdef_event_list(tree_classdef_event *e)
tree_classdef_body * append_classdef_properties_block(tree_classdef_body *body, tree_classdef_properties_block *block)
std::list< std::string > m_subfunction_names
Definition parse.h:734
tree_command * make_do_until_command(token *do_tok, tree_statement_list *body, token *until_tok, tree_expression *expr)
tree_classdef_superclass * make_classdef_superclass(token *fqident)
bool m_autoloading
Definition parse.h:687
void parsing_local_functions(bool flag)
Definition parse.h:201
tree_command * make_break_command(token *break_tok)
tree_statement_list * set_stmt_print_flag(tree_statement_list *list, int sep_char, bool warn_missing_semi)
tree_statement_list * append_function_body(tree_statement_list *body, tree_statement_list *list)
tree_arg_validation * make_arg_validation(tree_arg_size_spec *size_spec, tree_identifier *class_name, tree_arg_validation_fcns *validation_fcns, token *eq_tok=nullptr, tree_expression *default_value=nullptr)
virtual ~base_parser()
tree_expression * make_colon_expression(tree_expression *base, token *colon_tok, tree_expression *limit)
tree_constant * make_constant(token *tok)
bool m_parsing_subfunctions
Definition parse.h:695
bool validate_param_list(tree_parameter_list *lst, tree_parameter_list::in_or_out type)
tree_decl_init_list * make_decl_init_list(tree_decl_elt *elt)
bool finish_classdef_file(tree_classdef *cls, tree_statement_list *local_fcns, token *eof_tok)
bool validate_primary_fcn()
tree_classdef_enum * make_classdef_enum(tree_identifier *id, token *open_paren, tree_expression *expr, token *close_paren)
void endfunction_found(bool flag)
Definition parse.h:216
tree_decl_init_list * append_decl_init_list(tree_decl_init_list *list, tree_decl_elt *elt)
tree_expression * make_assign_op(tree_argument_list *lhs, token *eq_tok, tree_expression *rhs)
void bison_error(const std::string &s)
tree_classdef_method_list * make_classdef_method_list(tree_function_def *fcn_def)
tree_index_expression * make_indirect_ref(tree_expression *expr, token *dot_tok, token *struct_elt_tok)
tree_classdef_body * append_classdef_events_block(tree_classdef_body *body, tree_classdef_events_block *block)
tree_arguments_block * make_arguments_block(token *arguments_tok, tree_args_block_attribute_list *attr_list, tree_args_block_validation_list *validation_list, token *end_tok)
tree_args_block_validation_list * append_args_validation_list(tree_args_block_validation_list *list, tree_arg_validation *arg_validation)
tree_statement_list * append_function_def_list(tree_statement_list *list, separator_list *sep_list, tree_function_def *fcn_def)
tree_classdef_superclass_list * make_classdef_superclass_list(token *lt_tok, tree_classdef_superclass *sc)
tree_arg_size_spec * make_arg_size_spec(tree_argument_list *size_args)
tree_expression * make_prefix_op(token *op_tok, tree_expression *op1)
tree_expression * make_binary_op(tree_expression *op1, token *op_tok, tree_expression *op2)
tree_statement * make_end(const std::string &type, bool eof, token *tok)
void * m_parser_state
Definition parse.h:746
tree_cell * append_cell_row(tree_cell *cell, token *sep_tok, tree_argument_list *row)
std::shared_ptr< tree_classdef > m_classdef_object
Definition parse.h:737
int m_curr_fcn_depth
Definition parse.h:711
tree_matrix * append_matrix_row(tree_matrix *matrix, token *sep_tok, tree_argument_list *row)
tree_classdef_body * append_classdef_methods_block(tree_classdef_body *body, tree_classdef_methods_block *block)
tree_superclass_ref * make_superclass_ref(token *superclassref)
tree_command * make_while_command(token *while_tok, tree_expression *expr, tree_statement_list *body, token *end_tok)
tree_switch_case * make_default_switch_case(token *default_tok, tree_statement_list *list)
tree_classdef_enum_list * make_classdef_enum_list(tree_classdef_enum *e)
void make_script(tree_statement_list *cmds, tree_statement *end_script)
octave_user_function * start_classdef_external_method(tree_identifier *id, tree_parameter_list *pl=nullptr)
tree_argument_list * make_argument_list(tree_expression *expr)
void classdef_object(const std::shared_ptr< tree_classdef > &obj)
Definition parse.h:174
tree_args_block_validation_list * make_args_validation_list(tree_arg_validation *arg_validation)
bool push_fcn_symtab()
tree_classdef_property_list * make_classdef_property_list(tree_classdef_property *prop)
tree_arg_validation_fcns * make_arg_validation_fcns(tree_argument_list *fcn_args)
std::string m_parse_error_msg
Definition parse.h:681
bool end_token_ok(token *tok, token::end_tok_type expected)
tree_if_command_list * start_if_command(tree_if_clause *clause)
tree_statement * make_statement(T *arg)
tree_classdef_event * make_classdef_event(tree_identifier *id)
static std::string decode_prompt_string(const std::string &s)
Definition cmd-edit.cc:1273
bool is_end_of_line() const
std::string text() const
bool empty() const
bool uses_hash_char() const
reference front()
comment_elt find_doc_comment() const
std::string find_doc_string() const
bool empty() const
octave_function * load_oct(const std::string &fcn_name, const std::string &file_name="", bool relative=false)
octave_function * load_mex(const std::string &fcn_name, const std::string &file_name="", bool relative=false)
void set_discard_warning_messages(bool flag)
Definition error.h:104
void set_last_warning_message(const std::string &val)
Definition error.h:207
octave_value discard_warning_messages(const octave_value_list &args, int nargout)
Definition error.cc:299
octave_value last_warning_message(const octave_value_list &args, int nargout)
Definition error.cc:343
void increment_column(int val=1)
Definition filepos.h:56
void line(int l)
Definition filepos.h:49
void column(int c)
Definition filepos.h:50
error_system & get_error_system()
void source_file(const std::string &file_name, const std::string &context="", bool verbose=false, bool require_file=true)
dynamic_loader & get_dynamic_loader()
octave_value PS1(const octave_value_list &args, int nargout)
tree_evaluator & get_evaluator()
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
void recover_from_exception()
octave_value PS2(const octave_value_list &args, int nargout)
input_system & get_input_system()
symbol_table & get_symbol_table()
Definition lex.h:723
bool input_from_eval_string() const
Definition lex.h:770
symbol_scope curr_scope() const
Definition lex.cc:4965
symbol_scope parent_scope() const
Definition lex.cc:4974
void push(const symbol_scope &scope)
Definition lex.h:76
bool m_looking_at_parameter_list
Definition lex.h:367
bool m_reading_classdef_file
Definition lex.h:434
bool m_looking_at_anon_fcn_args
Definition lex.h:361
std::string m_package_name
Definition lex.h:502
void mark_as_variables(const std::list< std::string > &lst)
Definition lex.cc:5141
filepos m_filepos
Definition lex.h:470
bool m_arguments_is_keyword
Definition lex.h:385
std::string m_current_input_line
Definition lex.h:483
bool m_end_of_input
Definition lex.h:351
bool m_allow_command_syntax
Definition lex.h:354
int m_looping
Definition lex.h:451
bool m_parsing_classdef_set_method
Definition lex.h:418
bool m_parsing_anon_fcn_body
Definition lex.h:392
std::stack< bool > m_parsed_function_name
Definition lex.h:511
bool m_at_beginning_of_statement
Definition lex.h:358
std::string m_fcn_file_full_name
Definition lex.h:496
bool m_looking_at_return_list
Definition lex.h:364
bool m_parsing_classdef_get_method
Definition lex.h:415
bool m_parsing_classdef_decl
Definition lex.h:403
bool m_looking_at_matrix_or_assign_lhs
Definition lex.h:375
bool m_parsing_classdef_superclass
Definition lex.h:407
bool m_looking_for_object_index
Definition lex.h:378
interpreter & m_interpreter
Definition lex.h:348
bbp_nesting_level m_nesting_level
Definition lex.h:518
bool m_parsing_classdef
Definition lex.h:398
bool m_reading_script_file
Definition lex.h:431
bool m_classdef_element_names_are_keywords
Definition lex.h:389
bool m_reading_fcn_file
Definition lex.h:428
std::string m_function_text
Definition lex.h:490
std::string m_fcn_file_name
Definition lex.h:493
bool m_looking_at_decl_list
Definition lex.h:371
symbol_table_context m_symtab_context
Definition lex.h:514
bool m_parsing_class_method
Definition lex.h:395
bool m_buffer_function_text
Definition lex.h:438
bool m_force_script
Definition lex.h:425
void mark_as_variable(const std::string &nm)
Definition lex.cc:5132
std::string m_dir_name
Definition lex.h:499
bool m_maybe_classdef_get_set_method
Definition lex.h:412
bool m_looking_at_indirect_ref
Definition lex.h:382
int m_looking_at_function_handle
Definition lex.h:457
int m_defining_fcn
Definition lex.h:454
virtual std::string doc_string(const std::string &="") const
Definition ov-fcn.h:221
virtual void maybe_relocate_end()
Definition ov-fcn.h:194
void document(const std::string &ds)
Definition ov-fcn.h:218
void stash_dir_name(const std::string &dir)
Definition ov-fcn.h:174
void stash_dispatch_class(const std::string &nm)
Definition ov-fcn.h:148
std::string name() const
Definition ov-fcn.h:208
void stash_package_name(const std::string &pack)
Definition ov-fcn.h:152
virtual void accept(octave::tree_walker &)
Definition ov-fcn.h:225
void mark_relative()
Definition ov-fcn.h:204
virtual void stash_subfunction_names(const std::list< std::string > &)
Definition ov-fcn.h:199
static const octave_value instance
Definition ov-null-mat.h:50
static const octave_value instance
Definition ov-null-mat.h:92
static const octave_value instance
Definition ov-null-mat.h:70
void stash_fcn_file_name(const std::string &nm)
Definition ov-usr-fcn.h:101
octave::symbol_scope scope()
Definition ov-usr-fcn.h:97
std::string fcn_file_name() const
Definition ov-usr-fcn.h:112
void cache_function_text(const std::string &text, const octave::sys::time &timestamp)
void stash_fcn_file_time(const octave::sys::time &t)
Definition ov-usr-fcn.h:106
octave::sys::time time_parsed() const
Definition ov-usr-fcn.h:114
octave::tree_statement_list * body()
Definition ov-usr-fcn.h:125
void stash_function_name(const std::string &s)
Definition ov-usr-fcn.h:304
void set_fcn_tok(const octave::token &fcn_tok)
Definition ov-usr-fcn.h:240
octave_user_function * define_ret_list(octave::tree_parameter_list *t)
void mark_as_classdef_method()
Definition ov-usr-fcn.h:366
void set_eq_tok(const octave::token &eq_tok)
Definition ov-usr-fcn.h:241
octave_user_function * user_function_value(bool=false)
Definition ov-usr-fcn.h:230
void accept(octave::tree_walker &tw)
void mark_as_legacy_constructor()
Definition ov-usr-fcn.h:342
std::map< std::string, octave_value > subfunctions() const
void attach_trailing_comments(const octave::comment_list &lst)
void mark_as_classdef_constructor()
Definition ov-usr-fcn.h:350
void mark_as_nested_function()
Definition ov-usr-fcn.h:336
octave_idx_type length() const
Definition ovl.h:111
octave_value_list & prepend(const octave_value &val)
Definition ovl.cc:80
octave_function * function_value(bool silent=false) const
@ op_hermitian
Definition ov.h:84
@ op_uminus
Definition ov.h:82
@ op_not
Definition ov.h:80
@ op_transpose
Definition ov.h:83
@ unknown_unary_op
Definition ov.h:88
@ op_uplus
Definition ov.h:81
@ op_incr
Definition ov.h:85
@ op_decr
Definition ov.h:86
bool is_defined() const
Definition ov.h:592
bool isempty() const
Definition ov.h:601
@ op_pow_eq
Definition ov.h:141
@ op_asn_eq
Definition ov.h:135
@ op_add_eq
Definition ov.h:136
@ op_el_pow_eq
Definition ov.h:145
@ op_mul_eq
Definition ov.h:138
@ op_div_eq
Definition ov.h:139
@ op_el_and_eq
Definition ov.h:146
@ op_el_ldiv_eq
Definition ov.h:144
@ op_sub_eq
Definition ov.h:137
@ op_el_mul_eq
Definition ov.h:142
@ op_el_or_eq
Definition ov.h:147
@ unknown_assign_op
Definition ov.h:149
@ op_el_div_eq
Definition ov.h:143
@ op_ldiv_eq
Definition ov.h:140
@ magic_colon_t
Definition ov.h:170
binary_op
Definition ov.h:92
@ op_ldiv
Definition ov.h:98
@ op_ne
Definition ov.h:104
@ unknown_binary_op
Definition ov.h:113
@ op_el_or
Definition ov.h:110
@ op_el_ldiv
Definition ov.h:108
@ op_pow
Definition ov.h:97
@ op_ge
Definition ov.h:102
@ op_div
Definition ov.h:96
@ op_el_pow
Definition ov.h:107
@ op_mul
Definition ov.h:95
@ op_add
Definition ov.h:93
@ op_sub
Definition ov.h:94
@ op_el_mul
Definition ov.h:105
@ op_le
Definition ov.h:100
@ op_lt
Definition ov.h:99
@ op_gt
Definition ov.h:103
@ op_eq
Definition ov.h:101
@ op_el_and
Definition ov.h:109
@ op_el_div
Definition ov.h:106
octave_idx_type length() const
octave_user_function * user_function_value(bool silent=false) const
octave_user_code * user_code_value(bool silent=false) const
int run()
void cache_fcn_name(const std::string &name)
Definition symscope.h:602
static symbol_scope anonymous()
Definition symscope.h:405
void update_nest()
Definition symscope.h:691
void mark_primary_fcn_scope()
Definition symscope.h:658
static symbol_scope invalid()
Definition symscope.h:400
void set_parent(const symbol_scope &p)
Definition symscope.h:624
void install_subfunction(const std::string &name, const octave_value &fval)
Definition symscope.h:511
void mark_static()
Definition symscope.h:456
void cache_fcn_file_name(const std::string &name)
Definition symscope.h:636
void set_nesting_depth(std::size_t depth)
Definition symscope.h:440
void set_primary_parent(const symbol_scope &p)
Definition symscope.h:630
void cache_name(const std::string &name)
Definition symscope.h:591
std::shared_ptr< symbol_scope_rep > parent_scope() const
Definition symscope.h:462
void install_nestfunction(const std::string &name, const octave_value &fval, const symbol_scope &fcn_scope)
Definition symscope.h:518
void cache_dir_name(const std::string &name)
Definition symscope.h:642
octave_value builtin_find(const std::string &name, const symbol_scope &search_scope=symbol_scope::invalid())
Definition symtab.cc:195
void install_local_function(const std::string &name, const octave_value &fcn, const std::string &file_name)
Definition symtab.cc:364
Definition token.h:42
std::string text_rep() const
Definition token.h:159
std::string superclass_class_name() const
Definition token.h:157
filepos end_pos() const
Definition token.h:129
int token_id() const
Definition token.h:120
comment_list leading_comments() const
Definition token.h:134
std::string superclass_method_name() const
Definition token.h:156
end_tok_type ettype() const
Definition token.h:154
filepos beg_pos() const
Definition token.h:128
end_tok_type
Definition token.h:57
@ events_end
Definition token.h:62
@ methods_end
Definition token.h:66
@ enumeration_end
Definition token.h:61
@ unwind_protect_end
Definition token.h:71
@ try_catch_end
Definition token.h:70
@ properties_end
Definition token.h:68
@ switch_end
Definition token.h:69
@ simple_end
Definition token.h:58
@ classdef_end
Definition token.h:60
@ arguments_end
Definition token.h:59
@ if_end
Definition token.h:65
@ parfor_end
Definition token.h:67
@ for_end
Definition token.h:63
@ function_end
Definition token.h:64
@ while_end
Definition token.h:73
@ spmd_end
Definition token.h:72
std::string text() const
Definition token.h:151
octave_value number() const
Definition token.h:152
void accept(tree_walker &tw)
tree_arg_size_spec * size_spec()
tree_identifier * class_name()
void arg_name(tree_expression *name)
tree_arg_validation_fcns * validation_fcns()
tree_expression * remove_front()
std::list< std::string > variable_names() const
bool is_valid_lvalue_list() const
void mark_as_simple_assign_lhs()
bool has_magic_tilde() const
bool is_simple_assign_lhs()
void accept(tree_walker &tw)
bool all_elements_are_constant() const
octave_value::binary_op op_type() const
Definition pt-binop.h:82
tree_expression * lhs()
Definition pt-binop.h:84
tree_expression * rhs()
Definition pt-binop.h:85
token operator_token() const
Definition pt-binop.h:69
tree_classdef_body * append(tree_classdef_properties_block *pb)
void doc_string(const std::string &s)
bool have_doc_string() const
void set_separator(const token &sep_tok)
void accept(tree_walker &tw)
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition pt-colon.cc:55
filepos beg_pos() const
Definition pt-colon.h:68
void accept(tree_walker &tw)
Definition pt-colon.h:94
filepos end_pos() const
Definition pt-colon.h:69
void mark_persistent()
Definition pt-decl.h:202
void mark_global()
Definition pt-decl.h:196
tree_identifier * ident()
Definition pt-decl.h:86
std::list< std::string > variable_names() const
Definition pt-decl.h:160
void add_autoload(const std::string &fcn, const std::string &nm)
Definition pt-eval.cc:4780
void remove_autoload(const std::string &fcn, const std::string &nm)
Definition pt-eval.cc:4787
octave_map get_autoload_map() const
Definition pt-eval.cc:4717
virtual octave_value evaluate(tree_evaluator &tw, int nargout=1)=0
virtual bool is_binary_expression() const
Definition pt-exp.h:78
virtual bool is_identifier() const
Definition pt-exp.h:68
bool is_postfix_indexed() const
Definition pt-exp.h:99
virtual bool is_constant() const
Definition pt-exp.h:62
void mark_as_for_cmd_expr()
Definition pt-exp.h:115
tree_expression * mark_in_delims(const token &open_delim, const token &close_delim)
Definition pt-exp.h:119
virtual bool is_index_expression() const
Definition pt-exp.h:70
size_t delim_count() const
Definition pt-exp.h:97
tree_expression * set_print_flag(bool print)
Definition pt-exp.h:131
tree_expression * set_postfix_index(char type)
Definition pt-exp.h:125
virtual std::string name() const
Definition pt-exp.h:111
virtual bool is_matrix() const
Definition pt-exp.h:64
virtual bool is_assignment_expression() const
Definition pt-exp.h:72
void accept(tree_walker &tw)
Definition pt-cmd.h:146
octave_value function()
Definition pt-cmd.h:151
virtual bool is_black_hole() const
Definition pt-id.h:78
std::string name() const
Definition pt-id.h:71
token if_token() const
Definition pt-select.h:126
void mark_word_list_cmd()
Definition pt-idx.h:91
std::string name() const
Definition pt-idx.cc:131
bool is_word_list_cmd() const
Definition pt-idx.h:93
filepos beg_pos() const
Definition pt-idx.h:78
tree_index_expression * append(const token &open_delim, tree_argument_list *lst, const token &close_delim, char t='(')
Definition pt-idx.cc:68
void mark_varargs_only()
Definition pt-misc.h:91
void mark_varargs()
Definition pt-misc.h:89
void mark_as_formal_parameters()
Definition pt-misc.cc:48
tree_parameter_list * mark_in_delims(const token &open_delim, const token &close_delim)
Definition pt-misc.h:76
void accept(tree_walker &tw)
Definition pt-stmt.h:213
comment_list leading_comments() const
Definition pt-stmt.cc:205
tree_expression * expression()
Definition pt-stmt.h:104
int column() const
Definition pt-stmt.cc:155
void set_print_flag(bool print_flag)
Definition pt-stmt.cc:63
bool is_expression() const
Definition pt-stmt.h:78
void set_expression(tree_expression *e)
Definition pt-stmt.h:121
bool is_null_statement() const
Definition pt-stmt.h:106
comment_list leading_comments() const
Definition pt-stmt.cc:110
int line() const
Definition pt-stmt.cc:147
virtual void visit_index_expression(tree_index_expression &)
Definition pt-walk.cc:401
virtual void visit_octave_user_script(octave_user_script &)
Definition pt-walk.cc:287
virtual void visit_octave_user_function(octave_user_function &)
Definition pt-walk.cc:296
virtual int line() const
Definition pt.cc:45
virtual int column() const
Definition pt.cc:51
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void print_usage()
Definition defun-int.h:72
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
Definition defun.h:111
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
Definition defun.h:56
void error_with_id(const char *id, const char *fmt,...)
Definition error.cc:1048
void warning(const char *fmt,...)
Definition error.cc:1078
void warning_with_id(const char *id, const char *fmt,...)
Definition error.cc:1093
void parse_error_with_id(const char *id, const char *fmt,...)
Definition error.cc:1123
void error(const char *fmt,...)
Definition error.cc:1003
void message(const char *name, const char *fmt,...)
Definition error.cc:971
interpreter & __get_interpreter__()
int octave_lex(OCTAVE_STYPE *yylval_param, yyscan_t yyscanner)
The main scanner function which does all the work.
Definition lex.cc:1621
bool iskeyword(const std::string &s)
Definition lex.cc:1335
#define yyss
#define OCTAVE_YYUSE(...)
Definition oct-parse.cc:155
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition oct-parse.cc:595
#define YYMAXDEPTH
#define YYSTACK_FREE
Definition oct-parse.cc:633
yysymbol_kind_t
Definition oct-parse.cc:193
@ YYSYMBOL_END
Definition oct-parse.cc:253
@ YYSYMBOL_POW
Definition oct-parse.cc:247
@ YYSYMBOL_spmd_command
Definition oct-parse.cc:349
@ YYSYMBOL_INPUT_FILE
Definition oct-parse.cc:292
@ YYSYMBOL_statement_list
Definition oct-parse.cc:298
@ YYSYMBOL_param_list_beg
Definition oct-parse.cc:352
@ YYSYMBOL_CLASSDEF
Definition oct-parse.cc:278
@ YYSYMBOL_TRANSPOSE
Definition oct-parse.cc:244
@ YYSYMBOL_method_decl
Definition oct-parse.cc:398
@ YYSYMBOL_function_body
Definition oct-parse.cc:369
@ YYSYMBOL_opt_list
Definition oct-parse.cc:299
@ YYSYMBOL_class_name
Definition oct-parse.cc:378
@ YYSYMBOL_7_
Definition oct-parse.cc:202
@ YYSYMBOL_matrix
Definition oct-parse.cc:313
@ YYSYMBOL_3_
Definition oct-parse.cc:198
@ YYSYMBOL_EXPR_NE
Definition oct-parse.cc:236
@ YYSYMBOL_MINUS_MINUS
Definition oct-parse.cc:246
@ YYSYMBOL_power_expr
Definition oct-parse.cc:326
@ YYSYMBOL_param_list2
Definition oct-parse.cc:357
@ YYSYMBOL_YYUNDEF
Definition oct-parse.cc:197
@ YYSYMBOL_CONSTANT
Definition oct-parse.cc:250
@ YYSYMBOL_anon_fcn_begin
Definition oct-parse.cc:414
@ YYSYMBOL_EXPR_LT
Definition oct-parse.cc:233
@ YYSYMBOL_class_body1
Definition oct-parse.cc:389
@ YYSYMBOL_properties_block
Definition oct-parse.cc:390
@ YYSYMBOL_14_
Definition oct-parse.cc:209
@ YYSYMBOL_function_beg
Definition oct-parse.cc:365
@ YYSYMBOL_TRY
Definition oct-parse.cc:273
@ YYSYMBOL_parse_error
Definition oct-parse.cc:415
@ YYSYMBOL_19_
Definition oct-parse.cc:214
@ YYSYMBOL_class_property
Definition oct-parse.cc:394
@ YYSYMBOL_magic_tilde
Definition oct-parse.cc:322
@ YYSYMBOL_UNTIL
Definition oct-parse.cc:260
@ YYSYMBOL_classdef_beg
Definition oct-parse.cc:380
@ YYSYMBOL_204_1
Definition oct-parse.cc:399
@ YYSYMBOL_enumeration_beg
Definition oct-parse.cc:409
@ YYSYMBOL_begin_file
Definition oct-parse.cc:363
@ YYSYMBOL_jump_command
Definition oct-parse.cc:348
@ YYSYMBOL_HERMITIAN
Definition oct-parse.cc:243
@ YYSYMBOL_17_
Definition oct-parse.cc:212
@ YYSYMBOL_IF
Definition oct-parse.cc:262
@ YYSYMBOL_LEFTDIV
Definition oct-parse.cc:239
@ YYSYMBOL_enum_block
Definition oct-parse.cc:408
@ YYSYMBOL_PROPERTIES
Definition oct-parse.cc:279
@ YYSYMBOL_list1
Definition oct-parse.cc:301
@ YYSYMBOL_method
Definition oct-parse.cc:400
@ YYSYMBOL_ELSEIF
Definition oct-parse.cc:263
@ YYSYMBOL_simple_list
Definition oct-parse.cc:296
@ YYSYMBOL_property_list1
Definition oct-parse.cc:393
@ YYSYMBOL_classdef
Definition oct-parse.cc:381
@ YYSYMBOL_switch_case
Definition oct-parse.cc:345
@ YYSYMBOL_method_list1
Definition oct-parse.cc:402
@ YYSYMBOL_case_list1
Definition oct-parse.cc:344
@ YYSYMBOL_UNARY
Definition oct-parse.cc:293
@ YYSYMBOL_NUMBER
Definition oct-parse.cc:249
@ YYSYMBOL_superclass_list1
Definition oct-parse.cc:386
@ YYSYMBOL_file
Definition oct-parse.cc:364
@ YYSYMBOL_return_list
Definition oct-parse.cc:359
@ YYSYMBOL_YYerror
Definition oct-parse.cc:196
@ YYSYMBOL_BREAK
Definition oct-parse.cc:268
@ YYSYMBOL_SET
Definition oct-parse.cc:287
@ YYSYMBOL_arg_name
Definition oct-parse.cc:375
@ YYSYMBOL_OR_EQ
Definition oct-parse.cc:228
@ YYSYMBOL_12_
Definition oct-parse.cc:207
@ YYSYMBOL_constant
Definition oct-parse.cc:312
@ YYSYMBOL_opt_sep_no_nl
Definition oct-parse.cc:417
@ YYSYMBOL_push_fcn_symtab
Definition oct-parse.cc:351
@ YYSYMBOL_EXPR_AND
Definition oct-parse.cc:231
@ YYSYMBOL_property_list
Definition oct-parse.cc:392
@ YYSYMBOL_loop_command
Definition oct-parse.cc:347
@ YYSYMBOL_sep_no_nl
Definition oct-parse.cc:416
@ YYSYMBOL_21_n_
Definition oct-parse.cc:216
@ YYSYMBOL_methods_block
Definition oct-parse.cc:395
@ YYSYMBOL_10_
Definition oct-parse.cc:205
@ YYSYMBOL_LEXICAL_ERROR
Definition oct-parse.cc:290
@ YYSYMBOL_parsing_local_fcns
Definition oct-parse.cc:361
@ YYSYMBOL_attr_list1
Definition oct-parse.cc:383
@ YYSYMBOL_EXPR_LE
Definition oct-parse.cc:234
@ YYSYMBOL_assign_lhs
Definition oct-parse.cc:329
@ YYSYMBOL_EXPR_GT
Definition oct-parse.cc:238
@ YYSYMBOL_CATCH
Definition oct-parse.cc:274
@ YYSYMBOL_args_validation_list
Definition oct-parse.cc:374
@ YYSYMBOL_simple_expr
Definition oct-parse.cc:328
@ YYSYMBOL_magic_colon
Definition oct-parse.cc:321
@ YYSYMBOL_opt_fcn_list
Definition oct-parse.cc:302
@ YYSYMBOL_enum_list
Definition oct-parse.cc:410
@ YYSYMBOL_LEFTDIV_EQ
Definition oct-parse.cc:221
@ YYSYMBOL_events_beg
Definition oct-parse.cc:404
@ YYSYMBOL_8_
Definition oct-parse.cc:203
@ YYSYMBOL_EXPR_OR_OR
Definition oct-parse.cc:230
@ YYSYMBOL_indirect_ref_op
Definition oct-parse.cc:324
@ YYSYMBOL_function
Definition oct-parse.cc:368
@ YYSYMBOL_9_
Definition oct-parse.cc:204
@ YYSYMBOL_cell_or_matrix_row
Definition oct-parse.cc:317
@ YYSYMBOL_class_event
Definition oct-parse.cc:407
@ YYSYMBOL_function_end
Definition oct-parse.cc:367
@ YYSYMBOL_properties_beg
Definition oct-parse.cc:391
@ YYSYMBOL_fcn_list
Definition oct-parse.cc:303
@ YYSYMBOL_expression
Definition oct-parse.cc:331
@ YYSYMBOL_PARFOR
Definition oct-parse.cc:257
@ YYSYMBOL_METAQUERY
Definition oct-parse.cc:283
@ YYSYMBOL_args_attr_list
Definition oct-parse.cc:373
@ YYSYMBOL_DQ_STRING
Definition oct-parse.cc:254
@ YYSYMBOL_ELEFTDIV_EQ
Definition oct-parse.cc:225
@ YYSYMBOL_11_
Definition oct-parse.cc:206
@ YYSYMBOL_methods_beg
Definition oct-parse.cc:396
@ YYSYMBOL_ARGUMENTS
Definition oct-parse.cc:289
@ YYSYMBOL_param_list
Definition oct-parse.cc:355
@ YYSYMBOL_superclass_identifier
Definition oct-parse.cc:309
@ YYSYMBOL_method_list
Definition oct-parse.cc:401
@ YYSYMBOL_EMUL
Definition oct-parse.cc:240
@ YYSYMBOL_events_block
Definition oct-parse.cc:403
@ YYSYMBOL_simple_list1
Definition oct-parse.cc:297
@ YYSYMBOL_if_clause_list
Definition oct-parse.cc:338
@ YYSYMBOL_word_list_cmd
Definition oct-parse.cc:306
@ YYSYMBOL_ENUMERATION
Definition oct-parse.cc:282
@ YYSYMBOL_SUPERCLASSREF
Definition oct-parse.cc:284
@ YYSYMBOL_attr_list
Definition oct-parse.cc:382
@ YYSYMBOL_string
Definition oct-parse.cc:311
@ YYSYMBOL_superclass_list
Definition oct-parse.cc:385
@ YYSYMBOL_identifier
Definition oct-parse.cc:308
@ YYSYMBOL_15_
Definition oct-parse.cc:210
@ YYSYMBOL_6_
Definition oct-parse.cc:201
@ YYSYMBOL_ELSE
Definition oct-parse.cc:264
@ YYSYMBOL_primary_expr
Definition oct-parse.cc:320
@ YYSYMBOL_20_
Definition oct-parse.cc:215
@ YYSYMBOL_switch_command
Definition oct-parse.cc:342
@ YYSYMBOL_if_clause
Definition oct-parse.cc:339
@ YYSYMBOL_EXPR_GE
Definition oct-parse.cc:237
@ YYSYMBOL_cell_rows
Definition oct-parse.cc:316
@ YYSYMBOL_sep
Definition oct-parse.cc:418
@ YYSYMBOL_END_OF_INPUT
Definition oct-parse.cc:291
@ YYSYMBOL_CONTINUE
Definition oct-parse.cc:269
@ YYSYMBOL_EMUL_EQ
Definition oct-parse.cc:223
@ YYSYMBOL_MUL_EQ
Definition oct-parse.cc:219
@ YYSYMBOL_EPOW_EQ
Definition oct-parse.cc:226
@ YYSYMBOL_EPOW
Definition oct-parse.cc:248
@ YYSYMBOL_FCN_HANDLE
Definition oct-parse.cc:277
@ YYSYMBOL_opt_param_list
Definition oct-parse.cc:354
@ YYSYMBOL_attr
Definition oct-parse.cc:384
@ YYSYMBOL_arguments_block
Definition oct-parse.cc:371
@ YYSYMBOL_WHILE
Definition oct-parse.cc:258
@ YYSYMBOL_18_
Definition oct-parse.cc:213
@ YYSYMBOL_class_enum
Definition oct-parse.cc:412
@ YYSYMBOL_declaration
Definition oct-parse.cc:333
@ YYSYMBOL_arg_list
Definition oct-parse.cc:323
@ YYSYMBOL_UNWIND
Definition oct-parse.cc:271
@ YYSYMBOL_else_clause
Definition oct-parse.cc:341
@ YYSYMBOL_param_list_end
Definition oct-parse.cc:353
@ YYSYMBOL_GET
Definition oct-parse.cc:286
@ YYSYMBOL_matrix_rows
Definition oct-parse.cc:314
@ YYSYMBOL_SWITCH
Definition oct-parse.cc:265
@ YYSYMBOL_return_list1
Definition oct-parse.cc:360
@ YYSYMBOL_SUB_EQ
Definition oct-parse.cc:218
@ YYSYMBOL_opt_sep
Definition oct-parse.cc:419
@ YYSYMBOL_fcn_handle
Definition oct-parse.cc:318
@ YYSYMBOL_decl_init_list
Definition oct-parse.cc:334
@ YYSYMBOL_YYACCEPT
Definition oct-parse.cc:294
@ YYSYMBOL_statement
Definition oct-parse.cc:305
@ YYSYMBOL_EXPR_AND_AND
Definition oct-parse.cc:229
@ YYSYMBOL_4_
Definition oct-parse.cc:199
@ YYSYMBOL_EXPR_EQ
Definition oct-parse.cc:235
@ YYSYMBOL_assign_expr
Definition oct-parse.cc:330
@ YYSYMBOL_param_list_elt
Definition oct-parse.cc:358
@ YYSYMBOL_arguments_beg
Definition oct-parse.cc:372
@ YYSYMBOL_event_list
Definition oct-parse.cc:405
@ YYSYMBOL_EDIV
Definition oct-parse.cc:241
@ YYSYMBOL_select_command
Definition oct-parse.cc:336
@ YYSYMBOL_YYEOF
Definition oct-parse.cc:195
@ YYSYMBOL_list
Definition oct-parse.cc:300
@ YYSYMBOL_GLOBAL
Definition oct-parse.cc:275
@ YYSYMBOL_13_
Definition oct-parse.cc:208
@ YYSYMBOL_FUNCTION
Definition oct-parse.cc:288
@ YYSYMBOL_decl_elt
Definition oct-parse.cc:335
@ YYSYMBOL_SPMD
Definition oct-parse.cc:261
@ YYSYMBOL_AND_EQ
Definition oct-parse.cc:227
@ YYSYMBOL_size_spec
Definition oct-parse.cc:377
@ YYSYMBOL_push_script_symtab
Definition oct-parse.cc:362
@ YYSYMBOL_class_body
Definition oct-parse.cc:388
@ YYSYMBOL_input
Definition oct-parse.cc:295
@ YYSYMBOL_oper_expr
Definition oct-parse.cc:325
@ YYSYMBOL_DO
Definition oct-parse.cc:259
@ YYSYMBOL_POW_EQ
Definition oct-parse.cc:222
@ YYSYMBOL_colon_expr
Definition oct-parse.cc:327
@ YYSYMBOL_cell
Definition oct-parse.cc:315
@ YYSYMBOL_SQ_STRING
Definition oct-parse.cc:255
@ YYSYMBOL_case_list
Definition oct-parse.cc:343
@ YYSYMBOL_CASE
Definition oct-parse.cc:266
@ YYSYMBOL_default_case
Definition oct-parse.cc:346
@ YYSYMBOL_meta_identifier
Definition oct-parse.cc:310
@ YYSYMBOL_word_list
Definition oct-parse.cc:307
@ YYSYMBOL_YYEMPTY
Definition oct-parse.cc:194
@ YYSYMBOL_method_decl1
Definition oct-parse.cc:397
@ YYSYMBOL_event_list1
Definition oct-parse.cc:406
@ YYSYMBOL_arguments_block_list
Definition oct-parse.cc:370
@ YYSYMBOL_CLEANUP
Definition oct-parse.cc:272
@ YYSYMBOL_OTHERWISE
Definition oct-parse.cc:267
@ YYSYMBOL_PERSISTENT
Definition oct-parse.cc:276
@ YYSYMBOL_EDIV_EQ
Definition oct-parse.cc:224
@ YYSYMBOL_EXPR_OR
Definition oct-parse.cc:232
@ YYSYMBOL_STRUCT_ELT
Definition oct-parse.cc:251
@ YYSYMBOL_RETURN
Definition oct-parse.cc:270
@ YYSYMBOL_fcn_name
Definition oct-parse.cc:366
@ YYSYMBOL_except_command
Definition oct-parse.cc:350
@ YYSYMBOL_superclass
Definition oct-parse.cc:387
@ YYSYMBOL_DIV_EQ
Definition oct-parse.cc:220
@ YYSYMBOL_16_
Definition oct-parse.cc:211
@ YYSYMBOL_fcn_list1
Definition oct-parse.cc:304
@ YYSYMBOL_NAME
Definition oct-parse.cc:252
@ YYSYMBOL_5_
Definition oct-parse.cc:200
@ YYSYMBOL_ADD_EQ
Definition oct-parse.cc:217
@ YYSYMBOL_ELEFTDIV
Definition oct-parse.cc:242
@ YYSYMBOL_PLUS_PLUS
Definition oct-parse.cc:245
@ YYSYMBOL_FOR
Definition oct-parse.cc:256
@ YYSYMBOL_arg_validation
Definition oct-parse.cc:376
@ YYSYMBOL_enum_list1
Definition oct-parse.cc:411
@ YYSYMBOL_validation_fcns
Definition oct-parse.cc:379
@ YYSYMBOL_FQ_IDENT
Definition oct-parse.cc:285
@ YYSYMBOL_if_command
Definition oct-parse.cc:337
@ YYSYMBOL_param_list1
Definition oct-parse.cc:356
@ YYSYMBOL_command
Definition oct-parse.cc:332
@ YYSYMBOL_elseif_clause
Definition oct-parse.cc:340
@ YYSYMBOL_METHODS
Definition oct-parse.cc:280
@ YYSYMBOL_stmt_begin
Definition oct-parse.cc:413
@ YYSYMBOL_EVENTS
Definition oct-parse.cc:281
@ YYSYMBOL_anon_fcn_handle
Definition oct-parse.cc:319
octave_value load_fcn_from_file(const std::string &file_name, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, const std::string &fcn_name, bool autoload)
#define YY_ASSERT(E)
Definition oct-parse.cc:615
#define yyerrstatus
#define YY_(Msgid)
Definition oct-parse.cc:549
#define YYNOMEM
#define yypstate
Definition oct-parse.cc:75
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition oct-parse.cc:596
#define YYNSTATES
Definition oct-parse.cc:732
#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:611
#define yypstate_clear
Definition oct-parse.cc:73
#define yypstate_new
Definition oct-parse.cc:72
short yytype_int16
Definition oct-parse.cc:460
octave_value parse_fcn_file(interpreter &interp, const std::string &full_file, const std::string &file, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, bool require_file, bool force_script, bool autoload, bool relative_lookup)
#define YYABORT
#define YYSTACK_BYTES(N)
Definition oct-parse.cc:676
int octave_pull_parse(octave_pstate *yyps, octave::base_parser &parser)
yytype_int16 yy_state_t
Definition oct-parse.cc:536
int octave_push_parse(octave_pstate *yyps, int yypushed_char, OCTAVE_STYPE const *yypushed_val, octave::base_parser &parser)
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
Definition oct-parse.cc:174
#define yylex
Definition oct-parse.cc:76
#define YYMALLOC
Definition oct-parse.cc:646
#define YY_NULLPTR
Definition oct-parse.cc:186
#define YYFINAL
Definition oct-parse.cc:721
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition oct-parse.cc:824
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
#define YY_INITIAL_VALUE(Value)
Definition oct-parse.cc:592
#define yyparse
Definition oct-parse.cc:69
#define YYNTOKENS
Definition oct-parse.cc:726
unsigned char yytype_uint8
Definition oct-parse.cc:481
#define YY_STACK_PRINT(Bottom, Top)
#define YYSIZE_T
Definition oct-parse.cc:522
#define yydebug
Definition oct-parse.cc:78
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition oct-parse.cc:610
#define yyssa
std::string get_help_from_file(const std::string &nm, bool &symbol_found, std::string &full_file)
#define YYPTRDIFF_T
Definition oct-parse.cc:508
#define yynerrs
Definition oct-parse.cc:79
octave_value_list Feval(octave::interpreter &interp, const octave_value_list &args, int nargout)
#define yyvsp
#define scanner
Definition oct-parse.cc:147
#define YYACCEPT
#define yytable_value_is_error(Yyn)
Definition oct-parse.cc:895
#define YYTRANSLATE(YYX)
Definition oct-parse.cc:740
#define yyssp
@ YYENOMEM
void * malloc(unsigned)
#define yystacksize
#define YY_ATTRIBUTE_UNUSED
Definition oct-parse.cc:566
#define yyvs
#define yystate
#define YYFREE
Definition oct-parse.cc:652
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition oct-parse.cc:539
unsigned short yytype_uint16
Definition oct-parse.cc:492
int octave_lex(OCTAVE_STYPE *, void *)
The main scanner function which does all the work.
Definition lex.cc:1621
#define YYLAST
Definition oct-parse.cc:723
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition oct-parse.cc:687
#define yypact_value_is_default(Yyn)
Definition oct-parse.cc:890
#define YYINITDEPTH
#define yypush_parse
Definition oct-parse.cc:70
signed char yytype_int8
Definition oct-parse.cc:452
void free(void *)
void source_file(const std::string &file_name, const std::string &context, bool verbose, bool require_file)
#define YYERROR
#define YYSIZEOF(X)
Definition oct-parse.cc:532
#define YYSTACK_ALLOC
Definition oct-parse.cc:632
#define yyvsa
#define YYDPRINTF(Args)
#define YY_USE(E)
Definition oct-parse.cc:572
#define yyerror
Definition oct-parse.cc:77
@ LEFTDIV
Definition oct-parse.h:87
@ EDIV
Definition oct-parse.h:89
@ PLUS_PLUS
Definition oct-parse.h:93
@ OCTAVE_EOF
Definition oct-parse.h:62
@ DIV_EQ
Definition oct-parse.h:68
@ NUMBER
Definition oct-parse.h:97
@ ELEFTDIV
Definition oct-parse.h:90
@ EXPR_LT
Definition oct-parse.h:81
@ DQ_STRING
Definition oct-parse.h:102
@ MINUS_MINUS
Definition oct-parse.h:94
@ POW
Definition oct-parse.h:95
@ TRANSPOSE
Definition oct-parse.h:92
@ OR_EQ
Definition oct-parse.h:76
@ EXPR_AND_AND
Definition oct-parse.h:77
@ EXPR_NE
Definition oct-parse.h:84
@ EXPR_OR_OR
Definition oct-parse.h:78
@ EPOW_EQ
Definition oct-parse.h:74
@ OCTAVE_error
Definition oct-parse.h:63
@ EPOW
Definition oct-parse.h:96
@ SQ_STRING
Definition oct-parse.h:103
@ MUL_EQ
Definition oct-parse.h:67
@ AND_EQ
Definition oct-parse.h:75
@ EMUL_EQ
Definition oct-parse.h:71
@ CONSTANT
Definition oct-parse.h:98
@ POW_EQ
Definition oct-parse.h:70
@ OCTAVE_UNDEF
Definition oct-parse.h:64
@ ADD_EQ
Definition oct-parse.h:65
@ SUB_EQ
Definition oct-parse.h:66
@ PERSISTENT
Definition oct-parse.h:124
@ EXPR_LE
Definition oct-parse.h:82
@ PARFOR
Definition oct-parse.h:105
@ EXPR_GE
Definition oct-parse.h:85
@ OCTAVE_EMPTY
Definition oct-parse.h:61
@ EXPR_OR
Definition oct-parse.h:80
@ EMUL
Definition oct-parse.h:88
@ LEFTDIV_EQ
Definition oct-parse.h:69
@ HERMITIAN
Definition oct-parse.h:91
@ EDIV_EQ
Definition oct-parse.h:72
@ ELEFTDIV_EQ
Definition oct-parse.h:73
@ EXPR_GT
Definition oct-parse.h:86
@ EXPR_EQ
Definition oct-parse.h:83
@ GLOBAL
Definition oct-parse.h:123
@ EXPR_AND
Definition oct-parse.h:79
#define YYSTYPE
#define yylval
#define yyalloc
#define yyss
yysymbol_kind_t
#define yyerrstatus
#define yypstate
#define yypstate_delete
#define yypstate_new
short yytype_int16
unsigned char yytype_uint8
#define yyssa
#define YYPTRDIFF_T
#define yynerrs
#define yyvsp
#define yyssp
#define yystacksize
#define yyvs
#define yystate
#define YYINITDEPTH
signed char yytype_int8
yytype_int8 yy_state_t
#define yyvsa
@ YYPUSH_MORE
#define octave_stdout
Definition pager.h:301
int octave_debug
tree_binary_expression * maybe_compound_binary_expression(tree_expression *a, const token &op_tok, tree_expression *b, octave_value::binary_op t)
Definition pt-cbinop.cc:143
std::string undo_string_escapes(const std::string &s)
Definition utils.cc:1065
std::string fcn_file_in_path(const std::string &name)
Definition utils.cc:749
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)
Definition variables.cc:583
F77_RET_T len
Definition xerbla.cc:61