| 1 |
/* A Bison parser, made by GNU Bison 2.0. */ |
| 2 |
|
| 3 |
/* Skeleton parser for Yacc-like parsing with Bison, |
| 4 |
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
| 5 |
|
| 6 |
This program is free software; you can redistribute it and/or modify |
| 7 |
it under the terms of the GNU General Public License as published by |
| 8 |
the Free Software Foundation; either version 2, or (at your option) |
| 9 |
any later version. |
| 10 |
|
| 11 |
This program is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
GNU General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU General Public License |
| 17 |
along with this program; if not, write to the Free Software |
| 18 |
Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 |
Boston, MA 02111-1307, USA. */ |
| 20 |
|
| 21 |
/* As a special exception, when this file is copied by Bison into a |
| 22 |
Bison output file, you may use that output file without restriction. |
| 23 |
This special exception was added by the Free Software Foundation |
| 24 |
in version 1.24 of Bison. */ |
| 25 |
|
| 26 |
/* Written by Richard Stallman by simplifying the original so called |
| 27 |
``semantic'' parser. */ |
| 28 |
|
| 29 |
/* All symbols defined below should begin with zz_ or ZZ_, to avoid |
| 30 |
infringing on user name space. This should be done even for local |
| 31 |
variables, as they might otherwise be expanded by user macros. |
| 32 |
There are some unavoidable exceptions within include files to |
| 33 |
define necessary library symbols; they are noted "INFRINGES ON |
| 34 |
USER NAME SPACE" below. */ |
| 35 |
|
| 36 |
/* Identify Bison output. */ |
| 37 |
#define ZZ_BISON 1 |
| 38 |
|
| 39 |
/* Skeleton name. */ |
| 40 |
#define ZZ_SKELETON_NAME "yacc.c" |
| 41 |
|
| 42 |
/* Pure parsers. */ |
| 43 |
#define ZZ_PURE 0 |
| 44 |
|
| 45 |
/* Using locations. */ |
| 46 |
#define ZZ_LSP_NEEDED 0 |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
/* Tokens. */ |
| 51 |
#ifndef ZZ_TOKENTYPE |
| 52 |
# define ZZ_TOKENTYPE |
| 53 |
/* Put the tokens into the symbol table, so that GDB and other debuggers |
| 54 |
know about them. */ |
| 55 |
enum zz_tokentype { |
| 56 |
ADD_T = 258, |
| 57 |
ALIASES_T = 259, |
| 58 |
AND_T = 260, |
| 59 |
ANY_T = 261, |
| 60 |
AREALIKE_T = 262, |
| 61 |
ARETHESAME_T = 263, |
| 62 |
ARRAY_T = 264, |
| 63 |
ASSERT_T = 265, |
| 64 |
ATOM_T = 266, |
| 65 |
BEQ_T = 267, |
| 66 |
BNE_T = 268, |
| 67 |
BREAK_T = 269, |
| 68 |
CALL_T = 270, |
| 69 |
CARD_T = 271, |
| 70 |
CASE_T = 272, |
| 71 |
CHOICE_T = 273, |
| 72 |
CHECK_T = 274, |
| 73 |
CONDITIONAL_T = 275, |
| 74 |
CONSTANT_T = 276, |
| 75 |
CONTINUE_T = 277, |
| 76 |
CREATE_T = 278, |
| 77 |
DATA_T = 279, |
| 78 |
DECREASING_T = 280, |
| 79 |
DEFAULT_T = 281, |
| 80 |
DEFINITION_T = 282, |
| 81 |
DIMENSION_T = 283, |
| 82 |
DIMENSIONLESS_T = 284, |
| 83 |
DO_T = 285, |
| 84 |
ELSE_T = 286, |
| 85 |
END_T = 287, |
| 86 |
EXPECT_T = 288, |
| 87 |
EXTERNAL_T = 289, |
| 88 |
FALSE_T = 290, |
| 89 |
FALLTHRU_T = 291, |
| 90 |
FIX_T = 292, |
| 91 |
FOR_T = 293, |
| 92 |
FREE_T = 294, |
| 93 |
FROM_T = 295, |
| 94 |
GLOBAL_T = 296, |
| 95 |
IF_T = 297, |
| 96 |
IMPORT_T = 298, |
| 97 |
IN_T = 299, |
| 98 |
INPUT_T = 300, |
| 99 |
INCREASING_T = 301, |
| 100 |
INTERACTIVE_T = 302, |
| 101 |
INTERSECTION_T = 303, |
| 102 |
ISA_T = 304, |
| 103 |
_IS_T = 305, |
| 104 |
ISREFINEDTO_T = 306, |
| 105 |
MAXIMIZE_T = 307, |
| 106 |
MAXINTEGER_T = 308, |
| 107 |
MAXREAL_T = 309, |
| 108 |
METHODS_T = 310, |
| 109 |
METHOD_T = 311, |
| 110 |
MINIMIZE_T = 312, |
| 111 |
MODEL_T = 313, |
| 112 |
NOT_T = 314, |
| 113 |
NOTES_T = 315, |
| 114 |
OF_T = 316, |
| 115 |
OR_T = 317, |
| 116 |
OTHERWISE_T = 318, |
| 117 |
OUTPUT_T = 319, |
| 118 |
PATCH_T = 320, |
| 119 |
PROD_T = 321, |
| 120 |
PROVIDE_T = 322, |
| 121 |
REFINES_T = 323, |
| 122 |
REPLACE_T = 324, |
| 123 |
REQUIRE_T = 325, |
| 124 |
RETURN_T = 326, |
| 125 |
RUN_T = 327, |
| 126 |
SATISFIED_T = 328, |
| 127 |
SELECT_T = 329, |
| 128 |
SIZE_T = 330, |
| 129 |
STOP_T = 331, |
| 130 |
SUCHTHAT_T = 332, |
| 131 |
SUM_T = 333, |
| 132 |
SWITCH_T = 334, |
| 133 |
THEN_T = 335, |
| 134 |
TRUE_T = 336, |
| 135 |
UNION_T = 337, |
| 136 |
UNITS_T = 338, |
| 137 |
UNIVERSAL_T = 339, |
| 138 |
WHEN_T = 340, |
| 139 |
WHERE_T = 341, |
| 140 |
WHILE_T = 342, |
| 141 |
WILLBE_T = 343, |
| 142 |
WILLBETHESAME_T = 344, |
| 143 |
WILLNOTBETHESAME_T = 345, |
| 144 |
ASSIGN_T = 346, |
| 145 |
CASSIGN_T = 347, |
| 146 |
DBLCOLON_T = 348, |
| 147 |
USE_T = 349, |
| 148 |
LEQ_T = 350, |
| 149 |
GEQ_T = 351, |
| 150 |
NEQ_T = 352, |
| 151 |
DOTDOT_T = 353, |
| 152 |
WITH_T = 354, |
| 153 |
VALUE_T = 355, |
| 154 |
WITH_VALUE_T = 356, |
| 155 |
REAL_T = 357, |
| 156 |
INTEGER_T = 358, |
| 157 |
IDENTIFIER_T = 359, |
| 158 |
BRACEDTEXT_T = 360, |
| 159 |
SYMBOL_T = 361, |
| 160 |
DQUOTE_T = 362, |
| 161 |
UPLUS_T = 363, |
| 162 |
UMINUS_T = 364 |
| 163 |
}; |
| 164 |
#endif |
| 165 |
#define ADD_T 258 |
| 166 |
#define ALIASES_T 259 |
| 167 |
#define AND_T 260 |
| 168 |
#define ANY_T 261 |
| 169 |
#define AREALIKE_T 262 |
| 170 |
#define ARETHESAME_T 263 |
| 171 |
#define ARRAY_T 264 |
| 172 |
#define ASSERT_T 265 |
| 173 |
#define ATOM_T 266 |
| 174 |
#define BEQ_T 267 |
| 175 |
#define BNE_T 268 |
| 176 |
#define BREAK_T 269 |
| 177 |
#define CALL_T 270 |
| 178 |
#define CARD_T 271 |
| 179 |
#define CASE_T 272 |
| 180 |
#define CHOICE_T 273 |
| 181 |
#define CHECK_T 274 |
| 182 |
#define CONDITIONAL_T 275 |
| 183 |
#define CONSTANT_T 276 |
| 184 |
#define CONTINUE_T 277 |
| 185 |
#define CREATE_T 278 |
| 186 |
#define DATA_T 279 |
| 187 |
#define DECREASING_T 280 |
| 188 |
#define DEFAULT_T 281 |
| 189 |
#define DEFINITION_T 282 |
| 190 |
#define DIMENSION_T 283 |
| 191 |
#define DIMENSIONLESS_T 284 |
| 192 |
#define DO_T 285 |
| 193 |
#define ELSE_T 286 |
| 194 |
#define END_T 287 |
| 195 |
#define EXPECT_T 288 |
| 196 |
#define EXTERNAL_T 289 |
| 197 |
#define FALSE_T 290 |
| 198 |
#define FALLTHRU_T 291 |
| 199 |
#define FIX_T 292 |
| 200 |
#define FOR_T 293 |
| 201 |
#define FREE_T 294 |
| 202 |
#define FROM_T 295 |
| 203 |
#define GLOBAL_T 296 |
| 204 |
#define IF_T 297 |
| 205 |
#define IMPORT_T 298 |
| 206 |
#define IN_T 299 |
| 207 |
#define INPUT_T 300 |
| 208 |
#define INCREASING_T 301 |
| 209 |
#define INTERACTIVE_T 302 |
| 210 |
#define INTERSECTION_T 303 |
| 211 |
#define ISA_T 304 |
| 212 |
#define _IS_T 305 |
| 213 |
#define ISREFINEDTO_T 306 |
| 214 |
#define MAXIMIZE_T 307 |
| 215 |
#define MAXINTEGER_T 308 |
| 216 |
#define MAXREAL_T 309 |
| 217 |
#define METHODS_T 310 |
| 218 |
#define METHOD_T 311 |
| 219 |
#define MINIMIZE_T 312 |
| 220 |
#define MODEL_T 313 |
| 221 |
#define NOT_T 314 |
| 222 |
#define NOTES_T 315 |
| 223 |
#define OF_T 316 |
| 224 |
#define OR_T 317 |
| 225 |
#define OTHERWISE_T 318 |
| 226 |
#define OUTPUT_T 319 |
| 227 |
#define PATCH_T 320 |
| 228 |
#define PROD_T 321 |
| 229 |
#define PROVIDE_T 322 |
| 230 |
#define REFINES_T 323 |
| 231 |
#define REPLACE_T 324 |
| 232 |
#define REQUIRE_T 325 |
| 233 |
#define RETURN_T 326 |
| 234 |
#define RUN_T 327 |
| 235 |
#define SATISFIED_T 328 |
| 236 |
#define SELECT_T 329 |
| 237 |
#define SIZE_T 330 |
| 238 |
#define STOP_T 331 |
| 239 |
#define SUCHTHAT_T 332 |
| 240 |
#define SUM_T 333 |
| 241 |
#define SWITCH_T 334 |
| 242 |
#define THEN_T 335 |
| 243 |
#define TRUE_T 336 |
| 244 |
#define UNION_T 337 |
| 245 |
#define UNITS_T 338 |
| 246 |
#define UNIVERSAL_T 339 |
| 247 |
#define WHEN_T 340 |
| 248 |
#define WHERE_T 341 |
| 249 |
#define WHILE_T 342 |
| 250 |
#define WILLBE_T 343 |
| 251 |
#define WILLBETHESAME_T 344 |
| 252 |
#define WILLNOTBETHESAME_T 345 |
| 253 |
#define ASSIGN_T 346 |
| 254 |
#define CASSIGN_T 347 |
| 255 |
#define DBLCOLON_T 348 |
| 256 |
#define USE_T 349 |
| 257 |
#define LEQ_T 350 |
| 258 |
#define GEQ_T 351 |
| 259 |
#define NEQ_T 352 |
| 260 |
#define DOTDOT_T 353 |
| 261 |
#define WITH_T 354 |
| 262 |
#define VALUE_T 355 |
| 263 |
#define WITH_VALUE_T 356 |
| 264 |
#define REAL_T 357 |
| 265 |
#define INTEGER_T 358 |
| 266 |
#define IDENTIFIER_T 359 |
| 267 |
#define BRACEDTEXT_T 360 |
| 268 |
#define SYMBOL_T 361 |
| 269 |
#define DQUOTE_T 362 |
| 270 |
#define UPLUS_T 363 |
| 271 |
#define UMINUS_T 364 |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
/* Copy the first part of user declarations. */ |
| 277 |
#line 1 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 278 |
|
| 279 |
/* |
| 280 |
* Ascend Grammar file |
| 281 |
* by Tom Epperly |
| 282 |
* Version: $Revision: 1.23 $ |
| 283 |
* Version control file: $RCSfile: ascParse.y,v $ |
| 284 |
* Date last modified: $Date: 2000/01/25 02:25:59 $ |
| 285 |
* Last modified by: $Author: ballan $ |
| 286 |
* |
| 287 |
* This file is part of the Ascend Language Interpreter. |
| 288 |
* |
| 289 |
* Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly |
| 290 |
* Copyright (C) 1997 Benjamin Andrew Allan & Vicente Rico-Ramirez |
| 291 |
* Copyright (C) 1998 Carnegie Mellon University |
| 292 |
* |
| 293 |
* The Ascend Language Interpreter is free software; you can redistribute |
| 294 |
* it and/or modify it under the terms of the GNU General Public License as |
| 295 |
* published by the Free Software Foundation; either version 2 of the |
| 296 |
* License, or (at your option) any later version. |
| 297 |
* |
| 298 |
* The Ascend Language Interpreter is distributed in hope that it will be |
| 299 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 300 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 301 |
* General Public License for more details. |
| 302 |
* |
| 303 |
* You should have received a copy of the GNU General Public License |
| 304 |
* along with the program; if not, write to the Free Software Foundation, |
| 305 |
* Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named |
| 306 |
* COPYING. |
| 307 |
* |
| 308 |
*/ |
| 309 |
#include <stdio.h> |
| 310 |
#include <stdarg.h> |
| 311 |
#include <limits.h> /* need DBL_MAX and LONG_MAX */ |
| 312 |
#include <float.h> /* on a NeXT they are in here */ |
| 313 |
|
| 314 |
#include "utilities/ascConfig.h" |
| 315 |
#include "utilities/ascMalloc.h" |
| 316 |
#include "general/list.h" |
| 317 |
#include "general/dstring.h" |
| 318 |
#include "compiler/compiler.h" |
| 319 |
#include "compiler/scanner.h" |
| 320 |
#include "compiler/symtab.h" /* the global string/symbol table */ |
| 321 |
#include "compiler/notate.h" /* notes database wrapper */ |
| 322 |
#include "compiler/braced.h" |
| 323 |
#include "compiler/fractions.h" |
| 324 |
#include "compiler/dimen.h" |
| 325 |
#include "compiler/functype.h" |
| 326 |
#include "compiler/func.h" |
| 327 |
#include "compiler/types.h" |
| 328 |
#include "compiler/name.h" |
| 329 |
#include "compiler/nameio.h" |
| 330 |
#include "compiler/instance_enum.h" |
| 331 |
#include "compiler/extfunc.h" |
| 332 |
#include "compiler/packages.h" |
| 333 |
#include "compiler/sets.h" |
| 334 |
#include "compiler/exprs.h" |
| 335 |
#include "compiler/exprio.h" |
| 336 |
#include "compiler/vlist.h" |
| 337 |
#include "compiler/vlistio.h" /* for debugging only */ |
| 338 |
#include "compiler/stattypes.h" |
| 339 |
#include "compiler/slist.h" |
| 340 |
#include "compiler/statement.h" |
| 341 |
#include "compiler/statio.h" |
| 342 |
#include "compiler/units.h" |
| 343 |
#include "compiler/when.h" |
| 344 |
#include "compiler/select.h" |
| 345 |
#include "compiler/switch.h" |
| 346 |
#include "compiler/proc.h" |
| 347 |
#include "compiler/watchpt.h" |
| 348 |
#include "compiler/module.h" |
| 349 |
#include "compiler/child.h" |
| 350 |
#include "compiler/type_desc.h" |
| 351 |
#include "compiler/type_descio.h" |
| 352 |
#include "compiler/typedef.h" |
| 353 |
#include "compiler/library.h" |
| 354 |
#include "compiler/syntax.h" |
| 355 |
#include "compiler/lexer.h" |
| 356 |
/* 1 ==> expr can find missing , w/o shift/reduce conflicts */ |
| 357 |
#define COMMAEXPR_NOTBUGGY 0 |
| 358 |
#if COMMAEXPR_NOTBUGGY |
| 359 |
#include "compiler/exprio.h" |
| 360 |
#endif /* for CommaExpr if working. */ |
| 361 |
|
| 362 |
#ifndef lint |
| 363 |
static CONST char ParserID[] = "$Id: ascParse.y,v 1.23 2000/01/25 02:25:59 ballan Exp $"; |
| 364 |
#endif |
| 365 |
|
| 366 |
int g_compiler_warnings = 1; /* level of whine to allow */ |
| 367 |
|
| 368 |
#include "compiler/redirectFile.h" |
| 369 |
#ifndef ASCERR |
| 370 |
#define ASCERR g_ascend_errors |
| 371 |
#define ASCWAR g_ascend_warnings |
| 372 |
#define ASCINF g_ascend_information |
| 373 |
#endif |
| 374 |
|
| 375 |
extern int zz_error(char *); |
| 376 |
/* provided at the end of this file. |
| 377 |
* it increments g_untrapped_error, the global defined below |
| 378 |
*/ |
| 379 |
|
| 380 |
static unsigned long g_header_linenum = 0; |
| 381 |
static unsigned int g_untrapped_error = 0; |
| 382 |
/* if g_untrapped_error is set to 1, the current definition |
| 383 |
* should be abandoned even if nothing else detectable by |
| 384 |
* typedef.c exists. basically any syntax error should cause a type |
| 385 |
* to be abandoned, but not all cause the parser to barf. |
| 386 |
*/ |
| 387 |
|
| 388 |
/* the last seen method name while processing a method */ |
| 389 |
static symchar *g_proc_name=NULL; |
| 390 |
|
| 391 |
/* the last seen ATOM/MODEL/constant type and refinement base */ |
| 392 |
static symchar *g_type_name=NULL; |
| 393 |
static symchar *g_refines_name=NULL; |
| 394 |
/*********************************************************************\ |
| 395 |
* g_type_name is used by the scanner when closing a module to check if |
| 396 |
* the parser is in the middle of parsing a MODEL or ATOM type |
| 397 |
* definition. |
| 398 |
* g_type_name == NULL implies that the parser is in between |
| 399 |
* definitions. This depends on proper |
| 400 |
* resets to NULL at END of type productions. |
| 401 |
* g_type_name != NULL implies that the parser is in the middle |
| 402 |
* of a type definition and gives the name |
| 403 |
* of that type. |
| 404 |
\*********************************************************************/ |
| 405 |
|
| 406 |
static symchar *g_end_identifier = NULL; |
| 407 |
/* This variable gets reset every time we see an ``END_T''. If the |
| 408 |
* token after END_T is missing (i.e., ``END;'') or if it is recognized |
| 409 |
* (e.g., FOR_T), set this variable to NULL. When we see an |
| 410 |
* ``END_T IDENTIFIER_T'', set this variable to the pointer into the |
| 411 |
* symbol table returned by the scanner. |
| 412 |
*/ |
| 413 |
|
| 414 |
static struct StatementList *g_model_parameters=NULL; |
| 415 |
/* this is the statementlist of the parameterized type |
| 416 |
*/ |
| 417 |
|
| 418 |
static struct StatementList *g_parameter_wheres=NULL; |
| 419 |
/* this is the where list of a parameterized type. restrictions on args |
| 420 |
*/ |
| 421 |
|
| 422 |
static struct StatementList *g_parameter_reduction=NULL; |
| 423 |
/* this is the statementlist of the REFINES clause |
| 424 |
* at present both might be null, which is bad. |
| 425 |
*/ |
| 426 |
|
| 427 |
static struct Set *g_typeargs=NULL; |
| 428 |
/* optional args to a typename in part declaration. |
| 429 |
* it is set in the production type_identifier. in |
| 430 |
* contexts where args are not allowed, use IDENTIFIER_T instead of the |
| 431 |
* type_identifier production. |
| 432 |
*/ |
| 433 |
|
| 434 |
static struct Set *g_callargs=NULL; |
| 435 |
/* optional args to a user defined method. |
| 436 |
* it is set in the production call_identifier. in |
| 437 |
* contexts where args are not allowed, use IDENTIFIER_T instead of the |
| 438 |
* type_identifier production. |
| 439 |
*/ |
| 440 |
|
| 441 |
static struct gl_list_t *g_notelist = NULL; |
| 442 |
/* |
| 443 |
* Notes accumulator until a type commits or destroys it. |
| 444 |
*/ |
| 445 |
|
| 446 |
static int g_defaulted; /* used for atoms,constants */ |
| 447 |
|
| 448 |
static CONST dim_type *g_dim_ptr; /* dim of last units parsed, or so */ |
| 449 |
static CONST dim_type *g_atom_dim_ptr; /* dim of DIMENSION decl */ |
| 450 |
static CONST dim_type *g_default_dim_ptr; /* dim of default value parsed */ |
| 451 |
|
| 452 |
static double g_default_double; |
| 453 |
static long g_default_long; |
| 454 |
symchar *g_default_symbol; |
| 455 |
#define DOUBLECONSTANT 0 |
| 456 |
#define LONGCONSTANT 1 |
| 457 |
#define BOOLEANCONSTANT 2 |
| 458 |
#define SYMBOLCONSTANT 3 |
| 459 |
static int g_constant_type = DOUBLECONSTANT; |
| 460 |
static CONST struct Units *g_units_ptr; |
| 461 |
|
| 462 |
int g_parse_relns = 1; |
| 463 |
/* Should we parse relations? |
| 464 |
* 0 indicates don't parse relations |
| 465 |
* 1 indicates process them |
| 466 |
*/ |
| 467 |
|
| 468 |
/* Forward declaration of error message reporting |
| 469 |
* functions provided at the end of this file. |
| 470 |
*/ |
| 471 |
static void ErrMsg_Generic(CONST char *); |
| 472 |
static void ErrMsg_CommaName(CONST char *, struct Name *); |
| 473 |
#if COMMAEXPR_NOTBUGGY |
| 474 |
static void ErrMsg_CommaExpr(CONST char *, struct Expr *); |
| 475 |
#endif /* COMMAEXPR_NOTBUGGY */ |
| 476 |
static void ErrMsg_NullDefPointer(CONST char *); |
| 477 |
static void ErrMsg_ProcTypeMissing(CONST char *, CONST char *); |
| 478 |
static void ErrMsg_ProcsRejected(CONST char *, CONST char *); |
| 479 |
static void ErrMsg_DuplicateProc(struct InitProcedure *); |
| 480 |
static void ErrMsg_ParensBrackets(CONST char *); |
| 481 |
static void WarnMsg_MismatchEnd(CONST char *, CONST char *, |
| 482 |
unsigned long, CONST char *); |
| 483 |
static CONST char *TokenAsString(unsigned long); |
| 484 |
|
| 485 |
static void error_reporter_current_line(const error_severity_t sev, const char *fmt,...); |
| 486 |
|
| 487 |
/** @page ascend-notes About 'NOTES' in ASCEND |
| 488 |
* |
| 489 |
* The parser will now parse a NOTES block as well as in-lined NOTES. As |
| 490 |
* a matter of fact, the parser would probably parse FORTRAN now since it |
| 491 |
* is very lenient. For the in-lined NOTES, I accept any "doubly-quoted" |
| 492 |
* string after an `fname'. I am currently dropping the NOTE on the |
| 493 |
* floor. Ideally, we should only accept an inline NOTE when we are |
| 494 |
* creating a new thing, like in an IS_A statement or a labeled relation. |
| 495 |
* That means either adding the optional_note to fname and whining at the |
| 496 |
* user when he/she uses the in-lined notes incorrectly, or coming up |
| 497 |
* with a fvarnotelist and fnamenote that accepts fnames and |
| 498 |
* optional_notes in a list or a stand-alone form. |
| 499 |
* |
| 500 |
* For the block NOTES statement, the symtax is |
| 501 |
* |
| 502 |
* NOTES ( SYMBOL_T ( fvarlist BRACEDTEXT_T )+ )+ END NOTES ';' |
| 503 |
* |
| 504 |
* Here I am using () as part of the meta-language to describe the syntax |
| 505 |
* to you, they are not part of the formal grammer. An example is |
| 506 |
* |
| 507 |
* NOTES |
| 508 |
* 'text' a,b,c { Here is some text } |
| 509 |
* d { Here is more text } |
| 510 |
* 'html' SELF { <bold>html sucks</bold> } |
| 511 |
* END NOTES; |
| 512 |
* |
| 513 |
* Note that the only punctuation is the `,' between the members of the |
| 514 |
* fvarlist and the closing `;'. Right now, the term `SELF' would be |
| 515 |
* eaten in the fvarlist production. I'm not sure if this is what we |
| 516 |
* should do (which requires having the notes processing do something |
| 517 |
* special when it sees SELF in the fvarlist), or if we should create |
| 518 |
* a SELF_T token. The latter is certainly easier to implement from |
| 519 |
* the parser's perspective, which is why I did it that way. |
| 520 |
* |
| 521 |
* The block NOTES statement doesn't do anything with its stuff either, |
| 522 |
* the symbols and {bracedText} get dropped on the floor and I destroy |
| 523 |
* the fvarlist, but that all that happens. |
| 524 |
* |
| 525 |
* The `notes_body' and `noteslist' productions return `notes_ptr', which |
| 526 |
* right now is a `void*' until we can decide what type of data structure |
| 527 |
* we want to handle NOTES. |
| 528 |
* |
| 529 |
* As an amusing side note, the parser will currently eat the following: |
| 530 |
* |
| 531 |
* NOTES |
| 532 |
* 'fun' name "put some text here" {put more text here} |
| 533 |
* END NOTES; |
| 534 |
* |
| 535 |
* Like I said, this is so the parser will eat them; it's not being real |
| 536 |
* smart about what it does with them. |
| 537 |
* |
| 538 |
* For debugging the NOTES stuff, set the DEBUG_NOTES macro to the |
| 539 |
* following: |
| 540 |
* |
| 541 |
* #define DEBUG_NOTES(s) FPRINTF(stderr,"****DISCARDED NOTES:\n%s****\n",(s)) |
| 542 |
* |
| 543 |
* To completely ignore the NOTES, set DEBUG_NOTES to the following: |
| 544 |
* |
| 545 |
* #define DEBUG_NOTES(s) 0 |
| 546 |
* |
| 547 |
* Note that if you do the latter, you'll get `statement with no effect' |
| 548 |
* warnings from gcc -Wall. |
| 549 |
* |
| 550 |
* -- Mark Thomas Thursday, 13 March 1997 |
| 551 |
*/ |
| 552 |
#define DEBUG_NOTES(s) 0 |
| 553 |
|
| 554 |
/* |
| 555 |
* Because the ascend types and notes are not tightly bound to each other, |
| 556 |
* what with notes being stored in a database, |
| 557 |
* We collect notes locally until the type associated with a batch of notes |
| 558 |
* is approved by typedef and other error checks. Then we process the |
| 559 |
* collected notes, commiting them to the database. |
| 560 |
* |
| 561 |
* NOTES made via ADD NOTES do not require a type check first and the |
| 562 |
* type may not even exist yet in the library. |
| 563 |
* |
| 564 |
* ProcessNotes(keep); Clear up collected list, commit them if keep != 0. |
| 565 |
* CollectNote(note); Add a note to the collected list. |
| 566 |
*/ |
| 567 |
static void ProcessNotes(int); |
| 568 |
static void CollectNote(struct Note *); |
| 569 |
|
| 570 |
/* For 'inline' notes, note on DQUOTE_T from scanner.l: |
| 571 |
* Remember that DQUOTE_T is a string value which is local to the |
| 572 |
* production that finds it. It must be copied if you want to |
| 573 |
* keep it. |
| 574 |
*/ |
| 575 |
|
| 576 |
|
| 577 |
/* Enabling traces. */ |
| 578 |
#ifndef ZZ_DEBUG |
| 579 |
# define ZZ_DEBUG 0 |
| 580 |
#endif |
| 581 |
|
| 582 |
/* Enabling verbose error messages. */ |
| 583 |
#ifdef ZZ_ERROR_VERBOSE |
| 584 |
# undef ZZ_ERROR_VERBOSE |
| 585 |
# define ZZ_ERROR_VERBOSE 1 |
| 586 |
#else |
| 587 |
# define ZZ_ERROR_VERBOSE 0 |
| 588 |
#endif |
| 589 |
|
| 590 |
#if ! defined (ZZ_STYPE) && ! defined (ZZ_STYPE_IS_DECLARED) |
| 591 |
#line 300 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 592 |
typedef union ZZ_STYPE { |
| 593 |
double real_value; |
| 594 |
long int_value; |
| 595 |
struct fraction frac_value; |
| 596 |
symchar *id_ptr; |
| 597 |
CONST char *braced_ptr; /* pointer for units, explanations, tables */ |
| 598 |
symchar *sym_ptr; /* pointer for symbols */ |
| 599 |
CONST char *dquote_ptr; /* for text in "double quotes" */ |
| 600 |
struct Name *nptr; |
| 601 |
struct Expr *eptr; |
| 602 |
struct Set *sptr; |
| 603 |
struct VariableList *lptr; |
| 604 |
struct Statement *statptr; |
| 605 |
struct StatementList *slptr; |
| 606 |
struct SelectList *septr; |
| 607 |
struct SwitchList *swptr; |
| 608 |
struct WhenList *wptr; |
| 609 |
struct NoteTmp *notesptr; /* change this once struct Notes is defined */ |
| 610 |
struct gl_list_t *listp; |
| 611 |
struct InitProcedure *procptr; |
| 612 |
CONST dim_type *dimp; |
| 613 |
struct TypeDescription *tptr; |
| 614 |
struct UnitDefinition *udefptr; |
| 615 |
dim_type dimen; |
| 616 |
enum ForOrder order; |
| 617 |
enum ForKind fkind; |
| 618 |
} ZZ_STYPE; |
| 619 |
/* Line 190 of yacc.c. */ |
| 620 |
#line 621 "y.tab.c" |
| 621 |
# define zz_stype ZZ_STYPE /* obsolescent; will be withdrawn */ |
| 622 |
# define ZZ_STYPE_IS_DECLARED 1 |
| 623 |
# define ZZ_STYPE_IS_TRIVIAL 1 |
| 624 |
#endif |
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
/* Copy the second part of user declarations. */ |
| 629 |
|
| 630 |
|
| 631 |
/* Line 213 of yacc.c. */ |
| 632 |
#line 633 "y.tab.c" |
| 633 |
|
| 634 |
#if ! defined (zz_overflow) || ZZ_ERROR_VERBOSE |
| 635 |
|
| 636 |
# ifndef ZZ_FREE |
| 637 |
# define ZZ_FREE free |
| 638 |
# endif |
| 639 |
# ifndef ZZ_MALLOC |
| 640 |
# define ZZ_MALLOC malloc |
| 641 |
# endif |
| 642 |
|
| 643 |
/* The parser invokes alloca or malloc; define the necessary symbols. */ |
| 644 |
|
| 645 |
# ifdef ZZ_STACK_USE_ALLOCA |
| 646 |
# if ZZ_STACK_USE_ALLOCA |
| 647 |
# ifdef __GNUC__ |
| 648 |
# define ZZ_STACK_ALLOC __builtin_alloca |
| 649 |
# else |
| 650 |
# define ZZ_STACK_ALLOC alloca |
| 651 |
# endif |
| 652 |
# endif |
| 653 |
# endif |
| 654 |
|
| 655 |
# ifdef ZZ_STACK_ALLOC |
| 656 |
/* Pacify GCC's `empty if-body' warning. */ |
| 657 |
# define ZZ_STACK_FREE(Ptr) do { /* empty */; } while (0) |
| 658 |
# else |
| 659 |
# if defined (__STDC__) || defined (__cplusplus) |
| 660 |
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
| 661 |
# define ZZ_SIZE_T size_t |
| 662 |
# endif |
| 663 |
# define ZZ_STACK_ALLOC ZZ_MALLOC |
| 664 |
# define ZZ_STACK_FREE ZZ_FREE |
| 665 |
# endif |
| 666 |
#endif /* ! defined (zz_overflow) || ZZ_ERROR_VERBOSE */ |
| 667 |
|
| 668 |
|
| 669 |
#if (! defined (zz_overflow) \ |
| 670 |
&& (! defined (__cplusplus) \ |
| 671 |
|| (defined (ZZ_STYPE_IS_TRIVIAL) && ZZ_STYPE_IS_TRIVIAL))) |
| 672 |
|
| 673 |
/* A type that is properly aligned for any stack member. */ |
| 674 |
union zz_alloc |
| 675 |
{ |
| 676 |
short int zz_ss; |
| 677 |
ZZ_STYPE zz_vs; |
| 678 |
}; |
| 679 |
|
| 680 |
/* The size of the maximum gap between one aligned stack and the next. */ |
| 681 |
# define ZZ_STACK_GAP_MAXIMUM (sizeof (union zz_alloc) - 1) |
| 682 |
|
| 683 |
/* The size of an array large to enough to hold all stacks, each with |
| 684 |
N elements. */ |
| 685 |
# define ZZ_STACK_BYTES(N) \ |
| 686 |
((N) * (sizeof (short int) + sizeof (ZZ_STYPE)) \ |
| 687 |
+ ZZ_STACK_GAP_MAXIMUM) |
| 688 |
|
| 689 |
/* Copy COUNT objects from FROM to TO. The source and destination do |
| 690 |
not overlap. */ |
| 691 |
# ifndef ZZ_COPY |
| 692 |
# if defined (__GNUC__) && 1 < __GNUC__ |
| 693 |
# define ZZ_COPY(To, From, Count) \ |
| 694 |
__builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
| 695 |
# else |
| 696 |
# define ZZ_COPY(To, From, Count) \ |
| 697 |
do \ |
| 698 |
{ \ |
| 699 |
register ZZ_SIZE_T zz_i; \ |
| 700 |
for (zz_i = 0; zz_i < (Count); zz_i++) \ |
| 701 |
(To)[zz_i] = (From)[zz_i]; \ |
| 702 |
} \ |
| 703 |
while (0) |
| 704 |
# endif |
| 705 |
# endif |
| 706 |
|
| 707 |
/* Relocate STACK from its old location to the new one. The |
| 708 |
local variables ZZ_SIZE and ZZ_STACKSIZE give the old and new number of |
| 709 |
elements in the stack, and ZZ_PTR gives the new location of the |
| 710 |
stack. Advance ZZ_PTR to a properly aligned location for the next |
| 711 |
stack. */ |
| 712 |
# define ZZ_STACK_RELOCATE(Stack) \ |
| 713 |
do \ |
| 714 |
{ \ |
| 715 |
ZZ_SIZE_T zz_newbytes; \ |
| 716 |
ZZ_COPY (&zz_ptr->Stack, Stack, zz_size); \ |
| 717 |
Stack = &zz_ptr->Stack; \ |
| 718 |
zz_newbytes = zz_stacksize * sizeof (*Stack) + ZZ_STACK_GAP_MAXIMUM; \ |
| 719 |
zz_ptr += zz_newbytes / sizeof (*zz_ptr); \ |
| 720 |
} \ |
| 721 |
while (0) |
| 722 |
|
| 723 |
#endif |
| 724 |
|
| 725 |
#if defined (__STDC__) || defined (__cplusplus) |
| 726 |
typedef signed char zz_signed_char; |
| 727 |
#else |
| 728 |
typedef short int zz_signed_char; |
| 729 |
#endif |
| 730 |
|
| 731 |
/* ZZ_FINAL -- State number of the termination state. */ |
| 732 |
#define ZZ_FINAL 2 |
| 733 |
/* ZZ_LAST -- Last index in ZZ_TABLE. */ |
| 734 |
#define ZZ_LAST 1180 |
| 735 |
|
| 736 |
/* ZZ_NTOKENS -- Number of terminals. */ |
| 737 |
#define ZZ_NTOKENS 127 |
| 738 |
/* ZZ_NNTS -- Number of nonterminals. */ |
| 739 |
#define ZZ_NNTS 116 |
| 740 |
/* ZZ_NRULES -- Number of rules. */ |
| 741 |
#define ZZ_NRULES 307 |
| 742 |
/* ZZ_NRULES -- Number of states. */ |
| 743 |
#define ZZ_NSTATES 615 |
| 744 |
|
| 745 |
/* ZZ_TRANSLATE(ZZ_LEX) -- Bison symbol number corresponding to ZZ_LEX. */ |
| 746 |
#define ZZ_UNDEFTOK 2 |
| 747 |
#define ZZ_MAXUTOK 364 |
| 748 |
|
| 749 |
#define ZZ_TRANSLATE(ZZ_X) \ |
| 750 |
((unsigned int) (ZZ_X) <= ZZ_MAXUTOK ? zz_translate[ZZ_X] : ZZ_UNDEFTOK) |
| 751 |
|
| 752 |
/* ZZ_TRANSLATE[ZZ_LEX] -- Bison symbol number corresponding to ZZ_LEX. */ |
| 753 |
static const unsigned char zz_translate[] = |
| 754 |
{ |
| 755 |
0, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 759 |
121, 122, 116, 113, 108, 114, 124, 115, 2, 2, |
| 760 |
2, 2, 2, 2, 2, 2, 2, 2, 123, 120, |
| 761 |
110, 111, 112, 2, 2, 2, 2, 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, 125, 2, 126, 119, 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, 109, 2, 2, 2, 2, 2, |
| 768 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 769 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 770 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 771 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 772 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 773 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 774 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 775 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 776 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 777 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 778 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 779 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 780 |
2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 781 |
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 782 |
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 783 |
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 784 |
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
| 785 |
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 786 |
55, 56, 57, 58, 59, 60, 61, 62, 63, 64, |
| 787 |
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
| 788 |
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, |
| 789 |
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, |
| 790 |
95, 96, 97, 98, 99, 100, 101, 102, 103, 104, |
| 791 |
105, 106, 107, 117, 118 |
| 792 |
}; |
| 793 |
|
| 794 |
#if ZZ_DEBUG |
| 795 |
/* ZZ_PRHS[ZZ_N] -- Index of the first RHS symbol of rule number ZZ_N in |
| 796 |
ZZ_RHS. */ |
| 797 |
static const unsigned short int zz_prhs[] = |
| 798 |
{ |
| 799 |
0, 0, 3, 4, 7, 9, 11, 13, 15, 17, |
| 800 |
19, 21, 23, 25, 27, 29, 31, 33, 35, 41, |
| 801 |
45, 49, 52, 56, 60, 63, 69, 73, 78, 85, |
| 802 |
90, 96, 103, 108, 114, 121, 128, 135, 138, 139, |
| 803 |
143, 146, 149, 152, 155, 164, 165, 169, 172, 175, |
| 804 |
178, 185, 190, 198, 201, 202, 206, 207, 212, 213, |
| 805 |
217, 223, 229, 230, 232, 238, 241, 244, 248, 249, |
| 806 |
252, 257, 258, 259, 263, 265, 266, 269, 275, 278, |
| 807 |
280, 281, 285, 289, 291, 293, 295, 297, 299, 301, |
| 808 |
303, 305, 307, 309, 311, 313, 315, 317, 319, 321, |
| 809 |
323, 325, 327, 329, 331, 333, 335, 337, 339, 341, |
| 810 |
343, 345, 347, 349, 355, 361, 365, 378, 379, 384, |
| 811 |
389, 393, 395, 400, 402, 407, 408, 411, 412, 415, |
| 812 |
416, 419, 422, 425, 428, 431, 435, 439, 441, 445, |
| 813 |
447, 450, 453, 463, 467, 471, 472, 477, 487, 488, |
| 814 |
491, 500, 501, 503, 505, 507, 509, 511, 513, 516, |
| 815 |
521, 524, 527, 533, 536, 539, 546, 552, 553, 556, |
| 816 |
561, 568, 575, 584, 586, 591, 595, 601, 606, 608, |
| 817 |
610, 612, 614, 617, 620, 625, 632, 634, 639, 643, |
| 818 |
649, 654, 659, 666, 668, 673, 677, 683, 688, 692, |
| 819 |
696, 699, 703, 706, 710, 712, 714, 718, 721, 724, |
| 820 |
726, 730, 735, 738, 741, 744, 747, 750, 753, 756, |
| 821 |
759, 762, 765, 768, 771, 774, 776, 777, 779, 780, |
| 822 |
782, 784, 785, 787, 791, 795, 801, 803, 805, 808, |
| 823 |
811, 812, 814, 817, 819, 820, 822, 824, 826, 828, |
| 824 |
832, 836, 840, 844, 847, 849, 855, 856, 858, 860, |
| 825 |
862, 864, 866, 868, 870, 872, 874, 876, 878, 882, |
| 826 |
886, 890, 894, 898, 902, 906, 910, 913, 917, 921, |
| 827 |
925, 929, 933, 936, 939, 946, 951, 956, 961, 966, |
| 828 |
971, 976, 981, 986, 991, 996, 1001, 1006, 1011, 1016, |
| 829 |
1020, 1022, 1024, 1026, 1028, 1030, 1032, 1034 |
| 830 |
}; |
| 831 |
|
| 832 |
/* ZZ_RHS -- A `-1'-separated list of the rules' RHS. */ |
| 833 |
static const short int zz_rhs[] = |
| 834 |
{ |
| 835 |
128, 0, -1, -1, 128, 129, -1, 131, -1, 132, |
| 836 |
-1, 133, -1, 136, -1, 138, -1, 134, -1, 144, |
| 837 |
-1, 140, -1, 147, -1, 156, -1, 153, -1, 158, |
| 838 |
-1, 130, -1, 1, -1, 41, 120, 168, 226, 120, |
| 839 |
-1, 70, 107, 120, -1, 70, 225, 120, -1, 70, |
| 840 |
225, -1, 67, 107, 120, -1, 67, 225, 120, -1, |
| 841 |
67, 225, -1, 43, 104, 40, 107, 120, -1, 43, |
| 842 |
104, 120, -1, 135, 220, 226, 120, -1, 3, 60, |
| 843 |
44, 104, 179, 120, -1, 137, 164, 226, 120, -1, |
| 844 |
3, 55, 44, 104, 120, -1, 3, 55, 44, 27, |
| 845 |
58, 120, -1, 139, 164, 226, 120, -1, 69, 55, |
| 846 |
44, 104, 120, -1, 69, 55, 44, 27, 58, 120, |
| 847 |
-1, 155, 141, 168, 162, 226, 120, -1, 142, 68, |
| 848 |
104, 234, 143, 120, -1, 11, 104, -1, -1, 26, |
| 849 |
239, 231, -1, 26, 35, -1, 26, 81, -1, 26, |
| 850 |
106, -1, 155, 145, -1, 21, 104, 68, 104, 234, |
| 851 |
146, 228, 120, -1, -1, 92, 239, 231, -1, 92, |
| 852 |
81, -1, 92, 35, -1, 92, 106, -1, 155, 148, |
| 853 |
168, 162, 226, 120, -1, 149, 150, 151, 120, -1, |
| 854 |
149, 150, 151, 68, 104, 152, 120, -1, 58, 104, |
| 855 |
-1, -1, 121, 168, 122, -1, -1, 86, 121, 168, |
| 856 |
122, -1, -1, 121, 168, 122, -1, 154, 168, 162, |
| 857 |
226, 120, -1, 65, 104, 38, 104, 120, -1, -1, |
| 858 |
84, -1, 157, 168, 162, 226, 120, -1, 27, 104, |
| 859 |
-1, 159, 120, -1, 83, 160, 226, -1, -1, 160, |
| 860 |
161, -1, 104, 111, 105, 120, -1, -1, -1, 55, |
| 861 |
163, 164, -1, 165, -1, -1, 165, 166, -1, 167, |
| 862 |
120, 168, 226, 120, -1, 56, 104, -1, 169, -1, |
| 863 |
-1, 169, 170, 120, -1, 169, 1, 120, -1, 171, |
| 864 |
-1, 172, -1, 173, -1, 175, -1, 176, -1, 182, |
| 865 |
-1, 183, -1, 184, -1, 185, -1, 186, -1, 187, |
| 866 |
-1, 193, -1, 189, -1, 202, -1, 201, -1, 195, |
| 867 |
-1, 198, -1, 199, -1, 200, -1, 203, -1, 204, |
| 868 |
-1, 205, -1, 207, -1, 211, -1, 210, -1, 212, |
| 869 |
-1, 215, -1, 218, -1, 219, -1, 159, -1, 222, |
| 870 |
49, 178, 180, 181, -1, 222, 88, 178, 180, 181, |
| 871 |
-1, 222, 4, 224, -1, 222, 4, 121, 222, 122, |
| 872 |
86, 222, 49, 104, 61, 104, 174, -1, -1, 101, |
| 873 |
121, 229, 122, -1, 222, 50, 104, 180, -1, 222, |
| 874 |
51, 178, -1, 104, -1, 104, 121, 229, 122, -1, |
| 875 |
104, -1, 104, 121, 229, 122, -1, -1, 56, 104, |
| 876 |
-1, -1, 61, 104, -1, -1, 101, 240, -1, 222, |
| 877 |
7, -1, 222, 8, -1, 222, 89, -1, 222, 90, |
| 878 |
-1, 224, 91, 240, -1, 224, 92, 240, -1, 188, |
| 879 |
-1, 224, 123, 188, -1, 240, -1, 57, 240, -1, |
| 880 |
52, 240, -1, 224, 123, 104, 121, 190, 120, 191, |
| 881 |
192, 122, -1, 222, 123, 45, -1, 222, 123, 64, |
| 882 |
-1, -1, 120, 224, 123, 24, -1, 224, 123, 104, |
| 883 |
121, 222, 120, 103, 122, 194, -1, -1, 44, 224, |
| 884 |
-1, 38, 104, 44, 240, 196, 197, 168, 226, -1, |
| 885 |
-1, 46, -1, 25, -1, 23, -1, 33, -1, 19, |
| 886 |
-1, 30, -1, 72, 224, -1, 72, 224, 93, 224, |
| 887 |
-1, 37, 222, -1, 39, 222, -1, 34, 104, 121, |
| 888 |
222, 122, -1, 15, 177, -1, 10, 240, -1, 42, |
| 889 |
240, 80, 168, 206, 226, -1, 87, 240, 30, 168, |
| 890 |
226, -1, -1, 31, 168, -1, 85, 222, 208, 226, |
| 891 |
-1, 224, 123, 85, 222, 208, 226, -1, 85, 121, |
| 892 |
222, 122, 208, 226, -1, 224, 123, 85, 121, 222, |
| 893 |
122, 208, 226, -1, 209, -1, 17, 229, 123, 168, |
| 894 |
-1, 63, 123, 168, -1, 209, 17, 229, 123, 168, |
| 895 |
-1, 209, 63, 123, 168, -1, 14, -1, 22, -1, |
| 896 |
36, -1, 71, -1, 76, 227, -1, 94, 224, -1, |
| 897 |
74, 222, 213, 226, -1, 74, 121, 222, 122, 213, |
| 898 |
226, -1, 214, -1, 17, 229, 123, 168, -1, 63, |
| 899 |
123, 168, -1, 214, 17, 229, 123, 168, -1, 214, |
| 900 |
63, 123, 168, -1, 79, 222, 216, 226, -1, 79, |
| 901 |
121, 222, 122, 216, 226, -1, 217, -1, 17, 229, |
| 902 |
123, 168, -1, 63, 123, 168, -1, 217, 17, 229, |
| 903 |
123, 168, -1, 217, 63, 123, 168, -1, 20, 168, |
| 904 |
226, -1, 60, 220, 226, -1, 106, 221, -1, 220, |
| 905 |
106, 221, -1, 222, 105, -1, 221, 222, 105, -1, |
| 906 |
223, -1, 224, -1, 223, 108, 224, -1, 223, 224, |
| 907 |
-1, 225, 228, -1, 104, -1, 225, 124, 104, -1, |
| 908 |
225, 125, 229, 126, -1, 32, 20, -1, 32, 38, |
| 909 |
-1, 32, 42, -1, 32, 47, -1, 32, 55, -1, |
| 910 |
32, 60, -1, 32, 74, -1, 32, 79, -1, 32, |
| 911 |
83, -1, 32, 41, -1, 32, 85, -1, 32, 87, |
| 912 |
-1, 32, 104, -1, 32, -1, -1, 105, -1, -1, |
| 913 |
107, -1, 230, -1, -1, 240, -1, 240, 98, 240, |
| 914 |
-1, 230, 108, 240, -1, 230, 108, 240, 98, 240, |
| 915 |
-1, 103, -1, 232, -1, 102, 233, -1, 103, 105, |
| 916 |
-1, -1, 105, -1, 28, 235, -1, 29, -1, -1, |
| 917 |
116, -1, 236, -1, 104, -1, 103, -1, 236, 115, |
| 918 |
236, -1, 236, 116, 236, -1, 236, 119, 237, -1, |
| 919 |
121, 236, 122, -1, 239, 238, -1, 103, -1, 121, |
| 920 |
103, 115, 103, 122, -1, -1, 113, -1, 114, -1, |
| 921 |
103, -1, 53, -1, 232, -1, 54, -1, 81, -1, |
| 922 |
35, -1, 6, -1, 106, -1, 224, -1, 125, 229, |
| 923 |
126, -1, 240, 113, 240, -1, 240, 114, 240, -1, |
| 924 |
240, 116, 240, -1, 240, 115, 240, -1, 240, 119, |
| 925 |
240, -1, 240, 5, 240, -1, 240, 62, 240, -1, |
| 926 |
59, 240, -1, 240, 241, 240, -1, 240, 242, 240, |
| 927 |
-1, 240, 44, 240, -1, 240, 109, 240, -1, 240, |
| 928 |
77, 240, -1, 113, 240, -1, 114, 240, -1, 73, |
| 929 |
121, 224, 108, 232, 122, -1, 73, 121, 224, 122, |
| 930 |
-1, 78, 121, 229, 122, -1, 78, 125, 229, 126, |
| 931 |
-1, 66, 121, 229, 122, -1, 66, 125, 229, 126, |
| 932 |
-1, 82, 121, 229, 122, -1, 82, 125, 229, 126, |
| 933 |
-1, 48, 121, 229, 122, -1, 48, 125, 229, 126, |
| 934 |
-1, 16, 121, 229, 122, -1, 16, 125, 229, 126, |
| 935 |
-1, 18, 121, 229, 122, -1, 18, 125, 229, 126, |
| 936 |
-1, 104, 121, 240, 122, -1, 121, 240, 122, -1, |
| 937 |
111, -1, 110, -1, 112, -1, 95, -1, 96, -1, |
| 938 |
97, -1, 12, -1, 13, -1 |
| 939 |
}; |
| 940 |
|
| 941 |
/* ZZ_RLINE[ZZ_N] -- source line where rule number ZZ_N was defined. */ |
| 942 |
static const unsigned short int zz_rline[] = |
| 943 |
{ |
| 944 |
0, 409, 409, 411, 415, 416, 417, 418, 419, 420, |
| 945 |
421, 422, 423, 424, 425, 426, 427, 428, 435, 480, |
| 946 |
484, 489, 497, 501, 506, 514, 518, 525, 556, 564, |
| 947 |
584, 594, 602, 620, 629, 637, 690, 701, 710, 715, |
| 948 |
720, 727, 734, 744, 783, 818, 823, 828, 835, 842, |
| 949 |
852, 893, 902, 915, 924, 927, 935, 938, 946, 949, |
| 950 |
956, 988, 1002, 1005, 1012, 1042, 1051, 1056, 1076, 1079, |
| 951 |
1087, 1097, 1101, 1100, 1114, 1122, 1125, 1148, 1162, 1171, |
| 952 |
1179, 1182, 1190, 1198, 1199, 1200, 1201, 1202, 1203, 1204, |
| 953 |
1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, |
| 954 |
1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, |
| 955 |
1225, 1226, 1227, 1231, 1272, 1301, 1305, 1356, 1359, 1366, |
| 956 |
1378, 1405, 1410, 1418, 1423, 1432, 1435, 1443, 1446, 1454, |
| 957 |
1457, 1464, 1471, 1478, 1485, 1492, 1496, 1503, 1516, 1533, |
| 958 |
1543, 1551, 1562, 1575, 1582, 1590, 1593, 1600, 1621, 1624, |
| 959 |
1631, 1653, 1656, 1660, 1667, 1671, 1675, 1679, 1686, 1690, |
| 960 |
1697, 1704, 1711, 1722, 1733, 1739, 1749, 1759, 1762, 1769, |
| 961 |
1780, 1792, 1799, 1809, 1816, 1820, 1824, 1828, 1835, 1839, |
| 962 |
1843, 1847, 1851, 1858, 1865, 1876, 1886, 1893, 1897, 1901, |
| 963 |
1905, 1912, 1923, 1933, 1940, 1944, 1948, 1952, 1959, 1969, |
| 964 |
2006, 2015, 2030, 2035, 2044, 2055, 2059, 2064, 2077, 2097, |
| 965 |
2101, 2106, 2121, 2126, 2131, 2136, 2141, 2146, 2151, 2156, |
| 966 |
2161, 2166, 2171, 2176, 2181, 2186, 2195, 2198, 2206, 2209, |
| 967 |
2216, 2221, 2227, 2231, 2235, 2240, 2248, 2254, 2263, 2267, |
| 968 |
2289, 2293, 2314, 2318, 2323, 2329, 2333, 2340, 2344, 2348, |
| 969 |
2352, 2356, 2360, 2367, 2374, 2378, 2386, 2389, 2393, 2400, |
| 970 |
2404, 2408, 2412, 2416, 2420, 2424, 2428, 2432, 2436, 2440, |
| 971 |
2445, 2450, 2455, 2460, 2465, 2470, 2475, 2479, 2484, 2489, |
| 972 |
2494, 2499, 2504, 2508, 2512, 2516, 2520, 2527, 2531, 2538, |
| 973 |
2542, 2549, 2553, 2560, 2564, 2571, 2575, 2582, 2586, 2597, |
| 974 |
2604, 2608, 2612, 2616, 2620, 2624, 2631, 2635 |
| 975 |
}; |
| 976 |
#endif |
| 977 |
|
| 978 |
#if ZZ_DEBUG || ZZ_ERROR_VERBOSE |
| 979 |
/* ZZ_TNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
| 980 |
First, the terminals, then, starting at ZZ_NTOKENS, nonterminals. */ |
| 981 |
static const char *const zz_tname[] = |
| 982 |
{ |
| 983 |
"$end", "error", "$undefined", "ADD_T", "ALIASES_T", "AND_T", "ANY_T", |
| 984 |
"AREALIKE_T", "ARETHESAME_T", "ARRAY_T", "ASSERT_T", "ATOM_T", "BEQ_T", |
| 985 |
"BNE_T", "BREAK_T", "CALL_T", "CARD_T", "CASE_T", "CHOICE_T", "CHECK_T", |
| 986 |
"CONDITIONAL_T", "CONSTANT_T", "CONTINUE_T", "CREATE_T", "DATA_T", |
| 987 |
"DECREASING_T", "DEFAULT_T", "DEFINITION_T", "DIMENSION_T", |
| 988 |
"DIMENSIONLESS_T", "DO_T", "ELSE_T", "END_T", "EXPECT_T", "EXTERNAL_T", |
| 989 |
"FALSE_T", "FALLTHRU_T", "FIX_T", "FOR_T", "FREE_T", "FROM_T", |
| 990 |
"GLOBAL_T", "IF_T", "IMPORT_T", "IN_T", "INPUT_T", "INCREASING_T", |
| 991 |
"INTERACTIVE_T", "INTERSECTION_T", "ISA_T", "_IS_T", "ISREFINEDTO_T", |
| 992 |
"MAXIMIZE_T", "MAXINTEGER_T", "MAXREAL_T", "METHODS_T", "METHOD_T", |
| 993 |
"MINIMIZE_T", "MODEL_T", "NOT_T", "NOTES_T", "OF_T", "OR_T", |
| 994 |
"OTHERWISE_T", "OUTPUT_T", "PATCH_T", "PROD_T", "PROVIDE_T", "REFINES_T", |
| 995 |
"REPLACE_T", "REQUIRE_T", "RETURN_T", "RUN_T", "SATISFIED_T", "SELECT_T", |
| 996 |
"SIZE_T", "STOP_T", "SUCHTHAT_T", "SUM_T", "SWITCH_T", "THEN_T", |
| 997 |
"TRUE_T", "UNION_T", "UNITS_T", "UNIVERSAL_T", "WHEN_T", "WHERE_T", |
| 998 |
"WHILE_T", "WILLBE_T", "WILLBETHESAME_T", "WILLNOTBETHESAME_T", |
| 999 |
"ASSIGN_T", "CASSIGN_T", "DBLCOLON_T", "USE_T", "LEQ_T", "GEQ_T", |
| 1000 |
"NEQ_T", "DOTDOT_T", "WITH_T", "VALUE_T", "WITH_VALUE_T", "REAL_T", |
| 1001 |
"INTEGER_T", "IDENTIFIER_T", "BRACEDTEXT_T", "SYMBOL_T", "DQUOTE_T", |
| 1002 |
"','", "'|'", "'<'", "'='", "'>'", "'+'", "'-'", "'/'", "'*'", "UPLUS_T", |
| 1003 |
"UMINUS_T", "'^'", "';'", "'('", "')'", "':'", "'.'", "'['", "']'", |
| 1004 |
"$accept", "definitions", "definition", "global_def", "require_file", |
| 1005 |
"provide_module", "import", "add_notes_def", "add_notes_head", |
| 1006 |
"add_method_def", "add_method_head", "replace_method_def", |
| 1007 |
"replace_method_head", "atom_def", "atom_head", "atom_id", "default_val", |
| 1008 |
"constant_def", "constant_head", "constant_val", "model_def", |
| 1009 |
"model_head", "model_id", "optional_model_parameters", |
| 1010 |
"optional_parameter_wheres", "optional_parameter_reduction", "patch_def", |
| 1011 |
"patch_head", "universal", "definition_def", "definition_id", |
| 1012 |
"units_def", "units_statement", "unitdeflist", "unitdef", "methods", |
| 1013 |
"@1", "proclist", "proclistf", "procedure", "procedure_id", |
| 1014 |
"fstatements", "statements", "statement", "isa_statement", |
| 1015 |
"willbe_statement", "aliases_statement", "optional_set_values", |
| 1016 |
"is_statement", "isrefinedto_statement", "call_identifier", |
| 1017 |
"type_identifier", "optional_method", "optional_of", |
| 1018 |
"optional_with_value", "arealike_statement", "arethesame_statement", |
| 1019 |
"willbethesame_statement", "willnotbethesame_statement", |
| 1020 |
"assignment_statement", "relation_statement", "relation", |
| 1021 |
"blackbox_statement", "input_args", "output_args", "data_args", |
| 1022 |
"glassbox_statement", "optional_scope", "for_statement", |
| 1023 |
"optional_direction", "forexprend", "run_statement", "fix_statement", |
| 1024 |
"free_statement", "external_statement", "call_statement", |
| 1025 |
"assert_statement", "if_statement", "while_statement", "optional_else", |
| 1026 |
"when_statement", "whenlist", "whenlistf", "flow_statement", |
| 1027 |
"use_statement", "select_statement", "selectlist", "selectlistf", |
| 1028 |
"switch_statement", "switchlist", "switchlistf", "conditional_statement", |
| 1029 |
"notes_statement", "notes_body", "noteslist", "fvarlist", "varlist", |
| 1030 |
"fname", "name", "end", "optional_bracedtext", "optional_notes", "set", |
| 1031 |
"setexprlist", "number", "realnumber", "opunits", "dims", "dimensions", |
| 1032 |
"dimexpr", "fraction", "fractail", "optional_sign", "expr", "relop", |
| 1033 |
"logrelop", 0 |
| 1034 |
}; |
| 1035 |
#endif |
| 1036 |
|
| 1037 |
# ifdef ZZ_PRINT |
| 1038 |
/* ZZ_TOKNUM[ZZ_LEX-NUM] -- Internal token number corresponding to |
| 1039 |
token ZZ_LEX-NUM. */ |
| 1040 |
static const unsigned short int zz_toknum[] = |
| 1041 |
{ |
| 1042 |
0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 1043 |
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 1044 |
275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
| 1045 |
285, 286, 287, 288, 289, 290, 291, 292, 293, 294, |
| 1046 |
295, 296, 297, 298, 299, 300, 301, 302, 303, 304, |
| 1047 |
305, 306, 307, 308, 309, 310, 311, 312, 313, 314, |
| 1048 |
315, 316, 317, 318, 319, 320, 321, 322, 323, 324, |
| 1049 |
325, 326, 327, 328, 329, 330, 331, 332, 333, 334, |
| 1050 |
335, 336, 337, 338, 339, 340, 341, 342, 343, 344, |
| 1051 |
345, 346, 347, 348, 349, 350, 351, 352, 353, 354, |
| 1052 |
355, 356, 357, 358, 359, 360, 361, 362, 44, 124, |
| 1053 |
60, 61, 62, 43, 45, 47, 42, 363, 364, 94, |
| 1054 |
59, 40, 41, 58, 46, 91, 93 |
| 1055 |
}; |
| 1056 |
# endif |
| 1057 |
|
| 1058 |
/* ZZ_R1[ZZ_N] -- Symbol number of symbol that rule ZZ_N derives. */ |
| 1059 |
static const unsigned char zz_r1[] = |
| 1060 |
{ |
| 1061 |
0, 127, 128, 128, 129, 129, 129, 129, 129, 129, |
| 1062 |
129, 129, 129, 129, 129, 129, 129, 129, 130, 131, |
| 1063 |
131, 131, 132, 132, 132, 133, 133, 134, 135, 136, |
| 1064 |
137, 137, 138, 139, 139, 140, 141, 142, 143, 143, |
| 1065 |
143, 143, 143, 144, 145, 146, 146, 146, 146, 146, |
| 1066 |
147, 148, 148, 149, 150, 150, 151, 151, 152, 152, |
| 1067 |
153, 154, 155, 155, 156, 157, 158, 159, 160, 160, |
| 1068 |
161, 162, 163, 162, 164, 165, 165, 166, 167, 168, |
| 1069 |
169, 169, 169, 170, 170, 170, 170, 170, 170, 170, |
| 1070 |
170, 170, 170, 170, 170, 170, 170, 170, 170, 170, |
| 1071 |
170, 170, 170, 170, 170, 170, 170, 170, 170, 170, |
| 1072 |
170, 170, 170, 171, 172, 173, 173, 174, 174, 175, |
| 1073 |
176, 177, 177, 178, 178, 179, 179, 180, 180, 181, |
| 1074 |
181, 182, 183, 184, 185, 186, 186, 187, 187, 188, |
| 1075 |
188, 188, 189, 190, 191, 192, 192, 193, 194, 194, |
| 1076 |
195, 196, 196, 196, 197, 197, 197, 197, 198, 198, |
| 1077 |
199, 200, 201, 202, 203, 204, 205, 206, 206, 207, |
| 1078 |
207, 207, 207, 208, 209, 209, 209, 209, 210, 210, |
| 1079 |
210, 210, 210, 211, 212, 212, 213, 214, 214, 214, |
| 1080 |
214, 215, 215, 216, 217, 217, 217, 217, 218, 219, |
| 1081 |
220, 220, 221, 221, 222, 223, 223, 223, 224, 225, |
| 1082 |
225, 225, 226, 226, 226, 226, 226, 226, 226, 226, |
| 1083 |
226, 226, 226, 226, 226, 226, 227, 227, 228, 228, |
| 1084 |
229, 229, 230, 230, 230, 230, 231, 231, 232, 232, |
| 1085 |
233, 233, 234, 234, 234, 235, 235, 236, 236, 236, |
| 1086 |
236, 236, 236, 237, 238, 238, 239, 239, 239, 240, |
| 1087 |
240, 240, 240, 240, 240, 240, 240, 240, 240, 240, |
| 1088 |
240, 240, 240, 240, 240, 240, 240, 240, 240, 240, |
| 1089 |
240, 240, 240, 240, 240, 240, 240, 240, 240, 240, |
| 1090 |
240, 240, 240, 240, 240, 240, 240, 240, 240, 240, |
| 1091 |
241, 241, 241, 241, 241, 241, 242, 242 |
| 1092 |
}; |
| 1093 |
|
| 1094 |
/* ZZ_R2[ZZ_N] -- Number of symbols composing right hand side of rule ZZ_N. */ |
| 1095 |
static const unsigned char zz_r2[] = |
| 1096 |
{ |
| 1097 |
0, 2, 0, 2, 1, 1, 1, 1, 1, 1, |
| 1098 |
1, 1, 1, 1, 1, 1, 1, 1, 5, 3, |
| 1099 |
3, 2, 3, 3, 2, 5, 3, 4, 6, 4, |
| 1100 |
5, 6, 4, 5, 6, 6, 6, 2, 0, 3, |
| 1101 |
2, 2, 2, 2, 8, 0, 3, 2, 2, 2, |
| 1102 |
6, 4, 7, 2, 0, 3, 0, 4, 0, 3, |
| 1103 |
5, 5, 0, 1, 5, 2, 2, 3, 0, 2, |
| 1104 |
4, 0, 0, 3, 1, 0, 2, 5, 2, 1, |
| 1105 |
0, 3, 3, 1, 1, 1, 1, 1, 1, 1, |
| 1106 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 1107 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 1108 |
1, 1, 1, 5, 5, 3, 12, 0, 4, 4, |
| 1109 |
3, 1, 4, 1, 4, 0, 2, 0, 2, 0, |
| 1110 |
2, 2, 2, 2, 2, 3, 3, 1, 3, 1, |
| 1111 |
2, 2, 9, 3, 3, 0, 4, 9, 0, 2, |
| 1112 |
8, 0, 1, 1, 1, 1, 1, 1, 2, 4, |
| 1113 |
2, 2, 5, 2, 2, 6, 5, 0, 2, 4, |
| 1114 |
6, 6, 8, 1, 4, 3, 5, 4, 1, 1, |
| 1115 |
1, 1, 2, 2, 4, 6, 1, 4, 3, 5, |
| 1116 |
4, 4, 6, 1, 4, 3, 5, 4, 3, 3, |
| 1117 |
2, 3, 2, 3, 1, 1, 3, 2, 2, 1, |
| 1118 |
3, 4, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1119 |
2, 2, 2, 2, 2, 1, 0, 1, 0, 1, |
| 1120 |
1, 0, 1, 3, 3, 5, 1, 1, 2, 2, |
| 1121 |
0, 1, 2, 1, 0, 1, 1, 1, 1, 3, |
| 1122 |
3, 3, 3, 2, 1, 5, 0, 1, 1, 1, |
| 1123 |
1, 1, 1, 1, 1, 1, 1, 1, 3, 3, |
| 1124 |
3, 3, 3, 3, 3, 3, 2, 3, 3, 3, |
| 1125 |
3, 3, 2, 2, 6, 4, 4, 4, 4, 4, |
| 1126 |
4, 4, 4, 4, 4, 4, 4, 4, 4, 3, |
| 1127 |
1, 1, 1, 1, 1, 1, 1, 1 |
| 1128 |
}; |
| 1129 |
|
| 1130 |
/* ZZ_DEFACT[STATE-NAME] -- Default rule to reduce with in state |
| 1131 |
STATE-NUM when ZZ_TABLE doesn't specify something else to do. Zero |
| 1132 |
means the default is an error. */ |
| 1133 |
static const unsigned short int zz_defact[] = |
| 1134 |
{ |
| 1135 |
2, 0, 1, 17, 0, 0, 0, 0, 0, 0, |
| 1136 |
0, 0, 68, 63, 3, 16, 4, 5, 6, 9, |
| 1137 |
0, 7, 75, 8, 75, 11, 10, 12, 14, 80, |
| 1138 |
0, 13, 80, 15, 0, 0, 0, 65, 80, 0, |
| 1139 |
0, 209, 0, 24, 0, 0, 21, 0, 0, 0, |
| 1140 |
0, 74, 0, 71, 0, 0, 0, 0, 80, 0, |
| 1141 |
43, 80, 54, 71, 66, 0, 0, 0, 0, 26, |
| 1142 |
0, 22, 23, 0, 231, 0, 19, 20, 225, 0, |
| 1143 |
69, 67, 200, 0, 204, 205, 228, 0, 0, 0, |
| 1144 |
0, 76, 0, 0, 72, 0, 0, 265, 0, 178, |
| 1145 |
0, 0, 0, 80, 179, 0, 264, 180, 0, 0, |
| 1146 |
0, 0, 0, 0, 260, 262, 0, 0, 0, 0, |
| 1147 |
181, 0, 0, 0, 226, 0, 0, 263, 0, 0, |
| 1148 |
0, 0, 240, 259, 209, 266, 0, 0, 0, 231, |
| 1149 |
112, 0, 83, 84, 85, 86, 87, 88, 89, 90, |
| 1150 |
91, 92, 93, 137, 95, 94, 98, 99, 100, 101, |
| 1151 |
97, 96, 102, 103, 104, 105, 107, 106, 108, 109, |
| 1152 |
110, 111, 0, 267, 261, 139, 37, 0, 53, 71, |
| 1153 |
0, 71, 80, 56, 0, 0, 0, 125, 0, 0, |
| 1154 |
0, 210, 267, 0, 230, 232, 0, 0, 212, 213, |
| 1155 |
221, 214, 215, 216, 217, 218, 219, 220, 222, 223, |
| 1156 |
224, 0, 0, 202, 0, 207, 229, 208, 201, 27, |
| 1157 |
29, 78, 80, 32, 75, 0, 82, 164, 121, 163, |
| 1158 |
231, 231, 231, 231, 0, 0, 160, 0, 161, 0, |
| 1159 |
231, 231, 141, 140, 276, 0, 231, 231, 158, 0, |
| 1160 |
0, 0, 227, 182, 231, 231, 0, 0, 231, 231, |
| 1161 |
0, 0, 0, 183, 241, 238, 239, 0, 282, 283, |
| 1162 |
0, 0, 81, 0, 131, 132, 0, 0, 0, 0, |
| 1163 |
133, 134, 0, 0, 0, 0, 306, 307, 0, 0, |
| 1164 |
0, 303, 304, 305, 0, 301, 300, 302, 0, 0, |
| 1165 |
0, 0, 0, 0, 0, 0, 0, 244, 0, 0, |
| 1166 |
0, 0, 0, 0, 30, 0, 0, 18, 25, 61, |
| 1167 |
211, 0, 0, 0, 33, 0, 203, 206, 0, 73, |
| 1168 |
60, 231, 0, 0, 0, 0, 198, 0, 0, 80, |
| 1169 |
0, 0, 199, 0, 0, 0, 0, 0, 231, 0, |
| 1170 |
0, 186, 0, 0, 0, 231, 0, 0, 193, 0, |
| 1171 |
0, 0, 231, 0, 0, 173, 80, 0, 299, 268, |
| 1172 |
0, 115, 123, 127, 127, 120, 127, 135, 136, 0, |
| 1173 |
209, 138, 274, 279, 275, 281, 280, 269, 270, 272, |
| 1174 |
271, 273, 277, 278, 244, 0, 0, 243, 38, 0, |
| 1175 |
55, 80, 0, 51, 64, 31, 126, 28, 234, 233, |
| 1176 |
34, 70, 0, 0, 294, 295, 296, 297, 0, 151, |
| 1177 |
167, 292, 293, 288, 289, 159, 0, 285, 0, 0, |
| 1178 |
80, 184, 231, 0, 286, 287, 0, 0, 80, 191, |
| 1179 |
231, 0, 290, 291, 0, 0, 80, 169, 231, 0, |
| 1180 |
0, 298, 0, 231, 0, 129, 119, 129, 0, 0, |
| 1181 |
0, 45, 35, 248, 247, 245, 0, 242, 246, 256, |
| 1182 |
0, 50, 0, 58, 0, 77, 122, 162, 153, 152, |
| 1183 |
0, 80, 0, 0, 0, 0, 80, 188, 0, 80, |
| 1184 |
0, 80, 195, 0, 80, 0, 80, 175, 0, 80, |
| 1185 |
166, 0, 0, 128, 0, 113, 114, 0, 0, 0, |
| 1186 |
0, 267, 256, 228, 0, 0, 0, 256, 40, 41, |
| 1187 |
42, 257, 258, 0, 36, 57, 80, 0, 235, 156, |
| 1188 |
154, 157, 155, 80, 168, 165, 284, 185, 187, 80, |
| 1189 |
190, 192, 194, 80, 197, 171, 174, 80, 177, 0, |
| 1190 |
124, 130, 0, 170, 0, 0, 0, 48, 47, 49, |
| 1191 |
0, 0, 252, 249, 250, 251, 0, 236, 39, 237, |
| 1192 |
0, 52, 0, 189, 196, 176, 0, 0, 145, 0, |
| 1193 |
0, 143, 46, 44, 254, 0, 253, 59, 150, 0, |
| 1194 |
172, 0, 0, 0, 148, 0, 0, 0, 142, 144, |
| 1195 |
0, 147, 0, 0, 0, 149, 0, 117, 146, 255, |
| 1196 |
0, 116, 231, 0, 118 |
| 1197 |
}; |
| 1198 |
|
| 1199 |
/* ZZ_DEFGOTO[NTERM-NUM]. */ |
| 1200 |
static const short int zz_defgoto[] = |
| 1201 |
{ |
| 1202 |
-1, 1, 14, 15, 16, 17, 18, 19, 20, 21, |
| 1203 |
22, 23, 24, 25, 58, 59, 470, 26, 60, 513, |
| 1204 |
27, 61, 62, 183, 311, 527, 28, 29, 30, 31, |
| 1205 |
32, 33, 34, 47, 80, 95, 224, 50, 51, 91, |
| 1206 |
92, 53, 54, 141, 142, 143, 144, 611, 145, 146, |
| 1207 |
229, 373, 316, 455, 505, 147, 148, 149, 150, 151, |
| 1208 |
152, 153, 154, 509, 578, 592, 155, 601, 156, 480, |
| 1209 |
533, 157, 158, 159, 160, 161, 162, 163, 164, 482, |
| 1210 |
165, 364, 365, 166, 167, 168, 350, 351, 169, 357, |
| 1211 |
358, 170, 171, 49, 82, 83, 84, 192, 86, 81, |
| 1212 |
253, 217, 193, 194, 568, 174, 265, 398, 467, 468, |
| 1213 |
565, 586, 523, 195, 303, 304 |
| 1214 |
}; |
| 1215 |
|
| 1216 |
/* ZZ_PACT[STATE-NUM] -- Index in ZZ_TABLE of the portion describing |
| 1217 |
STATE-NUM. */ |
| 1218 |
#define ZZ_PACT_NINF -437 |
| 1219 |
static const short int zz_pact[] = |
| 1220 |
{ |
| 1221 |
-437, 1096, -437, -437, 81, -59, 2, 25, 38, 57, |
| 1222 |
1, 82, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1223 |
71, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1224 |
10, -437, -437, -437, 77, 167, 179, -437, -437, -30, |
| 1225 |
202, -437, 130, 43, 204, 133, 60, -18, 150, -19, |
| 1226 |
223, 206, 223, 203, 593, 156, 159, 160, -437, 197, |
| 1227 |
-437, -437, 145, 203, -437, -11, 166, 223, 168, -437, |
| 1228 |
169, -437, -437, 170, 165, -10, -437, -437, 476, 161, |
| 1229 |
-437, -437, 150, 171, -61, -437, 0, 150, 157, 162, |
| 1230 |
176, -437, 163, 164, -437, 223, 172, -437, 165, -437, |
| 1231 |
181, 33, 44, -437, -437, 183, -437, -437, 150, 189, |
| 1232 |
150, 165, 89, 165, -437, -437, 165, 165, 71, 96, |
| 1233 |
-437, 150, 173, -72, 186, 105, -64, -437, 108, -62, |
| 1234 |
165, 150, 190, 191, 177, -437, 165, 165, 165, 165, |
| 1235 |
-437, 180, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1236 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1237 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1238 |
-437, -437, 59, 84, -437, 960, -437, 231, -437, 203, |
| 1239 |
198, 203, -437, 215, 223, 247, 193, 251, 194, 195, |
| 1240 |
196, -437, -437, 185, 210, 801, 261, 207, -437, -437, |
| 1241 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1242 |
-437, 218, 219, -437, 150, -437, -437, -437, 150, -437, |
| 1243 |
-437, -437, -437, -437, -437, 212, -437, 960, 205, -437, |
| 1244 |
165, 165, 165, 165, 223, 213, -437, 289, -437, 844, |
| 1245 |
165, 165, 960, 960, -437, -19, 165, 165, 243, 150, |
| 1246 |
150, -5, -437, -437, 165, 165, 150, -2, 165, 165, |
| 1247 |
150, 7, 874, -437, -437, -437, -437, 165, 242, 242, |
| 1248 |
244, 211, -437, -4, -437, -437, 246, 258, 246, 246, |
| 1249 |
-437, -437, 165, 165, 694, 165, -437, -437, 165, 165, |
| 1250 |
165, -437, -437, -437, 165, -437, -437, -437, 165, 165, |
| 1251 |
165, 165, 165, 165, 165, 260, 223, 187, 223, 245, |
| 1252 |
248, -49, 252, 253, -437, 264, 254, -437, -437, -437, |
| 1253 |
-437, 165, 165, 255, -437, 256, -437, -437, 223, -437, |
| 1254 |
-437, 165, 249, 239, 257, 259, -437, 150, 165, -437, |
| 1255 |
262, 263, -437, 268, 265, 150, 6, 270, 165, 271, |
| 1256 |
223, 16, 274, 267, 276, 165, 279, 223, 36, 282, |
| 1257 |
280, 283, 165, 285, 223, 48, -437, 715, -437, -437, |
| 1258 |
150, -437, 288, 316, 316, -437, 316, 960, 960, 11, |
| 1259 |
290, -437, 233, 233, 233, 375, 375, 63, 63, 242, |
| 1260 |
242, 242, 80, 990, 187, 266, -66, -437, 352, 293, |
| 1261 |
-437, -437, 277, -437, -437, -437, -437, -437, 917, 960, |
| 1262 |
-437, -437, 296, 295, -437, -437, -437, -437, 301, 758, |
| 1263 |
387, -437, -437, -437, -437, -437, -26, -437, -5, 302, |
| 1264 |
-437, -437, 165, 303, -437, -437, -2, 304, -437, -437, |
| 1265 |
165, 305, -437, -437, 7, 306, -437, -437, 165, 308, |
| 1266 |
223, -437, 311, 165, 320, 333, -437, 333, 150, 7, |
| 1267 |
165, 291, -437, -437, -437, -437, -52, -437, 90, -17, |
| 1268 |
319, -437, 314, 321, 165, -437, -437, -437, -437, -437, |
| 1269 |
127, -437, 223, 191, 318, 223, -437, -437, 322, -437, |
| 1270 |
223, -437, -437, 323, -437, 223, -437, -437, 324, -437, |
| 1271 |
-437, 355, 327, -437, 165, -437, -437, 329, 223, 332, |
| 1272 |
116, -79, 39, 337, 40, -52, -52, 128, -437, -437, |
| 1273 |
-437, -437, -437, 142, -437, -437, -437, 334, 960, -437, |
| 1274 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1275 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, 150, |
| 1276 |
-437, 960, 7, -437, 150, 350, 411, -437, -437, -437, |
| 1277 |
142, 339, -437, 338, 338, -437, -75, 191, -437, -437, |
| 1278 |
340, -437, 223, -437, -437, -437, 415, 223, 346, 344, |
| 1279 |
347, -437, -437, -437, -437, 370, -437, -437, -437, 371, |
| 1280 |
-437, 150, 354, 410, 433, 363, 418, 357, -437, -437, |
| 1281 |
150, -437, 378, 379, 458, -437, 376, 391, -437, -437, |
| 1282 |
372, -437, 165, 377, -437 |
| 1283 |
}; |
| 1284 |
|
| 1285 |
/* ZZ_PGOTO[NTERM-NUM]. */ |
| 1286 |
static const short int zz_pgoto[] = |
| 1287 |
{ |
| 1288 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1289 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1290 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1291 |
-437, -437, 443, -437, -437, -41, -437, -20, -437, -437, |
| 1292 |
-437, -31, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1293 |
-437, -27, -437, -253, 46, -437, -437, -437, -437, -437, |
| 1294 |
-437, 216, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1295 |
-437, -437, -437, -437, -437, -437, -437, -437, -437, -437, |
| 1296 |
-437, -436, -437, -437, -437, -437, 76, -437, -437, 69, |
| 1297 |
-437, -437, -437, 389, 422, -28, -437, -48, 226, -47, |
| 1298 |
-437, -3, -128, -437, -45, -417, -437, 117, -437, -431, |
| 1299 |
-437, -437, -373, 284, -437, -437 |
| 1300 |
}; |
| 1301 |
|
| 1302 |
/* ZZ_TABLE[ZZ_PACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 1303 |
positive, shift that token. If negative, reduce the rule which |
| 1304 |
number is the opposite. If zero, do what ZZ_DEFACT says. |
| 1305 |
If ZZ_TABLE_NINF, syntax error. */ |
| 1306 |
#define ZZ_TABLE_NINF -206 |
| 1307 |
static const short int zz_table[] = |
| 1308 |
{ |
| 1309 |
85, 63, 88, 89, 52, 93, 173, 67, 495, 484, |
| 1310 |
68, 271, 348, 78, 78, 355, 185, 196, 518, 402, |
| 1311 |
188, 55, 184, 508, 362, -205, 172, 179, 584, -205, |
| 1312 |
181, 56, 41, 432, 85, 514, 215, 463, 464, 85, |
| 1313 |
41, -205, 41, 41, -205, 37, 585, 214, 225, 250, |
| 1314 |
465, 463, 464, 440, 212, 466, 44, 256, 349, 260, |
| 1315 |
85, 356, 85, 273, 519, 448, 274, 275, 57, 466, |
| 1316 |
363, 403, 234, 248, 557, 85, 132, 483, 85, 433, |
| 1317 |
236, 85, 238, 263, 563, 564, 79, 87, -205, 520, |
| 1318 |
69, -205, -205, 186, 197, 251, 521, 522, 257, 441, |
| 1319 |
41, 261, 332, 333, 334, 335, 569, 216, 276, 277, |
| 1320 |
278, 449, 340, 341, 426, 41, 577, 370, 343, 344, |
| 1321 |
558, 456, 38, 457, 73, 74, 352, 353, 427, 39, |
| 1322 |
359, 360, 458, -205, -205, -205, 35, 312, 306, 560, |
| 1323 |
308, 36, 40, 569, 566, 559, 529, 279, 280, 281, |
| 1324 |
530, 309, 521, 522, 230, 515, 516, 531, 231, 517, |
| 1325 |
532, 41, 562, 72, 42, 232, 327, 73, 74, 233, |
| 1326 |
85, 97, -205, -205, -205, 282, 283, 48, 300, 301, |
| 1327 |
77, 101, 302, 102, 73, 74, 41, 336, -205, 45, |
| 1328 |
212, 328, -205, 298, 299, 300, 301, 64, 342, 302, |
| 1329 |
106, 346, 85, 413, 329, 515, 516, 284, 85, 517, |
| 1330 |
240, 65, 85, 112, 241, 396, 397, 246, 114, 115, |
| 1331 |
429, 247, 347, 66, 117, 371, 254, 437, 354, 258, |
| 1332 |
255, 119, 361, 259, 445, 43, 555, 46, 122, 556, |
| 1333 |
70, 521, 522, 125, 132, 567, 127, 128, 75, 285, |
| 1334 |
71, 375, 376, 76, 41, 78, 286, 287, 94, 395, |
| 1335 |
176, 399, 90, 177, 178, 180, 182, 132, 133, 134, |
| 1336 |
187, 135, 211, 190, 191, 189, 213, 219, 136, 137, |
| 1337 |
221, 412, 220, 222, 223, 228, 138, 235, 288, 85, |
| 1338 |
139, 252, 226, 237, 249, 264, 266, 425, 267, 305, |
| 1339 |
272, 310, 307, 431, 488, 313, 289, 315, 420, 418, |
| 1340 |
439, 320, 493, 314, 317, 318, 319, 447, 321, 323, |
| 1341 |
498, 290, 85, 325, 326, 502, 331, 324, 291, 292, |
| 1342 |
293, 85, 330, 338, 337, 450, 345, 369, 175, 291, |
| 1343 |
292, 293, 452, 295, 296, 297, 298, 299, 300, 301, |
| 1344 |
372, 459, 302, 294, 295, 296, 297, 298, 299, 300, |
| 1345 |
301, 302, 374, 302, 394, 415, 368, 400, 406, 401, |
| 1346 |
472, 414, 404, 405, 407, 410, 411, 454, 469, 416, |
| 1347 |
285, 473, 227, 512, 421, 417, 462, 286, 287, 422, |
| 1348 |
423, 424, 428, 435, 430, 239, 434, 242, 436, 487, |
| 1349 |
243, 244, 438, 500, 442, 444, 443, 492, 446, 453, |
| 1350 |
85, 460, 511, 471, 262, 497, 475, 476, 481, 288, |
| 1351 |
268, 269, 270, 477, 503, 486, 489, 491, 494, 496, |
| 1352 |
507, 499, 510, 501, 504, 535, 525, 289, 537, 524, |
| 1353 |
536, 549, 526, 541, 216, 539, 543, 547, 545, 550, |
| 1354 |
534, 552, 554, 580, 571, 538, 581, 517, 540, 583, |
| 1355 |
542, 553, 587, 544, 589, 546, 591, 593, 548, 594, |
| 1356 |
291, 292, 293, 595, 599, 596, 598, 600, 602, 603, |
| 1357 |
604, 606, 608, 607, 613, 295, 296, 297, 298, 299, |
| 1358 |
300, 301, 610, 612, 302, 570, 198, 140, 609, 614, |
| 1359 |
381, 85, 572, 506, 485, 490, 85, 245, 573, 218, |
| 1360 |
561, 461, 574, 0, 199, 582, 575, 200, 201, 0, |
| 1361 |
0, 576, 0, 202, 0, 588, 579, 0, 0, 0, |
| 1362 |
590, 203, 0, 0, 0, 0, 204, 0, 0, 0, |
| 1363 |
0, 0, 0, 597, 0, 0, 0, 0, 0, 0, |
| 1364 |
205, 367, 605, 0, 0, 206, 0, 0, 0, 207, |
| 1365 |
0, 208, 0, 209, 0, 0, 377, 378, 175, 382, |
| 1366 |
0, 0, 383, 384, 385, 0, 0, 0, 386, 0, |
| 1367 |
210, 0, 387, 388, 389, 390, 391, 392, 393, 0, |
| 1368 |
0, 0, 0, 0, 96, 0, 0, 0, 0, 97, |
| 1369 |
0, 0, 0, 98, 0, 408, 409, 99, 100, 101, |
| 1370 |
-79, 102, 0, 103, 0, 104, 0, 0, 0, 0, |
| 1371 |
0, 0, 419, 0, -79, -79, 0, 105, 106, 107, |
| 1372 |
108, 109, 110, 0, 0, 111, 0, 0, 0, 0, |
| 1373 |
0, 112, 0, 0, 0, 113, 114, 115, -79, 0, |
| 1374 |
116, 0, 117, 118, 0, 0, -79, 0, 0, 119, |
| 1375 |
0, 0, 0, 0, 120, 121, 122, 123, 0, 124, |
| 1376 |
0, 125, 126, 0, 127, 128, 12, 0, 129, 0, |
| 1377 |
130, 0, 0, 0, 0, 0, 0, 131, 0, 0, |
| 1378 |
0, 0, 0, 0, 0, 132, 133, 134, 0, 135, |
| 1379 |
97, 0, 0, 0, 0, 0, 136, 137, 0, 0, |
| 1380 |
101, 0, 102, 0, 138, -79, 0, 0, 139, 0, |
| 1381 |
285, 0, 0, 0, 0, 0, 0, 286, 287, 106, |
| 1382 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1383 |
0, 0, 112, 0, 367, 0, 113, 114, 115, 0, |
| 1384 |
0, 116, 0, 117, 0, 0, 0, 0, 528, 288, |
| 1385 |
119, 0, 0, 285, 0, 0, 0, 122, 0, 0, |
| 1386 |
286, 287, 125, 0, 0, 127, 128, 289, 0, 379, |
| 1387 |
0, 0, 0, 478, 0, 0, 0, 0, 551, 0, |
| 1388 |
0, 0, 290, 0, 0, 0, 132, 133, 380, 0, |
| 1389 |
135, 0, 288, 0, 479, 0, 285, 136, 137, 0, |
| 1390 |
291, 292, 293, 286, 287, 138, 0, 0, 0, 139, |
| 1391 |
289, 0, 0, 0, 294, 295, 296, 297, 298, 299, |
| 1392 |
300, 301, 0, 0, 302, 290, 0, 451, 0, 0, |
| 1393 |
0, 0, 0, 0, 0, 288, 0, 0, 0, 285, |
| 1394 |
0, 0, 0, 291, 292, 293, 286, 287, 0, 0, |
| 1395 |
0, 0, 0, 289, 0, 0, 0, 294, 295, 296, |
| 1396 |
297, 298, 299, 300, 301, 0, 0, 302, 290, 285, |
| 1397 |
0, 0, 0, 0, 0, 0, 286, 287, 288, 0, |
| 1398 |
0, 0, 0, 0, 0, 0, 291, 292, 293, 322, |
| 1399 |
0, 0, 0, 0, 366, 0, 289, 0, 0, 0, |
| 1400 |
294, 295, 296, 297, 298, 299, 300, 301, 288, 0, |
| 1401 |
302, 290, 285, 0, 339, 0, 0, 0, 0, 286, |
| 1402 |
287, 0, 0, 0, 0, 0, 289, 0, 0, 291, |
| 1403 |
292, 293, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1404 |
0, 290, 0, 294, 295, 296, 297, 298, 299, 300, |
| 1405 |
301, 288, 0, 302, 0, 285, 0, 0, 0, 291, |
| 1406 |
292, 293, 286, 287, 0, 0, 0, 0, 0, 289, |
| 1407 |
0, 0, 0, 294, 295, 296, 297, 298, 299, 300, |
| 1408 |
301, 0, 0, 302, 290, 285, 0, 0, 0, 0, |
| 1409 |
0, 0, 0, 0, 288, 0, 0, 0, 0, 0, |
| 1410 |
0, 0, 291, 292, 293, 474, 0, 0, 0, 0, |
| 1411 |
0, 0, 289, 0, 0, 0, 294, 295, 296, 297, |
| 1412 |
298, 299, 300, 301, 288, 0, 302, 290, 0, 0, |
| 1413 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1414 |
0, 0, 289, 0, 0, 291, 292, 293, 0, 0, |
| 1415 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 294, |
| 1416 |
295, 296, 297, 298, 299, 300, 301, 0, 0, 302, |
| 1417 |
0, 0, 0, 0, 0, 291, 292, 293, 0, 0, |
| 1418 |
0, 0, 0, 0, 0, 0, 2, 3, 0, 4, |
| 1419 |
295, 296, 297, 298, 299, 300, 301, -62, 0, 302, |
| 1420 |
0, 0, 0, 0, 0, 0, 0, -62, 0, 0, |
| 1421 |
0, 0, 0, 5, 0, 0, 0, 0, 0, 0, |
| 1422 |
0, 0, 0, 0, 0, 0, 0, 6, 0, 7, |
| 1423 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1424 |
0, 0, 0, 0, -62, 0, 0, 0, 0, 0, |
| 1425 |
0, 8, 0, 9, 0, 10, 11, 0, 0, 0, |
| 1426 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 12, |
| 1427 |
13 |
| 1428 |
}; |
| 1429 |
|
| 1430 |
static const short int zz_check[] = |
| 1431 |
{ |
| 1432 |
48, 32, 49, 50, 24, 52, 54, 38, 444, 426, |
| 1433 |
40, 139, 17, 32, 32, 17, 27, 27, 35, 68, |
| 1434 |
67, 11, 63, 459, 17, 104, 54, 58, 103, 108, |
| 1435 |
61, 21, 104, 17, 82, 466, 84, 103, 104, 87, |
| 1436 |
104, 120, 104, 104, 123, 104, 121, 108, 95, 121, |
| 1437 |
116, 103, 104, 17, 82, 121, 55, 121, 63, 121, |
| 1438 |
108, 63, 110, 4, 81, 17, 7, 8, 58, 121, |
| 1439 |
63, 120, 103, 121, 35, 123, 102, 103, 126, 63, |
| 1440 |
108, 129, 110, 131, 515, 516, 104, 106, 4, 106, |
| 1441 |
120, 7, 8, 104, 104, 123, 113, 114, 126, 63, |
| 1442 |
104, 129, 230, 231, 232, 233, 523, 107, 49, 50, |
| 1443 |
51, 63, 240, 241, 108, 104, 552, 121, 246, 247, |
| 1444 |
81, 374, 120, 376, 124, 125, 254, 255, 122, 104, |
| 1445 |
258, 259, 121, 49, 50, 51, 55, 184, 179, 512, |
| 1446 |
181, 60, 104, 560, 517, 106, 19, 88, 89, 90, |
| 1447 |
23, 182, 113, 114, 121, 115, 116, 30, 125, 119, |
| 1448 |
33, 104, 122, 120, 107, 121, 214, 124, 125, 125, |
| 1449 |
218, 6, 88, 89, 90, 91, 92, 106, 115, 116, |
| 1450 |
120, 16, 119, 18, 124, 125, 104, 234, 104, 107, |
| 1451 |
218, 222, 108, 113, 114, 115, 116, 120, 245, 119, |
| 1452 |
35, 249, 250, 331, 224, 115, 116, 123, 256, 119, |
| 1453 |
121, 44, 260, 48, 125, 28, 29, 121, 53, 54, |
| 1454 |
348, 125, 250, 44, 59, 273, 121, 355, 256, 121, |
| 1455 |
125, 66, 260, 125, 362, 9, 120, 11, 73, 123, |
| 1456 |
38, 113, 114, 78, 102, 103, 81, 82, 44, 5, |
| 1457 |
120, 278, 279, 120, 104, 32, 12, 13, 55, 306, |
| 1458 |
104, 308, 56, 104, 104, 68, 121, 102, 103, 104, |
| 1459 |
104, 106, 111, 104, 104, 107, 105, 120, 113, 114, |
| 1460 |
104, 328, 120, 120, 120, 104, 121, 104, 44, 337, |
| 1461 |
125, 105, 120, 104, 121, 105, 105, 345, 121, 68, |
| 1462 |
120, 86, 104, 350, 432, 58, 62, 56, 339, 337, |
| 1463 |
357, 126, 440, 120, 120, 120, 120, 364, 108, 58, |
| 1464 |
448, 77, 370, 105, 105, 453, 121, 120, 95, 96, |
| 1465 |
97, 379, 120, 44, 121, 366, 93, 126, 54, 95, |
| 1466 |
96, 97, 370, 110, 111, 112, 113, 114, 115, 116, |
| 1467 |
104, 379, 119, 109, 110, 111, 112, 113, 114, 115, |
| 1468 |
116, 119, 104, 119, 104, 126, 122, 122, 104, 121, |
| 1469 |
401, 122, 120, 120, 120, 120, 120, 61, 26, 122, |
| 1470 |
5, 104, 98, 92, 122, 126, 120, 12, 13, 126, |
| 1471 |
122, 126, 122, 126, 123, 111, 122, 113, 122, 430, |
| 1472 |
116, 117, 123, 450, 122, 122, 126, 438, 123, 121, |
| 1473 |
458, 121, 460, 120, 130, 446, 120, 122, 31, 44, |
| 1474 |
136, 137, 138, 122, 104, 123, 123, 123, 123, 123, |
| 1475 |
458, 123, 460, 122, 101, 482, 122, 62, 485, 120, |
| 1476 |
122, 86, 121, 490, 107, 123, 123, 123, 495, 122, |
| 1477 |
481, 122, 120, 103, 120, 486, 45, 119, 489, 120, |
| 1478 |
491, 508, 122, 494, 49, 496, 120, 123, 499, 122, |
| 1479 |
95, 96, 97, 103, 64, 104, 122, 44, 115, 61, |
| 1480 |
123, 103, 24, 104, 612, 110, 111, 112, 113, 114, |
| 1481 |
115, 116, 101, 121, 119, 526, 20, 54, 122, 122, |
| 1482 |
284, 549, 533, 457, 428, 436, 554, 118, 539, 87, |
| 1483 |
513, 394, 543, -1, 38, 560, 547, 41, 42, -1, |
| 1484 |
-1, 549, -1, 47, -1, 572, 554, -1, -1, -1, |
| 1485 |
577, 55, -1, -1, -1, -1, 60, -1, -1, -1, |
| 1486 |
-1, -1, -1, 591, -1, -1, -1, -1, -1, -1, |
| 1487 |
74, 267, 600, -1, -1, 79, -1, -1, -1, 83, |
| 1488 |
-1, 85, -1, 87, -1, -1, 282, 283, 284, 285, |
| 1489 |
-1, -1, 288, 289, 290, -1, -1, -1, 294, -1, |
| 1490 |
104, -1, 298, 299, 300, 301, 302, 303, 304, -1, |
| 1491 |
-1, -1, -1, -1, 1, -1, -1, -1, -1, 6, |
| 1492 |
-1, -1, -1, 10, -1, 321, 322, 14, 15, 16, |
| 1493 |
17, 18, -1, 20, -1, 22, -1, -1, -1, -1, |
| 1494 |
-1, -1, 338, -1, 31, 32, -1, 34, 35, 36, |
| 1495 |
37, 38, 39, -1, -1, 42, -1, -1, -1, -1, |
| 1496 |
-1, 48, -1, -1, -1, 52, 53, 54, 55, -1, |
| 1497 |
57, -1, 59, 60, -1, -1, 63, -1, -1, 66, |
| 1498 |
-1, -1, -1, -1, 71, 72, 73, 74, -1, 76, |
| 1499 |
-1, 78, 79, -1, 81, 82, 83, -1, 85, -1, |
| 1500 |
87, -1, -1, -1, -1, -1, -1, 94, -1, -1, |
| 1501 |
-1, -1, -1, -1, -1, 102, 103, 104, -1, 106, |
| 1502 |
6, -1, -1, -1, -1, -1, 113, 114, -1, -1, |
| 1503 |
16, -1, 18, -1, 121, 122, -1, -1, 125, -1, |
| 1504 |
5, -1, -1, -1, -1, -1, -1, 12, 13, 35, |
| 1505 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1506 |
-1, -1, 48, -1, 460, -1, 52, 53, 54, -1, |
| 1507 |
-1, 57, -1, 59, -1, -1, -1, -1, 474, 44, |
| 1508 |
66, -1, -1, 5, -1, -1, -1, 73, -1, -1, |
| 1509 |
12, 13, 78, -1, -1, 81, 82, 62, -1, 85, |
| 1510 |
-1, -1, -1, 25, -1, -1, -1, -1, 504, -1, |
| 1511 |
-1, -1, 77, -1, -1, -1, 102, 103, 104, -1, |
| 1512 |
106, -1, 44, -1, 46, -1, 5, 113, 114, -1, |
| 1513 |
95, 96, 97, 12, 13, 121, -1, -1, -1, 125, |
| 1514 |
62, -1, -1, -1, 109, 110, 111, 112, 113, 114, |
| 1515 |
115, 116, -1, -1, 119, 77, -1, 122, -1, -1, |
| 1516 |
-1, -1, -1, -1, -1, 44, -1, -1, -1, 5, |
| 1517 |
-1, -1, -1, 95, 96, 97, 12, 13, -1, -1, |
| 1518 |
-1, -1, -1, 62, -1, -1, -1, 109, 110, 111, |
| 1519 |
112, 113, 114, 115, 116, -1, -1, 119, 77, 5, |
| 1520 |
-1, -1, -1, -1, -1, -1, 12, 13, 44, -1, |
| 1521 |
-1, -1, -1, -1, -1, -1, 95, 96, 97, 98, |
| 1522 |
-1, -1, -1, -1, 30, -1, 62, -1, -1, -1, |
| 1523 |
109, 110, 111, 112, 113, 114, 115, 116, 44, -1, |
| 1524 |
119, 77, 5, -1, 80, -1, -1, -1, -1, 12, |
| 1525 |
13, -1, -1, -1, -1, -1, 62, -1, -1, 95, |
| 1526 |
96, 97, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1527 |
-1, 77, -1, 109, 110, 111, 112, 113, 114, 115, |
| 1528 |
116, 44, -1, 119, -1, 5, -1, -1, -1, 95, |
| 1529 |
96, 97, 12, 13, -1, -1, -1, -1, -1, 62, |
| 1530 |
-1, -1, -1, 109, 110, 111, 112, 113, 114, 115, |
| 1531 |
116, -1, -1, 119, 77, 5, -1, -1, -1, -1, |
| 1532 |
-1, -1, -1, -1, 44, -1, -1, -1, -1, -1, |
| 1533 |
-1, -1, 95, 96, 97, 98, -1, -1, -1, -1, |
| 1534 |
-1, -1, 62, -1, -1, -1, 109, 110, 111, 112, |
| 1535 |
113, 114, 115, 116, 44, -1, 119, 77, -1, -1, |
| 1536 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1537 |
-1, -1, 62, -1, -1, 95, 96, 97, -1, -1, |
| 1538 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, 109, |
| 1539 |
110, 111, 112, 113, 114, 115, 116, -1, -1, 119, |
| 1540 |
-1, -1, -1, -1, -1, 95, 96, 97, -1, -1, |
| 1541 |
-1, -1, -1, -1, -1, -1, 0, 1, -1, 3, |
| 1542 |
110, 111, 112, 113, 114, 115, 116, 11, -1, 119, |
| 1543 |
-1, -1, -1, -1, -1, -1, -1, 21, -1, -1, |
| 1544 |
-1, -1, -1, 27, -1, -1, -1, -1, -1, -1, |
| 1545 |
-1, -1, -1, -1, -1, -1, -1, 41, -1, 43, |
| 1546 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1547 |
-1, -1, -1, -1, 58, -1, -1, -1, -1, -1, |
| 1548 |
-1, 65, -1, 67, -1, 69, 70, -1, -1, -1, |
| 1549 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, 83, |
| 1550 |
84 |
| 1551 |
}; |
| 1552 |
|
| 1553 |
/* ZZ_STOS[STATE-NUM] -- The (internal number of the) accessing |
| 1554 |
symbol of state STATE-NUM. */ |
| 1555 |
static const unsigned char zz_stos[] = |
| 1556 |
{ |
| 1557 |
0, 128, 0, 1, 3, 27, 41, 43, 65, 67, |
| 1558 |
69, 70, 83, 84, 129, 130, 131, 132, 133, 134, |
| 1559 |
135, 136, 137, 138, 139, 140, 144, 147, 153, 154, |
| 1560 |
155, 156, 157, 158, 159, 55, 60, 104, 120, 104, |
| 1561 |
104, 104, 107, 225, 55, 107, 225, 160, 106, 220, |
| 1562 |
164, 165, 164, 168, 169, 11, 21, 58, 141, 142, |
| 1563 |
145, 148, 149, 168, 120, 44, 44, 168, 40, 120, |
| 1564 |
38, 120, 120, 124, 125, 44, 120, 120, 32, 104, |
| 1565 |
161, 226, 221, 222, 223, 224, 225, 106, 226, 226, |
| 1566 |
56, 166, 167, 226, 55, 162, 1, 6, 10, 14, |
| 1567 |
15, 16, 18, 20, 22, 34, 35, 36, 37, 38, |
| 1568 |
39, 42, 48, 52, 53, 54, 57, 59, 60, 66, |
| 1569 |
71, 72, 73, 74, 76, 78, 79, 81, 82, 85, |
| 1570 |
87, 94, 102, 103, 104, 106, 113, 114, 121, 125, |
| 1571 |
159, 170, 171, 172, 173, 175, 176, 182, 183, 184, |
| 1572 |
185, 186, 187, 188, 189, 193, 195, 198, 199, 200, |
| 1573 |
201, 202, 203, 204, 205, 207, 210, 211, 212, 215, |
| 1574 |
218, 219, 222, 224, 232, 240, 104, 104, 104, 168, |
| 1575 |
68, 168, 121, 150, 162, 27, 104, 104, 226, 107, |
| 1576 |
104, 104, 224, 229, 230, 240, 27, 104, 20, 38, |
| 1577 |
41, 42, 47, 55, 60, 74, 79, 83, 85, 87, |
| 1578 |
104, 111, 222, 105, 108, 224, 107, 228, 221, 120, |
| 1579 |
120, 104, 120, 120, 163, 226, 120, 240, 104, 177, |
| 1580 |
121, 125, 121, 125, 168, 104, 222, 104, 222, 240, |
| 1581 |
121, 125, 240, 240, 240, 220, 121, 125, 224, 121, |
| 1582 |
121, 222, 105, 227, 121, 125, 121, 222, 121, 125, |
| 1583 |
121, 222, 240, 224, 105, 233, 105, 121, 240, 240, |
| 1584 |
240, 229, 120, 4, 7, 8, 49, 50, 51, 88, |
| 1585 |
89, 90, 91, 92, 123, 5, 12, 13, 44, 62, |
| 1586 |
77, 95, 96, 97, 109, 110, 111, 112, 113, 114, |
| 1587 |
115, 116, 119, 241, 242, 68, 162, 104, 162, 168, |
| 1588 |
86, 151, 226, 58, 120, 56, 179, 120, 120, 120, |
| 1589 |
126, 108, 98, 58, 120, 105, 105, 224, 168, 164, |
| 1590 |
120, 121, 229, 229, 229, 229, 226, 121, 44, 80, |
| 1591 |
229, 229, 226, 229, 229, 93, 224, 222, 17, 63, |
| 1592 |
213, 214, 229, 229, 222, 17, 63, 216, 217, 229, |
| 1593 |
229, 222, 17, 63, 208, 209, 30, 240, 122, 126, |
| 1594 |
121, 224, 104, 178, 104, 178, 178, 240, 240, 85, |
| 1595 |
104, 188, 240, 240, 240, 240, 240, 240, 240, 240, |
| 1596 |
240, 240, 240, 240, 104, 226, 28, 29, 234, 226, |
| 1597 |
122, 121, 68, 120, 120, 120, 104, 120, 240, 240, |
| 1598 |
120, 120, 226, 229, 122, 126, 122, 126, 222, 240, |
| 1599 |
168, 122, 126, 122, 126, 224, 108, 122, 122, 229, |
| 1600 |
123, 226, 17, 63, 122, 126, 122, 229, 123, 226, |
| 1601 |
17, 63, 122, 126, 122, 229, 123, 226, 17, 63, |
| 1602 |
168, 122, 222, 121, 61, 180, 180, 180, 121, 222, |
| 1603 |
121, 234, 120, 103, 104, 116, 121, 235, 236, 26, |
| 1604 |
143, 120, 168, 104, 98, 120, 122, 122, 25, 46, |
| 1605 |
196, 31, 206, 103, 232, 213, 123, 168, 229, 123, |
| 1606 |
216, 123, 168, 229, 123, 208, 123, 168, 229, 123, |
| 1607 |
226, 122, 229, 104, 101, 181, 181, 222, 208, 190, |
| 1608 |
222, 224, 92, 146, 236, 115, 116, 119, 35, 81, |
| 1609 |
106, 113, 114, 239, 120, 122, 121, 152, 240, 19, |
| 1610 |
23, 30, 33, 197, 168, 226, 122, 226, 168, 123, |
| 1611 |
168, 226, 168, 123, 168, 226, 168, 123, 168, 86, |
| 1612 |
122, 240, 122, 226, 120, 120, 123, 35, 81, 106, |
| 1613 |
239, 228, 122, 236, 236, 237, 239, 103, 231, 232, |
| 1614 |
168, 120, 168, 168, 168, 168, 222, 208, 191, 222, |
| 1615 |
103, 45, 231, 120, 103, 121, 238, 122, 226, 49, |
| 1616 |
226, 120, 192, 123, 122, 103, 104, 224, 122, 64, |
| 1617 |
44, 194, 115, 61, 123, 224, 103, 104, 24, 122, |
| 1618 |
101, 174, 121, 229, 122 |
| 1619 |
}; |
| 1620 |
|
| 1621 |
#if ! defined (ZZ_SIZE_T) && defined (__SIZE_TYPE__) |
| 1622 |
# define ZZ_SIZE_T __SIZE_TYPE__ |
| 1623 |
#endif |
| 1624 |
#if ! defined (ZZ_SIZE_T) && defined (size_t) |
| 1625 |
# define ZZ_SIZE_T size_t |
| 1626 |
#endif |
| 1627 |
#if ! defined (ZZ_SIZE_T) |
| 1628 |
# if defined (__STDC__) || defined (__cplusplus) |
| 1629 |
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| 1630 |
# define ZZ_SIZE_T size_t |
| 1631 |
# endif |
| 1632 |
#endif |
| 1633 |
#if ! defined (ZZ_SIZE_T) |
| 1634 |
# define ZZ_SIZE_T unsigned int |
| 1635 |
#endif |
| 1636 |
|
| 1637 |
#define zz_errok (zz_errstatus = 0) |
| 1638 |
#define zz_clearin (zz_char = ZZ_EMPTY) |
| 1639 |
#define ZZ_EMPTY (-2) |
| 1640 |
#define ZZ_EOF 0 |
| 1641 |
|
| 1642 |
#define ZZ_ACCEPT goto zz_acceptlab |
| 1643 |
#define ZZ_ABORT goto zz_abortlab |
| 1644 |
#define ZZ_ERROR goto zz_errorlab |
| 1645 |
|
| 1646 |
|
| 1647 |
/* Like ZZ_ERROR except do call zz_error. This remains here temporarily |
| 1648 |
to ease the transition to the new meaning of ZZ_ERROR, for GCC. |
| 1649 |
Once GCC version 2 has supplanted version 1, this can go. */ |
| 1650 |
|
| 1651 |
#define ZZ_FAIL goto zz_errlab |
| 1652 |
|
| 1653 |
#define ZZ_RECOVERING() (!!zz_errstatus) |
| 1654 |
|
| 1655 |
#define ZZ_BACKUP(Token, Value) \ |
| 1656 |
do \ |
| 1657 |
if (zz_char == ZZ_EMPTY && zz_len == 1) \ |
| 1658 |
{ \ |
| 1659 |
zz_char = (Token); \ |
| 1660 |
zz_lval = (Value); \ |
| 1661 |
zz_token = ZZ_TRANSLATE (zz_char); \ |
| 1662 |
ZZ_POPSTACK; \ |
| 1663 |
goto zz_backup; \ |
| 1664 |
} \ |
| 1665 |
else \ |
| 1666 |
{ \ |
| 1667 |
zz_error ("syntax error: cannot back up");\ |
| 1668 |
ZZ_ERROR; \ |
| 1669 |
} \ |
| 1670 |
while (0) |
| 1671 |
|
| 1672 |
|
| 1673 |
#define ZZ_TERROR 1 |
| 1674 |
#define ZZ_ERRCODE 256 |
| 1675 |
|
| 1676 |
|
| 1677 |
/* ZZ_LLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
| 1678 |
If N is 0, then set CURRENT to the empty location which ends |
| 1679 |
the previous symbol: RHS[0] (always defined). */ |
| 1680 |
|
| 1681 |
#define ZZ_RHSLOC(Rhs, K) ((Rhs)[K]) |
| 1682 |
#ifndef ZZ_LLOC_DEFAULT |
| 1683 |
# define ZZ_LLOC_DEFAULT(Current, Rhs, N) \ |
| 1684 |
do \ |
| 1685 |
if (N) \ |
| 1686 |
{ \ |
| 1687 |
(Current).first_line = ZZ_RHSLOC (Rhs, 1).first_line; \ |
| 1688 |
(Current).first_column = ZZ_RHSLOC (Rhs, 1).first_column; \ |
| 1689 |
(Current).last_line = ZZ_RHSLOC (Rhs, N).last_line; \ |
| 1690 |
(Current).last_column = ZZ_RHSLOC (Rhs, N).last_column; \ |
| 1691 |
} \ |
| 1692 |
else \ |
| 1693 |
{ \ |
| 1694 |
(Current).first_line = (Current).last_line = \ |
| 1695 |
ZZ_RHSLOC (Rhs, 0).last_line; \ |
| 1696 |
(Current).first_column = (Current).last_column = \ |
| 1697 |
ZZ_RHSLOC (Rhs, 0).last_column; \ |
| 1698 |
} \ |
| 1699 |
while (0) |
| 1700 |
#endif |
| 1701 |
|
| 1702 |
|
| 1703 |
/* ZZ__LOCATION_PRINT -- Print the location on the stream. |
| 1704 |
This macro was not mandated originally: define only if we know |
| 1705 |
we won't break user code: when these are the locations we know. */ |
| 1706 |
|
| 1707 |
#ifndef ZZ__LOCATION_PRINT |
| 1708 |
# if ZZ_LTYPE_IS_TRIVIAL |
| 1709 |
# define ZZ__LOCATION_PRINT(File, Loc) \ |
| 1710 |
fprintf (File, "%d.%d-%d.%d", \ |
| 1711 |
(Loc).first_line, (Loc).first_column, \ |
| 1712 |
(Loc).last_line, (Loc).last_column) |
| 1713 |
# else |
| 1714 |
# define ZZ__LOCATION_PRINT(File, Loc) ((void) 0) |
| 1715 |
# endif |
| 1716 |
#endif |
| 1717 |
|
| 1718 |
|
| 1719 |
/* ZZ_LEX -- calling `zz_lex' with the right arguments. */ |
| 1720 |
|
| 1721 |
#ifdef ZZ_LEX_PARAM |
| 1722 |
# define ZZ_LEX zz_lex (ZZ_LEX_PARAM) |
| 1723 |
#else |
| 1724 |
# define ZZ_LEX zz_lex () |
| 1725 |
#endif |
| 1726 |
|
| 1727 |
/* Enable debugging if requested. */ |
| 1728 |
#if ZZ_DEBUG |
| 1729 |
|
| 1730 |
# ifndef ZZ_FPRINTF |
| 1731 |
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
| 1732 |
# define ZZ_FPRINTF fprintf |
| 1733 |
# endif |
| 1734 |
|
| 1735 |
# define ZZ_DPRINTF(Args) \ |
| 1736 |
do { \ |
| 1737 |
if (zz_debug) \ |
| 1738 |
ZZ_FPRINTF Args; \ |
| 1739 |
} while (0) |
| 1740 |
|
| 1741 |
# define ZZ__SYMBOL_PRINT(Title, Type, Value, Location) \ |
| 1742 |
do { \ |
| 1743 |
if (zz_debug) \ |
| 1744 |
{ \ |
| 1745 |
ZZ_FPRINTF (stderr, "%s ", Title); \ |
| 1746 |
zz_symprint (stderr, \ |
| 1747 |
Type, Value); \ |
| 1748 |
ZZ_FPRINTF (stderr, "\n"); \ |
| 1749 |
} \ |
| 1750 |
} while (0) |
| 1751 |
|
| 1752 |
/*------------------------------------------------------------------. |
| 1753 |
| zz__stack_print -- Print the state stack from its BOTTOM up to its | |
| 1754 |
| TOP (included). | |
| 1755 |
`------------------------------------------------------------------*/ |
| 1756 |
|
| 1757 |
#if defined (__STDC__) || defined (__cplusplus) |
| 1758 |
static void |
| 1759 |
zz__stack_print (short int *bottom, short int *top) |
| 1760 |
#else |
| 1761 |
static void |
| 1762 |
zz__stack_print (bottom, top) |
| 1763 |
short int *bottom; |
| 1764 |
short int *top; |
| 1765 |
#endif |
| 1766 |
{ |
| 1767 |
ZZ_FPRINTF (stderr, "Stack now"); |
| 1768 |
for (/* Nothing. */; bottom <= top; ++bottom) |
| 1769 |
ZZ_FPRINTF (stderr, " %d", *bottom); |
| 1770 |
ZZ_FPRINTF (stderr, "\n"); |
| 1771 |
} |
| 1772 |
|
| 1773 |
# define ZZ__STACK_PRINT(Bottom, Top) \ |
| 1774 |
do { \ |
| 1775 |
if (zz_debug) \ |
| 1776 |
zz__stack_print ((Bottom), (Top)); \ |
| 1777 |
} while (0) |
| 1778 |
|
| 1779 |
|
| 1780 |
/*------------------------------------------------. |
| 1781 |
| Report that the ZZ_RULE is going to be reduced. | |
| 1782 |
`------------------------------------------------*/ |
| 1783 |
|
| 1784 |
#if defined (__STDC__) || defined (__cplusplus) |
| 1785 |
static void |
| 1786 |
zz__reduce_print (int zz_rule) |
| 1787 |
#else |
| 1788 |
static void |
| 1789 |
zz__reduce_print (zz_rule) |
| 1790 |
int zz_rule; |
| 1791 |
#endif |
| 1792 |
{ |
| 1793 |
int zz_i; |
| 1794 |
unsigned int zz_lno = zz_rline[zz_rule]; |
| 1795 |
ZZ_FPRINTF (stderr, "Reducing stack by rule %d (line %u), ", |
| 1796 |
zz_rule - 1, zz_lno); |
| 1797 |
/* Print the symbols being reduced, and their result. */ |
| 1798 |
for (zz_i = zz_prhs[zz_rule]; 0 <= zz_rhs[zz_i]; zz_i++) |
| 1799 |
ZZ_FPRINTF (stderr, "%s ", zz_tname [zz_rhs[zz_i]]); |
| 1800 |
ZZ_FPRINTF (stderr, "-> %s\n", zz_tname [zz_r1[zz_rule]]); |
| 1801 |
} |
| 1802 |
|
| 1803 |
# define ZZ__REDUCE_PRINT(Rule) \ |
| 1804 |
do { \ |
| 1805 |
if (zz_debug) \ |
| 1806 |
zz__reduce_print (Rule); \ |
| 1807 |
} while (0) |
| 1808 |
|
| 1809 |
/* Nonzero means print parse trace. It is left uninitialized so that |
| 1810 |
multiple parsers can coexist. */ |
| 1811 |
int zz_debug; |
| 1812 |
#else /* !ZZ_DEBUG */ |
| 1813 |
# define ZZ_DPRINTF(Args) |
| 1814 |
# define ZZ__SYMBOL_PRINT(Title, Type, Value, Location) |
| 1815 |
# define ZZ__STACK_PRINT(Bottom, Top) |
| 1816 |
# define ZZ__REDUCE_PRINT(Rule) |
| 1817 |
#endif /* !ZZ_DEBUG */ |
| 1818 |
|
| 1819 |
|
| 1820 |
/* ZZ_INITDEPTH -- initial size of the parser's stacks. */ |
| 1821 |
#ifndef ZZ_INITDEPTH |
| 1822 |
# define ZZ_INITDEPTH 200 |
| 1823 |
#endif |
| 1824 |
|
| 1825 |
/* ZZ_MAXDEPTH -- maximum size the stacks can grow to (effective only |
| 1826 |
if the built-in stack extension method is used). |
| 1827 |
|
| 1828 |
Do not make this value too large; the results are undefined if |
| 1829 |
SIZE_MAX < ZZ_STACK_BYTES (ZZ_MAXDEPTH) |
| 1830 |
evaluated with infinite-precision integer arithmetic. */ |
| 1831 |
|
| 1832 |
#ifndef ZZ_MAXDEPTH |
| 1833 |
# define ZZ_MAXDEPTH 10000 |
| 1834 |
#endif |
| 1835 |
|
| 1836 |
|
| 1837 |
|
| 1838 |
#if ZZ_ERROR_VERBOSE |
| 1839 |
|
| 1840 |
# ifndef zz_strlen |
| 1841 |
# if defined (__GLIBC__) && defined (_STRING_H) |
| 1842 |
# define zz_strlen strlen |
| 1843 |
# else |
| 1844 |
/* Return the length of ZZ_STR. */ |
| 1845 |
static ZZ_SIZE_T |
| 1846 |
# if defined (__STDC__) || defined (__cplusplus) |
| 1847 |
zz_strlen (const char *zz_str) |
| 1848 |
# else |
| 1849 |
zz_strlen (zz_str) |
| 1850 |
const char *zz_str; |
| 1851 |
# endif |
| 1852 |
{ |
| 1853 |
register const char *zz_s = zz_str; |
| 1854 |
|
| 1855 |
while (*zz_s++ != '\0') |
| 1856 |
continue; |
| 1857 |
|
| 1858 |
return zz_s - zz_str - 1; |
| 1859 |
} |
| 1860 |
# endif |
| 1861 |
# endif |
| 1862 |
|
| 1863 |
# ifndef zz_stpcpy |
| 1864 |
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) |
| 1865 |
# define zz_stpcpy stpcpy |
| 1866 |
# else |
| 1867 |
/* Copy ZZ_SRC to ZZ_DEST, returning the address of the terminating '\0' in |
| 1868 |
ZZ_DEST. */ |
| 1869 |
static char * |
| 1870 |
# if defined (__STDC__) || defined (__cplusplus) |
| 1871 |
zz_stpcpy (char *zz_dest, const char *zz_src) |
| 1872 |
# else |
| 1873 |
zz_stpcpy (zz_dest, zz_src) |
| 1874 |
char *zz_dest; |
| 1875 |
const char *zz_src; |
| 1876 |
# endif |
| 1877 |
{ |
| 1878 |
register char *zz_d = zz_dest; |
| 1879 |
register const char *zz_s = zz_src; |
| 1880 |
|
| 1881 |
while ((*zz_d++ = *zz_s++) != '\0') |
| 1882 |
continue; |
| 1883 |
|
| 1884 |
return zz_d - 1; |
| 1885 |
} |
| 1886 |
# endif |
| 1887 |
# endif |
| 1888 |
|
| 1889 |
#endif /* !ZZ_ERROR_VERBOSE */ |
| 1890 |
|
| 1891 |
|
| 1892 |
|
| 1893 |
#if ZZ_DEBUG |
| 1894 |
/*--------------------------------. |
| 1895 |
| Print this symbol on ZZ_OUTPUT. | |
| 1896 |
`--------------------------------*/ |
| 1897 |
|
| 1898 |
#if defined (__STDC__) || defined (__cplusplus) |
| 1899 |
static void |
| 1900 |
zz_symprint (FILE *zz_output, int zz_type, ZZ_STYPE *zz_valuep) |
| 1901 |
#else |
| 1902 |
static void |
| 1903 |
zz_symprint (zz_output, zz_type, zz_valuep) |
| 1904 |
FILE *zz_output; |
| 1905 |
int zz_type; |
| 1906 |
ZZ_STYPE *zz_valuep; |
| 1907 |
#endif |
| 1908 |
{ |
| 1909 |
/* Pacify ``unused variable'' warnings. */ |
| 1910 |
(void) zz_valuep; |
| 1911 |
|
| 1912 |
if (zz_type < ZZ_NTOKENS) |
| 1913 |
ZZ_FPRINTF (zz_output, "token %s (", zz_tname[zz_type]); |
| 1914 |
else |
| 1915 |
ZZ_FPRINTF (zz_output, "nterm %s (", zz_tname[zz_type]); |
| 1916 |
|
| 1917 |
|
| 1918 |
# ifdef ZZ_PRINT |
| 1919 |
if (zz_type < ZZ_NTOKENS) |
| 1920 |
ZZ_PRINT (zz_output, zz_toknum[zz_type], *zz_valuep); |
| 1921 |
# endif |
| 1922 |
switch (zz_type) |
| 1923 |
{ |
| 1924 |
default: |
| 1925 |
break; |
| 1926 |
} |
| 1927 |
ZZ_FPRINTF (zz_output, ")"); |
| 1928 |
} |
| 1929 |
|
| 1930 |
#endif /* ! ZZ_DEBUG */ |
| 1931 |
/*-----------------------------------------------. |
| 1932 |
| Release the memory associated to this symbol. | |
| 1933 |
`-----------------------------------------------*/ |
| 1934 |
|
| 1935 |
#if defined (__STDC__) || defined (__cplusplus) |
| 1936 |
static void |
| 1937 |
zz_destruct (const char *zz_msg, int zz_type, ZZ_STYPE *zz_valuep) |
| 1938 |
#else |
| 1939 |
static void |
| 1940 |
zz_destruct (zz_msg, zz_type, zz_valuep) |
| 1941 |
const char *zz_msg; |
| 1942 |
int zz_type; |
| 1943 |
ZZ_STYPE *zz_valuep; |
| 1944 |
#endif |
| 1945 |
{ |
| 1946 |
/* Pacify ``unused variable'' warnings. */ |
| 1947 |
(void) zz_valuep; |
| 1948 |
|
| 1949 |
if (!zz_msg) |
| 1950 |
zz_msg = "Deleting"; |
| 1951 |
ZZ__SYMBOL_PRINT (zz_msg, zz_type, zz_valuep, zz_locationp); |
| 1952 |
|
| 1953 |
switch (zz_type) |
| 1954 |
{ |
| 1955 |
|
| 1956 |
default: |
| 1957 |
break; |
| 1958 |
} |
| 1959 |
} |
| 1960 |
|
| 1961 |
|
| 1962 |
/* Prevent warnings from -Wmissing-prototypes. */ |
| 1963 |
|
| 1964 |
#ifdef ZZ_PARSE_PARAM |
| 1965 |
# if defined (__STDC__) || defined (__cplusplus) |
| 1966 |
int zz_parse (void *ZZ_PARSE_PARAM); |
| 1967 |
# else |
| 1968 |
int zz_parse (); |
| 1969 |
# endif |
| 1970 |
#else /* ! ZZ_PARSE_PARAM */ |
| 1971 |
#if defined (__STDC__) || defined (__cplusplus) |
| 1972 |
int zz_parse (void); |
| 1973 |
#else |
| 1974 |
int zz_parse (); |
| 1975 |
#endif |
| 1976 |
#endif /* ! ZZ_PARSE_PARAM */ |
| 1977 |
|
| 1978 |
|
| 1979 |
|
| 1980 |
/* The look-ahead symbol. */ |
| 1981 |
int zz_char; |
| 1982 |
|
| 1983 |
/* The semantic value of the look-ahead symbol. */ |
| 1984 |
ZZ_STYPE zz_lval; |
| 1985 |
|
| 1986 |
/* Number of syntax errors so far. */ |
| 1987 |
int zz_nerrs; |
| 1988 |
|
| 1989 |
|
| 1990 |
|
| 1991 |
/*----------. |
| 1992 |
| zz_parse. | |
| 1993 |
`----------*/ |
| 1994 |
|
| 1995 |
#ifdef ZZ_PARSE_PARAM |
| 1996 |
# if defined (__STDC__) || defined (__cplusplus) |
| 1997 |
int zz_parse (void *ZZ_PARSE_PARAM) |
| 1998 |
# else |
| 1999 |
int zz_parse (ZZ_PARSE_PARAM) |
| 2000 |
void *ZZ_PARSE_PARAM; |
| 2001 |
# endif |
| 2002 |
#else /* ! ZZ_PARSE_PARAM */ |
| 2003 |
#if defined (__STDC__) || defined (__cplusplus) |
| 2004 |
int |
| 2005 |
zz_parse (void) |
| 2006 |
#else |
| 2007 |
int |
| 2008 |
zz_parse () |
| 2009 |
|
| 2010 |
#endif |
| 2011 |
#endif |
| 2012 |
{ |
| 2013 |
|
| 2014 |
register int zz_state; |
| 2015 |
register int zz_n; |
| 2016 |
int zz_result; |
| 2017 |
/* Number of tokens to shift before error messages enabled. */ |
| 2018 |
int zz_errstatus; |
| 2019 |
/* Look-ahead token as an internal (translated) token number. */ |
| 2020 |
int zz_token = 0; |
| 2021 |
|
| 2022 |
/* Three stacks and their tools: |
| 2023 |
`zz_ss': related to states, |
| 2024 |
`zz_vs': related to semantic values, |
| 2025 |
`zz_ls': related to locations. |
| 2026 |
|
| 2027 |
Refer to the stacks thru separate pointers, to allow zz_overflow |
| 2028 |
to reallocate them elsewhere. */ |
| 2029 |
|
| 2030 |
/* The state stack. */ |
| 2031 |
short int zz_ssa[ZZ_INITDEPTH]; |
| 2032 |
short int *zz_ss = zz_ssa; |
| 2033 |
register short int *zz_ssp; |
| 2034 |
|
| 2035 |
/* The semantic value stack. */ |
| 2036 |
ZZ_STYPE zz_vsa[ZZ_INITDEPTH]; |
| 2037 |
ZZ_STYPE *zz_vs = zz_vsa; |
| 2038 |
register ZZ_STYPE *zz_vsp; |
| 2039 |
|
| 2040 |
|
| 2041 |
|
| 2042 |
#define ZZ_POPSTACK (zz_vsp--, zz_ssp--) |
| 2043 |
|
| 2044 |
ZZ_SIZE_T zz_stacksize = ZZ_INITDEPTH; |
| 2045 |
|
| 2046 |
/* The variables used to return semantic value and location from the |
| 2047 |
action routines. */ |
| 2048 |
ZZ_STYPE zz_val; |
| 2049 |
|
| 2050 |
|
| 2051 |
/* When reducing, the number of symbols on the RHS of the reduced |
| 2052 |
rule. */ |
| 2053 |
int zz_len; |
| 2054 |
|
| 2055 |
ZZ_DPRINTF ((stderr, "Starting parse\n")); |
| 2056 |
|
| 2057 |
zz_state = 0; |
| 2058 |
zz_errstatus = 0; |
| 2059 |
zz_nerrs = 0; |
| 2060 |
zz_char = ZZ_EMPTY; /* Cause a token to be read. */ |
| 2061 |
|
| 2062 |
/* Initialize stack pointers. |
| 2063 |
Waste one element of value and location stack |
| 2064 |
so that they stay on the same level as the state stack. |
| 2065 |
The wasted elements are never initialized. */ |
| 2066 |
|
| 2067 |
zz_ssp = zz_ss; |
| 2068 |
zz_vsp = zz_vs; |
| 2069 |
|
| 2070 |
|
| 2071 |
zz_vsp[0] = zz_lval; |
| 2072 |
|
| 2073 |
goto zz_setstate; |
| 2074 |
|
| 2075 |
/*------------------------------------------------------------. |
| 2076 |
| zz_newstate -- Push a new state, which is found in zz_state. | |
| 2077 |
`------------------------------------------------------------*/ |
| 2078 |
zz_newstate: |
| 2079 |
/* In all cases, when you get here, the value and location stacks |
| 2080 |
have just been pushed. so pushing a state here evens the stacks. |
| 2081 |
*/ |
| 2082 |
zz_ssp++; |
| 2083 |
|
| 2084 |
zz_setstate: |
| 2085 |
*zz_ssp = zz_state; |
| 2086 |
|
| 2087 |
if (zz_ss + zz_stacksize - 1 <= zz_ssp) |
| 2088 |
{ |
| 2089 |
/* Get the current used size of the three stacks, in elements. */ |
| 2090 |
ZZ_SIZE_T zz_size = zz_ssp - zz_ss + 1; |
| 2091 |
|
| 2092 |
#ifdef zz_overflow |
| 2093 |
{ |
| 2094 |
/* Give user a chance to reallocate the stack. Use copies of |
| 2095 |
these so that the &'s don't force the real ones into |
| 2096 |
memory. */ |
| 2097 |
ZZ_STYPE *zz_vs1 = zz_vs; |
| 2098 |
short int *zz_ss1 = zz_ss; |
| 2099 |
|
| 2100 |
|
| 2101 |
/* Each stack pointer address is followed by the size of the |
| 2102 |
data in use in that stack, in bytes. This used to be a |
| 2103 |
conditional around just the two extra args, but that might |
| 2104 |
be undefined if zz_overflow is a macro. */ |
| 2105 |
zz_overflow ("parser stack overflow", |
| 2106 |
&zz_ss1, zz_size * sizeof (*zz_ssp), |
| 2107 |
&zz_vs1, zz_size * sizeof (*zz_vsp), |
| 2108 |
|
| 2109 |
&zz_stacksize); |
| 2110 |
|
| 2111 |
zz_ss = zz_ss1; |
| 2112 |
zz_vs = zz_vs1; |
| 2113 |
} |
| 2114 |
#else /* no zz_overflow */ |
| 2115 |
# ifndef ZZ_STACK_RELOCATE |
| 2116 |
goto zz_overflowlab; |
| 2117 |
# else |
| 2118 |
/* Extend the stack our own way. */ |
| 2119 |
if (ZZ_MAXDEPTH <= zz_stacksize) |
| 2120 |
goto zz_overflowlab; |
| 2121 |
zz_stacksize *= 2; |
| 2122 |
if (ZZ_MAXDEPTH < zz_stacksize) |
| 2123 |
zz_stacksize = ZZ_MAXDEPTH; |
| 2124 |
|
| 2125 |
{ |
| 2126 |
short int *zz_ss1 = zz_ss; |
| 2127 |
union zz_alloc *zz_ptr = |
| 2128 |
(union zz_alloc *) ZZ_STACK_ALLOC (ZZ_STACK_BYTES (zz_stacksize)); |
| 2129 |
if (! zz_ptr) |
| 2130 |
goto zz_overflowlab; |
| 2131 |
ZZ_STACK_RELOCATE (zz_ss); |
| 2132 |
ZZ_STACK_RELOCATE (zz_vs); |
| 2133 |
|
| 2134 |
# undef ZZ_STACK_RELOCATE |
| 2135 |
if (zz_ss1 != zz_ssa) |
| 2136 |
ZZ_STACK_FREE (zz_ss1); |
| 2137 |
} |
| 2138 |
# endif |
| 2139 |
#endif /* no zz_overflow */ |
| 2140 |
|
| 2141 |
zz_ssp = zz_ss + zz_size - 1; |
| 2142 |
zz_vsp = zz_vs + zz_size - 1; |
| 2143 |
|
| 2144 |
|
| 2145 |
ZZ_DPRINTF ((stderr, "Stack size increased to %lu\n", |
| 2146 |
(unsigned long int) zz_stacksize)); |
| 2147 |
|
| 2148 |
if (zz_ss + zz_stacksize - 1 <= zz_ssp) |
| 2149 |
ZZ_ABORT; |
| 2150 |
} |
| 2151 |
|
| 2152 |
ZZ_DPRINTF ((stderr, "Entering state %d\n", zz_state)); |
| 2153 |
|
| 2154 |
goto zz_backup; |
| 2155 |
|
| 2156 |
/*-----------. |
| 2157 |
| zz_backup. | |
| 2158 |
`-----------*/ |
| 2159 |
zz_backup: |
| 2160 |
|
| 2161 |
/* Do appropriate processing given the current state. */ |
| 2162 |
/* Read a look-ahead token if we need one and don't already have one. */ |
| 2163 |
/* zz_resume: */ |
| 2164 |
|
| 2165 |
/* First try to decide what to do without reference to look-ahead token. */ |
| 2166 |
|
| 2167 |
zz_n = zz_pact[zz_state]; |
| 2168 |
if (zz_n == ZZ_PACT_NINF) |
| 2169 |
goto zz_default; |
| 2170 |
|
| 2171 |
/* Not known => get a look-ahead token if don't already have one. */ |
| 2172 |
|
| 2173 |
/* ZZ_CHAR is either ZZ_EMPTY or ZZ_EOF or a valid look-ahead symbol. */ |
| 2174 |
if (zz_char == ZZ_EMPTY) |
| 2175 |
{ |
| 2176 |
ZZ_DPRINTF ((stderr, "Reading a token: ")); |
| 2177 |
zz_char = ZZ_LEX; |
| 2178 |
} |
| 2179 |
|
| 2180 |
if (zz_char <= ZZ_EOF) |
| 2181 |
{ |
| 2182 |
zz_char = zz_token = ZZ_EOF; |
| 2183 |
ZZ_DPRINTF ((stderr, "Now at end of input.\n")); |
| 2184 |
} |
| 2185 |
else |
| 2186 |
{ |
| 2187 |
zz_token = ZZ_TRANSLATE (zz_char); |
| 2188 |
ZZ__SYMBOL_PRINT ("Next token is", zz_token, &zz_lval, &zz_lloc); |
| 2189 |
} |
| 2190 |
|
| 2191 |
/* If the proper action on seeing token ZZ_TOKEN is to reduce or to |
| 2192 |
detect an error, take that action. */ |
| 2193 |
zz_n += zz_token; |
| 2194 |
if (zz_n < 0 || ZZ_LAST < zz_n || zz_check[zz_n] != zz_token) |
| 2195 |
goto zz_default; |
| 2196 |
zz_n = zz_table[zz_n]; |
| 2197 |
if (zz_n <= 0) |
| 2198 |
{ |
| 2199 |
if (zz_n == 0 || zz_n == ZZ_TABLE_NINF) |
| 2200 |
goto zz_errlab; |
| 2201 |
zz_n = -zz_n; |
| 2202 |
goto zz_reduce; |
| 2203 |
} |
| 2204 |
|
| 2205 |
if (zz_n == ZZ_FINAL) |
| 2206 |
ZZ_ACCEPT; |
| 2207 |
|
| 2208 |
/* Shift the look-ahead token. */ |
| 2209 |
ZZ__SYMBOL_PRINT ("Shifting", zz_token, &zz_lval, &zz_lloc); |
| 2210 |
|
| 2211 |
/* Discard the token being shifted unless it is eof. */ |
| 2212 |
if (zz_char != ZZ_EOF) |
| 2213 |
zz_char = ZZ_EMPTY; |
| 2214 |
|
| 2215 |
*++zz_vsp = zz_lval; |
| 2216 |
|
| 2217 |
|
| 2218 |
/* Count tokens shifted since error; after three, turn off error |
| 2219 |
status. */ |
| 2220 |
if (zz_errstatus) |
| 2221 |
zz_errstatus--; |
| 2222 |
|
| 2223 |
zz_state = zz_n; |
| 2224 |
goto zz_newstate; |
| 2225 |
|
| 2226 |
|
| 2227 |
/*-----------------------------------------------------------. |
| 2228 |
| zz_default -- do the default action for the current state. | |
| 2229 |
`-----------------------------------------------------------*/ |
| 2230 |
zz_default: |
| 2231 |
zz_n = zz_defact[zz_state]; |
| 2232 |
if (zz_n == 0) |
| 2233 |
goto zz_errlab; |
| 2234 |
goto zz_reduce; |
| 2235 |
|
| 2236 |
|
| 2237 |
/*-----------------------------. |
| 2238 |
| zz_reduce -- Do a reduction. | |
| 2239 |
`-----------------------------*/ |
| 2240 |
zz_reduce: |
| 2241 |
/* zz_n is the number of a rule to reduce with. */ |
| 2242 |
zz_len = zz_r2[zz_n]; |
| 2243 |
|
| 2244 |
/* If ZZ_LEN is nonzero, implement the default value of the action: |
| 2245 |
`$$ = $1'. |
| 2246 |
|
| 2247 |
Otherwise, the following line sets ZZ_VAL to garbage. |
| 2248 |
This behavior is undocumented and Bison |
| 2249 |
users should not rely upon it. Assigning to ZZ_VAL |
| 2250 |
unconditionally makes the parser a bit smaller, and it avoids a |
| 2251 |
GCC warning that ZZ_VAL may be used uninitialized. */ |
| 2252 |
zz_val = zz_vsp[1-zz_len]; |
| 2253 |
|
| 2254 |
|
| 2255 |
ZZ__REDUCE_PRINT (zz_n); |
| 2256 |
switch (zz_n) |
| 2257 |
{ |
| 2258 |
case 17: |
| 2259 |
#line 429 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2260 |
{ |
| 2261 |
ErrMsg_Generic("Error in definition."); |
| 2262 |
} |
| 2263 |
break; |
| 2264 |
|
| 2265 |
case 18: |
| 2266 |
#line 436 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2267 |
{ |
| 2268 |
/* the following steps apply to string buffers only, not files */ |
| 2269 |
struct gl_list_t *stats; |
| 2270 |
int dispose; |
| 2271 |
if ((zz_vsp[-2].slptr) != NULL) { |
| 2272 |
stats = gl_create(1L); |
| 2273 |
gl_append_ptr(stats,(void *)(zz_vsp[-2].slptr)); |
| 2274 |
if (g_untrapped_error) { |
| 2275 |
ErrMsg_Generic("Because of a syntax error, the following statements are being ignored:"); |
| 2276 |
WriteStatementList(ASCERR,(zz_vsp[-2].slptr),4); |
| 2277 |
DestroyStatementList((zz_vsp[-2].slptr)); |
| 2278 |
} else { |
| 2279 |
dispose = Asc_ModuleAddStatements(Asc_CurrentModule(),stats); |
| 2280 |
switch (dispose) { |
| 2281 |
case 1: /* appended */ |
| 2282 |
if (stats != NULL) { |
| 2283 |
gl_destroy(stats); |
| 2284 |
} |
| 2285 |
break; |
| 2286 |
case 0: /* kept */ |
| 2287 |
break; |
| 2288 |
case -1: /* illegal in file */ |
| 2289 |
ErrMsg_Generic("GLOBAL statements can only be made interactively. Ignoring:"); |
| 2290 |
if (stats != NULL) { |
| 2291 |
WriteStatementList(ASCERR,(zz_vsp[-2].slptr),4); |
| 2292 |
gl_iterate(stats,(DestroyFunc)DestroyStatementList); |
| 2293 |
gl_destroy(stats); |
| 2294 |
} |
| 2295 |
break; |
| 2296 |
default: |
| 2297 |
break; |
| 2298 |
} |
| 2299 |
} |
| 2300 |
} |
| 2301 |
/* don't let any bizarreness in string parsing hang around */ |
| 2302 |
g_type_name = g_refines_name = g_proc_name = NULL; |
| 2303 |
g_model_parameters = |
| 2304 |
g_parameter_reduction = |
| 2305 |
g_parameter_wheres = NULL; |
| 2306 |
g_untrapped_error = 0; |
| 2307 |
} |
| 2308 |
break; |
| 2309 |
|
| 2310 |
case 19: |
| 2311 |
#line 481 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2312 |
{ |
| 2313 |
Asc_ScannerPushBuffer((zz_vsp[-1].dquote_ptr)); |
| 2314 |
} |
| 2315 |
break; |
| 2316 |
|
| 2317 |
case 20: |
| 2318 |
#line 485 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2319 |
{ |
| 2320 |
DestroyName((zz_vsp[-1].nptr)); |
| 2321 |
ErrMsg_Generic("REQUIRE statement syntax is 'REQUIRE \"filename\";'."); |
| 2322 |
} |
| 2323 |
break; |
| 2324 |
|
| 2325 |
case 21: |
| 2326 |
#line 490 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2327 |
{ |
| 2328 |
DestroyName((zz_vsp[0].nptr)); |
| 2329 |
ErrMsg_Generic("REQUIRE statement syntax is 'REQUIRE \"filename\";'."); |
| 2330 |
} |
| 2331 |
break; |
| 2332 |
|
| 2333 |
case 22: |
| 2334 |
#line 498 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2335 |
{ |
| 2336 |
Asc_ModuleCreateAlias(Asc_CurrentModule(),(zz_vsp[-1].dquote_ptr)); |
| 2337 |
} |
| 2338 |
break; |
| 2339 |
|
| 2340 |
case 23: |
| 2341 |
#line 502 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2342 |
{ |
| 2343 |
DestroyName((zz_vsp[-1].nptr)); |
| 2344 |
ErrMsg_Generic("PROVIDE statement syntax is 'PROVIDE \"filename\";'."); |
| 2345 |
} |
| 2346 |
break; |
| 2347 |
|
| 2348 |
case 24: |
| 2349 |
#line 507 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2350 |
{ |
| 2351 |
DestroyName((zz_vsp[0].nptr)); |
| 2352 |
ErrMsg_Generic("PROVIDE statement syntax is 'PROVIDE \"filename\";'."); |
| 2353 |
} |
| 2354 |
break; |
| 2355 |
|
| 2356 |
case 25: |
| 2357 |
#line 515 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2358 |
{ |
| 2359 |
(void)LoadArchiveLibrary((zz_vsp[-1].dquote_ptr),SCP((zz_vsp[-3].id_ptr))); |
| 2360 |
} |
| 2361 |
break; |
| 2362 |
|
| 2363 |
case 26: |
| 2364 |
#line 519 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2365 |
{ |
| 2366 |
(void)LoadArchiveLibrary(SCP((zz_vsp[-1].id_ptr)),NULL); |
| 2367 |
} |
| 2368 |
break; |
| 2369 |
|
| 2370 |
case 27: |
| 2371 |
#line 526 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2372 |
{ |
| 2373 |
/* see comments for notes statement. */ |
| 2374 |
if( (zz_vsp[-1].int_value) != NOTES_T ) { |
| 2375 |
WarnMsg_MismatchEnd("NOTES", NULL, (zz_vsp[-1].int_value), NULL); |
| 2376 |
} |
| 2377 |
if ((zz_vsp[-2].notesptr) != NULL) { |
| 2378 |
struct NoteTmp *nt; |
| 2379 |
symchar *lang=NULL; /* dummy */ |
| 2380 |
nt = (zz_vsp[-2].notesptr); |
| 2381 |
while (nt != NULL) { |
| 2382 |
if (nt->lang != NULL) { |
| 2383 |
lang = nt->lang; |
| 2384 |
} |
| 2385 |
/* save exploding vardata to simple entries until we keep */ |
| 2386 |
CollectNote(CreateNote(g_type_name, lang, NULL, g_proc_name, |
| 2387 |
Asc_ModuleBestName(Asc_CurrentModule()), |
| 2388 |
nt->bt, |
| 2389 |
nt->line, nt->vardata, nd_vlist)); |
| 2390 |
nt = nt->next; |
| 2391 |
} |
| 2392 |
/* now keep them */ |
| 2393 |
ProcessNotes(1); |
| 2394 |
DestroyNoteTmpList((zz_vsp[-2].notesptr)); |
| 2395 |
} |
| 2396 |
g_type_name = g_proc_name = NULL; |
| 2397 |
g_untrapped_error = 0; |
| 2398 |
} |
| 2399 |
break; |
| 2400 |
|
| 2401 |
case 28: |
| 2402 |
#line 557 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2403 |
{ |
| 2404 |
g_type_name = (zz_vsp[-2].id_ptr); |
| 2405 |
g_proc_name = (zz_vsp[-1].id_ptr); |
| 2406 |
} |
| 2407 |
break; |
| 2408 |
|
| 2409 |
case 29: |
| 2410 |
#line 565 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2411 |
{ |
| 2412 |
if ((zz_vsp[-3].tptr) == NULL) { |
| 2413 |
DestroyProcedureList((zz_vsp[-2].listp)); |
| 2414 |
} else { |
| 2415 |
if( (zz_vsp[-1].int_value) != METHODS_T ) { |
| 2416 |
WarnMsg_MismatchEnd("ADD METHODS", NULL, (zz_vsp[-1].int_value), "METHODS"); |
| 2417 |
} |
| 2418 |
if (AddMethods((zz_vsp[-3].tptr),(zz_vsp[-2].listp),g_untrapped_error) != 0) { |
| 2419 |
if ((zz_vsp[-3].tptr) != ILLEGAL_DEFINITION) { |
| 2420 |
ErrMsg_ProcsRejected("ADD",SCP(GetName((zz_vsp[-3].tptr)))); |
| 2421 |
DestroyProcedureList((zz_vsp[-2].listp)); |
| 2422 |
} /* else adding in DEFINITION MODEL may have misgone */ |
| 2423 |
} |
| 2424 |
} |
| 2425 |
g_untrapped_error = 0; |
| 2426 |
} |
| 2427 |
break; |
| 2428 |
|
| 2429 |
case 30: |
| 2430 |
#line 585 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2431 |
{ |
| 2432 |
struct TypeDescription *tmptype; |
| 2433 |
tmptype = FindType((zz_vsp[-1].id_ptr)); |
| 2434 |
if (tmptype == NULL) { |
| 2435 |
ErrMsg_ProcTypeMissing("ADD", SCP((zz_vsp[-1].id_ptr))); |
| 2436 |
} |
| 2437 |
(zz_val.tptr) = tmptype; /* parent should check for NULL */ |
| 2438 |
g_type_name = (zz_vsp[-1].id_ptr); /* scope for notes */ |
| 2439 |
} |
| 2440 |
break; |
| 2441 |
|
| 2442 |
case 31: |
| 2443 |
#line 595 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2444 |
{ |
| 2445 |
(zz_val.tptr) = ILLEGAL_DEFINITION; |
| 2446 |
/* need a bit of global state here to tag base methods */ |
| 2447 |
} |
| 2448 |
break; |
| 2449 |
|
| 2450 |
case 32: |
| 2451 |
#line 603 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2452 |
{ |
| 2453 |
if ((zz_vsp[-3].tptr) == NULL) { |
| 2454 |
DestroyProcedureList((zz_vsp[-2].listp)); |
| 2455 |
} else { |
| 2456 |
if( (zz_vsp[-1].int_value) != METHODS_T ) { |
| 2457 |
WarnMsg_MismatchEnd("REPLACE METHODS", NULL, (zz_vsp[-1].int_value), "METHODS"); |
| 2458 |
} |
| 2459 |
if (ReplaceMethods((zz_vsp[-3].tptr),(zz_vsp[-2].listp),g_untrapped_error) != 0) { |
| 2460 |
ErrMsg_ProcsRejected("REPLACE",SCP(GetName((zz_vsp[-3].tptr)))); |
| 2461 |
DestroyProcedureList((zz_vsp[-2].listp)); |
| 2462 |
} |
| 2463 |
} |
| 2464 |
g_untrapped_error = 0; |
| 2465 |
} |
| 2466 |
break; |
| 2467 |
|
| 2468 |
case 33: |
| 2469 |
#line 621 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2470 |
{ |
| 2471 |
struct TypeDescription *tmptype; |
| 2472 |
tmptype = FindType((zz_vsp[-1].id_ptr)); |
| 2473 |
if (tmptype == NULL) { |
| 2474 |
ErrMsg_ProcTypeMissing("REPLACE", SCP((zz_vsp[-1].id_ptr))); |
| 2475 |
} |
| 2476 |
(zz_val.tptr) = tmptype; /* parent should check for NULL */ |
| 2477 |
} |
| 2478 |
break; |
| 2479 |
|
| 2480 |
case 34: |
| 2481 |
#line 630 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2482 |
{ |
| 2483 |
(zz_val.tptr) = ILLEGAL_DEFINITION; |
| 2484 |
/* need a bit of global state here to tag base methods */ |
| 2485 |
} |
| 2486 |
break; |
| 2487 |
|
| 2488 |
case 35: |
| 2489 |
#line 638 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2490 |
{ |
| 2491 |
struct TypeDescription *def_ptr; |
| 2492 |
int keepnotes = 0; |
| 2493 |
|
| 2494 |
if(( (zz_vsp[-1].int_value) != IDENTIFIER_T ) || ( g_end_identifier != g_type_name )) { |
| 2495 |
/* all identifier_t are from symbol table, so ptr match |
| 2496 |
* is sufficient for equality. |
| 2497 |
*/ |
| 2498 |
WarnMsg_MismatchEnd("ATOM", SCP(g_type_name), |
| 2499 |
(zz_vsp[-1].int_value), SCP(g_type_name)); |
| 2500 |
} |
| 2501 |
g_atom_dim_ptr = CheckDimensionsMatch(g_default_dim_ptr, |
| 2502 |
g_atom_dim_ptr); |
| 2503 |
if (g_atom_dim_ptr != NULL) { |
| 2504 |
def_ptr = CreateAtomTypeDef(g_type_name, |
| 2505 |
g_refines_name, |
| 2506 |
real_type, /* ignored..really */ |
| 2507 |
Asc_CurrentModule(), |
| 2508 |
(zz_vsp[-5].int_value), |
| 2509 |
(zz_vsp[-3].slptr), |
| 2510 |
(zz_vsp[-2].listp), |
| 2511 |
g_defaulted, |
| 2512 |
g_default_double, |
| 2513 |
g_atom_dim_ptr, |
| 2514 |
g_default_long, |
| 2515 |
g_default_symbol, |
| 2516 |
g_untrapped_error); |
| 2517 |
if (def_ptr != NULL) { |
| 2518 |
keepnotes = AddType(def_ptr); |
| 2519 |
} else { |
| 2520 |
/* CreateAtomTypeDef is responsible for freeing (if needed) |
| 2521 |
* all args sent to it event of failure so we don't have to. |
| 2522 |
* In particular $3 $4 should be killed before returning NULL. |
| 2523 |
*/ |
| 2524 |
ErrMsg_NullDefPointer(SCP(g_type_name)); |
| 2525 |
} |
| 2526 |
} else { |
| 2527 |
error_reporter(ASC_USER_ERROR,Asc_ModuleBestName(Asc_CurrentModule()),g_header_linenum,NULL, |
| 2528 |
"Atom dimensions don't match in ATOM %s on line %s:%lu.\n", |
| 2529 |
SCP(g_type_name), |
| 2530 |
Asc_ModuleBestName(Asc_CurrentModule()), |
| 2531 |
g_header_linenum); |
| 2532 |
DestroyStatementList((zz_vsp[-3].slptr)); |
| 2533 |
DestroyProcedureList((zz_vsp[-2].listp)); |
| 2534 |
} |
| 2535 |
ProcessNotes(keepnotes); |
| 2536 |
g_type_name = g_refines_name = g_proc_name = NULL; |
| 2537 |
g_untrapped_error = 0; |
| 2538 |
} |
| 2539 |
break; |
| 2540 |
|
| 2541 |
case 36: |
| 2542 |
#line 691 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2543 |
{ |
| 2544 |
/* g_type_name = $1; */ |
| 2545 |
g_refines_name = (zz_vsp[-3].id_ptr); |
| 2546 |
g_atom_dim_ptr = (zz_vsp[-2].dimp); |
| 2547 |
g_default_double = (zz_vsp[-1].real_value); |
| 2548 |
g_header_linenum = LineNum(); |
| 2549 |
} |
| 2550 |
break; |
| 2551 |
|
| 2552 |
case 37: |
| 2553 |
#line 702 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2554 |
{ |
| 2555 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 2556 |
g_type_name = (zz_vsp[0].id_ptr); /* want this set early so parm lists see it */ |
| 2557 |
} |
| 2558 |
break; |
| 2559 |
|
| 2560 |
case 38: |
| 2561 |
#line 710 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2562 |
{ |
| 2563 |
(zz_val.real_value) = 0.0; |
| 2564 |
g_default_dim_ptr = WildDimension(); |
| 2565 |
g_defaulted = 0; |
| 2566 |
} |
| 2567 |
break; |
| 2568 |
|
| 2569 |
case 39: |
| 2570 |
#line 716 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2571 |
{ |
| 2572 |
(zz_val.real_value) = (zz_vsp[-1].int_value) ? -(zz_vsp[0].real_value) : (zz_vsp[0].real_value); |
| 2573 |
g_defaulted = 1; |
| 2574 |
} |
| 2575 |
break; |
| 2576 |
|
| 2577 |
case 40: |
| 2578 |
#line 721 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2579 |
{ |
| 2580 |
(zz_val.real_value) = 0.0; |
| 2581 |
g_default_dim_ptr = Dimensionless(); |
| 2582 |
g_default_long = 0; |
| 2583 |
g_defaulted = 1; |
| 2584 |
} |
| 2585 |
break; |
| 2586 |
|
| 2587 |
case 41: |
| 2588 |
#line 728 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2589 |
{ |
| 2590 |
(zz_val.real_value) = 0.0; |
| 2591 |
g_default_dim_ptr = Dimensionless(); |
| 2592 |
g_default_long = 1; |
| 2593 |
g_defaulted = 1; |
| 2594 |
} |
| 2595 |
break; |
| 2596 |
|
| 2597 |
case 42: |
| 2598 |
#line 735 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2599 |
{ |
| 2600 |
(zz_val.real_value) = 0.0; |
| 2601 |
g_default_dim_ptr = Dimensionless(); |
| 2602 |
g_default_symbol = (zz_vsp[0].sym_ptr); |
| 2603 |
g_defaulted = 0; |
| 2604 |
} |
| 2605 |
break; |
| 2606 |
|
| 2607 |
case 43: |
| 2608 |
#line 745 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2609 |
{ |
| 2610 |
struct TypeDescription *def_ptr; |
| 2611 |
int keepnotes = 0; |
| 2612 |
if (g_defaulted) { |
| 2613 |
g_atom_dim_ptr = CheckDimensionsMatch(g_default_dim_ptr, |
| 2614 |
g_atom_dim_ptr); |
| 2615 |
} |
| 2616 |
if (g_atom_dim_ptr != NULL) { |
| 2617 |
def_ptr = CreateConstantTypeDef(g_type_name, |
| 2618 |
g_refines_name, |
| 2619 |
Asc_CurrentModule(), |
| 2620 |
(zz_vsp[-1].int_value), |
| 2621 |
g_defaulted, |
| 2622 |
g_default_double, |
| 2623 |
g_default_long, |
| 2624 |
g_default_symbol, |
| 2625 |
g_atom_dim_ptr, |
| 2626 |
g_untrapped_error); |
| 2627 |
if (def_ptr != NULL) { |
| 2628 |
keepnotes = AddType(def_ptr); |
| 2629 |
} else { |
| 2630 |
ErrMsg_NullDefPointer(SCP(g_type_name)); |
| 2631 |
} |
| 2632 |
} else { |
| 2633 |
error_reporter(ASC_USER_ERROR,Asc_ModuleBestName(Asc_CurrentModule()),g_header_linenum,NULL, |
| 2634 |
"Constant dimensions don't match in CONSTANT %s" |
| 2635 |
" on line %s:%lu.\n", |
| 2636 |
SCP(g_type_name), |
| 2637 |
Asc_ModuleBestName(Asc_CurrentModule()), |
| 2638 |
g_header_linenum); |
| 2639 |
} |
| 2640 |
ProcessNotes(keepnotes); |
| 2641 |
g_type_name = g_refines_name = NULL; |
| 2642 |
g_untrapped_error = 0; |
| 2643 |
} |
| 2644 |
break; |
| 2645 |
|
| 2646 |
case 44: |
| 2647 |
#line 785 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2648 |
{ |
| 2649 |
g_type_name = (zz_vsp[-6].id_ptr); |
| 2650 |
g_refines_name = (zz_vsp[-4].id_ptr); |
| 2651 |
g_atom_dim_ptr = (zz_vsp[-3].dimp); |
| 2652 |
switch (g_constant_type) { |
| 2653 |
case DOUBLECONSTANT: |
| 2654 |
g_default_double = (zz_vsp[-2].real_value); |
| 2655 |
break; |
| 2656 |
case LONGCONSTANT: |
| 2657 |
g_default_long = (zz_vsp[-2].real_value); |
| 2658 |
break; |
| 2659 |
case BOOLEANCONSTANT: |
| 2660 |
g_default_long = (zz_vsp[-2].int_value); |
| 2661 |
break; |
| 2662 |
case SYMBOLCONSTANT: |
| 2663 |
g_default_symbol = (zz_vsp[-2].sym_ptr); |
| 2664 |
break; |
| 2665 |
default: |
| 2666 |
ErrMsg_Generic("Wierd constant type assign encountered."); |
| 2667 |
break; /* better not be reached. */ |
| 2668 |
} |
| 2669 |
g_header_linenum = LineNum(); |
| 2670 |
if ((zz_vsp[-1].dquote_ptr) != NULL) { |
| 2671 |
CollectNote(CreateNote(g_type_name,InlineNote(),SelfNote(),NULL, |
| 2672 |
Asc_ModuleBestName(Asc_CurrentModule()), |
| 2673 |
AddBraceChar((zz_vsp[-1].dquote_ptr),InlineNote()), |
| 2674 |
g_header_linenum,NULL,nd_empty)); |
| 2675 |
} |
| 2676 |
} |
| 2677 |
break; |
| 2678 |
|
| 2679 |
case 45: |
| 2680 |
#line 818 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2681 |
{ |
| 2682 |
(zz_val.real_value) = 0.0; |
| 2683 |
g_default_dim_ptr = WildDimension(); |
| 2684 |
g_defaulted = 0; |
| 2685 |
} |
| 2686 |
break; |
| 2687 |
|
| 2688 |
case 46: |
| 2689 |
#line 824 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2690 |
{ |
| 2691 |
(zz_val.real_value) = (zz_vsp[-1].int_value) ? -(zz_vsp[0].real_value) : (zz_vsp[0].real_value); |
| 2692 |
g_defaulted = 1; |
| 2693 |
} |
| 2694 |
break; |
| 2695 |
|
| 2696 |
case 47: |
| 2697 |
#line 829 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2698 |
{ |
| 2699 |
(zz_val.int_value) = 1; |
| 2700 |
g_defaulted = 1; |
| 2701 |
g_default_dim_ptr = Dimensionless(); |
| 2702 |
g_constant_type = BOOLEANCONSTANT; |
| 2703 |
} |
| 2704 |
break; |
| 2705 |
|
| 2706 |
case 48: |
| 2707 |
#line 836 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2708 |
{ |
| 2709 |
(zz_val.int_value) = 0; |
| 2710 |
g_defaulted = 1; |
| 2711 |
g_default_dim_ptr = Dimensionless(); |
| 2712 |
g_constant_type = BOOLEANCONSTANT; |
| 2713 |
} |
| 2714 |
break; |
| 2715 |
|
| 2716 |
case 49: |
| 2717 |
#line 843 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2718 |
{ |
| 2719 |
(zz_val.sym_ptr) = (zz_vsp[0].sym_ptr); |
| 2720 |
g_defaulted = 1; |
| 2721 |
g_default_dim_ptr = Dimensionless(); |
| 2722 |
g_constant_type = SYMBOLCONSTANT; |
| 2723 |
} |
| 2724 |
break; |
| 2725 |
|
| 2726 |
case 50: |
| 2727 |
#line 853 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2728 |
{ |
| 2729 |
struct TypeDescription *def_ptr; |
| 2730 |
int keepnotes = 0; |
| 2731 |
if(( (zz_vsp[-1].int_value) != IDENTIFIER_T ) || ( g_end_identifier != g_type_name )) { |
| 2732 |
/* all identifier_t are from symbol table, so ptr match |
| 2733 |
* is sufficient for equality. |
| 2734 |
*/ |
| 2735 |
WarnMsg_MismatchEnd("MODEL", SCP(g_type_name), |
| 2736 |
(zz_vsp[-1].int_value), SCP(g_type_name)); |
| 2737 |
} |
| 2738 |
def_ptr = CreateModelTypeDef(g_type_name, |
| 2739 |
g_refines_name, |
| 2740 |
Asc_CurrentModule(), |
| 2741 |
(zz_vsp[-5].int_value), |
| 2742 |
(zz_vsp[-3].slptr), |
| 2743 |
(zz_vsp[-2].listp), |
| 2744 |
g_model_parameters, |
| 2745 |
g_parameter_reduction, |
| 2746 |
g_parameter_wheres, |
| 2747 |
g_untrapped_error); |
| 2748 |
if (def_ptr != NULL) { |
| 2749 |
keepnotes = AddType(def_ptr); |
| 2750 |
} else { |
| 2751 |
/* CreateModelTypeDef is responsible for freeing (if needed) |
| 2752 |
* all args sent to it so we don't have to here. |
| 2753 |
* in particular $3 $4 g_model_parameters, g_parameter_reduction, |
| 2754 |
* and g_parameter_wheres. |
| 2755 |
*/ |
| 2756 |
ErrMsg_NullDefPointer(SCP(g_type_name)); |
| 2757 |
} |
| 2758 |
ProcessNotes(keepnotes); |
| 2759 |
g_type_name = g_refines_name = NULL; |
| 2760 |
g_model_parameters = |
| 2761 |
g_parameter_reduction = |
| 2762 |
g_parameter_wheres = NULL; |
| 2763 |
g_untrapped_error = 0; |
| 2764 |
} |
| 2765 |
break; |
| 2766 |
|
| 2767 |
case 51: |
| 2768 |
#line 895 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2769 |
{ |
| 2770 |
/* g_type_name = $1; */ |
| 2771 |
g_model_parameters = (zz_vsp[-2].slptr); |
| 2772 |
g_parameter_wheres = (zz_vsp[-1].slptr); |
| 2773 |
g_refines_name = NULL; |
| 2774 |
g_header_linenum = LineNum(); |
| 2775 |
} |
| 2776 |
break; |
| 2777 |
|
| 2778 |
case 52: |
| 2779 |
#line 904 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2780 |
{ |
| 2781 |
/* g_type_name = $1; */ |
| 2782 |
g_model_parameters = (zz_vsp[-5].slptr); |
| 2783 |
g_parameter_wheres = (zz_vsp[-4].slptr); |
| 2784 |
g_refines_name = (zz_vsp[-2].id_ptr); |
| 2785 |
g_parameter_reduction = (zz_vsp[-1].slptr); |
| 2786 |
g_header_linenum = LineNum(); |
| 2787 |
} |
| 2788 |
break; |
| 2789 |
|
| 2790 |
case 53: |
| 2791 |
#line 916 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2792 |
{ |
| 2793 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 2794 |
g_type_name = (zz_vsp[0].id_ptr); /* want this set early so parm lists see it */ |
| 2795 |
} |
| 2796 |
break; |
| 2797 |
|
| 2798 |
case 54: |
| 2799 |
#line 924 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2800 |
{ |
| 2801 |
(zz_val.slptr) = NULL; |
| 2802 |
} |
| 2803 |
break; |
| 2804 |
|
| 2805 |
case 55: |
| 2806 |
#line 928 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2807 |
{ |
| 2808 |
(zz_val.slptr) = (zz_vsp[-1].slptr); /* this could be much more sophisticated */ |
| 2809 |
} |
| 2810 |
break; |
| 2811 |
|
| 2812 |
case 56: |
| 2813 |
#line 935 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2814 |
{ |
| 2815 |
(zz_val.slptr) = NULL; |
| 2816 |
} |
| 2817 |
break; |
| 2818 |
|
| 2819 |
case 57: |
| 2820 |
#line 939 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2821 |
{ |
| 2822 |
(zz_val.slptr) = (zz_vsp[-1].slptr); /* this could be much more sophisticated */ |
| 2823 |
} |
| 2824 |
break; |
| 2825 |
|
| 2826 |
case 58: |
| 2827 |
#line 946 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2828 |
{ |
| 2829 |
(zz_val.slptr) = NULL; |
| 2830 |
} |
| 2831 |
break; |
| 2832 |
|
| 2833 |
case 59: |
| 2834 |
#line 950 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2835 |
{ |
| 2836 |
(zz_val.slptr) = (zz_vsp[-1].slptr); /* this could be much more sophisticated */ |
| 2837 |
} |
| 2838 |
break; |
| 2839 |
|
| 2840 |
case 60: |
| 2841 |
#line 957 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2842 |
{ |
| 2843 |
struct TypeDescription *def_ptr; |
| 2844 |
if (((zz_vsp[-1].int_value) != IDENTIFIER_T ) || ( g_end_identifier != g_type_name )) { |
| 2845 |
/* all identifier_t are from symbol table, so ptr match |
| 2846 |
* is sufficient for equality. |
| 2847 |
*/ |
| 2848 |
WarnMsg_MismatchEnd("PATCH", SCP(g_type_name), |
| 2849 |
(zz_vsp[-1].int_value), SCP(g_type_name)); |
| 2850 |
} |
| 2851 |
def_ptr = CreatePatchTypeDef(g_type_name, |
| 2852 |
g_refines_name, |
| 2853 |
NULL, |
| 2854 |
Asc_CurrentModule(), |
| 2855 |
(zz_vsp[-3].slptr), |
| 2856 |
(zz_vsp[-2].listp), |
| 2857 |
g_untrapped_error); |
| 2858 |
g_untrapped_error = 0; |
| 2859 |
if (def_ptr != NULL) { |
| 2860 |
AddType(def_ptr); |
| 2861 |
} else { |
| 2862 |
/* CreatePatchTypeDef is responsible for freeing (if needed) |
| 2863 |
* all args sent to it so we don't have to here. |
| 2864 |
* in particular $2 $3 |
| 2865 |
*/ |
| 2866 |
ErrMsg_NullDefPointer(SCP(g_type_name)); |
| 2867 |
} |
| 2868 |
g_type_name = g_refines_name = g_proc_name = NULL; |
| 2869 |
} |
| 2870 |
break; |
| 2871 |
|
| 2872 |
case 61: |
| 2873 |
#line 989 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2874 |
{ |
| 2875 |
/* |
| 2876 |
* A patch definition looks just like a model def. |
| 2877 |
* with the original name <=> refine name. |
| 2878 |
*/ |
| 2879 |
g_type_name = (zz_vsp[-3].id_ptr); |
| 2880 |
g_refines_name = (zz_vsp[-1].id_ptr); |
| 2881 |
g_header_linenum = LineNum(); |
| 2882 |
} |
| 2883 |
break; |
| 2884 |
|
| 2885 |
case 62: |
| 2886 |
#line 1002 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2887 |
{ |
| 2888 |
(zz_val.int_value) = 0; |
| 2889 |
} |
| 2890 |
break; |
| 2891 |
|
| 2892 |
case 63: |
| 2893 |
#line 1006 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2894 |
{ |
| 2895 |
(zz_val.int_value) = 1; |
| 2896 |
} |
| 2897 |
break; |
| 2898 |
|
| 2899 |
case 64: |
| 2900 |
#line 1013 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2901 |
{ |
| 2902 |
struct TypeDescription *def_ptr; |
| 2903 |
int keepnotes = 0; |
| 2904 |
|
| 2905 |
if(( (zz_vsp[-1].int_value) != IDENTIFIER_T ) || ( g_end_identifier != (zz_vsp[-4].id_ptr) )) { |
| 2906 |
WarnMsg_MismatchEnd("DEFINITION", SCP((zz_vsp[-4].id_ptr)), (zz_vsp[-1].int_value), SCP((zz_vsp[-4].id_ptr))); |
| 2907 |
} |
| 2908 |
if( (zz_vsp[-4].id_ptr) == GetBaseTypeName(relation_type)) { |
| 2909 |
def_ptr = CreateRelationTypeDef(Asc_CurrentModule(),(zz_vsp[-4].id_ptr),(zz_vsp[-3].slptr),(zz_vsp[-2].listp)); |
| 2910 |
} |
| 2911 |
else if( (zz_vsp[-4].id_ptr) == GetBaseTypeName(logrel_type) ) { |
| 2912 |
def_ptr = CreateLogRelTypeDef(Asc_CurrentModule(),(zz_vsp[-4].id_ptr),(zz_vsp[-3].slptr),(zz_vsp[-2].listp)); |
| 2913 |
} |
| 2914 |
else { |
| 2915 |
ErrMsg_Generic("Bad type passed to DEFINITION statement."); |
| 2916 |
def_ptr = NULL; |
| 2917 |
} |
| 2918 |
if ( def_ptr != NULL ) { |
| 2919 |
keepnotes = AddType(def_ptr); |
| 2920 |
} else { |
| 2921 |
ErrMsg_NullDefPointer(SCP((zz_vsp[-4].id_ptr))); |
| 2922 |
} |
| 2923 |
ProcessNotes(keepnotes); |
| 2924 |
g_type_name = NULL; |
| 2925 |
g_untrapped_error = 0; |
| 2926 |
} |
| 2927 |
break; |
| 2928 |
|
| 2929 |
case 65: |
| 2930 |
#line 1043 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2931 |
{ |
| 2932 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 2933 |
g_type_name = (zz_vsp[0].id_ptr); /* want this set early so parm lists see it */ |
| 2934 |
} |
| 2935 |
break; |
| 2936 |
|
| 2937 |
case 66: |
| 2938 |
#line 1052 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2939 |
{ /* nothing to do. just cruft to fix ; problem */ } |
| 2940 |
break; |
| 2941 |
|
| 2942 |
case 67: |
| 2943 |
#line 1057 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2944 |
{ |
| 2945 |
struct UnitDefinition *ud; |
| 2946 |
unsigned long c,len; |
| 2947 |
|
| 2948 |
if( (zz_vsp[0].int_value) != UNITS_T ) { |
| 2949 |
WarnMsg_MismatchEnd("UNITS", NULL, (zz_vsp[0].int_value), NULL); |
| 2950 |
} |
| 2951 |
len = gl_length((zz_vsp[-1].listp)); |
| 2952 |
for (c=1; c <= len; c++) { |
| 2953 |
ud = (struct UnitDefinition *)gl_fetch((zz_vsp[-1].listp),c); |
| 2954 |
ProcessUnitDef(ud); |
| 2955 |
DestroyUnitDef(ud); |
| 2956 |
} |
| 2957 |
gl_destroy((zz_vsp[-1].listp)); |
| 2958 |
(zz_val.statptr) = NULL; |
| 2959 |
} |
| 2960 |
break; |
| 2961 |
|
| 2962 |
case 68: |
| 2963 |
#line 1076 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2964 |
{ |
| 2965 |
(zz_val.listp) = gl_create(100L); |
| 2966 |
} |
| 2967 |
break; |
| 2968 |
|
| 2969 |
case 69: |
| 2970 |
#line 1080 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2971 |
{ |
| 2972 |
gl_append_ptr((zz_vsp[-1].listp),(char *)(zz_vsp[0].udefptr)); |
| 2973 |
(zz_val.listp) = (zz_vsp[-1].listp); |
| 2974 |
} |
| 2975 |
break; |
| 2976 |
|
| 2977 |
case 70: |
| 2978 |
#line 1088 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2979 |
{ |
| 2980 |
(zz_val.udefptr) = CreateUnitDef((zz_vsp[-3].id_ptr),(zz_vsp[-1].braced_ptr),Asc_ModuleBestName(Asc_CurrentModule()), |
| 2981 |
LineNum()); |
| 2982 |
} |
| 2983 |
break; |
| 2984 |
|
| 2985 |
case 71: |
| 2986 |
#line 1097 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2987 |
{ |
| 2988 |
(zz_val.listp) = NULL; |
| 2989 |
} |
| 2990 |
break; |
| 2991 |
|
| 2992 |
case 72: |
| 2993 |
#line 1101 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 2994 |
{ /* To get rid of this, we will need a global proclist |
| 2995 |
* that accumulates procs until a MODEL production is |
| 2996 |
* completed. If any other sort of production is started, |
| 2997 |
* and proclist is not NULL, it should be discarded. |
| 2998 |
*/ |
| 2999 |
} |
| 3000 |
break; |
| 3001 |
|
| 3002 |
case 73: |
| 3003 |
#line 1108 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3004 |
{ |
| 3005 |
(zz_val.listp) = (zz_vsp[0].listp); |
| 3006 |
} |
| 3007 |
break; |
| 3008 |
|
| 3009 |
case 74: |
| 3010 |
#line 1115 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3011 |
{ |
| 3012 |
(zz_val.listp) = (zz_vsp[0].listp); |
| 3013 |
gl_sort((zz_val.listp),(CmpFunc)CmpProcs); |
| 3014 |
} |
| 3015 |
break; |
| 3016 |
|
| 3017 |
case 75: |
| 3018 |
#line 1122 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3019 |
{ |
| 3020 |
(zz_val.listp) = gl_create(7L); |
| 3021 |
} |
| 3022 |
break; |
| 3023 |
|
| 3024 |
case 76: |
| 3025 |
#line 1126 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3026 |
{ |
| 3027 |
unsigned long c; |
| 3028 |
struct InitProcedure *oldproc; |
| 3029 |
c = gl_length((zz_vsp[-1].listp)); |
| 3030 |
while (c > 0) { |
| 3031 |
oldproc = (struct InitProcedure *)gl_fetch((zz_vsp[-1].listp),c); |
| 3032 |
if (ProcName((zz_vsp[0].procptr)) == ProcName(oldproc)) { |
| 3033 |
ErrMsg_DuplicateProc((zz_vsp[0].procptr)); |
| 3034 |
break; |
| 3035 |
} |
| 3036 |
c--; |
| 3037 |
} |
| 3038 |
if (c) { /* broke early */ |
| 3039 |
DestroyProcedure((zz_vsp[0].procptr)); |
| 3040 |
} else { |
| 3041 |
gl_append_ptr((zz_vsp[-1].listp),(char *)(zz_vsp[0].procptr)); |
| 3042 |
} |
| 3043 |
(zz_val.listp) = (zz_vsp[-1].listp); |
| 3044 |
} |
| 3045 |
break; |
| 3046 |
|
| 3047 |
case 77: |
| 3048 |
#line 1149 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3049 |
{ |
| 3050 |
if (((zz_vsp[-1].int_value) != IDENTIFIER_T) || ((zz_vsp[-4].id_ptr) != g_end_identifier)) { |
| 3051 |
/* all identifier_t are from symbol table, so ptr match |
| 3052 |
* is sufficient for equality. |
| 3053 |
*/ |
| 3054 |
WarnMsg_MismatchEnd("METHOD", SCP((zz_vsp[-4].id_ptr)), (zz_vsp[-1].int_value), SCP((zz_vsp[-4].id_ptr))); |
| 3055 |
} |
| 3056 |
(zz_val.procptr) = CreateProcedure((zz_vsp[-4].id_ptr),(zz_vsp[-2].slptr)); |
| 3057 |
g_proc_name = NULL; |
| 3058 |
} |
| 3059 |
break; |
| 3060 |
|
| 3061 |
case 78: |
| 3062 |
#line 1163 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3063 |
{ |
| 3064 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 3065 |
g_proc_name = (zz_vsp[0].id_ptr); |
| 3066 |
} |
| 3067 |
break; |
| 3068 |
|
| 3069 |
case 79: |
| 3070 |
#line 1172 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3071 |
{ |
| 3072 |
(zz_val.slptr) = CreateStatementList((zz_vsp[0].listp)); |
| 3073 |
} |
| 3074 |
break; |
| 3075 |
|
| 3076 |
case 80: |
| 3077 |
#line 1179 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3078 |
{ |
| 3079 |
(zz_val.listp) = gl_create(7L); |
| 3080 |
} |
| 3081 |
break; |
| 3082 |
|
| 3083 |
case 81: |
| 3084 |
#line 1183 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3085 |
{ |
| 3086 |
/* this is appending to a gllist of statements, not yet slist. */ |
| 3087 |
if ((zz_vsp[-1].statptr) != NULL) { |
| 3088 |
gl_append_ptr((zz_vsp[-2].listp),(char *)(zz_vsp[-1].statptr)); |
| 3089 |
} |
| 3090 |
(zz_val.listp) = (zz_vsp[-2].listp); |
| 3091 |
} |
| 3092 |
break; |
| 3093 |
|
| 3094 |
case 82: |
| 3095 |
#line 1191 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3096 |
{ |
| 3097 |
ErrMsg_Generic("Error in statement input."); |
| 3098 |
(zz_val.listp) = (zz_vsp[-2].listp); |
| 3099 |
} |
| 3100 |
break; |
| 3101 |
|
| 3102 |
case 113: |
| 3103 |
#line 1232 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3104 |
{ |
| 3105 |
struct TypeDescription *tmptype; |
| 3106 |
tmptype = FindType((zz_vsp[-2].id_ptr)); |
| 3107 |
if ((zz_vsp[0].eptr) != NULL) { |
| 3108 |
ErrMsg_Generic("WITH VALUE clause not allowed in IS_A."); |
| 3109 |
g_untrapped_error++; |
| 3110 |
DestroyVariableList((zz_vsp[-4].lptr)); |
| 3111 |
DestroySetList(g_typeargs); |
| 3112 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3113 |
(zz_val.statptr) = NULL; |
| 3114 |
} else { |
| 3115 |
if (tmptype != NULL) { |
| 3116 |
if ((GetBaseType(tmptype) != model_type) && |
| 3117 |
(g_typeargs != NULL)) { |
| 3118 |
error_reporter_current_line(ASC_USER_ERROR, |
| 3119 |
"IS_A has arguments to the nonmodel type %s.\n", |
| 3120 |
SCP((zz_vsp[-2].id_ptr))); |
| 3121 |
DestroyVariableList((zz_vsp[-4].lptr)); |
| 3122 |
DestroySetList(g_typeargs); |
| 3123 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3124 |
g_untrapped_error++; |
| 3125 |
(zz_val.statptr) = NULL; |
| 3126 |
} else { |
| 3127 |
(zz_val.statptr) = CreateISA((zz_vsp[-4].lptr),(zz_vsp[-2].id_ptr),g_typeargs,(zz_vsp[-1].id_ptr)); |
| 3128 |
} |
| 3129 |
} else { |
| 3130 |
error_reporter_current_line(ASC_USER_ERROR,"IS_A uses the undefined type %s.", SCP((zz_vsp[-2].id_ptr))); |
| 3131 |
DestroyVariableList((zz_vsp[-4].lptr)); |
| 3132 |
DestroySetList(g_typeargs); |
| 3133 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3134 |
g_untrapped_error++; |
| 3135 |
(zz_val.statptr) = NULL; |
| 3136 |
} |
| 3137 |
} |
| 3138 |
g_typeargs = NULL; |
| 3139 |
|
| 3140 |
} |
| 3141 |
break; |
| 3142 |
|
| 3143 |
case 114: |
| 3144 |
#line 1273 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3145 |
{ |
| 3146 |
struct TypeDescription *tmptype; |
| 3147 |
tmptype = FindType((zz_vsp[-2].id_ptr)); |
| 3148 |
if (tmptype != NULL) { |
| 3149 |
if ((GetBaseType(tmptype) != model_type) && |
| 3150 |
(g_typeargs != NULL)) { |
| 3151 |
error_reporter_current_line(ASC_USER_ERROR,"WILL_BE has arguments to the nonmodel type '%s'",SCP((zz_vsp[-2].id_ptr))); |
| 3152 |
DestroyVariableList((zz_vsp[-4].lptr)); |
| 3153 |
DestroySetList(g_typeargs); |
| 3154 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3155 |
g_untrapped_error++; |
| 3156 |
(zz_val.statptr) = NULL; |
| 3157 |
} else { |
| 3158 |
(zz_val.statptr) = CreateWILLBE((zz_vsp[-4].lptr),(zz_vsp[-2].id_ptr),g_typeargs,(zz_vsp[-1].id_ptr),(zz_vsp[0].eptr)); |
| 3159 |
} |
| 3160 |
} else { |
| 3161 |
DestroyVariableList((zz_vsp[-4].lptr)); |
| 3162 |
DestroySetList(g_typeargs); |
| 3163 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3164 |
g_untrapped_error++; |
| 3165 |
(zz_val.statptr) = NULL; |
| 3166 |
error_reporter_current_line(ASC_USER_ERROR,"WILL_BE uses the undefined type %s.",SCP((zz_vsp[-2].id_ptr))); |
| 3167 |
} |
| 3168 |
g_typeargs = NULL; |
| 3169 |
} |
| 3170 |
break; |
| 3171 |
|
| 3172 |
case 115: |
| 3173 |
#line 1302 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3174 |
{ |
| 3175 |
(zz_val.statptr) = CreateALIASES((zz_vsp[-2].lptr),(zz_vsp[0].nptr)); |
| 3176 |
} |
| 3177 |
break; |
| 3178 |
|
| 3179 |
case 116: |
| 3180 |
#line 1307 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3181 |
{ |
| 3182 |
int carray_err; |
| 3183 |
carray_err = 0; |
| 3184 |
if (VariableListLength((zz_vsp[-11].lptr)) != 1L) { |
| 3185 |
carray_err = 1; |
| 3186 |
error_reporter_current_line(ASC_USER_ERROR, |
| 3187 |
"Compound ALIASES allows only 1 LHS name. Found:"); |
| 3188 |
WriteVariableList(ASCERR,(zz_vsp[-11].lptr)); |
| 3189 |
} |
| 3190 |
if (VariableListLength((zz_vsp[-5].lptr)) != 1L) { |
| 3191 |
carray_err = 1; |
| 3192 |
error_reporter_current_line(ASC_USER_ERROR, |
| 3193 |
"Compound ALIASES/IS_A allows only one LHS name. Found:"); |
| 3194 |
WriteVariableList(ASCERR,(zz_vsp[-5].lptr)); |
| 3195 |
} |
| 3196 |
/* verify $9 == "set" */ |
| 3197 |
if (!carray_err && (zz_vsp[-3].id_ptr) != GetBaseTypeName(set_type)) { |
| 3198 |
carray_err = 1; |
| 3199 |
error_reporter_current_line(ASC_USER_ERROR,"Compound ALIASES statement requires IS_A %s. ",SCP(GetBaseTypeName(set_type))); |
| 3200 |
FPRINTF(ASCERR," Found %s.\n",SCP((zz_vsp[-3].id_ptr))); |
| 3201 |
} |
| 3202 |
/* verify set type */ |
| 3203 |
if ((!carray_err) && |
| 3204 |
((zz_vsp[-1].id_ptr) != GetBaseTypeName(symbol_constant_type)) && |
| 3205 |
((zz_vsp[-1].id_ptr) != GetBaseTypeName(integer_constant_type))) { |
| 3206 |
carray_err = 1; |
| 3207 |
error_reporter_current_line(ASC_USER_ERROR, |
| 3208 |
"Compound ALIASES IS_A statement requires %s or %s.\n", |
| 3209 |
SCP(GetBaseTypeName(integer_constant_type)), |
| 3210 |
SCP(GetBaseTypeName(symbol_constant_type))); |
| 3211 |
FPRINTF(ASCERR," Found %s.\n",SCP((zz_vsp[-1].id_ptr))); |
| 3212 |
} |
| 3213 |
if (carray_err) { |
| 3214 |
DestroyVariableList((zz_vsp[-11].lptr)); |
| 3215 |
DestroyVariableList((zz_vsp[-8].lptr)); |
| 3216 |
DestroyVariableList((zz_vsp[-5].lptr)); |
| 3217 |
DestroySetList((zz_vsp[0].sptr)); |
| 3218 |
g_untrapped_error++; |
| 3219 |
(zz_val.statptr) = NULL; |
| 3220 |
} else { |
| 3221 |
int intset; |
| 3222 |
intset = ((zz_vsp[-1].id_ptr) == GetBaseTypeName(integer_constant_type)); |
| 3223 |
(zz_val.statptr) = CreateARR((zz_vsp[-11].lptr),(zz_vsp[-8].lptr),(zz_vsp[-5].lptr),intset,(zz_vsp[0].sptr)); |
| 3224 |
} |
| 3225 |
} |
| 3226 |
break; |
| 3227 |
|
| 3228 |
case 117: |
| 3229 |
#line 1356 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3230 |
{ |
| 3231 |
(zz_val.sptr) = NULL; |
| 3232 |
} |
| 3233 |
break; |
| 3234 |
|
| 3235 |
case 118: |
| 3236 |
#line 1360 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3237 |
{ |
| 3238 |
(zz_val.sptr) = (zz_vsp[-1].sptr); |
| 3239 |
} |
| 3240 |
break; |
| 3241 |
|
| 3242 |
case 119: |
| 3243 |
#line 1367 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3244 |
{ |
| 3245 |
if (FindType((zz_vsp[-1].id_ptr))) { |
| 3246 |
(zz_val.statptr) = CreateREF((zz_vsp[-3].lptr),(zz_vsp[-1].id_ptr),(zz_vsp[0].id_ptr),1); |
| 3247 |
} else { |
| 3248 |
(zz_val.statptr) = CreateREF((zz_vsp[-3].lptr),(zz_vsp[-1].id_ptr),(zz_vsp[0].id_ptr),1); |
| 3249 |
error_reporter_current_line(ASC_USER_WARNING,"_IS_ uses the unbuilt prototype %s.\n",SCP((zz_vsp[-1].id_ptr))); |
| 3250 |
} |
| 3251 |
} |
| 3252 |
break; |
| 3253 |
|
| 3254 |
case 120: |
| 3255 |
#line 1379 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3256 |
{ |
| 3257 |
struct TypeDescription *tmptype; |
| 3258 |
tmptype = FindType((zz_vsp[0].id_ptr)); |
| 3259 |
if (tmptype != NULL) { |
| 3260 |
if ((GetBaseType(tmptype) != model_type) && |
| 3261 |
(g_typeargs != NULL)) { |
| 3262 |
error_reporter_current_line(ASC_USER_ERROR,"IS_REFINED_TO has arguments to the nonmodel type %s.",SCP((zz_vsp[0].id_ptr))); |
| 3263 |
DestroyVariableList((zz_vsp[-2].lptr)); |
| 3264 |
DestroySetList(g_typeargs); |
| 3265 |
g_untrapped_error++; |
| 3266 |
(zz_val.statptr) = NULL; |
| 3267 |
} else { |
| 3268 |
(zz_val.statptr) = CreateIRT((zz_vsp[-2].lptr),(zz_vsp[0].id_ptr),g_typeargs); |
| 3269 |
} |
| 3270 |
} else { |
| 3271 |
error_reporter_current_line(ASC_USER_ERROR,"The IS_REFINED_TO uses the undefined type %s.\n",SCP((zz_vsp[0].id_ptr))); |
| 3272 |
DestroyVariableList((zz_vsp[-2].lptr)); |
| 3273 |
DestroySetList(g_typeargs); |
| 3274 |
g_untrapped_error++; |
| 3275 |
(zz_val.statptr) = NULL; |
| 3276 |
} |
| 3277 |
g_typeargs = NULL; |
| 3278 |
} |
| 3279 |
break; |
| 3280 |
|
| 3281 |
case 121: |
| 3282 |
#line 1406 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3283 |
{ |
| 3284 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 3285 |
g_callargs = NULL; |
| 3286 |
} |
| 3287 |
break; |
| 3288 |
|
| 3289 |
case 122: |
| 3290 |
#line 1411 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3291 |
{ |
| 3292 |
(zz_val.id_ptr) = (zz_vsp[-3].id_ptr); |
| 3293 |
g_callargs = (zz_vsp[-1].sptr); |
| 3294 |
} |
| 3295 |
break; |
| 3296 |
|
| 3297 |
case 123: |
| 3298 |
#line 1419 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3299 |
{ |
| 3300 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 3301 |
g_typeargs = NULL; |
| 3302 |
} |
| 3303 |
break; |
| 3304 |
|
| 3305 |
case 124: |
| 3306 |
#line 1424 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3307 |
{ |
| 3308 |
(zz_val.id_ptr) = (zz_vsp[-3].id_ptr); |
| 3309 |
g_typeargs = (zz_vsp[-1].sptr); |
| 3310 |
} |
| 3311 |
break; |
| 3312 |
|
| 3313 |
case 125: |
| 3314 |
#line 1432 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3315 |
{ |
| 3316 |
(zz_val.id_ptr) = NULL; |
| 3317 |
} |
| 3318 |
break; |
| 3319 |
|
| 3320 |
case 126: |
| 3321 |
#line 1436 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3322 |
{ |
| 3323 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 3324 |
} |
| 3325 |
break; |
| 3326 |
|
| 3327 |
case 127: |
| 3328 |
#line 1443 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3329 |
{ |
| 3330 |
(zz_val.id_ptr) = NULL; |
| 3331 |
} |
| 3332 |
break; |
| 3333 |
|
| 3334 |
case 128: |
| 3335 |
#line 1447 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3336 |
{ |
| 3337 |
(zz_val.id_ptr) = (zz_vsp[0].id_ptr); |
| 3338 |
} |
| 3339 |
break; |
| 3340 |
|
| 3341 |
case 129: |
| 3342 |
#line 1454 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3343 |
{ |
| 3344 |
(zz_val.eptr) = NULL; |
| 3345 |
} |
| 3346 |
break; |
| 3347 |
|
| 3348 |
case 130: |
| 3349 |
#line 1458 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3350 |
{ |
| 3351 |
(zz_val.eptr) = (zz_vsp[0].eptr); |
| 3352 |
} |
| 3353 |
break; |
| 3354 |
|
| 3355 |
case 131: |
| 3356 |
#line 1465 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3357 |
{ |
| 3358 |
(zz_val.statptr) = CreateAA((zz_vsp[-1].lptr)); |
| 3359 |
} |
| 3360 |
break; |
| 3361 |
|
| 3362 |
case 132: |
| 3363 |
#line 1472 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3364 |
{ |
| 3365 |
(zz_val.statptr) = CreateATS((zz_vsp[-1].lptr)); |
| 3366 |
} |
| 3367 |
break; |
| 3368 |
|
| 3369 |
case 133: |
| 3370 |
#line 1479 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3371 |
{ |
| 3372 |
(zz_val.statptr) = CreateWBTS((zz_vsp[-1].lptr)); |
| 3373 |
} |
| 3374 |
break; |
| 3375 |
|
| 3376 |
case 134: |
| 3377 |
#line 1486 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3378 |
{ |
| 3379 |
(zz_val.statptr) = CreateWNBTS((zz_vsp[-1].lptr)); |
| 3380 |
} |
| 3381 |
break; |
| 3382 |
|
| 3383 |
case 135: |
| 3384 |
#line 1493 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3385 |
{ |
| 3386 |
(zz_val.statptr) = CreateASSIGN((zz_vsp[-2].nptr),(zz_vsp[0].eptr)); |
| 3387 |
} |
| 3388 |
break; |
| 3389 |
|
| 3390 |
case 136: |
| 3391 |
#line 1497 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3392 |
{ |
| 3393 |
(zz_val.statptr) = CreateCASSIGN((zz_vsp[-2].nptr),(zz_vsp[0].eptr)); |
| 3394 |
} |
| 3395 |
break; |
| 3396 |
|
| 3397 |
case 137: |
| 3398 |
#line 1504 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3399 |
{ |
| 3400 |
if (IsRelation((zz_vsp[0].eptr))) { |
| 3401 |
if (g_parse_relns == 0) { |
| 3402 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3403 |
(zz_val.statptr) = NULL; |
| 3404 |
} else { |
| 3405 |
(zz_val.statptr) = CreateREL(NULL,(zz_vsp[0].eptr)); |
| 3406 |
} |
| 3407 |
} else { |
| 3408 |
(zz_val.statptr) = CreateLOGREL(NULL,(zz_vsp[0].eptr)); |
| 3409 |
} |
| 3410 |
} |
| 3411 |
break; |
| 3412 |
|
| 3413 |
case 138: |
| 3414 |
#line 1517 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3415 |
{ |
| 3416 |
if (IsRelation((zz_vsp[0].eptr))) { |
| 3417 |
if (g_parse_relns == 0) { |
| 3418 |
DestroyExprList((zz_vsp[0].eptr)); |
| 3419 |
DestroyName((zz_vsp[-2].nptr)); |
| 3420 |
(zz_val.statptr) = NULL; |
| 3421 |
} else { |
| 3422 |
(zz_val.statptr) = CreateREL((zz_vsp[-2].nptr),(zz_vsp[0].eptr)); |
| 3423 |
} |
| 3424 |
} else { |
| 3425 |
(zz_val.statptr) = CreateLOGREL((zz_vsp[-2].nptr),(zz_vsp[0].eptr)); |
| 3426 |
} |
| 3427 |
} |
| 3428 |
break; |
| 3429 |
|
| 3430 |
case 139: |
| 3431 |
#line 1534 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3432 |
{ |
| 3433 |
(zz_val.eptr) = (zz_vsp[0].eptr); |
| 3434 |
if (NumberOfRelOps((zz_vsp[0].eptr)) < 1) { |
| 3435 |
/* want at least 1. restriction to exactly 1 is in typelint */ |
| 3436 |
ErrMsg_Generic("Missing punctuation (,;:) or else expression contains the \ |
| 3437 |
wrong number of relation operators (=, ==, <, >, <=, >=, !=) preceeding or."); |
| 3438 |
g_untrapped_error++; |
| 3439 |
} |
| 3440 |
} |
| 3441 |
break; |
| 3442 |
|
| 3443 |
case 140: |
| 3444 |
#line 1544 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3445 |
{ |
| 3446 |
(zz_val.eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_minimize)); |
| 3447 |
if (NumberOfRelOps((zz_vsp[0].eptr)) > 0) { |
| 3448 |
ErrMsg_Generic("Objective function contains relation operators (=, ==, <, >, <=, >=, !=)."); |
| 3449 |
g_untrapped_error++; |
| 3450 |
} |
| 3451 |
} |
| 3452 |
break; |
| 3453 |
|
| 3454 |
case 141: |
| 3455 |
#line 1552 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3456 |
{ |
| 3457 |
(zz_val.eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_maximize)); |
| 3458 |
if (NumberOfRelOps((zz_vsp[0].eptr))>0) { |
| 3459 |
ErrMsg_Generic("Objective function contains relation operators (=, ==, <, >, <=, >=, !=)."); |
| 3460 |
g_untrapped_error++; |
| 3461 |
} |
| 3462 |
} |
| 3463 |
break; |
| 3464 |
|
| 3465 |
case 142: |
| 3466 |
#line 1563 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3467 |
{ |
| 3468 |
/* |
| 3469 |
* This is the blackbox declarative external relation. |
| 3470 |
*/ |
| 3471 |
struct VariableList *vl; |
| 3472 |
vl = JoinVariableLists((zz_vsp[-4].lptr),(zz_vsp[-2].lptr)); |
| 3473 |
/* $$ = CreateEXTERN(2,$1,SCP($3),vl,$8,NULL); */ |
| 3474 |
(zz_val.statptr) = CreateEXTERNBlackBox((zz_vsp[-8].nptr),SCP((zz_vsp[-6].id_ptr)),vl,(zz_vsp[-1].nptr)); |
| 3475 |
} |
| 3476 |
break; |
| 3477 |
|
| 3478 |
case 143: |
| 3479 |
#line 1576 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3480 |
{ |
| 3481 |
(zz_val.lptr) = (zz_vsp[-2].lptr); |
| 3482 |
} |
| 3483 |
break; |
| 3484 |
|
| 3485 |
case 144: |
| 3486 |
#line 1583 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3487 |
{ |
| 3488 |
(zz_val.lptr) = (zz_vsp[-2].lptr); |
| 3489 |
} |
| 3490 |
break; |
| 3491 |
|
| 3492 |
case 145: |
| 3493 |
#line 1590 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3494 |
{ |
| 3495 |
(zz_val.nptr) = NULL; |
| 3496 |
} |
| 3497 |
break; |
| 3498 |
|
| 3499 |
case 146: |
| 3500 |
#line 1594 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3501 |
{ |
| 3502 |
(zz_val.nptr) = (zz_vsp[-2].nptr); |
| 3503 |
} |
| 3504 |
break; |
| 3505 |
|
| 3506 |
case 147: |
| 3507 |
#line 1601 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3508 |
{ |
| 3509 |
/* |
| 3510 |
* This is the glassbox declarative external relation. |
| 3511 |
* This now allows a scope for placement of the relations |
| 3512 |
*/ |
| 3513 |
struct VariableList *vl = (zz_vsp[-4].lptr); |
| 3514 |
struct Name *nptr; |
| 3515 |
char tmp[32]; |
| 3516 |
symchar *str; |
| 3517 |
|
| 3518 |
sprintf(tmp,"%ld",(zz_vsp[-2].int_value)); |
| 3519 |
str = AddSymbol(tmp); |
| 3520 |
nptr = CreateIdName(str); |
| 3521 |
/* $$ = CreateEXTERN(1,$1,SCP($3),vl,nptr,$9); */ |
| 3522 |
(zz_val.statptr) = CreateEXTERNGlassBox((zz_vsp[-8].nptr),SCP((zz_vsp[-6].id_ptr)),vl,nptr,(zz_vsp[0].nptr)); |
| 3523 |
} |
| 3524 |
break; |
| 3525 |
|
| 3526 |
case 148: |
| 3527 |
#line 1621 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3528 |
{ |
| 3529 |
(zz_val.nptr) = NULL; |
| 3530 |
} |
| 3531 |
break; |
| 3532 |
|
| 3533 |
case 149: |
| 3534 |
#line 1625 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3535 |
{ |
| 3536 |
(zz_val.nptr) = (zz_vsp[0].nptr); |
| 3537 |
} |
| 3538 |
break; |
| 3539 |
|
| 3540 |
case 150: |
| 3541 |
#line 1633 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3542 |
{ |
| 3543 |
if( (zz_vsp[0].int_value) != FOR_T ) { |
| 3544 |
WarnMsg_MismatchEnd("FOR", SCP((zz_vsp[-6].id_ptr)), (zz_vsp[0].int_value), NULL); |
| 3545 |
} |
| 3546 |
if ((zz_vsp[-2].fkind) == fk_create && (zz_vsp[-3].order) != f_random) { |
| 3547 |
/* create cannot have an order in declarative FOR */ |
| 3548 |
ErrMsg_Generic("FOR loops only accept DECREASING or INCREASING in the method section."); |
| 3549 |
g_untrapped_error++; |
| 3550 |
} |
| 3551 |
if ((zz_vsp[-2].fkind) == fk_do && (zz_vsp[-3].order) == f_random) { |
| 3552 |
/* all FOR/DO default to increasing */ |
| 3553 |
(zz_val.statptr) = CreateFOR((zz_vsp[-6].id_ptr),(zz_vsp[-4].eptr),(zz_vsp[-1].slptr),f_increasing,(zz_vsp[-2].fkind)); |
| 3554 |
} else { |
| 3555 |
(zz_val.statptr) = CreateFOR((zz_vsp[-6].id_ptr),(zz_vsp[-4].eptr),(zz_vsp[-1].slptr),(zz_vsp[-3].order),(zz_vsp[-2].fkind)); |
| 3556 |
} |
| 3557 |
} |
| 3558 |
break; |
| 3559 |
|
| 3560 |
case 151: |
| 3561 |
#line 1653 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3562 |
{ |
| 3563 |
(zz_val.order) = f_random; |
| 3564 |
} |
| 3565 |
break; |
| 3566 |
|
| 3567 |
case 152: |
| 3568 |
#line 1657 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3569 |
{ |
| 3570 |
(zz_val.order) = f_increasing; |
| 3571 |
} |
| 3572 |
break; |
| 3573 |
|
| 3574 |
case 153: |
| 3575 |
#line 1661 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3576 |
{ |
| 3577 |
(zz_val.order) = f_decreasing; |
| 3578 |
} |
| 3579 |
break; |
| 3580 |
|
| 3581 |
case 154: |
| 3582 |
#line 1668 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3583 |
{ |
| 3584 |
(zz_val.fkind) = fk_create; /* declarative FOR */ |
| 3585 |
} |
| 3586 |
break; |
| 3587 |
|
| 3588 |
case 155: |
| 3589 |
#line 1672 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3590 |
{ |
| 3591 |
(zz_val.fkind) = fk_expect; /* parameter FOR */ |
| 3592 |
} |
| 3593 |
break; |
| 3594 |
|
| 3595 |
case 156: |
| 3596 |
#line 1676 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3597 |
{ |
| 3598 |
(zz_val.fkind) = fk_check; /* WHERE FOR */ |
| 3599 |
} |
| 3600 |
break; |
| 3601 |
|
| 3602 |
case 157: |
| 3603 |
#line 1680 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3604 |
{ |
| 3605 |
(zz_val.fkind) = fk_do; /* method FOR */ |
| 3606 |
} |
| 3607 |
break; |
| 3608 |
|
| 3609 |
case 158: |
| 3610 |
#line 1687 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3611 |
{ |
| 3612 |
(zz_val.statptr) = CreateRUN((zz_vsp[0].nptr),NULL); |
| 3613 |
} |
| 3614 |
break; |
| 3615 |
|
| 3616 |
case 159: |
| 3617 |
#line 1691 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3618 |
{ |
| 3619 |
(zz_val.statptr) = CreateRUN((zz_vsp[0].nptr),(zz_vsp[-2].nptr)); /* type :: name */ |
| 3620 |
} |
| 3621 |
break; |
| 3622 |
|
| 3623 |
case 160: |
| 3624 |
#line 1698 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3625 |
{ |
| 3626 |
(zz_val.statptr) = CreateFIX((zz_vsp[0].lptr)); |
| 3627 |
} |
| 3628 |
break; |
| 3629 |
|
| 3630 |
case 161: |
| 3631 |
#line 1705 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3632 |
{ |
| 3633 |
(zz_val.statptr) = CreateFREE((zz_vsp[0].lptr)); |
| 3634 |
} |
| 3635 |
break; |
| 3636 |
|
| 3637 |
case 162: |
| 3638 |
#line 1712 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3639 |
{ |
| 3640 |
/* |
| 3641 |
* This is procedural external code. Was: |
| 3642 |
$$ = CreateEXTERN(0,NULL,SCP($2),$4,NULL,NULL); |
| 3643 |
*/ |
| 3644 |
(zz_val.statptr) = CreateEXTERNMethod(SCP((zz_vsp[-3].id_ptr)),(zz_vsp[-1].lptr)); |
| 3645 |
} |
| 3646 |
break; |
| 3647 |
|
| 3648 |
case 163: |
| 3649 |
#line 1723 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3650 |
{ |
| 3651 |
/* |
| 3652 |
* This is proper procedural external method code. |
| 3653 |
*/ |
| 3654 |
(zz_val.statptr) = CreateCALL((zz_vsp[0].id_ptr),g_callargs); |
| 3655 |
g_callargs = NULL; |
| 3656 |
} |
| 3657 |
break; |
| 3658 |
|
| 3659 |
case 164: |
| 3660 |
#line 1734 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3661 |
{ |
| 3662 |
(zz_val.statptr) = CreateASSERT((zz_vsp[0].eptr)); |
| 3663 |
} |
| 3664 |
break; |
| 3665 |
|
| 3666 |
case 165: |
| 3667 |
#line 1740 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3668 |
{ |
| 3669 |
if( (zz_vsp[0].int_value) != IF_T ) { |
| 3670 |
WarnMsg_MismatchEnd("IF", NULL, (zz_vsp[0].int_value), NULL); |
| 3671 |
} |
| 3672 |
(zz_val.statptr) = CreateIF((zz_vsp[-4].eptr),(zz_vsp[-2].slptr),(zz_vsp[-1].slptr)); |
| 3673 |
} |
| 3674 |
break; |
| 3675 |
|
| 3676 |
case 166: |
| 3677 |
#line 1750 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3678 |
{ |
| 3679 |
if( (zz_vsp[0].int_value) != WHILE_T ) { |
| 3680 |
WarnMsg_MismatchEnd("WHILE", NULL, (zz_vsp[0].int_value), NULL); |
| 3681 |
} |
| 3682 |
(zz_val.statptr) = CreateWhile((zz_vsp[-3].eptr),(zz_vsp[-1].slptr)); |
| 3683 |
} |
| 3684 |
break; |
| 3685 |
|
| 3686 |
case 167: |
| 3687 |
#line 1759 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3688 |
{ |
| 3689 |
(zz_val.slptr) = NULL; |
| 3690 |
} |
| 3691 |
break; |
| 3692 |
|
| 3693 |
case 168: |
| 3694 |
#line 1763 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3695 |
{ |
| 3696 |
(zz_val.slptr) = (zz_vsp[0].slptr); |
| 3697 |
} |
| 3698 |
break; |
| 3699 |
|
| 3700 |
case 169: |
| 3701 |
#line 1770 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3702 |
{ |
| 3703 |
if( (zz_vsp[0].int_value) != WHEN_T ) { |
| 3704 |
WarnMsg_MismatchEnd("WHEN", NULL, (zz_vsp[0].int_value), NULL); |
| 3705 |
} |
| 3706 |
ErrMsg_Generic("() missing in WHEN statement."); |
| 3707 |
DestroyWhenList((zz_vsp[-1].wptr)); |
| 3708 |
DestroyVariableList((zz_vsp[-2].lptr)); |
| 3709 |
g_untrapped_error++; |
| 3710 |
(zz_val.statptr) = NULL; |
| 3711 |
} |
| 3712 |
break; |
| 3713 |
|
| 3714 |
case 170: |
| 3715 |
#line 1781 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3716 |
{ |
| 3717 |
if( (zz_vsp[0].int_value) != WHEN_T ) { |
| 3718 |
WarnMsg_MismatchEnd("WHEN", NULL, (zz_vsp[0].int_value), NULL); |
| 3719 |
} |
| 3720 |
ErrMsg_Generic("() missing in WHEN statement."); |
| 3721 |
DestroyWhenList((zz_vsp[-1].wptr)); |
| 3722 |
DestroyVariableList((zz_vsp[-2].lptr)); |
| 3723 |
DestroyName((zz_vsp[-5].nptr)); |
| 3724 |
g_untrapped_error++; |
| 3725 |
(zz_val.statptr) = NULL; |
| 3726 |
} |
| 3727 |
break; |
| 3728 |
|
| 3729 |
case 171: |
| 3730 |
#line 1793 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3731 |
{ |
| 3732 |
if( (zz_vsp[0].int_value) != WHEN_T ) { |
| 3733 |
WarnMsg_MismatchEnd("WHEN", NULL, (zz_vsp[0].int_value), NULL); |
| 3734 |
} |
| 3735 |
(zz_val.statptr) = CreateWHEN(NULL,(zz_vsp[-3].lptr),(zz_vsp[-1].wptr)); |
| 3736 |
} |
| 3737 |
break; |
| 3738 |
|
| 3739 |
case 172: |
| 3740 |
#line 1800 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3741 |
{ |
| 3742 |
if( (zz_vsp[0].int_value) != WHEN_T ) { |
| 3743 |
WarnMsg_MismatchEnd("WHEN", NULL, (zz_vsp[0].int_value), NULL); |
| 3744 |
} |
| 3745 |
(zz_val.statptr) = CreateWHEN((zz_vsp[-7].nptr),(zz_vsp[-3].lptr),(zz_vsp[-1].wptr)); |
| 3746 |
} |
| 3747 |
break; |
| 3748 |
|
| 3749 |
case 173: |
| 3750 |
#line 1810 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3751 |
{ |
| 3752 |
(zz_val.wptr) = ReverseWhenCases((zz_vsp[0].wptr)); |
| 3753 |
} |
| 3754 |
break; |
| 3755 |
|
| 3756 |
case 174: |
| 3757 |
#line 1817 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3758 |
{ |
| 3759 |
(zz_val.wptr) = CreateWhen((zz_vsp[-2].sptr),(zz_vsp[0].slptr)); |
| 3760 |
} |
| 3761 |
break; |
| 3762 |
|
| 3763 |
case 175: |
| 3764 |
#line 1821 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3765 |
{ |
| 3766 |
(zz_val.wptr) = CreateWhen(NULL,(zz_vsp[0].slptr)); |
| 3767 |
} |
| 3768 |
break; |
| 3769 |
|
| 3770 |
case 176: |
| 3771 |
#line 1825 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3772 |
{ |
| 3773 |
(zz_val.wptr) = LinkWhenCases(CreateWhen((zz_vsp[-2].sptr),(zz_vsp[0].slptr)),(zz_vsp[-4].wptr)); |
| 3774 |
} |
| 3775 |
break; |
| 3776 |
|
| 3777 |
case 177: |
| 3778 |
#line 1829 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3779 |
{ |
| 3780 |
(zz_val.wptr) = LinkWhenCases(CreateWhen(NULL,(zz_vsp[0].slptr)),(zz_vsp[-3].wptr)); |
| 3781 |
} |
| 3782 |
break; |
| 3783 |
|
| 3784 |
case 178: |
| 3785 |
#line 1836 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3786 |
{ |
| 3787 |
(zz_val.statptr) = CreateFlow(fc_break,NULL); |
| 3788 |
} |
| 3789 |
break; |
| 3790 |
|
| 3791 |
case 179: |
| 3792 |
#line 1840 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3793 |
{ |
| 3794 |
(zz_val.statptr) = CreateFlow(fc_continue,NULL); |
| 3795 |
} |
| 3796 |
break; |
| 3797 |
|
| 3798 |
case 180: |
| 3799 |
#line 1844 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3800 |
{ |
| 3801 |
(zz_val.statptr) = CreateFlow(fc_fallthru,NULL); |
| 3802 |
} |
| 3803 |
break; |
| 3804 |
|
| 3805 |
case 181: |
| 3806 |
#line 1848 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3807 |
{ |
| 3808 |
(zz_val.statptr) = CreateFlow(fc_return,NULL); |
| 3809 |
} |
| 3810 |
break; |
| 3811 |
|
| 3812 |
case 182: |
| 3813 |
#line 1852 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3814 |
{ |
| 3815 |
(zz_val.statptr) = CreateFlow(fc_stop,(zz_vsp[0].braced_ptr)); |
| 3816 |
} |
| 3817 |
break; |
| 3818 |
|
| 3819 |
case 183: |
| 3820 |
#line 1859 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3821 |
{ |
| 3822 |
(zz_val.statptr) = CreateFNAME((zz_vsp[0].nptr)); |
| 3823 |
} |
| 3824 |
break; |
| 3825 |
|
| 3826 |
case 184: |
| 3827 |
#line 1866 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3828 |
{ |
| 3829 |
if( (zz_vsp[0].int_value) != SELECT_T ) { |
| 3830 |
WarnMsg_MismatchEnd("SELECT", NULL, (zz_vsp[0].int_value), NULL); |
| 3831 |
} |
| 3832 |
ErrMsg_Generic("() missing in SELECT statement."); |
| 3833 |
DestroySelectList((zz_vsp[-1].septr)); |
| 3834 |
DestroyVariableList((zz_vsp[-2].lptr)); |
| 3835 |
g_untrapped_error++; |
| 3836 |
(zz_val.statptr) = NULL; |
| 3837 |
} |
| 3838 |
break; |
| 3839 |
|
| 3840 |
case 185: |
| 3841 |
#line 1877 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3842 |
{ |
| 3843 |
if( (zz_vsp[0].int_value) != SELECT_T ) { |
| 3844 |
WarnMsg_MismatchEnd("SELECT", NULL, (zz_vsp[0].int_value), NULL); |
| 3845 |
} |
| 3846 |
(zz_val.statptr) = CreateSELECT((zz_vsp[-3].lptr),(zz_vsp[-1].septr)); |
| 3847 |
} |
| 3848 |
break; |
| 3849 |
|
| 3850 |
case 186: |
| 3851 |
#line 1887 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3852 |
{ |
| 3853 |
(zz_val.septr) = ReverseSelectCases((zz_vsp[0].septr)); |
| 3854 |
} |
| 3855 |
break; |
| 3856 |
|
| 3857 |
case 187: |
| 3858 |
#line 1894 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3859 |
{ |
| 3860 |
(zz_val.septr) = CreateSelect((zz_vsp[-2].sptr),(zz_vsp[0].slptr)); |
| 3861 |
} |
| 3862 |
break; |
| 3863 |
|
| 3864 |
case 188: |
| 3865 |
#line 1898 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3866 |
{ |
| 3867 |
(zz_val.septr) = CreateSelect(NULL,(zz_vsp[0].slptr)); |
| 3868 |
} |
| 3869 |
break; |
| 3870 |
|
| 3871 |
case 189: |
| 3872 |
#line 1902 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3873 |
{ |
| 3874 |
(zz_val.septr) = LinkSelectCases(CreateSelect((zz_vsp[-2].sptr),(zz_vsp[0].slptr)),(zz_vsp[-4].septr)); |
| 3875 |
} |
| 3876 |
break; |
| 3877 |
|
| 3878 |
case 190: |
| 3879 |
#line 1906 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3880 |
{ |
| 3881 |
(zz_val.septr) = LinkSelectCases(CreateSelect(NULL,(zz_vsp[0].slptr)),(zz_vsp[-3].septr)); |
| 3882 |
} |
| 3883 |
break; |
| 3884 |
|
| 3885 |
case 191: |
| 3886 |
#line 1913 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3887 |
{ |
| 3888 |
if( (zz_vsp[0].int_value) != SWITCH_T ) { |
| 3889 |
WarnMsg_MismatchEnd("SWITCH", NULL, (zz_vsp[0].int_value), NULL); |
| 3890 |
} |
| 3891 |
ErrMsg_Generic("() missing in SWITCH statement."); |
| 3892 |
DestroySwitchList((zz_vsp[-1].swptr)); |
| 3893 |
DestroyVariableList((zz_vsp[-2].lptr)); |
| 3894 |
g_untrapped_error++; |
| 3895 |
(zz_val.statptr) = NULL; |
| 3896 |
} |
| 3897 |
break; |
| 3898 |
|
| 3899 |
case 192: |
| 3900 |
#line 1924 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3901 |
{ |
| 3902 |
if( (zz_vsp[0].int_value) != SWITCH_T ) { |
| 3903 |
WarnMsg_MismatchEnd("SWITCH", NULL, (zz_vsp[0].int_value), NULL); |
| 3904 |
} |
| 3905 |
(zz_val.statptr) = CreateSWITCH((zz_vsp[-3].lptr),(zz_vsp[-1].swptr)); |
| 3906 |
} |
| 3907 |
break; |
| 3908 |
|
| 3909 |
case 193: |
| 3910 |
#line 1934 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3911 |
{ |
| 3912 |
(zz_val.swptr) = ReverseSwitchCases((zz_vsp[0].swptr)); |
| 3913 |
} |
| 3914 |
break; |
| 3915 |
|
| 3916 |
case 194: |
| 3917 |
#line 1941 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3918 |
{ |
| 3919 |
(zz_val.swptr) = CreateSwitch((zz_vsp[-2].sptr),(zz_vsp[0].slptr)); |
| 3920 |
} |
| 3921 |
break; |
| 3922 |
|
| 3923 |
case 195: |
| 3924 |
#line 1945 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3925 |
{ |
| 3926 |
(zz_val.swptr) = CreateSwitch(NULL,(zz_vsp[0].slptr)); |
| 3927 |
} |
| 3928 |
break; |
| 3929 |
|
| 3930 |
case 196: |
| 3931 |
#line 1949 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3932 |
{ |
| 3933 |
(zz_val.swptr) = LinkSwitchCases(CreateSwitch((zz_vsp[-2].sptr),(zz_vsp[0].slptr)),(zz_vsp[-4].swptr)); |
| 3934 |
} |
| 3935 |
break; |
| 3936 |
|
| 3937 |
case 197: |
| 3938 |
#line 1953 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3939 |
{ |
| 3940 |
(zz_val.swptr) = LinkSwitchCases(CreateSwitch(NULL,(zz_vsp[0].slptr)),(zz_vsp[-3].swptr)); |
| 3941 |
} |
| 3942 |
break; |
| 3943 |
|
| 3944 |
case 198: |
| 3945 |
#line 1960 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3946 |
{ |
| 3947 |
if( (zz_vsp[0].int_value) != CONDITIONAL_T ) { |
| 3948 |
WarnMsg_MismatchEnd("CONDITIONAL", NULL, (zz_vsp[0].int_value), NULL); |
| 3949 |
} |
| 3950 |
(zz_val.statptr) = CreateCOND((zz_vsp[-1].slptr)); |
| 3951 |
} |
| 3952 |
break; |
| 3953 |
|
| 3954 |
case 199: |
| 3955 |
#line 1970 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3956 |
{ |
| 3957 |
/* All processing of notes takes place on the notes_body here. |
| 3958 |
* Notes should NOT be added to the statement list. |
| 3959 |
* Here we know the current type and method names. |
| 3960 |
*/ |
| 3961 |
if( (zz_vsp[0].int_value) != NOTES_T ) { |
| 3962 |
WarnMsg_MismatchEnd("NOTES", NULL, (zz_vsp[0].int_value), NULL); |
| 3963 |
} |
| 3964 |
if ((zz_vsp[-1].notesptr) != NULL) { |
| 3965 |
struct NoteTmp *nt; |
| 3966 |
symchar *lang=NULL; /* dummy */ |
| 3967 |
nt = (zz_vsp[-1].notesptr); |
| 3968 |
while (nt != NULL) { |
| 3969 |
if (nt->lang != NULL) { |
| 3970 |
/* this logic works because of the reverse sort that |
| 3971 |
* yacc does via noteslist and the forward sort that |
| 3972 |
* we do via notesbody. lang recorded last appears |
| 3973 |
* before other entries that need it. |
| 3974 |
*/ |
| 3975 |
lang = nt->lang; |
| 3976 |
} |
| 3977 |
|
| 3978 |
/* save exploding vardata to simple entries until we keep */ |
| 3979 |
CollectNote(CreateNote(g_type_name, lang, NULL, g_proc_name, |
| 3980 |
Asc_ModuleBestName(Asc_CurrentModule()), |
| 3981 |
nt->bt, |
| 3982 |
nt->line, nt->vardata, nd_vlist)); |
| 3983 |
nt = nt->next; |
| 3984 |
} |
| 3985 |
DestroyNoteTmpList((zz_vsp[-1].notesptr)); |
| 3986 |
} |
| 3987 |
(zz_val.statptr) = NULL; |
| 3988 |
} |
| 3989 |
break; |
| 3990 |
|
| 3991 |
case 200: |
| 3992 |
#line 2007 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 3993 |
{ |
| 3994 |
/* At this point we have the "language", the names of the |
| 3995 |
* objects we are explaining, and the explanation/notes itself. |
| 3996 |
*/ |
| 3997 |
(zz_val.notesptr) = (zz_vsp[0].notesptr); |
| 3998 |
assert((zz_val.notesptr)->lang == NULL); |
| 3999 |
(zz_val.notesptr)->lang = (zz_vsp[-1].sym_ptr); |
| 4000 |
} |
| 4001 |
break; |
| 4002 |
|
| 4003 |
case 201: |
| 4004 |
#line 2016 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4005 |
{ |
| 4006 |
struct NoteTmp *nt; |
| 4007 |
(zz_val.notesptr) = (zz_vsp[-2].notesptr); |
| 4008 |
assert((zz_vsp[0].notesptr)->lang == NULL); |
| 4009 |
(zz_vsp[0].notesptr)->lang = (zz_vsp[-1].sym_ptr); |
| 4010 |
nt = (zz_val.notesptr); |
| 4011 |
while (nt->next != NULL) { |
| 4012 |
nt = nt->next; |
| 4013 |
} |
| 4014 |
LinkNoteTmp(nt,(zz_vsp[0].notesptr)); |
| 4015 |
} |
| 4016 |
break; |
| 4017 |
|
| 4018 |
case 202: |
| 4019 |
#line 2031 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4020 |
{ |
| 4021 |
(zz_val.notesptr) = CreateNoteTmp(NULL, AddBraceChar((zz_vsp[0].braced_ptr),NULL), |
| 4022 |
(void *)(zz_vsp[-1].lptr), LineNum()); |
| 4023 |
} |
| 4024 |
break; |
| 4025 |
|
| 4026 |
case 203: |
| 4027 |
#line 2036 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4028 |
{ |
| 4029 |
(zz_val.notesptr) = CreateNoteTmp(NULL, AddBraceChar((zz_vsp[0].braced_ptr),NULL), |
| 4030 |
(void *)(zz_vsp[-1].lptr), LineNum()); |
| 4031 |
LinkNoteTmp((zz_val.notesptr),(zz_vsp[-2].notesptr)); |
| 4032 |
} |
| 4033 |
break; |
| 4034 |
|
| 4035 |
case 204: |
| 4036 |
#line 2045 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4037 |
{ |
| 4038 |
/* |
| 4039 |
* Reversing the variable list is now essential to deal with |
| 4040 |
* external procedures and other things where order is important. |
| 4041 |
*/ |
| 4042 |
(zz_val.lptr) = ReverseVariableList((zz_vsp[0].lptr)); |
| 4043 |
} |
| 4044 |
break; |
| 4045 |
|
| 4046 |
case 205: |
| 4047 |
#line 2056 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4048 |
{ |
| 4049 |
(zz_val.lptr) = CreateVariableNode((zz_vsp[0].nptr)); |
| 4050 |
} |
| 4051 |
break; |
| 4052 |
|
| 4053 |
case 206: |
| 4054 |
#line 2060 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4055 |
{ |
| 4056 |
(zz_val.lptr) = CreateVariableNode((zz_vsp[0].nptr)); |
| 4057 |
LinkVariableNodes((zz_val.lptr),(zz_vsp[-2].lptr)); |
| 4058 |
} |
| 4059 |
break; |
| 4060 |
|
| 4061 |
case 207: |
| 4062 |
#line 2065 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4063 |
{ |
| 4064 |
ErrMsg_CommaName("name",(zz_vsp[0].nptr)); |
| 4065 |
(zz_val.lptr) = CreateVariableNode((zz_vsp[0].nptr)); |
| 4066 |
LinkVariableNodes((zz_val.lptr),(zz_vsp[-1].lptr)); |
| 4067 |
/* trash the definition. keep the loose fname around because |
| 4068 |
* destroying here is inconvenient |
| 4069 |
*/ |
| 4070 |
g_untrapped_error++; |
| 4071 |
} |
| 4072 |
break; |
| 4073 |
|
| 4074 |
case 208: |
| 4075 |
#line 2078 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4076 |
{ |
| 4077 |
symchar *simple; |
| 4078 |
void *data; |
| 4079 |
enum NoteData nd; |
| 4080 |
(zz_val.nptr) = ReverseName((zz_vsp[-1].nptr)); |
| 4081 |
if ((zz_vsp[0].dquote_ptr) != NULL && (zz_vsp[-1].nptr) != NULL) { |
| 4082 |
simple = SimpleNameIdPtr((zz_val.nptr)); |
| 4083 |
data = (simple == NULL ? (void *)(zz_val.nptr) : NULL); |
| 4084 |
nd = (data == NULL ? nd_empty : nd_name); |
| 4085 |
CollectNote(CreateNote(g_type_name, InlineNote(), simple, |
| 4086 |
g_proc_name, |
| 4087 |
Asc_ModuleBestName(Asc_CurrentModule()), |
| 4088 |
AddBraceChar((zz_vsp[0].dquote_ptr),InlineNote()), |
| 4089 |
LineNum(), data, nd)); |
| 4090 |
} |
| 4091 |
} |
| 4092 |
break; |
| 4093 |
|
| 4094 |
case 209: |
| 4095 |
#line 2098 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4096 |
{ |
| 4097 |
(zz_val.nptr) = CreateIdName((zz_vsp[0].id_ptr)); |
| 4098 |
} |
| 4099 |
break; |
| 4100 |
|
| 4101 |
case 210: |
| 4102 |
#line 2102 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4103 |
{ |
| 4104 |
(zz_val.nptr) = CreateIdName((zz_vsp[0].id_ptr)); |
| 4105 |
LinkNames((zz_val.nptr),(zz_vsp[-2].nptr)); |
| 4106 |
} |
| 4107 |
break; |
| 4108 |
|
| 4109 |
case 211: |
| 4110 |
#line 2107 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4111 |
{ |
| 4112 |
if ((zz_vsp[-1].sptr) == NULL) { |
| 4113 |
error_reporter_current_line(ASC_USER_ERROR,"syntax error: Empty set in name definition, name:"); |
| 4114 |
WriteName(ASCERR,(zz_vsp[-3].nptr)); |
| 4115 |
FPRINTF(ASCERR,"[]\n"); |
| 4116 |
g_untrapped_error++; |
| 4117 |
} else { |
| 4118 |
(zz_val.nptr) = CreateSetName((zz_vsp[-1].sptr)); |
| 4119 |
LinkNames((zz_val.nptr),(zz_vsp[-3].nptr)); |
| 4120 |
} |
| 4121 |
} |
| 4122 |
break; |
| 4123 |
|
| 4124 |
case 212: |
| 4125 |
#line 2122 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4126 |
{ |
| 4127 |
g_end_identifier = NULL; |
| 4128 |
(zz_val.int_value) = CONDITIONAL_T; |
| 4129 |
} |
| 4130 |
break; |
| 4131 |
|
| 4132 |
case 213: |
| 4133 |
#line 2127 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4134 |
{ |
| 4135 |
g_end_identifier = NULL; |
| 4136 |
(zz_val.int_value) = FOR_T; |
| 4137 |
} |
| 4138 |
break; |
| 4139 |
|
| 4140 |
case 214: |
| 4141 |
#line 2132 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4142 |
{ |
| 4143 |
g_end_identifier = NULL; |
| 4144 |
(zz_val.int_value) = IF_T; |
| 4145 |
} |
| 4146 |
break; |
| 4147 |
|
| 4148 |
case 215: |
| 4149 |
#line 2137 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4150 |
{ |
| 4151 |
g_end_identifier = NULL; |
| 4152 |
(zz_val.int_value) = INTERACTIVE_T; |
| 4153 |
} |
| 4154 |
break; |
| 4155 |
|
| 4156 |
case 216: |
| 4157 |
#line 2142 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4158 |
{ |
| 4159 |
g_end_identifier = NULL; |
| 4160 |
(zz_val.int_value) = METHODS_T; |
| 4161 |
} |
| 4162 |
break; |
| 4163 |
|
| 4164 |
case 217: |
| 4165 |
#line 2147 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4166 |
{ |
| 4167 |
g_end_identifier = NULL; |
| 4168 |
(zz_val.int_value) = NOTES_T; |
| 4169 |
} |
| 4170 |
break; |
| 4171 |
|
| 4172 |
case 218: |
| 4173 |
#line 2152 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4174 |
{ |
| 4175 |
g_end_identifier = NULL; |
| 4176 |
(zz_val.int_value) = SELECT_T; |
| 4177 |
} |
| 4178 |
break; |
| 4179 |
|
| 4180 |
case 219: |
| 4181 |
#line 2157 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4182 |
{ |
| 4183 |
g_end_identifier = NULL; |
| 4184 |
(zz_val.int_value) = SWITCH_T; |
| 4185 |
} |
| 4186 |
break; |
| 4187 |
|
| 4188 |
case 220: |
| 4189 |
#line 2162 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4190 |
{ |
| 4191 |
g_end_identifier = NULL; |
| 4192 |
(zz_val.int_value) = UNITS_T; |
| 4193 |
} |
| 4194 |
break; |
| 4195 |
|
| 4196 |
case 221: |
| 4197 |
#line 2167 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4198 |
{ |
| 4199 |
g_end_identifier = NULL; |
| 4200 |
(zz_val.int_value) = GLOBAL_T; |
| 4201 |
} |
| 4202 |
break; |
| 4203 |
|
| 4204 |
case 222: |
| 4205 |
#line 2172 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4206 |
{ |
| 4207 |
g_end_identifier = NULL; |
| 4208 |
(zz_val.int_value) = WHEN_T; |
| 4209 |
} |
| 4210 |
break; |
| 4211 |
|
| 4212 |
case 223: |
| 4213 |
#line 2177 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4214 |
{ |
| 4215 |
g_end_identifier = NULL; |
| 4216 |
(zz_val.int_value) = WHILE_T; |
| 4217 |
} |
| 4218 |
break; |
| 4219 |
|
| 4220 |
case 224: |
| 4221 |
#line 2182 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4222 |
{ |
| 4223 |
g_end_identifier = (zz_vsp[0].id_ptr); |
| 4224 |
(zz_val.int_value) = IDENTIFIER_T; |
| 4225 |
} |
| 4226 |
break; |
| 4227 |
|
| 4228 |
case 225: |
| 4229 |
#line 2187 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4230 |
{ |
| 4231 |
g_end_identifier = NULL; |
| 4232 |
(zz_val.int_value) = END_T; |
| 4233 |
} |
| 4234 |
break; |
| 4235 |
|
| 4236 |
case 226: |
| 4237 |
#line 2195 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4238 |
{ |
| 4239 |
(zz_val.braced_ptr) = NULL; |
| 4240 |
} |
| 4241 |
break; |
| 4242 |
|
| 4243 |
case 227: |
| 4244 |
#line 2199 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4245 |
{ |
| 4246 |
(zz_val.braced_ptr) = (zz_vsp[0].braced_ptr); |
| 4247 |
} |
| 4248 |
break; |
| 4249 |
|
| 4250 |
case 228: |
| 4251 |
#line 2206 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4252 |
{ |
| 4253 |
(zz_val.dquote_ptr) = NULL; |
| 4254 |
} |
| 4255 |
break; |
| 4256 |
|
| 4257 |
case 229: |
| 4258 |
#line 2210 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4259 |
{ |
| 4260 |
(zz_val.dquote_ptr) = (zz_vsp[0].dquote_ptr); |
| 4261 |
} |
| 4262 |
break; |
| 4263 |
|
| 4264 |
case 230: |
| 4265 |
#line 2217 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4266 |
{ |
| 4267 |
(zz_val.sptr) = ReverseSetList((zz_vsp[0].sptr)); |
| 4268 |
} |
| 4269 |
break; |
| 4270 |
|
| 4271 |
case 231: |
| 4272 |
#line 2221 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4273 |
{ |
| 4274 |
(zz_val.sptr) = NULL; |
| 4275 |
} |
| 4276 |
break; |
| 4277 |
|
| 4278 |
case 232: |
| 4279 |
#line 2228 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4280 |
{ |
| 4281 |
(zz_val.sptr) = CreateSingleSet((zz_vsp[0].eptr)); |
| 4282 |
} |
| 4283 |
break; |
| 4284 |
|
| 4285 |
case 233: |
| 4286 |
#line 2232 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4287 |
{ |
| 4288 |
(zz_val.sptr) = CreateRangeSet((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4289 |
} |
| 4290 |
break; |
| 4291 |
|
| 4292 |
case 234: |
| 4293 |
#line 2236 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4294 |
{ |
| 4295 |
(zz_val.sptr) = CreateSingleSet((zz_vsp[0].eptr)); |
| 4296 |
LinkSets((zz_val.sptr),(zz_vsp[-2].sptr)); |
| 4297 |
} |
| 4298 |
break; |
| 4299 |
|
| 4300 |
case 235: |
| 4301 |
#line 2241 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4302 |
{ |
| 4303 |
(zz_val.sptr) = CreateRangeSet((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4304 |
LinkSets((zz_val.sptr),(zz_vsp[-4].sptr)); |
| 4305 |
} |
| 4306 |
break; |
| 4307 |
|
| 4308 |
case 236: |
| 4309 |
#line 2249 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4310 |
{ |
| 4311 |
(zz_val.real_value) = (zz_vsp[0].int_value); |
| 4312 |
g_constant_type = LONGCONSTANT; |
| 4313 |
g_default_dim_ptr = Dimensionless(); |
| 4314 |
} |
| 4315 |
break; |
| 4316 |
|
| 4317 |
case 237: |
| 4318 |
#line 2255 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4319 |
{ |
| 4320 |
(zz_val.real_value) = (zz_vsp[0].real_value); |
| 4321 |
g_constant_type = DOUBLECONSTANT; |
| 4322 |
g_default_dim_ptr = g_dim_ptr; |
| 4323 |
} |
| 4324 |
break; |
| 4325 |
|
| 4326 |
case 238: |
| 4327 |
#line 2264 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4328 |
{ |
| 4329 |
(zz_val.real_value) = (zz_vsp[-1].real_value)*(zz_vsp[0].real_value); |
| 4330 |
} |
| 4331 |
break; |
| 4332 |
|
| 4333 |
case 239: |
| 4334 |
#line 2268 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4335 |
{ |
| 4336 |
unsigned long pos; |
| 4337 |
int error_code; |
| 4338 |
g_units_ptr = FindOrDefineUnits((zz_vsp[0].braced_ptr),&pos,&error_code); |
| 4339 |
if (g_units_ptr != NULL) { |
| 4340 |
(zz_val.real_value) = (double)(zz_vsp[-1].int_value)*UnitsConvFactor(g_units_ptr); |
| 4341 |
g_dim_ptr = UnitsDimensions(g_units_ptr); |
| 4342 |
} else { |
| 4343 |
char **errv; |
| 4344 |
(zz_val.real_value) = (double)(zz_vsp[-1].int_value); |
| 4345 |
g_dim_ptr = WildDimension(); |
| 4346 |
error_reporter_current_line(ASC_USER_ERROR,"Undefined units '%s'", (zz_vsp[0].braced_ptr)); |
| 4347 |
errv = UnitsExplainError((zz_vsp[0].braced_ptr),error_code,pos); |
| 4348 |
error_reporter_current_line(ASC_USER_ERROR," %s\n %s\n %s\n",errv[0],errv[1],errv[2]); |
| 4349 |
g_untrapped_error++; |
| 4350 |
} |
| 4351 |
} |
| 4352 |
break; |
| 4353 |
|
| 4354 |
case 240: |
| 4355 |
#line 2289 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4356 |
{ |
| 4357 |
g_dim_ptr = Dimensionless(); |
| 4358 |
(zz_val.real_value) = 1.0; |
| 4359 |
} |
| 4360 |
break; |
| 4361 |
|
| 4362 |
case 241: |
| 4363 |
#line 2294 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4364 |
{ |
| 4365 |
unsigned long pos; |
| 4366 |
int error_code; |
| 4367 |
g_units_ptr = FindOrDefineUnits((zz_vsp[0].braced_ptr),&pos,&error_code); |
| 4368 |
if (g_units_ptr != NULL) { |
| 4369 |
(zz_val.real_value) = UnitsConvFactor(g_units_ptr); |
| 4370 |
g_dim_ptr = UnitsDimensions(g_units_ptr); |
| 4371 |
} else { |
| 4372 |
char **errv; |
| 4373 |
(zz_val.real_value) = 1.0; |
| 4374 |
g_dim_ptr = WildDimension(); |
| 4375 |
error_reporter_current_line(ASC_USER_ERROR,"Undefined units '%s'",(zz_vsp[0].braced_ptr)); |
| 4376 |
errv = UnitsExplainError((zz_vsp[0].braced_ptr),error_code,pos); |
| 4377 |
error_reporter_current_line(ASC_USER_ERROR," %s\n %s\n %s\n",errv[0],errv[1],errv[2]); |
| 4378 |
g_untrapped_error++; |
| 4379 |
} |
| 4380 |
} |
| 4381 |
break; |
| 4382 |
|
| 4383 |
case 242: |
| 4384 |
#line 2315 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4385 |
{ |
| 4386 |
(zz_val.dimp) = (zz_vsp[0].dimp); |
| 4387 |
} |
| 4388 |
break; |
| 4389 |
|
| 4390 |
case 243: |
| 4391 |
#line 2319 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4392 |
{ |
| 4393 |
(zz_val.dimp) = Dimensionless(); |
| 4394 |
} |
| 4395 |
break; |
| 4396 |
|
| 4397 |
case 244: |
| 4398 |
#line 2323 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4399 |
{ |
| 4400 |
(zz_val.dimp) = WildDimension(); |
| 4401 |
} |
| 4402 |
break; |
| 4403 |
|
| 4404 |
case 245: |
| 4405 |
#line 2330 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4406 |
{ |
| 4407 |
(zz_val.dimp) = WildDimension(); |
| 4408 |
} |
| 4409 |
break; |
| 4410 |
|
| 4411 |
case 246: |
| 4412 |
#line 2334 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4413 |
{ |
| 4414 |
(zz_val.dimp) = FindOrAddDimen(&((zz_vsp[0].dimen))); |
| 4415 |
} |
| 4416 |
break; |
| 4417 |
|
| 4418 |
case 247: |
| 4419 |
#line 2341 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4420 |
{ |
| 4421 |
ParseDim(&((zz_val.dimen)),SCP((zz_vsp[0].id_ptr))); |
| 4422 |
} |
| 4423 |
break; |
| 4424 |
|
| 4425 |
case 248: |
| 4426 |
#line 2345 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4427 |
{ |
| 4428 |
ClearDimensions(&((zz_val.dimen))); |
| 4429 |
} |
| 4430 |
break; |
| 4431 |
|
| 4432 |
case 249: |
| 4433 |
#line 2349 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4434 |
{ |
| 4435 |
(zz_val.dimen) = SubDimensions(&((zz_vsp[-2].dimen)),&((zz_vsp[0].dimen))); |
| 4436 |
} |
| 4437 |
break; |
| 4438 |
|
| 4439 |
case 250: |
| 4440 |
#line 2353 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4441 |
{ |
| 4442 |
(zz_val.dimen) = AddDimensions(&((zz_vsp[-2].dimen)),&((zz_vsp[0].dimen))); |
| 4443 |
} |
| 4444 |
break; |
| 4445 |
|
| 4446 |
case 251: |
| 4447 |
#line 2357 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4448 |
{ |
| 4449 |
(zz_val.dimen) = ScaleDimensions(&((zz_vsp[-2].dimen)),(zz_vsp[0].frac_value)); |
| 4450 |
} |
| 4451 |
break; |
| 4452 |
|
| 4453 |
case 252: |
| 4454 |
#line 2361 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4455 |
{ |
| 4456 |
CopyDimensions(&((zz_vsp[-1].dimen)),&((zz_val.dimen))); |
| 4457 |
} |
| 4458 |
break; |
| 4459 |
|
| 4460 |
case 253: |
| 4461 |
#line 2368 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4462 |
{ |
| 4463 |
(zz_val.frac_value) = (zz_vsp[-1].int_value) ? NegateF((zz_vsp[0].frac_value)) : (zz_vsp[0].frac_value); |
| 4464 |
} |
| 4465 |
break; |
| 4466 |
|
| 4467 |
case 254: |
| 4468 |
#line 2375 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4469 |
{ |
| 4470 |
(zz_val.frac_value) = CreateFraction((short)(zz_vsp[0].int_value),(short)1); |
| 4471 |
} |
| 4472 |
break; |
| 4473 |
|
| 4474 |
case 255: |
| 4475 |
#line 2379 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4476 |
{ |
| 4477 |
(zz_val.frac_value) = CreateFraction((short)(zz_vsp[-3].int_value),(short)(zz_vsp[-1].int_value)); |
| 4478 |
} |
| 4479 |
break; |
| 4480 |
|
| 4481 |
case 256: |
| 4482 |
#line 2386 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4483 |
{ |
| 4484 |
(zz_val.int_value) = 0; |
| 4485 |
} |
| 4486 |
break; |
| 4487 |
|
| 4488 |
case 257: |
| 4489 |
#line 2390 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4490 |
{ |
| 4491 |
(zz_val.int_value) = 0; |
| 4492 |
} |
| 4493 |
break; |
| 4494 |
|
| 4495 |
case 258: |
| 4496 |
#line 2394 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4497 |
{ |
| 4498 |
(zz_val.int_value) = 1; |
| 4499 |
} |
| 4500 |
break; |
| 4501 |
|
| 4502 |
case 259: |
| 4503 |
#line 2401 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4504 |
{ |
| 4505 |
(zz_val.eptr) = CreateIntExpr((zz_vsp[0].int_value)); |
| 4506 |
} |
| 4507 |
break; |
| 4508 |
|
| 4509 |
case 260: |
| 4510 |
#line 2405 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4511 |
{ |
| 4512 |
(zz_val.eptr) = CreateIntExpr(LONG_MAX-1); |
| 4513 |
} |
| 4514 |
break; |
| 4515 |
|
| 4516 |
case 261: |
| 4517 |
#line 2409 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4518 |
{ |
| 4519 |
(zz_val.eptr) = CreateRealExpr((zz_vsp[0].real_value),g_dim_ptr); |
| 4520 |
} |
| 4521 |
break; |
| 4522 |
|
| 4523 |
case 262: |
| 4524 |
#line 2413 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4525 |
{ |
| 4526 |
(zz_val.eptr) = CreateRealExpr(DBL_MAX/(1+1e-15),Dimensionless()); |
| 4527 |
} |
| 4528 |
break; |
| 4529 |
|
| 4530 |
case 263: |
| 4531 |
#line 2417 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4532 |
{ |
| 4533 |
(zz_val.eptr) = CreateTrueExpr(); |
| 4534 |
} |
| 4535 |
break; |
| 4536 |
|
| 4537 |
case 264: |
| 4538 |
#line 2421 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4539 |
{ |
| 4540 |
(zz_val.eptr) = CreateFalseExpr(); |
| 4541 |
} |
| 4542 |
break; |
| 4543 |
|
| 4544 |
case 265: |
| 4545 |
#line 2425 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4546 |
{ |
| 4547 |
(zz_val.eptr) = CreateAnyExpr(); |
| 4548 |
} |
| 4549 |
break; |
| 4550 |
|
| 4551 |
case 266: |
| 4552 |
#line 2429 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4553 |
{ |
| 4554 |
(zz_val.eptr) = CreateSymbolExpr((zz_vsp[0].sym_ptr)); |
| 4555 |
} |
| 4556 |
break; |
| 4557 |
|
| 4558 |
case 267: |
| 4559 |
#line 2433 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4560 |
{ |
| 4561 |
(zz_val.eptr) = CreateVarExpr((zz_vsp[0].nptr)); |
| 4562 |
} |
| 4563 |
break; |
| 4564 |
|
| 4565 |
case 268: |
| 4566 |
#line 2437 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4567 |
{ |
| 4568 |
(zz_val.eptr) = CreateSetExpr((zz_vsp[-1].sptr)); |
| 4569 |
} |
| 4570 |
break; |
| 4571 |
|
| 4572 |
case 269: |
| 4573 |
#line 2441 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4574 |
{ |
| 4575 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_plus)); |
| 4576 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4577 |
} |
| 4578 |
break; |
| 4579 |
|
| 4580 |
case 270: |
| 4581 |
#line 2446 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4582 |
{ |
| 4583 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_minus)); |
| 4584 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4585 |
} |
| 4586 |
break; |
| 4587 |
|
| 4588 |
case 271: |
| 4589 |
#line 2451 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4590 |
{ |
| 4591 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_times)); |
| 4592 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4593 |
} |
| 4594 |
break; |
| 4595 |
|
| 4596 |
case 272: |
| 4597 |
#line 2456 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4598 |
{ |
| 4599 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_divide)); |
| 4600 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4601 |
} |
| 4602 |
break; |
| 4603 |
|
| 4604 |
case 273: |
| 4605 |
#line 2461 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4606 |
{ |
| 4607 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_power)); |
| 4608 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4609 |
} |
| 4610 |
break; |
| 4611 |
|
| 4612 |
case 274: |
| 4613 |
#line 2466 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4614 |
{ |
| 4615 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_and)); |
| 4616 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4617 |
} |
| 4618 |
break; |
| 4619 |
|
| 4620 |
case 275: |
| 4621 |
#line 2471 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4622 |
{ |
| 4623 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_or)); |
| 4624 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4625 |
} |
| 4626 |
break; |
| 4627 |
|
| 4628 |
case 276: |
| 4629 |
#line 2476 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4630 |
{ |
| 4631 |
(zz_val.eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_not)); |
| 4632 |
} |
| 4633 |
break; |
| 4634 |
|
| 4635 |
case 277: |
| 4636 |
#line 2480 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4637 |
{ |
| 4638 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),(zz_vsp[-1].eptr)); |
| 4639 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4640 |
} |
| 4641 |
break; |
| 4642 |
|
| 4643 |
case 278: |
| 4644 |
#line 2485 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4645 |
{ |
| 4646 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),(zz_vsp[-1].eptr)); |
| 4647 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4648 |
} |
| 4649 |
break; |
| 4650 |
|
| 4651 |
case 279: |
| 4652 |
#line 2490 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4653 |
{ |
| 4654 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_in)); |
| 4655 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4656 |
} |
| 4657 |
break; |
| 4658 |
|
| 4659 |
case 280: |
| 4660 |
#line 2495 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4661 |
{ |
| 4662 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_st)); |
| 4663 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4664 |
} |
| 4665 |
break; |
| 4666 |
|
| 4667 |
case 281: |
| 4668 |
#line 2500 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4669 |
{ |
| 4670 |
(zz_vsp[0].eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_st)); |
| 4671 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-2].eptr),(zz_vsp[0].eptr)); |
| 4672 |
} |
| 4673 |
break; |
| 4674 |
|
| 4675 |
case 282: |
| 4676 |
#line 2505 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4677 |
{ |
| 4678 |
(zz_val.eptr) = (zz_vsp[0].eptr); |
| 4679 |
} |
| 4680 |
break; |
| 4681 |
|
| 4682 |
case 283: |
| 4683 |
#line 2509 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4684 |
{ |
| 4685 |
(zz_val.eptr) = JoinExprLists((zz_vsp[0].eptr),CreateOpExpr(e_uminus)); |
| 4686 |
} |
| 4687 |
break; |
| 4688 |
|
| 4689 |
case 284: |
| 4690 |
#line 2513 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4691 |
{ |
| 4692 |
(zz_val.eptr) = CreateSatisfiedExpr((zz_vsp[-3].nptr),(zz_vsp[-1].real_value),g_dim_ptr); |
| 4693 |
} |
| 4694 |
break; |
| 4695 |
|
| 4696 |
case 285: |
| 4697 |
#line 2517 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4698 |
{ |
| 4699 |
(zz_val.eptr) = CreateSatisfiedExpr((zz_vsp[-1].nptr),DBL_MAX,NULL); |
| 4700 |
} |
| 4701 |
break; |
| 4702 |
|
| 4703 |
case 286: |
| 4704 |
#line 2521 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4705 |
{ |
| 4706 |
DestroySetList((zz_vsp[-1].sptr)); |
| 4707 |
(zz_val.eptr) = NULL; |
| 4708 |
ErrMsg_ParensBrackets("SUM"); |
| 4709 |
g_untrapped_error++; |
| 4710 |
} |
| 4711 |
break; |
| 4712 |
|
| 4713 |
case 287: |
| 4714 |
#line 2528 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4715 |
{ |
| 4716 |
(zz_val.eptr) = CreateBuiltin(e_sum,(zz_vsp[-1].sptr)); |
| 4717 |
} |
| 4718 |
break; |
| 4719 |
|
| 4720 |
case 288: |
| 4721 |
#line 2532 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4722 |
{ |
| 4723 |
DestroySetList((zz_vsp[-1].sptr)); |
| 4724 |
(zz_val.eptr) = NULL; |
| 4725 |
ErrMsg_ParensBrackets("PROD"); |
| 4726 |
g_untrapped_error++; |
| 4727 |
} |
| 4728 |
break; |
| 4729 |
|
| 4730 |
case 289: |
| 4731 |
#line 2539 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4732 |
{ |
| 4733 |
(zz_val.eptr) = CreateBuiltin(e_prod,(zz_vsp[-1].sptr)); |
| 4734 |
} |
| 4735 |
break; |
| 4736 |
|
| 4737 |
case 290: |
| 4738 |
#line 2543 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4739 |
{ |
| 4740 |
DestroySetList((zz_vsp[-1].sptr)); |
| 4741 |
(zz_val.eptr) = NULL; |
| 4742 |
ErrMsg_ParensBrackets("UNION"); |
| 4743 |
g_untrapped_error++; |
| 4744 |
} |
| 4745 |
break; |
| 4746 |
|
| 4747 |
case 291: |
| 4748 |
#line 2550 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4749 |
{ |
| 4750 |
(zz_val.eptr) = CreateBuiltin(e_union,(zz_vsp[-1].sptr)); |
| 4751 |
} |
| 4752 |
break; |
| 4753 |
|
| 4754 |
case 292: |
| 4755 |
#line 2554 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4756 |
{ |
| 4757 |
DestroySetList((zz_vsp[-1].sptr)); |
| 4758 |
(zz_val.eptr) = NULL; |
| 4759 |
ErrMsg_ParensBrackets("INTERSECTION"); |
| 4760 |
g_untrapped_error++; |
| 4761 |
} |
| 4762 |
break; |
| 4763 |
|
| 4764 |
case 293: |
| 4765 |
#line 2561 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4766 |
{ |
| 4767 |
(zz_val.eptr) = CreateBuiltin(e_inter,(zz_vsp[-1].sptr)); |
| 4768 |
} |
| 4769 |
break; |
| 4770 |
|
| 4771 |
case 294: |
| 4772 |
#line 2565 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4773 |
{ |
| 4774 |
DestroySetList((zz_vsp[-1].sptr)); |
| 4775 |
(zz_val.eptr) = NULL; |
| 4776 |
ErrMsg_ParensBrackets("CARD"); |
| 4777 |
g_untrapped_error++; |
| 4778 |
} |
| 4779 |
break; |
| 4780 |
|
| 4781 |
case 295: |
| 4782 |
#line 2572 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4783 |
{ |
| 4784 |
(zz_val.eptr) = CreateBuiltin(e_card,(zz_vsp[-1].sptr)); |
| 4785 |
} |
| 4786 |
break; |
| 4787 |
|
| 4788 |
case 296: |
| 4789 |
#line 2576 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4790 |
{ |
| 4791 |
DestroySetList((zz_vsp[-1].sptr)); |
| 4792 |
(zz_val.eptr) = NULL; |
| 4793 |
ErrMsg_ParensBrackets("CHOICE"); |
| 4794 |
g_untrapped_error++; |
| 4795 |
} |
| 4796 |
break; |
| 4797 |
|
| 4798 |
case 297: |
| 4799 |
#line 2583 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4800 |
{ |
| 4801 |
(zz_val.eptr) = CreateBuiltin(e_choice,(zz_vsp[-1].sptr)); |
| 4802 |
} |
| 4803 |
break; |
| 4804 |
|
| 4805 |
case 298: |
| 4806 |
#line 2587 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4807 |
{ |
| 4808 |
CONST struct Func *fptr; |
| 4809 |
if ((fptr = LookupFunc(SCP((zz_vsp[-3].id_ptr))))!=NULL) { |
| 4810 |
(zz_val.eptr) = JoinExprLists((zz_vsp[-1].eptr),CreateFuncExpr(fptr)); |
| 4811 |
} else { |
| 4812 |
(zz_val.eptr) = NULL; |
| 4813 |
error_reporter_current_line(ASC_USER_ERROR,"Function '%s' is not defined.",SCP((zz_vsp[-3].id_ptr))); |
| 4814 |
g_untrapped_error++; |
| 4815 |
} |
| 4816 |
} |
| 4817 |
break; |
| 4818 |
|
| 4819 |
case 299: |
| 4820 |
#line 2598 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4821 |
{ |
| 4822 |
(zz_val.eptr) = (zz_vsp[-1].eptr); |
| 4823 |
} |
| 4824 |
break; |
| 4825 |
|
| 4826 |
case 300: |
| 4827 |
#line 2605 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4828 |
{ |
| 4829 |
(zz_val.eptr) = CreateOpExpr(e_equal); |
| 4830 |
} |
| 4831 |
break; |
| 4832 |
|
| 4833 |
case 301: |
| 4834 |
#line 2609 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4835 |
{ |
| 4836 |
(zz_val.eptr) = CreateOpExpr(e_less); |
| 4837 |
} |
| 4838 |
break; |
| 4839 |
|
| 4840 |
case 302: |
| 4841 |
#line 2613 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4842 |
{ |
| 4843 |
(zz_val.eptr) = CreateOpExpr(e_greater); |
| 4844 |
} |
| 4845 |
break; |
| 4846 |
|
| 4847 |
case 303: |
| 4848 |
#line 2617 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4849 |
{ |
| 4850 |
(zz_val.eptr) = CreateOpExpr(e_lesseq); |
| 4851 |
} |
| 4852 |
break; |
| 4853 |
|
| 4854 |
case 304: |
| 4855 |
#line 2621 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4856 |
{ |
| 4857 |
(zz_val.eptr) = CreateOpExpr(e_greatereq); |
| 4858 |
} |
| 4859 |
break; |
| 4860 |
|
| 4861 |
case 305: |
| 4862 |
#line 2625 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4863 |
{ |
| 4864 |
(zz_val.eptr) = CreateOpExpr(e_notequal); |
| 4865 |
} |
| 4866 |
break; |
| 4867 |
|
| 4868 |
case 306: |
| 4869 |
#line 2632 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4870 |
{ |
| 4871 |
(zz_val.eptr) = CreateOpExpr(e_boolean_eq); |
| 4872 |
} |
| 4873 |
break; |
| 4874 |
|
| 4875 |
case 307: |
| 4876 |
#line 2636 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 4877 |
{ |
| 4878 |
(zz_val.eptr) = CreateOpExpr(e_boolean_neq); |
| 4879 |
} |
| 4880 |
break; |
| 4881 |
|
| 4882 |
|
| 4883 |
} |
| 4884 |
|
| 4885 |
/* Line 1037 of yacc.c. */ |
| 4886 |
#line 4887 "y.tab.c" |
| 4887 |
|
| 4888 |
zz_vsp -= zz_len; |
| 4889 |
zz_ssp -= zz_len; |
| 4890 |
|
| 4891 |
|
| 4892 |
ZZ__STACK_PRINT (zz_ss, zz_ssp); |
| 4893 |
|
| 4894 |
*++zz_vsp = zz_val; |
| 4895 |
|
| 4896 |
|
| 4897 |
/* Now `shift' the result of the reduction. Determine what state |
| 4898 |
that goes to, based on the state we popped back to and the rule |
| 4899 |
number reduced by. */ |
| 4900 |
|
| 4901 |
zz_n = zz_r1[zz_n]; |
| 4902 |
|
| 4903 |
zz_state = zz_pgoto[zz_n - ZZ_NTOKENS] + *zz_ssp; |
| 4904 |
if (0 <= zz_state && zz_state <= ZZ_LAST && zz_check[zz_state] == *zz_ssp) |
| 4905 |
zz_state = zz_table[zz_state]; |
| 4906 |
else |
| 4907 |
zz_state = zz_defgoto[zz_n - ZZ_NTOKENS]; |
| 4908 |
|
| 4909 |
goto zz_newstate; |
| 4910 |
|
| 4911 |
|
| 4912 |
/*------------------------------------. |
| 4913 |
| zz_errlab -- here on detecting error | |
| 4914 |
`------------------------------------*/ |
| 4915 |
zz_errlab: |
| 4916 |
/* If not already recovering from an error, report this error. */ |
| 4917 |
if (!zz_errstatus) |
| 4918 |
{ |
| 4919 |
++zz_nerrs; |
| 4920 |
#if ZZ_ERROR_VERBOSE |
| 4921 |
zz_n = zz_pact[zz_state]; |
| 4922 |
|
| 4923 |
if (ZZ_PACT_NINF < zz_n && zz_n < ZZ_LAST) |
| 4924 |
{ |
| 4925 |
ZZ_SIZE_T zz_size = 0; |
| 4926 |
int zz_type = ZZ_TRANSLATE (zz_char); |
| 4927 |
const char* zz_prefix; |
| 4928 |
char *zz_msg; |
| 4929 |
int zz_x; |
| 4930 |
|
| 4931 |
/* Start ZZ_X at -ZZ_N if negative to avoid negative indexes in |
| 4932 |
ZZ_CHECK. */ |
| 4933 |
int zz_xbegin = zz_n < 0 ? -zz_n : 0; |
| 4934 |
|
| 4935 |
/* Stay within bounds of both zz_check and zz_tname. */ |
| 4936 |
int zz_checklim = ZZ_LAST - zz_n; |
| 4937 |
int zz_xend = zz_checklim < ZZ_NTOKENS ? zz_checklim : ZZ_NTOKENS; |
| 4938 |
int zz_count = 0; |
| 4939 |
|
| 4940 |
zz_prefix = ", expecting "; |
| 4941 |
for (zz_x = zz_xbegin; zz_x < zz_xend; ++zz_x) |
| 4942 |
if (zz_check[zz_x + zz_n] == zz_x && zz_x != ZZ_TERROR) |
| 4943 |
{ |
| 4944 |
zz_size += zz_strlen (zz_prefix) + zz_strlen (zz_tname [zz_x]); |
| 4945 |
zz_count += 1; |
| 4946 |
if (zz_count == 5) |
| 4947 |
{ |
| 4948 |
zz_size = 0; |
| 4949 |
break; |
| 4950 |
} |
| 4951 |
} |
| 4952 |
zz_size += (sizeof ("syntax error, unexpected ") |
| 4953 |
+ zz_strlen (zz_tname[zz_type])); |
| 4954 |
zz_msg = (char *) ZZ_STACK_ALLOC (zz_size); |
| 4955 |
if (zz_msg != 0) |
| 4956 |
{ |
| 4957 |
char *zz_p = zz_stpcpy (zz_msg, "syntax error, unexpected "); |
| 4958 |
zz_p = zz_stpcpy (zz_p, zz_tname[zz_type]); |
| 4959 |
|
| 4960 |
if (zz_count < 5) |
| 4961 |
{ |
| 4962 |
zz_prefix = ", expecting "; |
| 4963 |
for (zz_x = zz_xbegin; zz_x < zz_xend; ++zz_x) |
| 4964 |
if (zz_check[zz_x + zz_n] == zz_x && zz_x != ZZ_TERROR) |
| 4965 |
{ |
| 4966 |
zz_p = zz_stpcpy (zz_p, zz_prefix); |
| 4967 |
zz_p = zz_stpcpy (zz_p, zz_tname[zz_x]); |
| 4968 |
zz_prefix = " or "; |
| 4969 |
} |
| 4970 |
} |
| 4971 |
zz_error (zz_msg); |
| 4972 |
ZZ_STACK_FREE (zz_msg); |
| 4973 |
} |
| 4974 |
else |
| 4975 |
zz_error ("syntax error; also virtual memory exhausted"); |
| 4976 |
} |
| 4977 |
else |
| 4978 |
#endif /* ZZ_ERROR_VERBOSE */ |
| 4979 |
zz_error ("syntax error"); |
| 4980 |
} |
| 4981 |
|
| 4982 |
|
| 4983 |
|
| 4984 |
if (zz_errstatus == 3) |
| 4985 |
{ |
| 4986 |
/* If just tried and failed to reuse look-ahead token after an |
| 4987 |
error, discard it. */ |
| 4988 |
|
| 4989 |
if (zz_char <= ZZ_EOF) |
| 4990 |
{ |
| 4991 |
/* If at end of input, pop the error token, |
| 4992 |
then the rest of the stack, then return failure. */ |
| 4993 |
if (zz_char == ZZ_EOF) |
| 4994 |
for (;;) |
| 4995 |
{ |
| 4996 |
|
| 4997 |
ZZ_POPSTACK; |
| 4998 |
if (zz_ssp == zz_ss) |
| 4999 |
ZZ_ABORT; |
| 5000 |
zz_destruct ("Error: popping", |
| 5001 |
zz_stos[*zz_ssp], zz_vsp); |
| 5002 |
} |
| 5003 |
} |
| 5004 |
else |
| 5005 |
{ |
| 5006 |
zz_destruct ("Error: discarding", zz_token, &zz_lval); |
| 5007 |
zz_char = ZZ_EMPTY; |
| 5008 |
} |
| 5009 |
} |
| 5010 |
|
| 5011 |
/* Else will try to reuse look-ahead token after shifting the error |
| 5012 |
token. */ |
| 5013 |
goto zz_errlab1; |
| 5014 |
|
| 5015 |
|
| 5016 |
/*---------------------------------------------------. |
| 5017 |
| zz_errorlab -- error raised explicitly by ZZ_ERROR. | |
| 5018 |
`---------------------------------------------------*/ |
| 5019 |
zz_errorlab: |
| 5020 |
|
| 5021 |
#ifdef __GNUC__ |
| 5022 |
/* Pacify GCC when the user code never invokes ZZ_ERROR and the label |
| 5023 |
zz_errorlab therefore never appears in user code. */ |
| 5024 |
if (0) |
| 5025 |
goto zz_errorlab; |
| 5026 |
#endif |
| 5027 |
|
| 5028 |
zz_vsp -= zz_len; |
| 5029 |
zz_ssp -= zz_len; |
| 5030 |
zz_state = *zz_ssp; |
| 5031 |
goto zz_errlab1; |
| 5032 |
|
| 5033 |
|
| 5034 |
/*-------------------------------------------------------------. |
| 5035 |
| zz_errlab1 -- common code for both syntax error and ZZ_ERROR. | |
| 5036 |
`-------------------------------------------------------------*/ |
| 5037 |
zz_errlab1: |
| 5038 |
zz_errstatus = 3; /* Each real token shifted decrements this. */ |
| 5039 |
|
| 5040 |
for (;;) |
| 5041 |
{ |
| 5042 |
zz_n = zz_pact[zz_state]; |
| 5043 |
if (zz_n != ZZ_PACT_NINF) |
| 5044 |
{ |
| 5045 |
zz_n += ZZ_TERROR; |
| 5046 |
if (0 <= zz_n && zz_n <= ZZ_LAST && zz_check[zz_n] == ZZ_TERROR) |
| 5047 |
{ |
| 5048 |
zz_n = zz_table[zz_n]; |
| 5049 |
if (0 < zz_n) |
| 5050 |
break; |
| 5051 |
} |
| 5052 |
} |
| 5053 |
|
| 5054 |
/* Pop the current state because it cannot handle the error token. */ |
| 5055 |
if (zz_ssp == zz_ss) |
| 5056 |
ZZ_ABORT; |
| 5057 |
|
| 5058 |
|
| 5059 |
zz_destruct ("Error: popping", zz_stos[zz_state], zz_vsp); |
| 5060 |
ZZ_POPSTACK; |
| 5061 |
zz_state = *zz_ssp; |
| 5062 |
ZZ__STACK_PRINT (zz_ss, zz_ssp); |
| 5063 |
} |
| 5064 |
|
| 5065 |
if (zz_n == ZZ_FINAL) |
| 5066 |
ZZ_ACCEPT; |
| 5067 |
|
| 5068 |
*++zz_vsp = zz_lval; |
| 5069 |
|
| 5070 |
|
| 5071 |
/* Shift the error token. */ |
| 5072 |
ZZ__SYMBOL_PRINT ("Shifting", zz_stos[zz_n], zz_vsp, zz_lsp); |
| 5073 |
|
| 5074 |
zz_state = zz_n; |
| 5075 |
goto zz_newstate; |
| 5076 |
|
| 5077 |
|
| 5078 |
/*-------------------------------------. |
| 5079 |
| zz_acceptlab -- ZZ_ACCEPT comes here. | |
| 5080 |
`-------------------------------------*/ |
| 5081 |
zz_acceptlab: |
| 5082 |
zz_result = 0; |
| 5083 |
goto zz_return; |
| 5084 |
|
| 5085 |
/*-----------------------------------. |
| 5086 |
| zz_abortlab -- ZZ_ABORT comes here. | |
| 5087 |
`-----------------------------------*/ |
| 5088 |
zz_abortlab: |
| 5089 |
zz_destruct ("Error: discarding lookahead", |
| 5090 |
zz_token, &zz_lval); |
| 5091 |
zz_char = ZZ_EMPTY; |
| 5092 |
zz_result = 1; |
| 5093 |
goto zz_return; |
| 5094 |
|
| 5095 |
#ifndef zz_overflow |
| 5096 |
/*----------------------------------------------. |
| 5097 |
| zz_overflowlab -- parser overflow comes here. | |
| 5098 |
`----------------------------------------------*/ |
| 5099 |
zz_overflowlab: |
| 5100 |
zz_error ("parser stack overflow"); |
| 5101 |
zz_result = 2; |
| 5102 |
/* Fall through. */ |
| 5103 |
#endif |
| 5104 |
|
| 5105 |
zz_return: |
| 5106 |
#ifndef zz_overflow |
| 5107 |
if (zz_ss != zz_ssa) |
| 5108 |
ZZ_STACK_FREE (zz_ss); |
| 5109 |
#endif |
| 5110 |
return zz_result; |
| 5111 |
} |
| 5112 |
|
| 5113 |
|
| 5114 |
#line 2640 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y" |
| 5115 |
|
| 5116 |
/* |
| 5117 |
* We really need to do something about freeing up the productions |
| 5118 |
* that invoke this so we don't leak memory like a seive. |
| 5119 |
* for example z[i IN [1..2]][j IN [process[i]] IS_A mass; eats a ton. |
| 5120 |
*/ |
| 5121 |
int |
| 5122 |
zz_error(char *s) |
| 5123 |
{ |
| 5124 |
g_untrapped_error++; |
| 5125 |
if (Asc_CurrentModule() != NULL) { |
| 5126 |
error_reporter_current_line(ASC_USER_ERROR,"%s",s); |
| 5127 |
} else { |
| 5128 |
error_reporter(ASC_USER_ERROR,NULL,0,"%s at end of input.\n",s); |
| 5129 |
} |
| 5130 |
return 0; |
| 5131 |
} |
| 5132 |
|
| 5133 |
/* |
| 5134 |
* See the header file scanner.h for a description of this function. |
| 5135 |
*/ |
| 5136 |
void |
| 5137 |
Asc_ErrMsgTypeDefnEOF(void) |
| 5138 |
{ |
| 5139 |
/* Check g_type_name to see if we're in the middle of a type |
| 5140 |
* definition. If NULL no, otherwise yes. |
| 5141 |
*/ |
| 5142 |
if ( g_type_name ) { |
| 5143 |
error_reporter_current_line(ASC_USER_ERROR, |
| 5144 |
"End of file reached in a type definition. Incomplete definition for '%s'.", |
| 5145 |
SCP(g_type_name)); |
| 5146 |
} |
| 5147 |
} |
| 5148 |
|
| 5149 |
|
| 5150 |
/* |
| 5151 |
* void ErrMsg_*(void) |
| 5152 |
* |
| 5153 |
* The following print error and warning messages to the filehandles |
| 5154 |
* ASCERR and ASCWARN, respectively. |
| 5155 |
* The type of error/warning that will be printed is indicated by the |
| 5156 |
* functions name and the arguments to fprintf. |
| 5157 |
*/ |
| 5158 |
static void |
| 5159 |
ErrMsg_Generic(CONST char *string) |
| 5160 |
{ |
| 5161 |
/* the module may have be already closed, Asc_CurrentModule will be null */ |
| 5162 |
error_reporter_current_line(ASC_USER_ERROR,"%s",string); |
| 5163 |
|
| 5164 |
if (g_type_name != NULL) { |
| 5165 |
error_reporter_current_line(ASC_USER_ERROR," type %s\n",SCP(g_type_name)); |
| 5166 |
} |
| 5167 |
if (g_proc_name != NULL) { |
| 5168 |
error_reporter_current_line(ASC_USER_ERROR," METHOD %s\n",SCP(g_proc_name)); |
| 5169 |
} |
| 5170 |
} |
| 5171 |
|
| 5172 |
static void ErrMsg_CommaName(CONST char *what, struct Name *name) |
| 5173 |
{ |
| 5174 |
struct module_t *mod; |
| 5175 |
|
| 5176 |
/* the module may have be already closed */ |
| 5177 |
mod = Asc_CurrentModule(); |
| 5178 |
|
| 5179 |
error_reporter_current_line(ASC_USER_ERROR, "ASC-Error: Missing comma or operator before %s ",what); |
| 5180 |
WriteName(ASCERR,name); |
| 5181 |
} |
| 5182 |
|
| 5183 |
#if COMMAEXPR_NOTBUGGY |
| 5184 |
static void ErrMsg_CommaExpr(CONST char *what, struct Expr *eptr) |
| 5185 |
{ |
| 5186 |
struct module_t *mod; |
| 5187 |
|
| 5188 |
/* the module may have be already closed */ |
| 5189 |
error_reporter_current_line(ASC_USER_ERROR, "ASC-Error: Missing comma before %s ",what); |
| 5190 |
WriteExpr(ASCERR,eptr); |
| 5191 |
} |
| 5192 |
#endif /* COMMAEXPR_NOTBUGGY. delete if can't fix */ |
| 5193 |
|
| 5194 |
static void |
| 5195 |
ErrMsg_NullDefPointer(CONST char *object) |
| 5196 |
{ |
| 5197 |
error_reporter_current_line(ASC_USER_ERROR,"Rejected '%s'", object); |
| 5198 |
} |
| 5199 |
|
| 5200 |
static void |
| 5201 |
ErrMsg_ProcTypeMissing(CONST char *AorR, CONST char *type) |
| 5202 |
{ |
| 5203 |
error_reporter_current_line(ASC_USER_ERROR, |
| 5204 |
"%s METHODS called with undefined type (%s)", AorR, type); |
| 5205 |
} |
| 5206 |
|
| 5207 |
static void |
| 5208 |
ErrMsg_ProcsRejected(CONST char *AorR, CONST char *type) |
| 5209 |
{ |
| 5210 |
error_reporter_current_line(ASC_USER_ERROR, |
| 5211 |
"%s METHODS failed for type %s", AorR, type); |
| 5212 |
} |
| 5213 |
|
| 5214 |
static void |
| 5215 |
ErrMsg_DuplicateProc(struct InitProcedure *p) |
| 5216 |
{ |
| 5217 |
error_reporter_current_line(ASC_USER_WARNING, |
| 5218 |
"Duplicate METHOD %s rejected", SCP(ProcName(p))); |
| 5219 |
} |
| 5220 |
|
| 5221 |
static void |
| 5222 |
ErrMsg_ParensBrackets(CONST char *operation) |
| 5223 |
{ |
| 5224 |
error_reporter_current_line(ASC_USER_ERROR, |
| 5225 |
" You should be using %s[] not %s()", |
| 5226 |
operation, |
| 5227 |
operation); |
| 5228 |
} |
| 5229 |
|
| 5230 |
|
| 5231 |
/* |
| 5232 |
* WarnMsg_MismatchEnd(statement, opt_name, end_token, expecting); |
| 5233 |
* const char *statement; |
| 5234 |
* const char *opt_name; |
| 5235 |
* unsigned long end_token; |
| 5236 |
* const char *expecting; |
| 5237 |
* |
| 5238 |
* Print a warning message that the token after the END keyword did not |
| 5239 |
* match what we were expecting for the current statement. |
| 5240 |
* Arguments: |
| 5241 |
* statement --the current statement, e.g. ATOM, METHOD, FOR, IF, CASE |
| 5242 |
* opt_name --the name of the thing we were defining for ATOMs, METHODs, |
| 5243 |
* etc, or NULL anonymous statements (FOR, IF, CASE, etc) |
| 5244 |
* end_token --the TOKEN_T that we were received instead. We use the |
| 5245 |
* TokenAsString to produce a string given a TOKEN_T |
| 5246 |
* expecting --the keyword we were expecting to see after the END; if |
| 5247 |
* NULL, we were expecting the string given in statement |
| 5248 |
*/ |
| 5249 |
static void |
| 5250 |
WarnMsg_MismatchEnd(CONST char *statement, CONST char *opt_name, |
| 5251 |
unsigned long end_token, CONST char *expecting) |
| 5252 |
{ |
| 5253 |
error_reporter_current_line(ASC_USER_WARNING, |
| 5254 |
"%s %s terminated with 'END %s;', expecting 'END %s;'" |
| 5255 |
,statement |
| 5256 |
,((opt_name != NULL) ? opt_name : "statement") |
| 5257 |
,TokenAsString(end_token) |
| 5258 |
,((expecting != NULL) ? expecting : statement)); |
| 5259 |
} |
| 5260 |
|
| 5261 |
|
| 5262 |
/* |
| 5263 |
* CONST char *TokenAsString(token); |
| 5264 |
* unsigned long token; |
| 5265 |
* |
| 5266 |
* Takes a TOKEN_T (e.g., FOR_T, MODEL_T, END_T, IDENTIFIER_T) and returns |
| 5267 |
* a string representation of it: |
| 5268 |
* e.g.: TokenAsString(FOR_T) ==> "FOR" |
| 5269 |
* |
| 5270 |
* Since this function is only used inside WarnMsg_MismatchEnd, we do a |
| 5271 |
* couple of things specific to that function: If token is END_T, we |
| 5272 |
* return an empty string, and if it is IDENTIFIER_T, we return the |
| 5273 |
* current value of g_end_identifier, or UNKNOWN if g_end_identifier is |
| 5274 |
* NULL. |
| 5275 |
*/ |
| 5276 |
static CONST char * |
| 5277 |
TokenAsString(unsigned long token) |
| 5278 |
{ |
| 5279 |
switch( token ) { |
| 5280 |
case ATOM_T: |
| 5281 |
return "ATOM"; |
| 5282 |
case CONDITIONAL_T: |
| 5283 |
return "CONDITIONAL"; |
| 5284 |
case FOR_T: |
| 5285 |
return "FOR"; |
| 5286 |
case ASSERT_T: |
| 5287 |
return "ASSERT"; |
| 5288 |
case IF_T: |
| 5289 |
return "IF"; |
| 5290 |
case INTERACTIVE_T: |
| 5291 |
return "INTERACTIVE"; |
| 5292 |
case METHOD_T: |
| 5293 |
return "METHOD"; |
| 5294 |
case METHODS_T: |
| 5295 |
return "METHODS"; |
| 5296 |
case MODEL_T: |
| 5297 |
return "MODEL"; |
| 5298 |
case NOTES_T: |
| 5299 |
return "NOTES"; |
| 5300 |
case PATCH_T: |
| 5301 |
return "PATCH"; |
| 5302 |
case SELECT_T: |
| 5303 |
return "SELECT"; |
| 5304 |
case SWITCH_T: |
| 5305 |
return "SWITCH"; |
| 5306 |
case UNITS_T: |
| 5307 |
return "UNITS"; |
| 5308 |
case WHEN_T: |
| 5309 |
return "WHEN"; |
| 5310 |
case END_T: |
| 5311 |
return ""; |
| 5312 |
case IDENTIFIER_T: |
| 5313 |
default: |
| 5314 |
if( g_end_identifier != NULL ) { |
| 5315 |
return SCP(g_end_identifier); |
| 5316 |
} else { |
| 5317 |
return "UNKNOWN"; |
| 5318 |
} |
| 5319 |
} |
| 5320 |
} |
| 5321 |
|
| 5322 |
/* need a refcount game on the text field of the note. must keep |
| 5323 |
* original note to avoid losing the varlist. |
| 5324 |
*/ |
| 5325 |
static void ProcessNotes(int keep) |
| 5326 |
{ |
| 5327 |
int c,len; |
| 5328 |
if (g_notelist == NULL) { |
| 5329 |
return; |
| 5330 |
} |
| 5331 |
if (keep) { |
| 5332 |
len = gl_length(g_notelist); |
| 5333 |
for (c=1;c <= len;c++) { |
| 5334 |
CommitNote(LibraryNote(),gl_fetch(g_notelist,c)); |
| 5335 |
} |
| 5336 |
} else { |
| 5337 |
gl_iterate(g_notelist,(void (*) (VOIDPTR))DestroyNote); |
| 5338 |
} |
| 5339 |
gl_destroy(g_notelist); |
| 5340 |
g_notelist = NULL; |
| 5341 |
} |
| 5342 |
|
| 5343 |
static void CollectNote(struct Note *n) |
| 5344 |
{ |
| 5345 |
if (g_notelist == NULL) { |
| 5346 |
g_notelist = gl_create(50L); |
| 5347 |
} |
| 5348 |
if (g_notelist == NULL) { |
| 5349 |
DestroyNote(n); |
| 5350 |
return; |
| 5351 |
} |
| 5352 |
gl_append_ptr(g_notelist,(VOIDPTR)n); |
| 5353 |
} |
| 5354 |
|
| 5355 |
/* |
| 5356 |
This can be called as error_reporter_current_line(ASC_USER_ERROR,...); |
| 5357 |
or error_reporter_current_line(ASC_USER_WARNING,...), or with any of the other |
| 5358 |
severity flags. |
| 5359 |
*/ |
| 5360 |
static void error_reporter_current_line(const error_severity_t sev, const char *fmt,...){ |
| 5361 |
va_list args; |
| 5362 |
va_start(args,fmt); |
| 5363 |
va_error_reporter(sev,Asc_ModuleBestName(Asc_CurrentModule()),(int)LineNum(),NULL,fmt,args); |
| 5364 |
va_end(args); |
| 5365 |
} |
| 5366 |
|