[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FW: Bison 1.50 question: Can it support Auto-Complete?
From: |
Nils Hasler |
Subject: |
Re: FW: Bison 1.50 question: Can it support Auto-Complete? |
Date: |
Wed, 06 Nov 2002 11:36:40 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; WinNT4.0; de-DE; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 |
hi Chris.
sorry for taking that long. our net was down...
first of all the option -l to bison removes the #line preprocessor
directives. this looked like a lot of work in your salsa.tab.c.
ok, i changed your salsa.tab.cpp. you really were almost done.
those undefined MACROS have only changed their names.
then i only had to introduce the "metatoken" YYWAIT. i only called it a
"metatoken"
because it is something that tells the parser something that is not
directly concerned
with the grammar but with the state of the editor.
your lexer has to be modified accordingly, but you will have to modify
it anyway to
figure out if the parse has to be stopped. in that case you don't want
to return eof.
i marked all changes with //|/
hope it works
nils
/* A Bison parser, made from salsa.y, by GNU bison 1.75. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Written by Richard Stallman by simplifying the original so called
``semantic'' parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
/* Identify Bison output. */
#define YYBISON 1
/* Pure parsers. */
#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
YYWAIT = 0; //|/ here is the token that tells us that we have to
wait
//|/ because the cursor has to move or whatever
c_comma = 258,
k_create = 259,
k_delete = 260,
k_place = 261,
k_set = 262,
k_assign = 263,
k_if = 264,
k_else = 265,
k_endif = 266,
k_while = 267,
k_endwhile = 268,
k_foreach = 269,
k_endforeach = 270,
k_doconcurrent = 271,
k_enddoconcurrent = 272,
k_move = 273,
k_resize = 274,
k_flash = 275,
k_cutout = 276,
k_position = 277,
k_grid = 278,
k_gridpos = 279,
k_as = 280,
k_clone = 281,
k_of = 282,
k_from = 283,
k_to = 284,
k_along = 285,
k_path = 286,
k_over = 287,
k_sec = 288,
k_for = 289,
k_hdata = 290,
k_hdatapos = 291,
k_hdatavisible = 292,
k_hgraphicrep = 293,
k_hvisible = 294,
k_hhighlighted = 295,
k_hfillcolor = 296,
k_houtlinecolor = 297,
k_hrefpoint = 298,
k_hrows = 299,
k_hcolumns = 300,
k_hcellwidth = 301,
k_hcellheight = 302,
k_hgridpoints = 303,
k_hinterngridlines = 304,
k_hexterngridlines = 305,
k_hposition = 306,
k_hxcoord = 307,
k_hycoord = 308,
k_id = 309,
k_name = 310,
k_data = 311,
k_datapos = 312,
k_datavisible = 313,
k_graphicrep = 314,
k_visible = 315,
k_highlighted = 316,
k_fillcolor = 317,
k_outlinecolor = 318,
k_refpoint = 319,
k_rows = 320,
k_columns = 321,
k_cellwidth = 322,
k_cellheight = 323,
k_gridpoints = 324,
k_interngridlines = 325,
k_externgridlines = 326,
k_xcoord = 327,
k_ycoord = 328,
k_height = 329,
k_width = 330,
v_id = 331,
v_color = 332,
v_int = 333,
v_float = 334,
v_qstring = 335,
v_bool = 336,
v_local_pos = 337,
v_at_kw = 338,
v_sr_kw = 339,
v_vplane_kw = 340,
v_move_dir = 341,
k_straight = 342,
k_clockwise = 343,
k_counterclockwise = 344,
k_custom = 345,
k_left_of = 346,
k_right_of = 347,
k_above = 348,
k_below = 349,
k_in = 350,
k_at = 351,
k_touching = 352,
k_outside_of = 353,
k_closer_than = 354,
k_further_away_than = 355,
c_asterisk = 356,
o_spatial_com = 357,
o_numeric_com = 358,
o_is_com = 359,
o_logical_andor = 360
};
#endif
#define YYWAIT 0 //|/ and here it is again
#define c_comma 258
#define k_create 259
#define k_delete 260
#define k_place 261
#define k_set 262
#define k_assign 263
#define k_if 264
#define k_else 265
#define k_endif 266
#define k_while 267
#define k_endwhile 268
#define k_foreach 269
#define k_endforeach 270
#define k_doconcurrent 271
#define k_enddoconcurrent 272
#define k_move 273
#define k_resize 274
#define k_flash 275
#define k_cutout 276
#define k_position 277
#define k_grid 278
#define k_gridpos 279
#define k_as 280
#define k_clone 281
#define k_of 282
#define k_from 283
#define k_to 284
#define k_along 285
#define k_path 286
#define k_over 287
#define k_sec 288
#define k_for 289
#define k_hdata 290
#define k_hdatapos 291
#define k_hdatavisible 292
#define k_hgraphicrep 293
#define k_hvisible 294
#define k_hhighlighted 295
#define k_hfillcolor 296
#define k_houtlinecolor 297
#define k_hrefpoint 298
#define k_hrows 299
#define k_hcolumns 300
#define k_hcellwidth 301
#define k_hcellheight 302
#define k_hgridpoints 303
#define k_hinterngridlines 304
#define k_hexterngridlines 305
#define k_hposition 306
#define k_hxcoord 307
#define k_hycoord 308
#define k_id 309
#define k_name 310
#define k_data 311
#define k_datapos 312
#define k_datavisible 313
#define k_graphicrep 314
#define k_visible 315
#define k_highlighted 316
#define k_fillcolor 317
#define k_outlinecolor 318
#define k_refpoint 319
#define k_rows 320
#define k_columns 321
#define k_cellwidth 322
#define k_cellheight 323
#define k_gridpoints 324
#define k_interngridlines 325
#define k_externgridlines 326
#define k_xcoord 327
#define k_ycoord 328
#define k_height 329
#define k_width 330
#define v_id 331
#define v_color 332
#define v_int 333
#define v_float 334
#define v_qstring 335
#define v_bool 336
#define v_local_pos 337
#define v_at_kw 338
#define v_sr_kw 339
#define v_vplane_kw 340
#define v_move_dir 341
#define k_straight 342
#define k_clockwise 343
#define k_counterclockwise 344
#define k_custom 345
#define k_left_of 346
#define k_right_of 347
#define k_above 348
#define k_below 349
#define k_in 350
#define k_at 351
#define k_touching 352
#define k_outside_of 353
#define k_closer_than 354
#define k_further_away_than 355
#define c_asterisk 356
#define o_spatial_com 357
#define o_numeric_com 358
#define o_is_com 359
#define o_logical_andor 360
/* Copy the first part of user declarations. */
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include "CCutout.h"
#include "CPosition.h"
#include "CGrid.h"
#include "CGridPosition.h"
#include "CObjectTable.h"
#include "salsa_stmt.h"
#include <malloc.h>
#define alloca _alloca
#define YYERROR_VERBOSE 1
void yysuccess(char *);
extern bool TextBuffer_Initialize(const char*);
extern bool TextBuffer_Terminate();
extern void yyerror(char*);
extern int yylex();
extern bool error_encountered;
extern char status_message[500];
char tmp[256];
object_expr *obj_expr;
position_expr *pos_expr;
gridpos_expr *gp_expr;
distance_expr *dist_expr;
boolean_comparison_expr *bool_com_expr;
boolean_expr *bool_expr;
string_expr *str_expr;
color_expr *col_expr;
localpos_expr *locpos_expr;
salsa_stmt *cmd_parsed;
cutout_create_stmt *c_create_cmd;
pos_create_stmt *p_create_cmd;
grid_create_stmt *g_create_cmd;
create_stmt *create_cmd;
place_stmt *place_cmd;
set_stmt *set_cmd;
assign_stmt *assign_cmd;
if_stmt *if_cmd;
else_stmt *else_cmd;
endif_stmt *endif_cmd;
while_stmt *while_cmd;
endwhile_stmt *endwhile_cmd;
doconcurrent_stmt *doconcurrent_cmd;
enddoconcurrent_stmt *enddoconcurrent_cmd;
move_stmt *move_cmd;
flash_stmt *flash_cmd;
delete_stmt *delete_cmd;
noop_stmt *noop_cmd;
/* more instances coming--one for each subclass of salsa_stmt */
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
#ifndef YYSTYPE
typedef union {
int ival;
float fval;
char *sval;
bool bval;
LOCAL_POS lpval;
SPATIAL_RELATION srval;
NUMERIC_OP nuopval;
IS_OP isval;
DIRECTION dirval;
AND_OR_OP andorval;
COLOR cval;
boolean_comparison_expr *boolcomexpr;
boolean_expr *boolexpr;
string_expr *strexpr;
color_expr *colexpr;
localpos_expr *localposexpr;
distance_expr *distexpr;
object_expr *objexpr;
position_expr *posexpr;
gridpos_expr *gposexpr;
SALSAOBJECT_ATTR sattr;
SALSA_TYPE stype;
} yystype;
/* Line 193 of /usr/local/share/bison/yacc.c. */
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif
#ifndef YYLTYPE
typedef struct yyltype
{
int first_line;
int first_column;
int last_line;
int last_column;
} yyltype;
# define YYLTYPE yyltype
# define YYLTYPE_IS_TRIVIAL 1
#endif
/* Copy the second part of user declarations. */
/* Line 213 of /usr/local/share/bison/yacc.c. */
#if ! defined (yyoverflow) || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
# else
# ifndef YYSTACK_USE_ALLOCA
# if defined (alloca) || defined (_ALLOCA_H)
# define YYSTACK_ALLOC alloca
# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
# if defined (__STDC__) || defined (__cplusplus)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
# define YYSTACK_ALLOC malloc
# define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
short yyss;
YYSTYPE yyvs;
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAX)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
register YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (0)
# endif
# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#endif
#if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char;
#else
typedef short yysigned_char;
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 90
#define YYLAST 309
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 106
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 59
/* YYNRULES -- Number of rules. */
#define YYNRULES 166
/* YYNRULES -- Number of states. */
#define YYNSTATES 289
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 360
#define YYTRANSLATE(X) \
((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const unsigned char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
105
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const unsigned short yyprhs[] =
{
0, 0, 3, 5, 7, 9, 10, 12, 14, 16,
18, 20, 22, 24, 26, 28, 30, 32, 34, 36,
37, 44, 45, 51, 52, 58, 63, 68, 73, 80,
87, 94, 101, 108, 115, 120, 125, 128, 130, 132,
135, 137, 139, 141, 142, 150, 151, 159, 160, 168,
169, 177, 178, 183, 186, 187, 191, 195, 199, 204,
205, 209, 210, 214, 215, 217, 218, 223, 224, 226,
227, 229, 230, 232, 234, 237, 239, 242, 244, 247,
249, 252, 255, 258, 260, 263, 266, 269, 271, 274,
277, 280, 283, 286, 289, 292, 295, 298, 301, 304,
307, 310, 314, 318, 322, 326, 330, 334, 338, 342,
346, 350, 354, 358, 362, 364, 368, 370, 374, 376,
380, 382, 386, 391, 393, 394, 397, 399, 403, 407,
411, 415, 419, 425, 431, 437, 444, 449, 451, 453,
455, 457, 459, 461, 463, 465, 467, 469, 471, 473,
475, 477, 479, 481, 483, 485, 487, 489, 491, 493,
495, 497, 499, 501, 503, 505, 507
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
107, 0, -1, 108, -1, 110, -1, 112, -1, -1,
114, -1, 115, -1, 116, -1, 117, -1, 118, -1,
119, -1, 120, -1, 121, -1, 122, -1, 123, -1,
124, -1, 129, -1, 131, -1, -1, 4, 21, 109,
135, 136, 138, -1, -1, 4, 22, 111, 135, 137,
-1, -1, 4, 23, 113, 135, 139, -1, 6, 76,
96, 155, -1, 6, 76, 96, 154, -1, 6, 76,
96, 156, -1, 7, 159, 27, 154, 29, 149, -1,
7, 160, 27, 154, 29, 148, -1, 7, 161, 27,
154, 29, 151, -1, 7, 162, 27, 154, 29, 150,
-1, 7, 163, 27, 154, 29, 78, -1, 7, 164,
27, 154, 29, 79, -1, 8, 76, 29, 154, -1,
8, 76, 29, 156, -1, 9, 147, -1, 10, -1,
11, -1, 12, 147, -1, 13, -1, 16, -1, 17,
-1, -1, 18, 154, 29, 155, 125, 132, 133, -1,
-1, 18, 154, 29, 154, 126, 132, 133, -1, -1,
18, 154, 29, 156, 127, 132, 133, -1, -1, 18,
154, 86, 152, 128, 132, 133, -1, -1, 20, 154,
130, 134, -1, 5, 76, -1, -1, 30, 87, 31,
-1, 30, 89, 31, -1, 30, 88, 31, -1, 30,
90, 31, 80, -1, -1, 32, 79, 33, -1, -1,
34, 79, 33, -1, -1, 76, -1, -1, 25, 26,
27, 76, -1, -1, 141, -1, -1, 140, -1, -1,
142, -1, 143, -1, 140, 143, -1, 144, -1, 141,
144, -1, 145, -1, 142, 145, -1, 146, -1, 38,
80, -1, 41, 77, -1, 42, 77, -1, 146, -1,
51, 155, -1, 52, 79, -1, 53, 79, -1, 146,
-1, 44, 78, -1, 45, 78, -1, 46, 152, -1,
47, 152, -1, 48, 81, -1, 49, 81, -1, 50,
81, -1, 39, 81, -1, 37, 81, -1, 36, 82,
-1, 35, 80, -1, 40, 81, -1, 43, 82, -1,
155, 102, 155, -1, 155, 102, 154, -1, 154, 102,
154, -1, 154, 102, 155, -1, 156, 102, 156, -1,
156, 102, 154, -1, 156, 102, 155, -1, 154, 102,
156, -1, 155, 102, 156, -1, 152, 103, 152, -1,
148, 103, 148, -1, 149, 104, 149, -1, 150, 104,
150, -1, 80, -1, 160, 27, 154, -1, 81, -1,
159, 27, 154, -1, 77, -1, 162, 27, 154, -1,
82, -1, 161, 27, 154, -1, 153, 164, 27, 154,
-1, 79, -1, -1, 79, 101, -1, 76, -1, 157,
158, 154, -1, 157, 158, 155, -1, 21, 96, 156,
-1, 79, 3, 79, -1, 82, 27, 154, -1, 24,
95, 76, 27, 154, -1, 24, 95, 76, 158, 154,
-1, 24, 95, 76, 158, 155, -1, 24, 78, 3,
78, 27, 76, -1, 24, 78, 27, 76, -1, 21,
-1, 22, -1, 23, -1, 93, -1, 94, -1, 91,
-1, 92, -1, 95, -1, 98, -1, 97, -1, 58,
-1, 60, -1, 61, -1, 69, -1, 70, -1, 71,
-1, 54, -1, 55, -1, 56, -1, 59, -1, 64,
-1, 57, -1, 63, -1, 62, -1, 65, -1, 66,
-1, 74, -1, 75, -1, 68, -1, 67, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short yyrline[] =
{
0, 233, 233, 234, 236, 238, 239, 241, 243, 245,
247, 249, 251, 253, 255, 257, 259, 261, 263, 267,
266, 276, 275, 285, 284, 293, 299, 306, 314, 320,
327, 334, 341, 348, 356, 362, 370, 377, 384, 391,
398, 405, 412, 420, 419, 428, 426, 436, 434, 444,
442, 452, 451, 459, 467, 468, 472, 476, 480, 486,
487, 492, 493, 498, 499, 506, 507, 514, 515, 518,
519, 522, 523, 526, 527, 530, 531, 534, 535, 538,
539, 546, 553, 561, 562, 568, 574, 581, 582, 588,
594, 600, 606, 612, 618, 625, 630, 637, 644, 651,
658, 666, 670, 675, 680, 685, 690, 695, 700, 705,
710, 715, 720, 725, 731, 735, 741, 745, 751, 755,
761, 765, 771, 776, 782, 783, 786, 790, 795, 800,
806, 810, 816, 820, 825, 830, 835, 841, 842, 844,
847, 848, 850, 852, 854, 856, 858, 861, 862, 864,
866, 868, 870, 873, 874, 876, 878, 881, 882, 885,
886, 889, 890, 893, 894, 896, 898
};
#endif
#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "c_comma", "k_create", "k_delete",
"k_place", "k_set", "k_assign", "k_if", "k_else", "k_endif", "k_while",
"k_endwhile", "k_foreach", "k_endforeach", "k_doconcurrent",
"k_enddoconcurrent", "k_move", "k_resize", "k_flash", "k_cutout",
"k_position", "k_grid", "k_gridpos", "k_as", "k_clone", "k_of",
"k_from", "k_to", "k_along", "k_path", "k_over", "k_sec", "k_for",
"k_hdata", "k_hdatapos", "k_hdatavisible", "k_hgraphicrep",
"k_hvisible", "k_hhighlighted", "k_hfillcolor", "k_houtlinecolor",
"k_hrefpoint", "k_hrows", "k_hcolumns", "k_hcellwidth", "k_hcellheight",
"k_hgridpoints", "k_hinterngridlines", "k_hexterngridlines",
"k_hposition", "k_hxcoord", "k_hycoord", "k_id", "k_name", "k_data",
"k_datapos", "k_datavisible", "k_graphicrep", "k_visible",
"k_highlighted", "k_fillcolor", "k_outlinecolor", "k_refpoint",
"k_rows", "k_columns", "k_cellwidth", "k_cellheight", "k_gridpoints",
"k_interngridlines", "k_externgridlines", "k_xcoord", "k_ycoord",
"k_height", "k_width", "v_id", "v_color", "v_int", "v_float",
"v_qstring", "v_bool", "v_local_pos", "v_at_kw", "v_sr_kw",
"v_vplane_kw", "v_move_dir", "k_straight", "k_clockwise",
"k_counterclockwise", "k_custom", "k_left_of", "k_right_of", "k_above",
"k_below", "k_in", "k_at", "k_touching", "k_outside_of",
"k_closer_than", "k_further_away_than", "c_asterisk", "o_spatial_com",
"o_numeric_com", "o_is_com", "o_logical_andor", "$accept", "s_stmt",
"s_cutout_create", "@1", "s_pos_create", "@2", "s_grid_create", "@3",
"s_place", "s_set", "s_assign", "s_if", "s_else", "s_endif", "s_while",
"s_endwhile", "s_doconcurrent", "s_enddoconcurrent", "s_move", "@4",
"@5", "@6", "@7", "s_flash", "@8", "s_delete", "opt_along_clause",
"opt_duration_clause", "opt_flashlen_clause", "opt_object_id",
"opt_cutout_clone_spec", "opt_pos_init_list", "opt_cutout_init_list",
"opt_grid_init_list", "cutout_init_list", "pos_init_list",
"grid_init_list", "cutout_init_stmt", "pos_init_stmt", "grid_init_stmt",
"object_init_stmt", "e_bool_com_expr", "e_string_expr", "e_bool_expr",
"e_color_expr", "e_localpos_expr", "e_dist_expr", "opt_multiplier",
"e_object_expr", "e_pos_expr", "e_gridpos_expr", "salsa_type_kw",
"spatial_rel_kw", "bool_attr", "string_attr", "localpos_attr",
"color_attr", "int_attr", "float_attr", 0
};
#endif
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
static const unsigned short yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
355, 356, 357, 358, 359, 360
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 106, 107, 107, 107, 107, 107, 107, 107, 107,
107, 107, 107, 107, 107, 107, 107, 107, 107, 109,
108, 111, 110, 113, 112, 114, 114, 114, 115, 115,
115, 115, 115, 115, 116, 116, 117, 118, 119, 120,
121, 122, 123, 125, 124, 126, 124, 127, 124, 128,
124, 130, 129, 131, 132, 132, 132, 132, 132, 133,
133, 134, 134, 135, 135, 136, 136, 137, 137, 138,
138, 139, 139, 140, 140, 141, 141, 142, 142, 143,
143, 143, 143, 144, 144, 144, 144, 145, 145, 145,
145, 145, 145, 145, 145, 146, 146, 146, 146, 146,
146, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 148, 148, 149, 149, 150, 150,
151, 151, 152, 152, 153, 153, 154, 154, 154, 154,
155, 155, 156, 156, 156, 156, 156, 157, 157, 157,
158, 158, 158, 158, 158, 158, 158, 159, 159, 159,
159, 159, 159, 160, 160, 160, 160, 161, 161, 162,
162, 163, 163, 164, 164, 164, 164
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const unsigned char yyr2[] =
{
0, 2, 1, 1, 1, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6, 0, 5, 0, 5, 4, 4, 4, 6, 6,
6, 6, 6, 6, 4, 4, 2, 1, 1, 2,
1, 1, 1, 0, 7, 0, 7, 0, 7, 0,
7, 0, 4, 2, 0, 3, 3, 3, 4, 0,
3, 0, 3, 0, 1, 0, 4, 0, 1, 0,
1, 0, 1, 1, 2, 1, 2, 1, 2, 1,
2, 2, 2, 1, 2, 2, 2, 1, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 1, 3, 1, 3, 1, 3,
1, 3, 4, 1, 0, 2, 1, 3, 3, 3,
3, 3, 5, 5, 5, 6, 4, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const unsigned char yydefact[] =
{
5, 0, 0, 0, 0, 0, 124, 37, 38, 124,
40, 41, 42, 0, 0, 0, 2, 3, 4, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 21, 23, 53, 0, 153, 154, 155,
158, 147, 156, 148, 149, 160, 159, 157, 161, 162,
166, 165, 150, 151, 152, 163, 164, 0, 0, 0,
0, 0, 0, 0, 137, 138, 139, 0, 126, 118,
123, 114, 116, 0, 36, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 39, 0, 51,
0, 63, 63, 63, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 125, 0, 0, 0,
0, 124, 0, 0, 0, 0, 142, 143, 140, 141,
144, 146, 145, 0, 0, 0, 0, 0, 124, 61,
64, 65, 67, 71, 0, 26, 25, 27, 0, 0,
0, 0, 0, 0, 34, 35, 129, 0, 0, 0,
130, 131, 111, 112, 113, 123, 110, 0, 103, 104,
108, 102, 101, 109, 106, 107, 105, 127, 128, 117,
115, 119, 45, 43, 47, 49, 0, 52, 0, 69,
0, 0, 0, 0, 0, 0, 0, 0, 0, 22,
68, 75, 83, 0, 0, 124, 124, 0, 0, 0,
24, 72, 77, 87, 0, 0, 0, 0, 0, 0,
0, 136, 0, 0, 122, 54, 54, 54, 54, 0,
0, 0, 0, 0, 20, 70, 73, 79, 98, 97,
96, 95, 99, 100, 84, 85, 86, 76, 88, 89,
90, 91, 92, 93, 94, 78, 28, 29, 120, 30,
0, 31, 32, 33, 0, 132, 133, 134, 0, 59,
59, 59, 59, 62, 0, 80, 81, 82, 74, 0,
135, 0, 0, 0, 0, 0, 46, 44, 48, 50,
66, 121, 55, 57, 56, 0, 0, 58, 60
};
/* YYDEFGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
-1, 15, 16, 91, 17, 92, 18, 93, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 216,
215, 217, 218, 30, 129, 31, 259, 276, 177, 131,
179, 189, 224, 200, 225, 190, 201, 226, 191, 202,
192, 74, 75, 76, 77, 249, 78, 79, 80, 81,
82, 83, 123, 84, 85, 59, 86, 61, 62
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -130
static const short yypact[] =
{
218, 36, -70, -49, 127, -33, 69, -130, -130, 69,
-130, -130, -130, 33, 33, 31, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -63, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -130, 25, 26, 37,
40, 41, 43, 42, 20, -130, -130, -66, -130, -130,
2, -130, -130, 51, -130, 14, -15, 15, 17, 67,
24, 34, 35, 166, 106, 116, 120, -130, -21, -130,
-130, 80, 80, 80, 39, 33, 33, 33, 33, 33,
33, -7, 134, 8, 86, 84, -130, 33, -14, 99,
-43, 87, 138, 39, 39, 39, -130, -130, -130, -130,
-130, -130, -130, 85, 33, 33, 33, 39, 87, 172,
-130, 184, 168, 204, 207, -130, -130, -130, 189, 203,
208, 213, 216, 217, -130, -130, -130, 155, 179, -18,
-130, -130, -130, -130, -130, 161, -130, 33, -130, -130,
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, 186, -130, 240, 136,
187, 188, 190, 191, 192, 193, -35, 195, 197, -130,
168, -130, -130, 199, 200, 87, 87, 198, 201, 202,
-130, 204, -130, -130, 99, -14, -36, -43, 206, 209,
241, -130, 33, 85, -130, 239, 239, 239, 239, 247,
254, 205, 210, 212, -130, 136, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
259, -130, -130, -130, 214, -130, -130, -130, 65, 260,
260, 260, 260, -130, 215, -130, -130, -130, -130, 33,
-130, 262, 263, 264, 265, 219, -130, -130, -130, -130,
-130, -130, -130, -130, -130, 220, 266, -130, -130
};
/* YYPGOTO[NTERM-NUM]. */
static const short yypgoto[] =
{
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-130, -130, -130, -130, -130, -130, -4, -45, -130, -44,
-130, -130, -130, -130, -130, -130, -130, 72, 111, 101,
-129, 294, -106, -99, -103, -130, -98, -130, -13, -91,
-76, -130, 156, 300, 302, 102, 303, -130, 230
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, parse error. */
#define YYTABLE_NINF -1
static const unsigned short yytable[] =
{
88, 89, 152, 136, 203, 105, 35, 154, 127, 212,
153, 147, 103, 156, 64, 65, 66, 67, 137, 45,
46, 40, 159, 162, 165, 145, 146, 36, 47, 104,
175, 90, 168, 94, 69, 148, 173, 160, 163, 166,
37, 38, 39, 63, 134, 42, 248, 73, 132, 133,
227, 174, 95, 96, 64, 65, 66, 32, 33, 34,
64, 65, 66, 67, 97, 128, 71, 98, 99, 68,
100, 101, 203, 116, 117, 118, 119, 120, 107, 121,
122, 135, 138, 139, 140, 141, 142, 143, 144, 109,
64, 65, 66, 67, 151, 234, 227, 240, 241, 247,
158, 161, 164, 106, 251, 246, 64, 65, 66, 68,
167, 169, 170, 171, 172, 68, 102, 108, 134, 110,
111, 73, 257, 37, 38, 39, 113, 41, 42, 43,
44, 45, 46, 124, 50, 51, 114, 115, 52, 53,
54, 55, 56, 125, 214, 68, 69, 126, 70, 71,
72, 73, 271, 272, 273, 274, 130, 41, 67, 43,
44, 68, 149, 150, 134, 157, 155, 73, 52, 53,
54, 180, 181, 182, 221, 183, 184, 222, 223, 185,
72, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 255,
256, 55, 56, 180, 181, 182, 176, 183, 184, 178,
105, 185, 260, 261, 262, 277, 278, 279, 204, 186,
187, 188, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 205, 210, 11, 12, 13, 206, 14, 180,
181, 182, 207, 183, 184, 208, 209, 185, 193, 194,
195, 196, 197, 198, 199, 211, 281, 116, 117, 118,
119, 120, 106, 121, 122, 219, 220, 228, 254, 258,
229, 230, 231, 232, 235, 233, 236, 238, 239, 242,
263, 264, 243, 244, 252, 265, 269, 266, 253, 267,
270, 280, 275, 282, 283, 284, 285, 268, 286, 288,
287, 237, 245, 87, 57, 213, 58, 60, 250, 112
};
static const unsigned short yycheck[] =
{
13, 14, 108, 94, 133, 3, 76, 110, 29, 27,
109, 3, 78, 111, 21, 22, 23, 24, 94, 62,
63, 57, 113, 114, 115, 101, 102, 76, 64, 95,
128, 0, 123, 96, 77, 27, 127, 113, 114, 115,
54, 55, 56, 76, 79, 59, 82, 82, 92, 93,
179, 127, 27, 27, 21, 22, 23, 21, 22, 23,
21, 22, 23, 24, 27, 86, 80, 27, 27, 76,
27, 29, 201, 91, 92, 93, 94, 95, 27, 97,
98, 94, 95, 96, 97, 98, 99, 100, 101, 104,
21, 22, 23, 24, 107, 186, 225, 195, 196, 205,
113, 114, 115, 101, 207, 204, 21, 22, 23, 76,
123, 124, 125, 126, 127, 76, 96, 103, 79, 104,
103, 82, 213, 54, 55, 56, 102, 58, 59, 60,
61, 62, 63, 27, 67, 68, 102, 102, 69, 70,
71, 74, 75, 27, 157, 76, 77, 27, 79, 80,
81, 82, 87, 88, 89, 90, 76, 58, 24, 60,
61, 76, 76, 79, 79, 27, 79, 82, 69, 70,
71, 35, 36, 37, 38, 39, 40, 41, 42, 43,
81, 54, 55, 56, 57, 58, 59, 60, 61, 62,
63, 64, 65, 66, 67, 68, 69, 70, 71, 212,
213, 74, 75, 35, 36, 37, 34, 39, 40, 25,
3, 43, 216, 217, 218, 260, 261, 262, 29, 51,
52, 53, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 29, 78, 16, 17, 18, 29, 20, 35,
36, 37, 29, 39, 40, 29, 29, 43, 44, 45,
46, 47, 48, 49, 50, 76, 269, 91, 92, 93,
94, 95, 101, 97, 98, 79, 26, 80, 27, 30,
82, 81, 81, 81, 79, 82, 79, 78, 78, 81,
33, 27, 81, 81, 78, 80, 27, 77, 79, 77,
76, 76, 32, 31, 31, 31, 31, 225, 79, 33,
80, 190, 201, 9, 4, 149, 4, 4, 206, 79
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const unsigned char yystos[] =
{
0, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 16, 17, 18, 20, 107, 108, 110, 112, 114,
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
129, 131, 21, 22, 23, 76, 76, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 74, 75, 159, 160, 161,
162, 163, 164, 76, 21, 22, 23, 24, 76, 77,
79, 80, 81, 82, 147, 148, 149, 150, 152, 153,
154, 155, 156, 157, 159, 160, 162, 147, 154, 154,
0, 109, 111, 113, 96, 27, 27, 27, 27, 27,
27, 29, 96, 78, 95, 3, 101, 27, 103, 104,
104, 103, 164, 102, 102, 102, 91, 92, 93, 94,
95, 97, 98, 158, 27, 27, 27, 29, 86, 130,
76, 135, 135, 135, 79, 154, 155, 156, 154, 154,
154, 154, 154, 154, 154, 156, 156, 3, 27, 76,
79, 154, 148, 149, 150, 79, 152, 27, 154, 155,
156, 154, 155, 156, 154, 155, 156, 154, 155, 154,
154, 154, 154, 155, 156, 152, 34, 134, 25, 136,
35, 36, 37, 39, 40, 43, 51, 52, 53, 137,
141, 144, 146, 44, 45, 46, 47, 48, 49, 50,
139, 142, 145, 146, 29, 29, 29, 29, 29, 29,
78, 76, 27, 158, 154, 126, 125, 127, 128, 79,
26, 38, 41, 42, 138, 140, 143, 146, 80, 82,
81, 81, 81, 82, 155, 79, 79, 144, 78, 78,
152, 152, 81, 81, 81, 145, 149, 148, 82, 151,
161, 150, 78, 79, 27, 154, 154, 155, 30, 132,
132, 132, 132, 33, 27, 80, 77, 77, 143, 27,
76, 87, 88, 89, 90, 32, 133, 133, 133, 133,
76, 154, 31, 31, 31, 31, 79, 80, 33
};
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up"); \
YYERROR; \
} \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
are run). */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.first_line = Rhs[1].first_line; \
Current.first_column = Rhs[1].first_column; \
Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column;
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
#define YYLEX yylex ()
/* Enable debugging if requested. */
#if YYDEBUG
# ifndef YYFPRINTF
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
# define YYFPRINTF fprintf
# endif
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
# define YYDSYMPRINT(Args) \
do { \
if (yydebug) \
yysymprint Args; \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined (__GLIBC__) && defined (_STRING_H)
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
static YYSIZE_T
# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
# else
yystrlen (yystr)
const char *yystr;
# endif
{
register const char *yys = yystr;
while (*yys++ != '\0')
continue;
return yys - yystr - 1;
}
# endif
# endif
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
static char *
# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
# else
yystpcpy (yydest, yysrc)
char *yydest;
const char *yysrc;
# endif
{
register char *yyd = yydest;
register const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
return yyd - 1;
}
# endif
# endif
#endif /* !YYERROR_VERBOSE */
#if YYDEBUG
/*-----------------------------.
| Print this symbol on YYOUT. |
`-----------------------------*/
static void
#if defined (__STDC__) || defined (__cplusplus)
yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
#else
yysymprint (yyout, yytype, yyvalue)
FILE* yyout;
int yytype;
YYSTYPE yyvalue;
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yyvalue;
if (yytype < YYNTOKENS)
{
YYFPRINTF (yyout, "token %s (", yytname[yytype]);
# ifdef YYPRINT
YYPRINT (yyout, yytoknum[yytype], yyvalue);
# endif
}
else
YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
switch (yytype)
{
default:
break;
}
YYFPRINTF (yyout, ")");
}
#endif /* YYDEBUG. */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
static void
#if defined (__STDC__) || defined (__cplusplus)
yydestruct (int yytype, YYSTYPE yyvalue)
#else
yydestruct (yytype, yyvalue)
int yytype;
YYSTYPE yyvalue;
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yyvalue;
switch (yytype)
{
default:
break;
}
}
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
Grammar actions can access the variable by casting it
to the proper pointer type. */
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
# define YYPARSE_PARAM_DECL
# else
# define YYPARSE_PARAM_ARG YYPARSE_PARAM
# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif
#else /* !YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
# ifdef YYPARSE_PARAM
int yyparse (void *);
# else
int yyparse (void);
# endif
#endif
/* The lookahead symbol. */
int yychar;
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of parse errors so far. */
int yynerrs;
/* Below are variables that were formally defined within yyparse.
We've shifted them to global scope in order to facilitate
incremental parsing, per Nils Hasler's instructions.
CDH 10/29/02
*/
int yystate;
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Lookahead token as an internal (translated) token number. */
int yychar1 = 0;
/* state in which last token was read */
int yylexstate;
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
short yyssa[YYINITDEPTH];
short *yyss = yyssa;
short *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
YYSTYPE *yyvsp;
#define YYPOPSTACK (yyvsp--, yyssp--)
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* When reducing, the number of symbols on the RHS of the reduced
rule. */
int yylen;
/* End, globalized variabled. */
int
yyparse (YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
/* Initialize global variables in this method; yycontinue will do the
parsing.
CDH -- 10/29/02
*/
{
/* Lookahead token as an internal (translated) token number. */
yychar1 = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
}
//
// continues parsing until it reaches the cursor or finishes the statement
// returns -1 if cursor has to advance
// 0 if statement is already finished
// 1 if statement is accepted
//
int yycontinue()
{
goto yysetstate;
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks.
*/
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow ("parser stack overflow",
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
# else
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
goto yyoverflowlab;
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
{
short *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
yylexstate = yystate;
}
/* Convert token to internal form (in yychar1) for indexing tables with. */
//|/ OK here is my mysterious "metatoken". my lexer simply returns a token that
//|/ is not a token as defined by bison. I simply used 0 as defined above.
if(yychar == YYWAIT) // waiting for the cursor to move
{ // or whatever your criterion for waiting is
yychar = YYEMPTY;
YYDPRINTF((stderr, "Waiting for cursor to advance.\n"));
return -1; // this means were not finished yet
}
//|/ we already handled the case where it is 0 but this doesn't matter at all
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more. */
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yychar1 = YYTRANSLATE (yychar);
/* We have to keep this `#if YYDEBUG', since we use variables
which are defined only if `YYDEBUG' is set. */
YYDPRINTF ((stderr, "Next token is "));
YYDSYMPRINT ((stderr, yychar1, yylval));
YYDPRINTF ((stderr, "\n"));
}
/* If the proper action on seeing token YYCHAR1 is to reduce or to
detect an error, take that action. */
yyn += yychar1;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
YYDPRINTF ((stderr, "Shifting token %d (%s), ",
yychar, yytname[yychar1]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
yystate = yyn;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
#if YYDEBUG
/* We have to keep this `#if YYDEBUG', since we use variables which
are defined only if `YYDEBUG' is set. */
if (yydebug)
{
int yyi;
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
yyn - 1, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn)
{
case 19:
{c_create_cmd = new cutout_create_stmt();
create_cmd = reinterpret_cast
<create_stmt *> (c_create_cmd);
cmd_parsed = c_create_cmd;
strcpy(tmp,"Cutout create statement
parsed.\n");
yysuccess(tmp);
}
break;
case 21:
{p_create_cmd = new pos_create_stmt();
create_cmd = reinterpret_cast
<create_stmt *> (p_create_cmd);
cmd_parsed = p_create_cmd;
strcpy(tmp,"Position create statement
parsed.\n");
yysuccess(tmp);
}
break;
case 23:
{g_create_cmd = new grid_create_stmt();
create_cmd = reinterpret_cast
<create_stmt *> (g_create_cmd);
cmd_parsed = g_create_cmd;
strcpy(tmp,"Grid create statement
parsed.\n");
yysuccess(tmp);
}
break;
case 25:
{place_cmd = new place_stmt(yyvsp[-2].sval,yyvsp[0].posexpr);
cmd_parsed = place_cmd;
strcpy(tmp,"Place statement parsed (at
positon_expr).\n");
yysuccess(tmp);
}
break;
case 26:
{place_cmd = new place_stmt(yyvsp[-2].sval,yyvsp[0].objexpr);
cmd_parsed = place_cmd;
strcpy(tmp,"Place statement parsed (at
object_expr).\n");
yysuccess(tmp);
}
break;
case 27:
{place_cmd = new place_stmt(yyvsp[-2].sval,yyvsp[0].gposexpr);
cmd_parsed = place_cmd;
strcpy(tmp,"Place statement parsed (at
gridpos_expr).\n");
yysuccess(tmp);
}
break;
case 28:
//#line 315 "salsa.y"
{set_cmd = new
set_stmt(yyvsp[-4].sattr,yyvsp[-2].objexpr,yyvsp[0].boolexpr);
cmd_parsed = set_cmd;
strcpy(tmp,"Set statement parsed
(boolean attribute).\n");
yysuccess(tmp);
}
break;
case 29:
//#line 322 "salsa.y"
{set_cmd = new set_stmt(yyvsp[-4].sattr,yyvsp[-2].objexpr,yyvsp[0].strexpr);
cmd_parsed = set_cmd;
strcpy(tmp,"Set statement parsed
(string attribute).\n");
yysuccess(tmp);
}
break;
case 30:
//#line 329 "salsa.y"
{set_cmd = new
set_stmt(yyvsp[-4].sattr,yyvsp[-2].objexpr,yyvsp[0].localposexpr);
cmd_parsed = set_cmd;
strcpy(tmp,"Set statement parsed
(localpos attribute).\n");
yysuccess(tmp);
}
break;
case 31:
//#line 336 "salsa.y"
{set_cmd = new set_stmt(yyvsp[-4].sattr,yyvsp[-2].objexpr,yyvsp[0].colexpr);
cmd_parsed = set_cmd;
strcpy(tmp,"Set statement parsed
(color attribute).\n");
yysuccess(tmp);
}
break;
case 32:
//#line 343 "salsa.y"
{set_cmd = new set_stmt(yyvsp[-4].sattr,yyvsp[-2].objexpr,yyvsp[0].ival);
cmd_parsed = set_cmd;
strcpy(tmp,"Set statement parsed
(integer attribute).\n");
yysuccess(tmp);
}
break;
case 33:
//#line 350 "salsa.y"
{set_cmd = new set_stmt(yyvsp[-4].sattr,yyvsp[-2].objexpr,yyvsp[0].fval);
cmd_parsed = set_cmd;
strcpy(tmp,"Set statement parsed
(float attribute).\n");
yysuccess(tmp);
}
break;
case 34:
//#line 357 "salsa.y"
{assign_cmd = new assign_stmt(yyvsp[-2].sval,yyvsp[0].objexpr);
cmd_parsed = assign_cmd;
strcpy(tmp,"Assign statement parsed
(to object_expr).\n");
yysuccess(tmp);
}
break;
case 35:
//#line 364 "salsa.y"
{assign_cmd = new assign_stmt(yyvsp[-2].sval,yyvsp[0].gposexpr);
cmd_parsed = assign_cmd;
strcpy(tmp,"Assign statement parsed
(to gridpos_expr).\n");
yysuccess(tmp);
}
break;
case 36:
//#line 371 "salsa.y"
{if_cmd = new if_stmt(yyvsp[0].boolcomexpr);
cmd_parsed = if_cmd;
strcpy(tmp,"if statement parsed.\n");
yysuccess(tmp);
}
break;
case 37:
//#line 378 "salsa.y"
{else_cmd = new else_stmt();
cmd_parsed = else_cmd;
strcpy(tmp,"else statement parsed.\n");
yysuccess(tmp);
}
break;
case 38:
//#line 385 "salsa.y"
{endif_cmd = new endif_stmt();
cmd_parsed = endif_cmd;
strcpy(tmp,"endif statement
parsed.\n");
yysuccess(tmp);
}
break;
case 39:
//#line 392 "salsa.y"
{while_cmd = new while_stmt(yyvsp[0].boolcomexpr);
cmd_parsed = while_cmd;
strcpy(tmp,"while statement
parsed.\n");
yysuccess(tmp);
}
break;
case 40:
//#line 399 "salsa.y"
{endwhile_cmd = new endwhile_stmt();
cmd_parsed = endwhile_cmd;
strcpy(tmp,"endwhile statement
parsed.\n");
yysuccess(tmp);
}
break;
case 41:
//#line 406 "salsa.y"
{doconcurrent_cmd = new doconcurrent_stmt();
cmd_parsed = doconcurrent_cmd;
strcpy(tmp,"doconcurrent statement
parsed.\n");
yysuccess(tmp);
}
break;
case 42:
//#line 413 "salsa.y"
{enddoconcurrent_cmd = new enddoconcurrent_stmt();
cmd_parsed = enddoconcurrent_cmd;
strcpy(tmp,"enddoconcurrent statement
parsed.\n");
yysuccess(tmp);
}
break;
case 43:
//#line 420 "salsa.y"
{move_cmd = new move_stmt(yyvsp[-2].objexpr,yyvsp[0].posexpr);
cmd_parsed = move_cmd;
strcpy(tmp,"Move statement parsed
(object->position).\n");
yysuccess(tmp);
}
break;
case 45:
//#line 428 "salsa.y"
{move_cmd = new move_stmt(yyvsp[-2].objexpr,yyvsp[0].objexpr);
cmd_parsed = move_cmd;
strcpy(tmp,"Move statement parsed
(object->object).\n");
yysuccess(tmp);
}
break;
case 47:
//#line 436 "salsa.y"
{move_cmd = new move_stmt(yyvsp[-2].objexpr,yyvsp[0].gposexpr);
cmd_parsed = move_cmd;
strcpy(tmp,"Move statement parsed
(object->gridpos).\n");
yysuccess(tmp);
}
break;
case 49:
//#line 444 "salsa.y"
{move_cmd = new
move_stmt(yyvsp[-2].objexpr,yyvsp[-1].dirval,yyvsp[0].distexpr);
cmd_parsed = move_cmd;
strcpy(tmp,"Move statement parsed
(object->distance).\n");
yysuccess(tmp);
}
break;
case 51:
//#line 452 "salsa.y"
{flash_cmd = new flash_stmt(yyvsp[0].objexpr);
cmd_parsed = flash_cmd;
strcpy(tmp,"Flash statement
parsed.\n");
yysuccess(tmp);
}
break;
case 53:
//#line 460 "salsa.y"
{
delete_cmd = new
delete_stmt(yyvsp[0].sval);
cmd_parsed = delete_cmd;
sprintf(tmp,"Delete statement with id
%s successfully parsed. ",yyvsp[0].sval);
yysuccess(tmp);
}
break;
case 55:
//#line 470 "salsa.y"
{move_cmd->set_path(P_STRAIGHT);
}
break;
case 56:
//#line 474 "salsa.y"
{move_cmd->set_path(P_COUNTERCLOCKWISE);
}
break;
case 57:
//#line 478 "salsa.y"
{move_cmd->set_path(P_CLOCKWISE);
}
break;
case 58:
//#line 482 "salsa.y"
{move_cmd->set_path(P_CUSTOM);
move_cmd->set_path_file(yyvsp[0].sval);
}
break;
case 60:
//#line 489 "salsa.y"
{move_cmd->set_duration(yyvsp[-1].fval);
}
break;
case 62:
//#line 495 "salsa.y"
{flash_cmd->set_flashlength(yyvsp[-1].fval);
}
break;
case 64:
//#line 501 "salsa.y"
{create_cmd->set_name(yyvsp[0].sval);
sprintf(tmp,"Name of object parsed:
%s.\n",yyvsp[0].sval);
yysuccess(tmp);
}
break;
case 66:
//#line 509 "salsa.y"
{c_create_cmd->set_proto(yyvsp[0].sval);
sprintf(tmp,"Cutout %s will be
cloned.\n",yyvsp[0].sval);
yysuccess(tmp);
}
break;
case 80:
//#line 541 "salsa.y"
{
c_create_cmd->set_graphicrep(yyvsp[0].sval);
sprintf(tmp,"Initial graphic rep of
cutout parsed: %s.\n",yyvsp[0].sval);
yysuccess(tmp);
}
break;
case 81:
//#line 548 "salsa.y"
{
c_create_cmd->set_fillcolor(yyvsp[0].cval);
sprintf(tmp,"Initial fillcolor of
cutout parsed: %d.\n",yyvsp[0].cval);
yysuccess(tmp);
}
break;
case 82:
//#line 555 "salsa.y"
{
c_create_cmd->set_outlinecolor(yyvsp[0].cval);
sprintf(tmp,"Initial outlinecolor of
cutout parsed: %d.\n",yyvsp[0].cval);
yysuccess(tmp);
}
break;
case 84:
//#line 564 "salsa.y"
{p_create_cmd->set_position(yyvsp[0].posexpr);
strcpy(tmp,"Initial position of
position parsed: <position_expr>.\n");
yysuccess(tmp);
}
break;
case 85:
//#line 570 "salsa.y"
{p_create_cmd->set_xcoord(yyvsp[0].fval);
sprintf(tmp,"X-coord of position
parsed: %f\n",yyvsp[0].fval);
yysuccess(tmp);
}
break;
case 86:
//#line 576 "salsa.y"
{p_create_cmd->set_ycoord(yyvsp[0].fval);
sprintf(tmp,"Y-coord of position
parsed: %f\n",yyvsp[0].fval);
yysuccess(tmp);
}
break;
case 88:
//#line 584 "salsa.y"
{g_create_cmd->set_rows(yyvsp[0].ival);
sprintf(tmp,"Rows of grid parsed:
%d\n",yyvsp[0].ival);
yysuccess(tmp);
}
break;
case 89:
//#line 590 "salsa.y"
{g_create_cmd->set_columns(yyvsp[0].ival);
sprintf(tmp,"Columns of grid parsed:
%d\n",yyvsp[0].ival);
yysuccess(tmp);
}
break;
case 90:
//#line 596 "salsa.y"
{g_create_cmd->set_cellwidth(yyvsp[0].distexpr);
strcpy(tmp,"Cellwidth of grid parsed:
<distance expr>.\n");
yysuccess(tmp);
}
break;
case 91:
//#line 602 "salsa.y"
{g_create_cmd->set_cellheight(yyvsp[0].distexpr);
strcpy(tmp,"Cellheight of grid parsed:
<distance expr>.\n");
yysuccess(tmp);
}
break;
case 92:
//#line 608 "salsa.y"
{g_create_cmd->set_gridpoints(yyvsp[0].bval);
sprintf(tmp,"Cellheight of grid
parsed: %f\n",yyvsp[0].bval);
yysuccess(tmp);
}
break;
case 93:
//#line 614 "salsa.y"
{g_create_cmd->set_interngridlines(yyvsp[0].bval);
sprintf(tmp,"Interngridlines of grid
parsed: %d\n",yyvsp[0].bval);
yysuccess(tmp);
}
break;
case 94:
//#line 620 "salsa.y"
{g_create_cmd->set_externgridlines(yyvsp[0].bval);
sprintf(tmp,"Externgridlines of grid
parsed: %d\n",yyvsp[0].bval);
yysuccess(tmp);
}
break;
case 95:
//#line 626 "salsa.y"
{create_cmd->set_visible(yyvsp[0].bval);
sprintf(tmp,"Initial visible of object
parsed: %d.\n",yyvsp[0].bval);
yysuccess(tmp);
}
break;
case 96:
//#line 632 "salsa.y"
{
create_cmd->set_datavisible(yyvsp[0].bval);
sprintf(tmp,"Initial datavisible of
object parsed: %d.\n",yyvsp[0].bval);
yysuccess(tmp);
}
break;
case 97:
//#line 639 "salsa.y"
{
create_cmd->set_datapos(yyvsp[0].lpval);
sprintf(tmp,"Initial data position of
object parsed: %d.\n",yyvsp[0].lpval);
yysuccess(tmp);
}
break;
case 98:
//#line 646 "salsa.y"
{
create_cmd->set_data(yyvsp[0].sval);
sprintf(tmp,"Initial data of object
parsed: %s.\n",yyvsp[0].sval);
yysuccess(tmp);
}
break;
case 99:
//#line 653 "salsa.y"
{
create_cmd->set_highlighted(yyvsp[0].bval);
sprintf(tmp,"Initial highlighted of
object parsed: %d.\n",yyvsp[0].bval);
yysuccess(tmp);
}
break;
case 100:
//#line 660 "salsa.y"
{
create_cmd->set_refpoint(yyvsp[0].lpval);
sprintf(tmp,"Initial refpoint of
object parsed: %d.\n",yyvsp[0].lpval);
yysuccess(tmp);
}
break;
case 101:
//#line 667 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].posexpr,yyvsp[-1].srval,yyvsp[0].posexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 102:
//#line 672 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].posexpr,yyvsp[-1].srval,yyvsp[0].objexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 103:
//#line 677 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].objexpr,yyvsp[-1].srval,yyvsp[0].objexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 104:
//#line 682 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].objexpr,yyvsp[-1].srval,yyvsp[0].posexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 105:
//#line 687 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].gposexpr,yyvsp[-1].srval,yyvsp[0].gposexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 106:
//#line 692 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].gposexpr,yyvsp[-1].srval,yyvsp[0].objexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 107:
//#line 697 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].gposexpr,yyvsp[-1].srval,yyvsp[0].posexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 108:
//#line 702 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].objexpr,yyvsp[-1].srval,yyvsp[0].gposexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 109:
//#line 707 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].posexpr,yyvsp[-1].srval,yyvsp[0].gposexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 110:
//#line 712 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].distexpr,yyvsp[-1].nuopval,yyvsp[0].distexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 111:
//#line 717 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].strexpr,yyvsp[-1].nuopval,yyvsp[0].strexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 112:
//#line 722 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].boolexpr,yyvsp[-1].isval,yyvsp[0].boolexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 113:
//#line 727 "salsa.y"
{bool_com_expr = new
boolean_comparison_expr(yyvsp[-2].colexpr,yyvsp[-1].isval,yyvsp[0].colexpr);
yyval.boolcomexpr = bool_com_expr;
}
break;
case 114:
//#line 732 "salsa.y"
{str_expr = new string_expr(yyvsp[0].sval);
yyval.strexpr = str_expr;
}
break;
case 115:
//#line 737 "salsa.y"
{str_expr = new string_expr(yyvsp[-2].sattr,yyvsp[0].objexpr);
yyval.strexpr = str_expr;
}
break;
case 116:
//#line 742 "salsa.y"
{bool_expr = new boolean_expr(yyvsp[0].bval);
yyval.boolexpr = bool_expr;
}
break;
case 117:
//#line 747 "salsa.y"
{bool_expr = new boolean_expr(yyvsp[-2].sattr,yyvsp[0].objexpr);
yyval.boolexpr = bool_expr;
}
break;
case 118:
//#line 752 "salsa.y"
{col_expr = new color_expr(yyvsp[0].cval);
yyval.colexpr = col_expr;
}
break;
case 119:
//#line 757 "salsa.y"
{col_expr = new color_expr(yyvsp[-2].sattr,yyvsp[0].objexpr);
yyval.colexpr = col_expr;
}
break;
case 120:
//#line 762 "salsa.y"
{locpos_expr = new localpos_expr(yyvsp[0].lpval);
yyval.localposexpr = locpos_expr;
}
break;
case 121:
//#line 767 "salsa.y"
{locpos_expr = new localpos_expr(yyvsp[-2].sattr,yyvsp[0].objexpr);
yyval.localposexpr = locpos_expr;
}
break;
case 122:
//#line 772 "salsa.y"
{
dist_expr = new
distance_expr(yyvsp[-3].fval,yyvsp[-2].sattr,yyvsp[0].objexpr);
yyval.distexpr = dist_expr;
}
break;
case 123:
//#line 778 "salsa.y"
{dist_expr = new distance_expr(yyvsp[0].fval);
yyval.distexpr = dist_expr;
}
break;
case 124:
//#line 782 "salsa.y"
{yyval.fval = 1.0;}
break;
case 125:
//#line 784 "salsa.y"
{yyval.fval = yyvsp[-1].fval;}
break;
case 126:
//#line 787 "salsa.y"
{obj_expr = new object_expr(yyvsp[0].sval);
yyval.objexpr = obj_expr;
}
break;
case 127:
//#line 792 "salsa.y"
{obj_expr = new
object_expr(yyvsp[-2].stype,yyvsp[-1].srval,yyvsp[0].objexpr);
yyval.objexpr = obj_expr;
}
break;
case 128:
//#line 797 "salsa.y"
{obj_expr = new
object_expr(yyvsp[-2].stype,yyvsp[-1].srval,yyvsp[0].posexpr);
yyval.objexpr = obj_expr;
}
break;
case 129:
//#line 802 "salsa.y"
{obj_expr = new object_expr(CUTOUT,SR_AT,yyvsp[0].gposexpr);
yyval.objexpr = obj_expr;
}
break;
case 130:
//#line 807 "salsa.y"
{pos_expr = new position_expr(yyvsp[-2].fval,yyvsp[0].fval);
yyval.posexpr = pos_expr;
}
break;
case 131:
//#line 812 "salsa.y"
{pos_expr = new position_expr(yyvsp[-2].lpval,yyvsp[0].objexpr);
yyval.posexpr = pos_expr;
}
break;
case 132:
//#line 817 "salsa.y"
{gp_expr = new gridpos_expr(yyvsp[-2].sval,yyvsp[0].objexpr);
yyval.gposexpr = gp_expr;
}
break;
case 133:
//#line 822 "salsa.y"
{gp_expr = new
gridpos_expr(yyvsp[-2].sval,yyvsp[-1].srval,yyvsp[0].objexpr);
yyval.gposexpr = gp_expr;
}
break;
case 134:
//#line 827 "salsa.y"
{gp_expr = new
gridpos_expr(yyvsp[-2].sval,yyvsp[-1].srval,yyvsp[0].posexpr);
yyval.gposexpr = gp_expr;
}
break;
case 135:
//#line 832 "salsa.y"
{gp_expr = new gridpos_expr(yyvsp[-4].ival,yyvsp[-2].ival,yyvsp[0].sval);
yyval.gposexpr = gp_expr;
}
break;
case 136:
//#line 837 "salsa.y"
{gp_expr = new gridpos_expr(yyvsp[-2].ival,yyvsp[0].sval);
yyval.gposexpr = gp_expr;
}
break;
case 137:
//#line 841 "salsa.y"
{yyval.stype = CUTOUT;}
break;
case 138:
//#line 843 "salsa.y"
{yyval.stype = POS;}
break;
case 139:
//#line 845 "salsa.y"
{yyval.stype = GRID;}
break;
case 140:
//#line 847 "salsa.y"
{yyval.srval = ABOVE;}
break;
case 141:
//#line 849 "salsa.y"
{yyval.srval = BELOW;}
break;
case 142:
//#line 851 "salsa.y"
{yyval.srval = LEFT_OF;}
break;
case 143:
//#line 853 "salsa.y"
{yyval.srval = RIGHT_OF;}
break;
case 144:
//#line 855 "salsa.y"
{yyval.srval = SR_IN;}
break;
case 145:
//#line 857 "salsa.y"
{yyval.srval = OUTSIDE_OF;}
break;
case 146:
//#line 859 "salsa.y"
{yyval.srval = TOUCHING;}
break;
case 147:
//#line 861 "salsa.y"
{yyval.sattr = A_DATAVISIBLE;}
break;
case 148:
//#line 863 "salsa.y"
{yyval.sattr = A_VISIBLE;}
break;
case 149:
//#line 865 "salsa.y"
{yyval.sattr = A_HIGHLIGHTED;}
break;
case 150:
//#line 867 "salsa.y"
{yyval.sattr = A_GRIDPOINTS;}
break;
case 151:
//#line 869 "salsa.y"
{yyval.sattr = A_INTERNGRIDLINES;}
break;
case 152:
//#line 871 "salsa.y"
{yyval.sattr = A_EXTERNGRIDLINES;}
break;
case 153:
//#line 873 "salsa.y"
{yyval.sattr = A_ID;}
break;
case 154:
//#line 875 "salsa.y"
{yyval.sattr = A_NAME;}
break;
case 155:
//#line 877 "salsa.y"
{yyval.sattr = A_DATA;}
break;
case 156:
//#line 879 "salsa.y"
{yyval.sattr = A_GRAPHICREP;}
break;
case 157:
//#line 881 "salsa.y"
{yyval.sattr = A_REFPOINT;}
break;
case 158:
//#line 883 "salsa.y"
{yyval.sattr = A_DATAPOS;}
break;
case 159:
//#line 885 "salsa.y"
{yyval.sattr = A_OUTLINECOLOR;}
break;
case 160:
//#line 887 "salsa.y"
{yyval.sattr = A_FILLCOLOR;}
break;
case 161:
//#line 889 "salsa.y"
{yyval.sattr = A_ROWS;}
break;
case 162:
//#line 891 "salsa.y"
{yyval.sattr = A_COLUMNS;}
break;
case 163:
//#line 893 "salsa.y"
{yyval.sattr = A_HEIGHT;}
break;
case 164:
//#line 895 "salsa.y"
{yyval.sattr = A_WIDTH;}
break;
case 165:
//#line 897 "salsa.y"
{yyval.sattr = A_CELLHEIGHT;}
break;
case 166:
//#line 899 "salsa.y"
{yyval.sattr = A_CELLWIDTH;}
break;
}
/* Line 1016 of /usr/local/share/bison/yacc.c. */
yyvsp -= yylen;
yyssp -= yylen;
#if YYDEBUG
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
expect(yylexstate, yyssp); //|/ this is just an exemplary position. You
could call it anywhere
#endif
*++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if YYERROR_VERBOSE
yyn = yypact[yystate];
if (YYPACT_NINF < yyn && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
int yytype = YYTRANSLATE (yychar);
char *yymsg;
int yyx, yycount;
yycount = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("parse error, unexpected ") + 1;
yysize += yystrlen (yytname[yytype]);
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
yyp = yystpcpy (yyp, yytname[yytype]);
if (yycount < 5)
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]);
yycount++;
}
}
yyerror (yymsg);
YYSTACK_FREE (yymsg);
}
else
yyerror ("parse error; also virtual memory exhausted");
}
else
#endif /* YYERROR_VERBOSE */
yyerror ("parse error");
}
goto yyerrlab1;
/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. |
`----------------------------------------------------*/
yyerrlab1:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
/* Return failure if at end of input. */
if (yychar == YYEOF)
{
/* Pop the error token. */
YYPOPSTACK;
/* Pop the rest of the stack. */
while (yyssp > yyss)
{
YYDPRINTF ((stderr, "Error: popping "));
YYDSYMPRINT ((stderr,
yystos[*yyssp],
*yyvsp));
YYDPRINTF ((stderr, "\n"));
yydestruct (yystos[*yyssp], *yyvsp);
YYPOPSTACK;
}
YYABORT;
}
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
yychar, yytname[yychar1]));
yydestruct (yychar1, yylval);
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
YYABORT;
YYDPRINTF ((stderr, "Error: popping "));
YYDSYMPRINT ((stderr,
yystos[*yyssp], *yyvsp));
YYDPRINTF ((stderr, "\n"));
yydestruct (yystos[yystate], *yyvsp);
yyvsp--;
yystate = *--yyssp;
#if YYDEBUG
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "Error: state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
}
if (yyn == YYFINAL)
YYACCEPT;
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here. |
`----------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
return yyresult;
}
void yysuccess(char *s)
/**********************************************************************
YYSUCCESS -- The tongue-and-cheek analog to yyerror, this function
merely appends a message to the current status_message string.
The appending is needed since, for a given line to be parsed,
multiple success messages might be reported.
**********************************************************************/
{
strcat(status_message,s);
tmp[0] = '\0';
}
bool Parse_Line(char *line, salsa_stmt **cmd, char **message)
/**********************************************************************
PARSE_LINE -- Given a null-terminated line to parse, this function
parses the line, building an instance of cmd of salsa_stmt.
The function returns TRUE if the line was parsed without errors,
and FALSE if an error was encountered; in either case, message points
to a status message to report to the user. Note that members of
ALVISView are responsible for freeing the heap space associated with
fwd and rev only if error_encountered is false.
**********************************************************************/
{
error_encountered = false;
cmd_parsed = NULL;
tmp[0] = '\0';
status_message[0] = '\0'; //null-terminate status message
TextBuffer_Initialize(line); //initialize parser for current line
//while (yylex() > 0);
yyparse();
TextBuffer_Terminate(); //free up text buffer.
(*message) = status_message;
if (!error_encountered) //the parse was successful
(*cmd) = cmd_parsed;
else if (cmd_parsed != NULL) //the parse was unsuccessful; free up heap
space
delete cmd_parsed;
return (!error_encountered);
}
void expect(int state)
/**********************************************************************
expect -- Given the current state, prints to stderr a list of valid
next tokens. Thanks to Nils Hasler for this code.
**********************************************************************/
{
short *stack = yyssp;
int yyn, x, count = 0;
int len;
while(1) {
/* First try to decide what to do without reference to
lookahead token. */
yyn = yypact[state];
if(yyn != YYPACT_NINF) { //|/ sorry, YYFLAG is now challed
YYPACT_NINF
for(x = (yyn < 0 ? -yyn : 0); yytname[x] != 0; x++) {
if(yycheck[x + yyn] == x) {
if(count == 0)
fprintf(stderr,"expecting %s",
yytname[x]);
else
fprintf(stderr, ", %s",
yytname[x]);
count++;
}
}
}
yyn = yydefact[state];
if(yyn == 0)
break;
len = yyr2[yyn]; // default reduction
stack -= len; // reduce the stacks
yyn = yyr1[yyn]; // shift the result of the reduction
state = yypgoto[yyn - YYNTOKENS] + *stack; //|/ this one
changed too: YYNTBASE -> YYNTOKENS
if(state >= 0 && state <= YYLAST && yycheck[state] == *stack)
state = yytable[state];
else
state = yydefgoto[yyn - YYNTOKENS];
stack++; // we push the new state
}
fprintf(stderr, "\n");
}