@ -1,7 +1,9 @@
/* A Bison parser, made by GNU Bison 2. 1a . */
/* A Bison parser, made by GNU Bison 2. 3 . */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright ( C ) 1984 , 1989 , 1990 , 2000 , 2001 , 2002 , 2003 , 2004 , 2005 , 2006 Free Software Foundation , Inc .
/* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright ( C ) 1984 , 1989 , 1990 , 2000 , 2001 , 2002 , 2003 , 2004 , 2005 , 2006
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
@ -18,10 +20,18 @@
Foundation , Inc . , 51 Franklin Street , Fifth Floor ,
Boston , MA 02110 - 1301 , 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 . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice , so long as that work isn ' t itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton . Alternatively , if you modify or redistribute
the parser skeleton itself , you may ( at your option ) remove this
special exception , which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception .
This special exception was added by the Free Software Foundation in
version 2.2 of Bison . */
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so - called " semantic " parser . */
@ -37,7 +47,7 @@
# define YYBISON 1
/* Bison version. */
# define YYBISON_VERSION "2. 1a "
# define YYBISON_VERSION "2. 3 "
/* Skeleton name. */
# define YYSKELETON_NAME "yacc.c"
@ -81,11 +91,12 @@
TOK_DIV = 272 ,
TOK_MULT = 273 ,
TOK_COMPL = 274 ,
TOK_EQTILDE = 275 ,
TOK_COLON = 276 ,
TOK_LP = 277 ,
TOK_RP = 278 ,
TOKEN = 279
TOK_TILDETILDE = 275 ,
TOK_EQTILDE = 276 ,
TOK_COLON = 277 ,
TOK_LP = 278 ,
TOK_RP = 279 ,
TOKEN = 280
} ;
# endif
/* Tokens. */
@ -106,11 +117,12 @@
# define TOK_DIV 272
# define TOK_MULT 273
# define TOK_COMPL 274
# define TOK_EQTILDE 275
# define TOK_COLON 276
# define TOK_LP 277
# define TOK_RP 278
# define TOKEN 279
# define TOK_TILDETILDE 275
# define TOK_EQTILDE 276
# define TOK_COLON 277
# define TOK_LP 278
# define TOK_RP 279
# define TOKEN 280
@ -403,6 +415,7 @@ static struct val *make_str __P((const char *));
static struct val * op_and __P ( ( struct val * , struct val * ) ) ;
static struct val * op_colon __P ( ( struct val * , struct val * ) ) ;
static struct val * op_eqtilde __P ( ( struct val * , struct val * ) ) ;
static struct val * op_tildetilde __P ( ( struct val * , struct val * ) ) ;
static struct val * op_div __P ( ( struct val * , struct val * ) ) ;
static struct val * op_eq __P ( ( struct val * , struct val * ) ) ;
static struct val * op_ge __P ( ( struct val * , struct val * ) ) ;
@ -470,13 +483,13 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
# if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
# line 34 1 "ast_expr2.y"
# line 34 2 "ast_expr2.y"
{
struct val * val ;
struct expr_node * arglist ;
}
/* Line 1 9 8 of yacc.c. */
# line 4 80 "ast_expr2.c"
/* Line 1 87 of yacc.c. */
# line 4 93 "ast_expr2.c"
YYSTYPE ;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@ -498,13 +511,13 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */
# line 34 6 "ast_expr2.y"
# line 34 7 "ast_expr2.y"
extern int ast_yylex __P ( ( YYSTYPE * , YYLTYPE * , yyscan_t ) ) ;
/* Line 2 2 1 of yacc.c. */
# line 5 08 "ast_expr2.c"
/* Line 2 16 of yacc.c. */
# line 5 21 "ast_expr2.c"
# ifdef short
# undef short
@ -634,8 +647,13 @@ YYID (i)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# ifdef __cplusplus
extern " C " {
# if (defined __cplusplus && ! defined _STDLIB_H \
& & ! ( ( defined YYMALLOC | | defined malloc ) \
& & ( defined YYFREE | | defined free ) ) )
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H
# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
@ -651,9 +669,6 @@ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
void free ( void * ) ; /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifdef __cplusplus
}
# endif
# endif
# endif /* ! defined yyoverflow || YYERROR_VERBOSE */
@ -719,20 +734,20 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
# define YYFINAL 11
/* YYLAST -- Last index in YYTABLE. */
# define YYLAST 15 0
# define YYLAST 15 9
/* YYNTOKENS -- Number of terminals. */
# define YYNTOKENS 2 5
# define YYNTOKENS 2 6
/* YYNNTS -- Number of nonterminals. */
# define YYNNTS 4
/* YYNRULES -- Number of rules. */
# define YYNRULES 2 6
# define YYNRULES 2 7
/* YYNRULES -- Number of states. */
# define YYNSTATES 5 2
# define YYNSTATES 5 4
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
# define YYUNDEFTOK 2
# define YYMAXUTOK 2 79
# define YYMAXUTOK 2 80
# define YYTRANSLATE(YYX) \
( ( unsigned int ) ( YYX ) < = YYMAXUTOK ? yytranslate [ YYX ] : YYUNDEFTOK )
@ -767,7 +782,8 @@ static const yytype_uint8 yytranslate[] =
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
15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 ,
25
} ;
# if YYDEBUG
@ -777,30 +793,30 @@ static const yytype_uint8 yyprhs[] =
{
0 , 0 , 3 , 5 , 6 , 8 , 12 , 17 , 19 , 23 ,
27 , 31 , 35 , 39 , 43 , 47 , 51 , 55 , 59 , 63 ,
66 , 69 , 73 , 77 , 81 , 85 , 89
66 , 69 , 73 , 77 , 81 , 85 , 89 , 95
} ;
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs [ ] =
{
2 6, 0 , - 1 , 28 , - 1 , - 1 , 28 , - 1 , 27 , 3 ,
2 8, - 1 , 24 , 22 , 27 , 23 , - 1 , 24 , - 1 , 2 2,
2 8, 23 , - 1 , 28 , 6 , 28 , - 1 , 28 , 7 , 28 ,
- 1 , 2 8, 13 , 28 , - 1 , 28 , 12 , 28 , - 1 , 28 ,
11 , 2 8, - 1 , 28 , 10 , 28 , - 1 , 28 , 9 , 28 ,
- 1 , 2 8, 8 , 28 , - 1 , 28 , 15 , 28 , - 1 , 28 ,
14 , 2 8, - 1 , 14 , 28 , - 1 , 19 , 28 , - 1 , 28 ,
18 , 2 8, - 1 , 28 , 17 , 28 , - 1 , 28 , 16 , 28 ,
- 1 , 2 8, 21 , 28 , - 1 , 28 , 20 , 28 , - 1 , 28 ,
5 , 2 8, 4 , 28 , - 1
2 7, 0 , - 1 , 29 , - 1 , - 1 , 29 , - 1 , 28 , 3 ,
2 9, - 1 , 25 , 23 , 28 , 24 , - 1 , 2 5, - 1 , 23 ,
2 9, 24 , - 1 , 29 , 6 , 29 , - 1 , 29 , 7 , 29 ,
- 1 , 2 9, 13 , 29 , - 1 , 29 , 12 , 29 , - 1 , 29 ,
11 , 2 9, - 1 , 29 , 10 , 29 , - 1 , 29 , 9 , 29 ,
- 1 , 2 9, 8 , 29 , - 1 , 29 , 15 , 29 , - 1 , 29 ,
14 , 2 9, - 1 , 14 , 29 , - 1 , 19 , 29 , - 1 , 29 ,
18 , 2 9, - 1 , 29 , 17 , 29 , - 1 , 29 , 16 , 29 ,
- 1 , 2 9, 22 , 29 , - 1 , 29 , 21 , 29 , - 1 , 29 ,
5 , 2 9, 4 , 29 , - 1 , 29 , 20 , 29 , - 1
} ;
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline [ ] =
{
0 , 37 2, 372 , 380 , 387 , 388 , 397 , 403 , 404 , 408 ,
41 2, 416 , 420 , 424 , 428 , 432 , 436 , 440 , 444 , 448 ,
45 2, 456 , 460 , 464 , 468 , 472 , 476
0 , 37 1, 371 , 379 , 386 , 387 , 396 , 402 , 403 , 407 ,
41 1, 415 , 419 , 423 , 427 , 431 , 435 , 439 , 443 , 447 ,
45 1, 455 , 459 , 463 , 467 , 471 , 475 , 480
} ;
# endif
@ -812,8 +828,8 @@ static const char *const yytname[] =
" $end " , " error " , " $undefined " , " TOK_COMMA " , " TOK_COLONCOLON " ,
" TOK_COND " , " TOK_OR " , " TOK_AND " , " TOK_NE " , " TOK_LE " , " TOK_GE " , " TOK_LT " ,
" TOK_GT " , " TOK_EQ " , " TOK_MINUS " , " TOK_PLUS " , " TOK_MOD " , " TOK_DIV " ,
" TOK_MULT " , " TOK_COMPL " , " TOK_ EQTILDE" , " TOK_COLON " , " TOK_LP " , " TOK_RP " ,
" TOK EN" , " $accept " , " start " , " arglist " , " expr " , 0
" TOK_MULT " , " TOK_COMPL " , " TOK_ TILDETILDE" , " TOK_ EQTILDE" , " TOK_COLON " ,
" TOK _LP" , " TOK_RP " , " TOK EN" , " $accept " , " start " , " arglist " , " expr " , 0
} ;
# endif
@ -824,16 +840,16 @@ static const yytype_uint16 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
275 , 276 , 277 , 278 , 279 , 280
} ;
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1 [ ] =
{
0 , 2 5, 26 , 2 6, 27 , 27 , 28 , 28 , 2 8, 28 ,
2 8, 28 , 28 , 28 , 28 , 28 , 28 , 28 , 28 , 28 ,
2 8, 28 , 28 , 28 , 28 , 28 , 28
0 , 2 6, 27 , 27 , 28 , 28 , 2 9, 29 , 29 , 29 ,
2 9, 29 , 29 , 29 , 29 , 29 , 29 , 29 , 29 , 29 ,
2 9, 29 , 29 , 29 , 29 , 29 , 29 , 29
} ;
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@ -841,7 +857,7 @@ static const yytype_uint8 yyr2[] =
{
0 , 2 , 1 , 0 , 1 , 3 , 4 , 1 , 3 , 3 ,
3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 2 ,
2 , 3 , 3 , 3 , 3 , 3 , 5
2 , 3 , 3 , 3 , 3 , 3 , 5 , 3
} ;
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@ -851,16 +867,16 @@ static const yytype_uint8 yydefact[] =
{
3 , 0 , 0 , 0 , 7 , 0 , 2 , 19 , 20 , 0 ,
0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 8, 0 ,
4, 0 , 9 , 10 , 16 , 15 , 14 , 13 , 12 , 11 ,
1 8, 17 , 23 , 22 , 21 , 2 5, 24 , 0 , 6 , 0 ,
5, 26
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 8 ,
0, 4, 0 , 9 , 10 , 16 , 15 , 14 , 13 , 12 ,
1 1, 1 8, 17 , 23 , 22 , 21 , 2 7, 25 , 24 , 0 ,
6, 0 , 5, 26
} ;
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto [ ] =
{
- 1 , 5 , 29 , 6
- 1 , 5 , 30 , 6
} ;
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@ -868,12 +884,12 @@ static const yytype_int8 yydefgoto[] =
# define YYPACT_NINF -18
static const yytype_int16 yypact [ ] =
{
11 2, 112 , 112 , 112 , - 16 , 5 , 62 , - 17 , - 17 , 24 ,
11 2, - 18 , 112 , 112 , 112 , 112 , 112 , 112 , 112 , 112 ,
11 2, 112 , 112 , 112 , 112 , 112 , 112 , 112 , - 18 , 4 ,
62 , 45 , 93 , 107 , 123 , 123 , 123 , 123 , 123 , 123 ,
1 29, 129 , - 17 , - 17 , - 17 , - 18 , - 18 , 112 , - 18 , 112 ,
62 , 78
11 8, 118 , 118 , 118 , - 15 , 6 , 65 , - 17 , - 17 , 25 ,
11 8, - 18 , 118 , 118 , 118 , 118 , 118 , 118 , 118 , 118 ,
11 8, 118 , 118 , 118 , 118 , 118 , 118 , 118 , 118 , - 18 ,
4 , 65 , 47 , 98 , 113 , 130 , 130 , 130 , 130 , 130 ,
1 30, 137 , 137 , - 17 , - 17 , - 17 , - 18 , - 18 , - 18 , 118 ,
- 18 , 118 , 65 , 82
} ;
/* YYPGOTO[NTERM-NUM]. */
@ -889,54 +905,54 @@ static const yytype_int8 yypgoto[] =
# define YYTABLE_NINF -1
static const yytype_uint8 yytable [ ] =
{
7 , 8 , 9 , 26 , 27 , 11 , 10 , 47 , 0 , 30 ,
0 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 ,
40 , 41 , 42 , 43 , 44 , 45 , 46 , 48 , 0 , 12 ,
13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 ,
23 , 24 , 25 , 0 , 26 , 27 , 50 , 28 , 51 , 49 ,
7 , 8 , 9 , 26 , 27 , 28 , 11 , 49 , 10 , 31 ,
0 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 ,
41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 50 , 0 ,
12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ,
22 , 23 , 24 , 25 , 0 , 26 , 27 , 28 , 52 , 29 ,
53 , 51 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 ,
20 , 21 , 22 , 23 , 24 , 25 , 0 , 26 , 27 , 28 ,
12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ,
22 , 23 , 24 , 25 , 0 , 26 , 27 , 12 , 13 , 14 ,
22 , 23 , 24 , 25 , 0 , 26 , 27 , 28 , 13 , 14 ,
15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 ,
25 , 0 , 26 , 27 , 13 , 14 , 15 , 16 , 17 , 18 ,
25 , 0 , 26 , 27 , 28 , 14 , 15 , 16 , 17 , 18 ,
19 , 20 , 21 , 22 , 23 , 24 , 25 , 0 , 26 , 27 ,
14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 ,
24 , 25 , 0 , 26 , 27 , 15 , 16 , 17 , 18 , 19 ,
20 , 21 , 22 , 23 , 24 , 25 , 1 , 26 , 27 , 0 ,
0 , 2 , 0 , 0 , 3 , 0 , 4 , 21 , 22 , 23 ,
24 , 25 , 0 , 26 , 27 , 23 , 24 , 25 , 0 , 26 ,
27
28 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 ,
24 , 25 , 1 , 26 , 27 , 28 , 0 , 2 , 0 , 0 ,
0 , 3 , 0 , 4 , 21 , 22 , 23 , 24 , 25 , 0 ,
26 , 27 , 28 , 23 , 24 , 25 , 0 , 26 , 27 , 28
} ;
static const yytype_int8 yycheck [ ] =
{
1 , 2 , 3 , 20 , 21 , 0 , 22 , 3 , - 1 , 10 ,
1 , 2 , 3 , 20 , 21 , 22 , 0 , 3 , 23 , 10 ,
- 1 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 ,
21 , 22 , 23 , 24 , 25 , 26 , 27 , 23 , - 1 , 5 ,
6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ,
16 , 17 , 18 , - 1 , 20 , 21 , 47 , 23 , 49 , 4 ,
21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 24 , - 1 ,
5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 ,
15 , 16 , 17 , 18 , - 1 , 20 , 21 , 5 , 6 , 7 ,
15 , 16 , 17 , 18 , - 1 , 20 , 21 , 22 , 49 , 24 ,
51 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ,
13 , 14 , 15 , 16 , 17 , 18 , - 1 , 20 , 21 , 22 ,
5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 ,
15 , 16 , 17 , 18 , - 1 , 20 , 21 , 22 , 6 , 7 ,
8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 ,
18 , - 1 , 20 , 21 , 6 , 7 , 8 , 9 , 10 , 11 ,
18 , - 1 , 20 , 21 , 22 , 7 , 8 , 9 , 10 , 11 ,
12 , 13 , 14 , 15 , 16 , 17 , 18 , - 1 , 20 , 21 ,
7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ,
17 , 18 , - 1 , 20 , 21 , 8 , 9 , 10 , 11 , 12 ,
13 , 14 , 15 , 16 , 17 , 18 , 14 , 20 , 21 , - 1 ,
- 1 , 19 , - 1 , - 1 , 22 , - 1 , 24 , 14 , 15 , 16 ,
17 , 18 , - 1 , 20 , 21 , 16 , 17 , 18 , - 1 , 20 ,
21
22 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ,
17 , 18 , 14 , 20 , 21 , 22 , - 1 , 19 , - 1 , - 1 ,
- 1 , 23 , - 1 , 25 , 14 , 15 , 16 , 17 , 18 , - 1 ,
20 , 21 , 22 , 16 , 17 , 18 , - 1 , 20 , 21 , 22
} ;
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE - NUM . */
static const yytype_uint8 yystos [ ] =
{
0 , 14 , 19 , 2 2, 24 , 26 , 28 , 28 , 28 , 28 ,
2 2 , 0 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ,
13 , 14 , 15 , 16 , 17 , 18 , 20 , 21 , 2 3, 27 ,
28 , 2 8, 28 , 28 , 28 , 28 , 28 , 28 , 28 , 28 ,
2 8, 28 , 28 , 28 , 28 , 28 , 28 , 3 , 23 , 4 ,
2 8, 28
0 , 14 , 19 , 2 3, 25 , 27 , 29 , 29 , 29 , 29 ,
2 3 , 0 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ,
13 , 14 , 15 , 16 , 17 , 18 , 20 , 21 , 2 2, 24 ,
28 , 2 9, 29 , 29 , 29 , 29 , 29 , 29 , 29 , 29 ,
2 9, 29 , 29 , 29 , 29 , 29 , 29 , 29 , 29 , 3 ,
2 4, 4 , 29 , 29
} ;
# define yyerrok (yyerrstatus = 0)
@ -1063,14 +1079,14 @@ do { \
# if (defined __STDC__ || defined __C99__FUNC__ \
| | defined __cplusplus | | defined _MSC_VER )
static void
yy_symbol_value_print ( FILE * yyoutput , int yytype , const YYSTYPE * const yyvaluep , const YYLTYPE * const yylocationp )
yy_symbol_value_print ( FILE * yyoutput , int yytype , YYSTYPE const * const yyvaluep , YYLTYPE const * const yylocationp )
# else
static void
yy_symbol_value_print ( yyoutput , yytype , yyvaluep , yylocationp )
FILE * yyoutput ;
int yytype ;
const YYSTYPE * const yyvaluep ;
const YYLTYPE * const yylocationp ;
YYSTYPE const * const yyvaluep ;
YYLTYPE const * const yylocationp ;
# endif
{
if ( ! yyvaluep )
@ -1097,14 +1113,14 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
# if (defined __STDC__ || defined __C99__FUNC__ \
| | defined __cplusplus | | defined _MSC_VER )
static void
yy_symbol_print ( FILE * yyoutput , int yytype , const YYSTYPE * const yyvaluep , const YYLTYPE * const yylocationp )
yy_symbol_print ( FILE * yyoutput , int yytype , YYSTYPE const * const yyvaluep , YYLTYPE const * const yylocationp )
# else
static void
yy_symbol_print ( yyoutput , yytype , yyvaluep , yylocationp )
FILE * yyoutput ;
int yytype ;
const YYSTYPE * const yyvaluep ;
const YYLTYPE * const yylocationp ;
YYSTYPE const * const yyvaluep ;
YYLTYPE const * const yylocationp ;
# endif
{
if ( yytype < YYNTOKENS )
@ -1157,8 +1173,7 @@ static void
yy_reduce_print ( YYSTYPE * yyvsp , YYLTYPE * yylsp , int yyrule )
# else
static void
yy_reduce_print ( yyvsp , yylsp , yyrule
)
yy_reduce_print ( yyvsp , yylsp , yyrule )
YYSTYPE * yyvsp ;
YYLTYPE * yylsp ;
int yyrule ;
@ -1281,7 +1296,7 @@ yytnamerr (char *yyres, const char *yystr)
{
if ( * yystr = = ' " ' )
{
size_t yyn = 0 ;
YYSIZE_T yyn = 0 ;
char const * yyp = yystr ;
for ( ; ; )
@ -1328,7 +1343,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
{
int yyn = yypact [ yystate ] ;
if ( ! ( YYPACT_NINF < yyn & & yyn < YYLAST ) )
if ( ! ( YYPACT_NINF < yyn & & yyn < = YYLAST ) )
return 0 ;
else
{
@ -1366,7 +1381,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
int yyxbegin = yyn < 0 ? - yyn : 0 ;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn ;
int yychecklim = YYLAST - yyn + 1 ;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS ;
int yycount = 1 ;
@ -1454,114 +1469,119 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
switch ( yytype )
{
case 4 : /* "TOK_COLONCOLON" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 14 60 "ast_expr2.c"
# line 14 75 "ast_expr2.c"
break ;
case 5 : /* "TOK_COND" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 14 65 "ast_expr2.c"
# line 14 80 "ast_expr2.c"
break ;
case 6 : /* "TOK_OR" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 14 70 "ast_expr2.c"
# line 14 85 "ast_expr2.c"
break ;
case 7 : /* "TOK_AND" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 14 75 "ast_expr2.c"
# line 14 90 "ast_expr2.c"
break ;
case 8 : /* "TOK_NE" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 14 80 "ast_expr2.c"
# line 14 95 "ast_expr2.c"
break ;
case 9 : /* "TOK_LE" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 1 48 5 "ast_expr2.c"
# line 1 500 "ast_expr2.c"
break ;
case 10 : /* "TOK_GE" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 1 490 "ast_expr2.c"
# line 1 505 "ast_expr2.c"
break ;
case 11 : /* "TOK_LT" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 1 49 5 "ast_expr2.c"
# line 1 510 "ast_expr2.c"
break ;
case 12 : /* "TOK_GT" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 00 "ast_expr2.c"
# line 15 15 "ast_expr2.c"
break ;
case 13 : /* "TOK_EQ" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 05 "ast_expr2.c"
# line 15 2 0 "ast_expr2.c"
break ;
case 14 : /* "TOK_MINUS" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 10 "ast_expr2.c"
# line 15 25 "ast_expr2.c"
break ;
case 15 : /* "TOK_PLUS" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 15 "ast_expr2.c"
# line 15 30 "ast_expr2.c"
break ;
case 16 : /* "TOK_MOD" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 20 "ast_expr2.c"
# line 15 35 "ast_expr2.c"
break ;
case 17 : /* "TOK_DIV" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 25 "ast_expr2.c"
# line 15 40 "ast_expr2.c"
break ;
case 18 : /* "TOK_MULT" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 30 "ast_expr2.c"
# line 15 45 "ast_expr2.c"
break ;
case 19 : /* "TOK_COMPL" */
# line 36 6 "ast_expr2.y"
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 3 5 "ast_expr2.c"
# line 15 50 "ast_expr2.c"
break ;
case 20 : /* "TOK_ EQ TILDE" */
# line 36 6 "ast_expr2.y"
case 20 : /* "TOK_ TILD ETILDE" */
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 40 "ast_expr2.c"
# line 15 55 "ast_expr2.c"
break ;
case 21 : /* "TOK_ COLON " */
# line 36 6 "ast_expr2.y"
case 21 : /* "TOK_ EQTILDE " */
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 45 "ast_expr2.c"
# line 15 60 "ast_expr2.c"
break ;
case 22 : /* "TOK_ LP " */
# line 36 6 "ast_expr2.y"
case 22 : /* "TOK_ COLON " */
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 50 "ast_expr2.c"
# line 15 6 5 "ast_expr2.c"
break ;
case 23 : /* "TOK_ R P" */
# line 36 6 "ast_expr2.y"
case 23 : /* "TOK_ L P" */
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 55 "ast_expr2.c"
# line 15 70 "ast_expr2.c"
break ;
case 24 : /* "TOK EN " */
# line 36 6 "ast_expr2.y"
case 24 : /* "TOK _RP " */
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 15 60 "ast_expr2.c"
# line 15 75 "ast_expr2.c"
break ;
case 2 8: /* "expr " */
# line 36 6 "ast_expr2.y"
case 2 5: /* "TOKEN " */
# line 36 5 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 1565 "ast_expr2.c"
# line 1580 "ast_expr2.c"
break ;
case 29 : /* "expr" */
# line 365 "ast_expr2.y"
{ free_value ( ( yyvaluep - > val ) ) ; } ;
# line 1585 "ast_expr2.c"
break ;
default :
@ -1884,7 +1904,7 @@ yyreduce:
switch ( yyn )
{
case 2 :
# line 37 2 "ast_expr2.y"
# line 37 1 "ast_expr2.y"
{ ( ( struct parse_io * ) parseio ) - > val = ( struct val * ) calloc ( sizeof ( struct val ) , 1 ) ;
( ( struct parse_io * ) parseio ) - > val - > type = ( yyvsp [ ( 1 ) - ( 1 ) ] . val ) - > type ;
if ( ( yyvsp [ ( 1 ) - ( 1 ) ] . val ) - > type = = AST_EXPR_number )
@ -1896,7 +1916,7 @@ yyreduce:
break ;
case 3 :
# line 3 80 "ast_expr2.y"
# line 3 79 "ast_expr2.y"
{ /* nothing */ ( ( struct parse_io * ) parseio ) - > val = ( struct val * ) calloc ( sizeof ( struct val ) , 1 ) ;
( ( struct parse_io * ) parseio ) - > val - > type = AST_EXPR_string ;
( ( struct parse_io * ) parseio ) - > val - > u . s = strdup ( " " ) ;
@ -1904,12 +1924,12 @@ yyreduce:
break ;
case 4 :
# line 38 7 "ast_expr2.y"
# line 38 6 "ast_expr2.y"
{ ( yyval . arglist ) = alloc_expr_node ( AST_EXPR_NODE_VAL ) ; ( yyval . arglist ) - > val = ( yyvsp [ ( 1 ) - ( 1 ) ] . val ) ; ; }
break ;
case 5 :
# line 38 8 "ast_expr2.y"
# line 38 7 "ast_expr2.y"
{ struct expr_node * x = alloc_expr_node ( AST_EXPR_NODE_VAL ) ;
struct expr_node * t ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
@ -1919,7 +1939,7 @@ yyreduce:
break ;
case 6 :
# line 39 7 "ast_expr2.y"
# line 39 6 "ast_expr2.y"
{ ( yyval . val ) = op_func ( ( yyvsp [ ( 1 ) - ( 4 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 4 ) ] . arglist ) , ( ( struct parse_io * ) parseio ) - > chan ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 4 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 4 ) - ( 4 ) ] . val ) ) ;
@ -1929,12 +1949,12 @@ yyreduce:
break ;
case 7 :
# line 40 3 "ast_expr2.y"
# line 40 2 "ast_expr2.y"
{ ( yyval . val ) = ( yyvsp [ ( 1 ) - ( 1 ) ] . val ) ; ; }
break ;
case 8 :
# line 40 4 "ast_expr2.y"
# line 40 3 "ast_expr2.y"
{ ( yyval . val ) = ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
( yyloc ) . first_line = 0 ; ( yyloc ) . last_line = 0 ;
@ -1942,7 +1962,7 @@ yyreduce:
break ;
case 9 :
# line 40 8 "ast_expr2.y"
# line 40 7 "ast_expr2.y"
{ ( yyval . val ) = op_or ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1950,7 +1970,7 @@ yyreduce:
break ;
case 10 :
# line 41 2 "ast_expr2.y"
# line 41 1 "ast_expr2.y"
{ ( yyval . val ) = op_and ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1958,7 +1978,7 @@ yyreduce:
break ;
case 11 :
# line 41 6 "ast_expr2.y"
# line 41 5 "ast_expr2.y"
{ ( yyval . val ) = op_eq ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1966,7 +1986,7 @@ yyreduce:
break ;
case 12 :
# line 4 20 "ast_expr2.y"
# line 4 19 "ast_expr2.y"
{ ( yyval . val ) = op_gt ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1974,7 +1994,7 @@ yyreduce:
break ;
case 13 :
# line 42 4 "ast_expr2.y"
# line 42 3 "ast_expr2.y"
{ ( yyval . val ) = op_lt ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1982,7 +2002,7 @@ yyreduce:
break ;
case 14 :
# line 42 8 "ast_expr2.y"
# line 42 7 "ast_expr2.y"
{ ( yyval . val ) = op_ge ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1990,7 +2010,7 @@ yyreduce:
break ;
case 15 :
# line 43 2 "ast_expr2.y"
# line 43 1 "ast_expr2.y"
{ ( yyval . val ) = op_le ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -1998,7 +2018,7 @@ yyreduce:
break ;
case 16 :
# line 43 6 "ast_expr2.y"
# line 43 5 "ast_expr2.y"
{ ( yyval . val ) = op_ne ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2006,7 +2026,7 @@ yyreduce:
break ;
case 17 :
# line 4 40 "ast_expr2.y"
# line 4 39 "ast_expr2.y"
{ ( yyval . val ) = op_plus ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2014,7 +2034,7 @@ yyreduce:
break ;
case 18 :
# line 44 4 "ast_expr2.y"
# line 44 3 "ast_expr2.y"
{ ( yyval . val ) = op_minus ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2022,7 +2042,7 @@ yyreduce:
break ;
case 19 :
# line 44 8 "ast_expr2.y"
# line 44 7 "ast_expr2.y"
{ ( yyval . val ) = op_negate ( ( yyvsp [ ( 2 ) - ( 2 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 1 ) - ( 2 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 2 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 2 ) - ( 2 ) ] ) . last_column ;
@ -2030,7 +2050,7 @@ yyreduce:
break ;
case 20 :
# line 45 2 "ast_expr2.y"
# line 45 1 "ast_expr2.y"
{ ( yyval . val ) = op_compl ( ( yyvsp [ ( 2 ) - ( 2 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 1 ) - ( 2 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 2 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 2 ) - ( 2 ) ] ) . last_column ;
@ -2038,7 +2058,7 @@ yyreduce:
break ;
case 21 :
# line 45 6 "ast_expr2.y"
# line 45 5 "ast_expr2.y"
{ ( yyval . val ) = op_times ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2046,7 +2066,7 @@ yyreduce:
break ;
case 22 :
# line 4 60 "ast_expr2.y"
# line 4 59 "ast_expr2.y"
{ ( yyval . val ) = op_div ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2054,7 +2074,7 @@ yyreduce:
break ;
case 23 :
# line 46 4 "ast_expr2.y"
# line 46 3 "ast_expr2.y"
{ ( yyval . val ) = op_rem ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2062,7 +2082,7 @@ yyreduce:
break ;
case 24 :
# line 46 8 "ast_expr2.y"
# line 46 7 "ast_expr2.y"
{ ( yyval . val ) = op_colon ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2070,7 +2090,7 @@ yyreduce:
break ;
case 25 :
# line 47 2 "ast_expr2.y"
# line 47 1 "ast_expr2.y"
{ ( yyval . val ) = op_eqtilde ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
@ -2078,7 +2098,7 @@ yyreduce:
break ;
case 26 :
# line 47 6 "ast_expr2.y"
# line 47 5 "ast_expr2.y"
{ ( yyval . val ) = op_cond ( ( yyvsp [ ( 1 ) - ( 5 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 5 ) ] . val ) , ( yyvsp [ ( 5 ) - ( 5 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 5 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 4 ) - ( 5 ) ] . val ) ) ;
@ -2086,9 +2106,17 @@ yyreduce:
( yyloc ) . first_line = 0 ; ( yyloc ) . last_line = 0 ; ; }
break ;
case 27 :
# line 480 "ast_expr2.y"
{ ( yyval . val ) = op_tildetilde ( ( yyvsp [ ( 1 ) - ( 3 ) ] . val ) , ( yyvsp [ ( 3 ) - ( 3 ) ] . val ) ) ;
DESTROY ( ( yyvsp [ ( 2 ) - ( 3 ) ] . val ) ) ;
( yyloc ) . first_column = ( yylsp [ ( 1 ) - ( 3 ) ] ) . first_column ; ( yyloc ) . last_column = ( yylsp [ ( 3 ) - ( 3 ) ] ) . last_column ;
( yyloc ) . first_line = 0 ; ( yyloc ) . last_line = 0 ; ; }
break ;
/* Line 1270 of yacc.c. */
# line 2092 "ast_expr2.c"
/* Line 12 6 7 of yacc.c. */
# line 2 120 "ast_expr2.c"
default : break ;
}
YY_SYMBOL_PRINT ( " -> $$ = " , yyr1 [ yyn ] , & yyval , & yyloc ) ;
@ -2303,11 +2331,12 @@ yyreturn:
if ( yymsg ! = yymsgbuf )
YYSTACK_FREE ( yymsg ) ;
# endif
return yyresult ;
/* Make sure YYID is used. */
return YYID ( yyresult ) ;
}
# line 48 3 "ast_expr2.y"
# line 48 6 "ast_expr2.y"
static struct expr_node * alloc_expr_node ( enum node_type nt )
@ -3446,3 +3475,29 @@ op_eqtilde (struct val *a, struct val *b)
return v ;
}
static struct val * /* this is a string concat operator */
op_tildetilde ( struct val * a , struct val * b )
{
struct val * v ;
char * vs ;
/* coerce to both arguments to strings */
to_string ( a ) ;
to_string ( b ) ;
/* strip double quotes from both -- */
strip_quotes ( a ) ;
strip_quotes ( b ) ;
vs = malloc ( strlen ( a - > u . s ) + strlen ( b - > u . s ) + 1 ) ;
strcpy ( vs , a - > u . s ) ;
strcat ( vs , b - > u . s ) ;
v = make_str ( vs ) ;
/* free arguments */
free_value ( a ) ;
free_value ( b ) ;
return v ;
}