annotate src/paranormal/libcalc/parser.c @ 3138:8e26022bb814

aac: handle premature EOF on shoutcast streams more gracefully. in combination with the neon work, we no longer have a problem. (closes #57)
author William Pitcock <nenolod@atheme.org>
date Thu, 07 May 2009 11:14:36 -0500
parents f1b6f1b2cdb3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1 /* A Bison parser, made by GNU Bison 1.875d. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
2
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
3 /* Skeleton parser for Yacc-like parsing with Bison,
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
5
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
6 This program is free software; you can redistribute it and/or modify
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
7 it under the terms of the GNU General Public License as published by
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
9 any later version.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
10
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
11 This program is distributed in the hope that it will be useful,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
14 GNU General Public License for more details.
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
15
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
16 You should have received a copy of the GNU General Public License
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
17 along with this program; if not, write to the Free Software
2835
f1b6f1b2cdb3 fixed FSF address
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2321
diff changeset
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
f1b6f1b2cdb3 fixed FSF address
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2321
diff changeset
19 Boston, MA 02110-1301, USA. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
20
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
21 /* As a special exception, when this file is copied by Bison into a
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
22 Bison output file, you may use that output file without restriction.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
23 This special exception was added by the Free Software Foundation
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
24 in version 1.24 of Bison. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
25
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
26 /* Written by Richard Stallman by simplifying the original so called
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
27 ``semantic'' parser. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
28
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
29 /* All symbols defined below should begin with yy or YY, to avoid
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
30 infringing on user name space. This should be done even for local
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
31 variables, as they might otherwise be expanded by user macros.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
32 There are some unavoidable exceptions within include files to
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
33 define necessary library symbols; they are noted "INFRINGES ON
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
34 USER NAME SPACE" below. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
35
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
36 /* Identify Bison output. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
37 #define YYBISON 1
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
38
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
39 /* Skeleton name. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
40 #define YYSKELETON_NAME "yacc.c"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
41
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
42 /* Pure parsers. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
43 #define YYPURE 1
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
44
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
45 /* Using locations. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
46 #define YYLSP_NEEDED 0
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
47
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
48
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
49
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
50 /* Tokens. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
51 #ifndef YYTOKENTYPE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
52 # define YYTOKENTYPE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
54 know about them. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
55 enum yytokentype {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
56 NAME = 258,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
57 NUMBER = 259,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
58 NEG = 260
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
59 };
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
60 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
61 #define NAME 258
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
62 #define NUMBER 259
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
63 #define NEG 260
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
64
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
65
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
66
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
67
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
68 /* Copy the first part of user declarations. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
69 #line 26 "parser.y"
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
70
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
71 #include <ctype.h>
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
72 #include <glib.h>
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
73 #include <locale.h>
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
74 #include <math.h>
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
75 #include <stdio.h>
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
76 #include <string.h>
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
77
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
78 #include "dict.h"
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
79 #include "execute.h"
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
80 #include "function.h"
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
81 #include "parser.h"
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
82 #include "storage.h"
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
83
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
84 #define YYPARSE_PARAM yyparam
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
85 #define YYLEX_PARAM yyparam
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
86
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
87 static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict,
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
88 char *str);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
89
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
90 #define GENERATE(str) if (!expr_add_compile (((parser_control *)yyparam)->expr, \
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
91 ((parser_control *)yyparam)->dict, str)) \
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
92 YYABORT;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
93
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
94
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
95 /* Enabling traces. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
96 #ifndef YYDEBUG
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
97 # define YYDEBUG 0
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
98 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
99
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
100 /* Enabling verbose error messages. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
101 #ifdef YYERROR_VERBOSE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
102 # undef YYERROR_VERBOSE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
103 # define YYERROR_VERBOSE 1
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
104 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
105 # define YYERROR_VERBOSE 0
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
106 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
107
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
108 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
109 #line 54 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
110 typedef union YYSTYPE {
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
111 char *s_value;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
112 char c_value;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
113 double d_value;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
114 int i_value;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
115 } YYSTYPE;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
116 /* Line 191 of yacc.c. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
117 #line 118 "parser.c"
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
118 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
119 # define YYSTYPE_IS_DECLARED 1
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
120 # define YYSTYPE_IS_TRIVIAL 1
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
121 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
122
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
123
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
124
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
125 /* Copy the second part of user declarations. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
126
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
127
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
128 /* Line 214 of yacc.c. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
129 #line 130 "parser.c"
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
130
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
131 #if ! defined (yyoverflow) || YYERROR_VERBOSE
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
132
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
133 # ifndef YYFREE
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
134 # define YYFREE free
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
135 # endif
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
136 # ifndef YYMALLOC
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
137 # define YYMALLOC malloc
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
138 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
139
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
140 /* The parser invokes alloca or malloc; define the necessary symbols. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
141
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
142 # ifdef YYSTACK_USE_ALLOCA
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
143 # if YYSTACK_USE_ALLOCA
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
144 # define YYSTACK_ALLOC alloca
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
145 # endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
146 # else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
147 # if defined (alloca) || defined (_ALLOCA_H)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
148 # define YYSTACK_ALLOC alloca
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
149 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
150 # ifdef __GNUC__
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
151 # define YYSTACK_ALLOC __builtin_alloca
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
152 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
153 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
154 # endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
155
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
156 # ifdef YYSTACK_ALLOC
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
157 /* Pacify GCC's `empty if-body' warning. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
158 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
159 # else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
160 # if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
161 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
162 # define YYSIZE_T size_t
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
163 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
164 # define YYSTACK_ALLOC YYMALLOC
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
165 # define YYSTACK_FREE YYFREE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
166 # endif
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
167 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
168
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
169
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
170 #if (! defined (yyoverflow) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
171 && (! defined (__cplusplus) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
172 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
173
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
174 /* A type that is properly aligned for any stack member. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
175 union yyalloc
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
176 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
177 short int yyss;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
178 YYSTYPE yyvs;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
179 };
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
180
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
181 /* The size of the maximum gap between one aligned stack and the next. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
182 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
183
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
184 /* The size of an array large to enough to hold all stacks, each with
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
185 N elements. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
186 # define YYSTACK_BYTES(N) \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
187 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
188 + YYSTACK_GAP_MAXIMUM)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
189
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
190 /* Copy COUNT objects from FROM to TO. The source and destination do
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
191 not overlap. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
192 # ifndef YYCOPY
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
193 # if defined (__GNUC__) && 1 < __GNUC__
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
194 # define YYCOPY(To, From, Count) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
195 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
196 # else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
197 # define YYCOPY(To, From, Count) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
198 do \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
199 { \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
200 register YYSIZE_T yyi; \
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
201 for (yyi = 0; yyi < (Count); yyi++) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
202 (To)[yyi] = (From)[yyi]; \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
203 } \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
204 while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
205 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
206 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
207
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
208 /* Relocate STACK from its old location to the new one. The
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
209 local variables YYSIZE and YYSTACKSIZE give the old and new number of
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
210 elements in the stack, and YYPTR gives the new location of the
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
211 stack. Advance YYPTR to a properly aligned location for the next
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
212 stack. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
213 # define YYSTACK_RELOCATE(Stack) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
214 do \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
215 { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
216 YYSIZE_T yynewbytes; \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
217 YYCOPY (&yyptr->Stack, Stack, yysize); \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
218 Stack = &yyptr->Stack; \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
219 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
220 yyptr += yynewbytes / sizeof (*yyptr); \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
221 } \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
222 while (0)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
223
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
224 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
225
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
226 #if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
227 typedef signed char yysigned_char;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
228 #else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
229 typedef short int yysigned_char;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
230 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
231
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
232 /* YYFINAL -- State number of the termination state. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
233 #define YYFINAL 2
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
234 /* YYLAST -- Last index in YYTABLE. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
235 #define YYLAST 65
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
236
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
237 /* YYNTOKENS -- Number of terminals. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
238 #define YYNTOKENS 18
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
239 /* YYNNTS -- Number of nonterminals. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
240 #define YYNNTS 5
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
241 /* YYNRULES -- Number of rules. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
242 #define YYNRULES 22
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
243 /* YYNRULES -- Number of states. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
244 #define YYNSTATES 37
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
245
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
246 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
247 #define YYUNDEFTOK 2
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
248 #define YYMAXUTOK 260
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
249
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
250 #define YYTRANSLATE(YYX) \
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
251 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
252
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
253 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
254 static const unsigned char yytranslate[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
255 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
256 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
260 14, 15, 8, 7, 13, 6, 2, 9, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
261 2, 2, 2, 2, 2, 2, 2, 2, 2, 12,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
262 17, 5, 16, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
265 2, 2, 2, 2, 11, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
281 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
282 10
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
283 };
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
284
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
285 #if YYDEBUG
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
286 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
287 YYRHS. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
288 static const unsigned char yyprhs[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
289 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
290 0, 0, 3, 4, 7, 8, 10, 13, 16, 18,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
291 22, 24, 26, 30, 35, 39, 43, 47, 51, 55,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
292 59, 62, 66
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
293 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
294
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
295 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
296 static const yysigned_char yyrhs[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
297 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
298 19, 0, -1, -1, 19, 20, -1, -1, 22, -1,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
299 20, 12, -1, 1, 12, -1, 22, -1, 21, 13,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
300 22, -1, 4, -1, 3, -1, 3, 5, 22, -1,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
301 3, 14, 21, 15, -1, 22, 16, 22, -1, 22,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
302 17, 22, -1, 22, 7, 22, -1, 22, 6, 22,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
303 -1, 22, 8, 22, -1, 22, 9, 22, -1, 6,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
304 22, -1, 22, 11, 22, -1, 14, 22, 15, -1
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
305 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
306
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
307 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
308 static const unsigned char yyrline[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
309 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
310 0, 76, 76, 77, 81, 82, 84, 85, 90, 93,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
311 98, 104, 110, 116, 123, 125, 128, 130, 132, 134,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
312 136, 138, 140
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
313 };
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
314 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
315
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
316 #if YYDEBUG || YYERROR_VERBOSE
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
317 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
318 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
319 static const char *const yytname[] =
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
320 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
321 "$end", "error", "$undefined", "NAME", "NUMBER", "'='", "'-'", "'+'",
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
322 "'*'", "'/'", "NEG", "'^'", "';'", "','", "'('", "')'", "'>'", "'<'",
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
323 "$accept", "input", "expression_list", "argument_list", "expression", 0
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
324 };
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
325 #endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
326
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
327 # ifdef YYPRINT
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
328 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
329 token YYLEX-NUM. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
330 static const unsigned short int yytoknum[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
331 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
332 0, 256, 257, 258, 259, 61, 45, 43, 42, 47,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
333 260, 94, 59, 44, 40, 41, 62, 60
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
334 };
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
335 # endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
336
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
337 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
338 static const unsigned char yyr1[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
339 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
340 0, 18, 19, 19, 20, 20, 20, 20, 21, 21,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
341 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
342 22, 22, 22
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
343 };
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
344
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
345 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
346 static const unsigned char yyr2[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
347 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
348 0, 2, 0, 2, 0, 1, 2, 2, 1, 3,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
349 1, 1, 3, 4, 3, 3, 3, 3, 3, 3,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
350 2, 3, 3
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
351 };
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
352
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
353 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
354 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
355 means the default is an error. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
356 static const unsigned char yydefact[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
357 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
358 2, 0, 1, 0, 11, 10, 0, 0, 3, 5,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
359 7, 0, 0, 20, 0, 6, 0, 0, 0, 0,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
360 0, 0, 0, 12, 0, 8, 22, 17, 16, 18,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
361 19, 21, 14, 15, 0, 13, 9
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
362 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
363
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
364 /* YYDEFGOTO[NTERM-NUM]. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
365 static const yysigned_char yydefgoto[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
366 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
367 -1, 1, 8, 24, 9
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
368 };
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
369
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
370 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
371 STATE-NUM. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
372 #define YYPACT_NINF -10
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
373 static const yysigned_char yypact[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
374 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
375 -10, 17, -10, -8, 22, -10, 47, 47, -3, 38,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
376 -10, 47, 47, -9, 26, -10, 47, 47, 47, 47,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
377 47, 47, 47, 38, 9, 38, -10, 48, 48, -9,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
378 -9, -9, 38, 38, 47, -10, 38
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
379 };
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
380
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
381 /* YYPGOTO[NTERM-NUM]. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
382 static const yysigned_char yypgoto[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
383 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
384 -10, -10, -10, -10, -6
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
385 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
386
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
387 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
388 positive, shift that token. If negative, reduce the rule which
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
389 number is the opposite. If zero, do what YYDEFACT says.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
390 If YYTABLE_NINF, syntax error. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
391 #define YYTABLE_NINF -5
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
392 static const yysigned_char yytable[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
393 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
394 13, 14, 20, 0, 10, 23, 25, 21, 22, 15,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
395 27, 28, 29, 30, 31, 32, 33, 2, 3, 0,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
396 4, 5, 34, 6, 35, 0, 0, 11, 36, -4,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
397 0, 7, 16, 17, 18, 19, 12, 20, 0, 0,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
398 0, 26, 21, 22, 16, 17, 18, 19, 0, 20,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
399 4, 5, 0, 6, 21, 22, 18, 19, 0, 20,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
400 0, 7, 0, 0, 21, 22
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
401 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
402
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
403 static const yysigned_char yycheck[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
404 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
405 6, 7, 11, -1, 12, 11, 12, 16, 17, 12,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
406 16, 17, 18, 19, 20, 21, 22, 0, 1, -1,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
407 3, 4, 13, 6, 15, -1, -1, 5, 34, 12,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
408 -1, 14, 6, 7, 8, 9, 14, 11, -1, -1,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
409 -1, 15, 16, 17, 6, 7, 8, 9, -1, 11,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
410 3, 4, -1, 6, 16, 17, 8, 9, -1, 11,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
411 -1, 14, -1, -1, 16, 17
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
412 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
413
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
414 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
415 symbol of state STATE-NUM. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
416 static const unsigned char yystos[] =
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
417 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
418 0, 19, 0, 1, 3, 4, 6, 14, 20, 22,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
419 12, 5, 14, 22, 22, 12, 6, 7, 8, 9,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
420 11, 16, 17, 22, 21, 22, 15, 22, 22, 22,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
421 22, 22, 22, 22, 13, 15, 22
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
422 };
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
423
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
424 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
425 # define YYSIZE_T __SIZE_TYPE__
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
426 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
427 #if ! defined (YYSIZE_T) && defined (size_t)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
428 # define YYSIZE_T size_t
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
429 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
430 #if ! defined (YYSIZE_T)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
431 # if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
432 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
433 # define YYSIZE_T size_t
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
434 # endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
435 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
436 #if ! defined (YYSIZE_T)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
437 # define YYSIZE_T unsigned int
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
438 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
439
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
440 #define yyerrok (yyerrstatus = 0)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
441 #define yyclearin (yychar = YYEMPTY)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
442 #define YYEMPTY (-2)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
443 #define YYEOF 0
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
444
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
445 #define YYACCEPT goto yyacceptlab
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
446 #define YYABORT goto yyabortlab
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
447 #define YYERROR goto yyerrorlab
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
448
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
449
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
450 /* Like YYERROR except do call yyerror. This remains here temporarily
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
451 to ease the transition to the new meaning of YYERROR, for GCC.
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
452 Once GCC version 2 has supplanted version 1, this can go. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
453
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
454 #define YYFAIL goto yyerrlab
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
455
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
456 #define YYRECOVERING() (!!yyerrstatus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
457
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
458 #define YYBACKUP(Token, Value) \
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
459 do \
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
460 if (yychar == YYEMPTY && yylen == 1) \
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
461 { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
462 yychar = (Token); \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
463 yylval = (Value); \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
464 yytoken = YYTRANSLATE (yychar); \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
465 YYPOPSTACK; \
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
466 goto yybackup; \
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
467 } \
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
468 else \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
469 { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
470 yyerror ("syntax error: cannot back up");\
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
471 YYERROR; \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
472 } \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
473 while (0)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
474
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
475 #define YYTERROR 1
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
476 #define YYERRCODE 256
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
477
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
478 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
479 are run). */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
480
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
481 #ifndef YYLLOC_DEFAULT
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
482 # define YYLLOC_DEFAULT(Current, Rhs, N) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
483 ((Current).first_line = (Rhs)[1].first_line, \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
484 (Current).first_column = (Rhs)[1].first_column, \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
485 (Current).last_line = (Rhs)[N].last_line, \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
486 (Current).last_column = (Rhs)[N].last_column)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
487 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
488
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
489 /* YYLEX -- calling `yylex' with the right arguments. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
490
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
491 #ifdef YYLEX_PARAM
2321
6b427677621f killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents: 1978
diff changeset
492 int yylex (YYSTYPE *yylval, void *yyparam);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
493 # define YYLEX yylex (&yylval, YYLEX_PARAM)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
494 #else
2321
6b427677621f killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents: 1978
diff changeset
495 int yylex (YYSTYPE *yylval);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
496 # define YYLEX yylex (&yylval)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
497 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
498
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
499 /* Enable debugging if requested. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
500 #if YYDEBUG
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
501
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
502 # ifndef YYFPRINTF
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
503 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
504 # define YYFPRINTF fprintf
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
505 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
506
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
507 # define YYDPRINTF(Args) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
508 do { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
509 if (yydebug) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
510 YYFPRINTF Args; \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
511 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
512
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
513 # define YYDSYMPRINT(Args) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
514 do { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
515 if (yydebug) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
516 yysymprint Args; \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
517 } while (0)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
518
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
519 # define YYDSYMPRINTF(Title, Token, Value, Location) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
520 do { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
521 if (yydebug) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
522 { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
523 YYFPRINTF (stderr, "%s ", Title); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
524 yysymprint (stderr, \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
525 Token, Value); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
526 YYFPRINTF (stderr, "\n"); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
527 } \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
528 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
529
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
530 /*------------------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
531 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
532 | TOP (included). |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
533 `------------------------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
534
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
535 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
536 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
537 yy_stack_print (short int *bottom, short int *top)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
538 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
539 static void
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
540 yy_stack_print (bottom, top)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
541 short int *bottom;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
542 short int *top;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
543 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
544 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
545 YYFPRINTF (stderr, "Stack now");
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
546 for (/* Nothing. */; bottom <= top; ++bottom)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
547 YYFPRINTF (stderr, " %d", *bottom);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
548 YYFPRINTF (stderr, "\n");
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
549 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
550
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
551 # define YY_STACK_PRINT(Bottom, Top) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
552 do { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
553 if (yydebug) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
554 yy_stack_print ((Bottom), (Top)); \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
555 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
556
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
557
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
558 /*------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
559 | Report that the YYRULE is going to be reduced. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
560 `------------------------------------------------*/
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
561
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
562 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
563 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
564 yy_reduce_print (int yyrule)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
565 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
566 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
567 yy_reduce_print (yyrule)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
568 int yyrule;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
569 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
570 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
571 int yyi;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
572 unsigned int yylno = yyrline[yyrule];
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
573 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
574 yyrule - 1, yylno);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
575 /* Print the symbols being reduced, and their result. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
576 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
577 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
578 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
579 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
580
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
581 # define YY_REDUCE_PRINT(Rule) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
582 do { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
583 if (yydebug) \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
584 yy_reduce_print (Rule); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
585 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
586
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
587 /* Nonzero means print parse trace. It is left uninitialized so that
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
588 multiple parsers can coexist. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
589 int yydebug;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
590 #else /* !YYDEBUG */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
591 # define YYDPRINTF(Args)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
592 # define YYDSYMPRINT(Args)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
593 # define YYDSYMPRINTF(Title, Token, Value, Location)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
594 # define YY_STACK_PRINT(Bottom, Top)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
595 # define YY_REDUCE_PRINT(Rule)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
596 #endif /* !YYDEBUG */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
597
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
598
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
599 /* YYINITDEPTH -- initial size of the parser's stacks. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
600 #ifndef YYINITDEPTH
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
601 # define YYINITDEPTH 200
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
602 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
603
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
604 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
605 if the built-in stack extension method is used).
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
606
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
607 Do not make this value too large; the results are undefined if
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
608 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
609 evaluated with infinite-precision integer arithmetic. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
610
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
611 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
612 # undef YYMAXDEPTH
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
613 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
614
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
615 #ifndef YYMAXDEPTH
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
616 # define YYMAXDEPTH 10000
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
617 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
618
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
619
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
620
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
621 #if YYERROR_VERBOSE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
622
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
623 # ifndef yystrlen
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
624 # if defined (__GLIBC__) && defined (_STRING_H)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
625 # define yystrlen strlen
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
626 # else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
627 /* Return the length of YYSTR. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
628 static YYSIZE_T
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
629 # if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
630 yystrlen (const char *yystr)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
631 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
632 yystrlen (yystr)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
633 const char *yystr;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
634 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
635 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
636 register const char *yys = yystr;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
637
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
638 while (*yys++ != '\0')
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
639 continue;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
640
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
641 return yys - yystr - 1;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
642 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
643 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
644 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
645
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
646 # ifndef yystpcpy
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
647 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
648 # define yystpcpy stpcpy
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
649 # else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
650 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
651 YYDEST. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
652 static char *
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
653 # if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
654 yystpcpy (char *yydest, const char *yysrc)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
655 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
656 yystpcpy (yydest, yysrc)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
657 char *yydest;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
658 const char *yysrc;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
659 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
660 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
661 register char *yyd = yydest;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
662 register const char *yys = yysrc;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
663
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
664 while ((*yyd++ = *yys++) != '\0')
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
665 continue;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
666
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
667 return yyd - 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
668 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
669 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
670 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
671
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
672 #endif /* !YYERROR_VERBOSE */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
673
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
674
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
675
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
676 #if YYDEBUG
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
677 /*--------------------------------.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
678 | Print this symbol on YYOUTPUT. |
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
679 `--------------------------------*/
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
680
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
681 #if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
682 static void
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
683 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
684 #else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
685 static void
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
686 yysymprint (yyoutput, yytype, yyvaluep)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
687 FILE *yyoutput;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
688 int yytype;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
689 YYSTYPE *yyvaluep;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
690 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
691 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
692 /* Pacify ``unused variable'' warnings. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
693 (void) yyvaluep;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
694
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
695 if (yytype < YYNTOKENS)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
696 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
697 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
698 # ifdef YYPRINT
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
699 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
700 # endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
701 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
702 else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
703 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
704
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
705 switch (yytype)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
706 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
707 default:
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
708 break;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
709 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
710 YYFPRINTF (yyoutput, ")");
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
711 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
712
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
713 #endif /* ! YYDEBUG */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
714 /*-----------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
715 | Release the memory associated to this symbol. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
716 `-----------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
717
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
718 #if defined (__STDC__) || defined (__cplusplus)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
719 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
720 yydestruct (int yytype, YYSTYPE *yyvaluep)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
721 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
722 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
723 yydestruct (yytype, yyvaluep)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
724 int yytype;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
725 YYSTYPE *yyvaluep;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
726 #endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
727 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
728 /* Pacify ``unused variable'' warnings. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
729 (void) yyvaluep;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
730
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
731 switch (yytype)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
732 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
733
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
734 default:
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
735 break;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
736 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
737 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
738
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
739
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
740 /* Prevent warnings from -Wmissing-prototypes. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
741
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
742 #ifdef YYPARSE_PARAM
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
743 # if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
744 int yyparse (void *YYPARSE_PARAM);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
745 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
746 int yyparse ();
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
747 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
748 #else /* ! YYPARSE_PARAM */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
749 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
750 int yyparse (void);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
751 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
752 int yyparse ();
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
753 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
754 #endif /* ! YYPARSE_PARAM */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
755
2321
6b427677621f killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents: 1978
diff changeset
756 int yyerror (char *s);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
757
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
758
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
759
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
760
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
761
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
762 /*----------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
763 | yyparse. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
764 `----------*/
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
765
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
766 #ifdef YYPARSE_PARAM
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
767 # if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
768 int yyparse (void *YYPARSE_PARAM)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
769 # else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
770 int yyparse (YYPARSE_PARAM)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
771 void *YYPARSE_PARAM;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
772 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
773 #else /* ! YYPARSE_PARAM */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
774 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
775 int
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
776 yyparse (void)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
777 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
778 int
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
779 yyparse ()
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
780
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
781 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
782 #endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
783 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
784 /* The lookahead symbol. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
785 int yychar;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
786
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
787 /* The semantic value of the lookahead symbol. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
788 YYSTYPE yylval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
789
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
790 /* Number of syntax errors so far. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
791 int yynerrs;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
792
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
793 register int yystate;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
794 register int yyn;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
795 int yyresult;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
796 /* Number of tokens to shift before error messages enabled. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
797 int yyerrstatus;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
798 /* Lookahead token as an internal (translated) token number. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
799 int yytoken = 0;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
800
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
801 /* Three stacks and their tools:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
802 `yyss': related to states,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
803 `yyvs': related to semantic values,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
804 `yyls': related to locations.
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
805
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
806 Refer to the stacks thru separate pointers, to allow yyoverflow
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
807 to reallocate them elsewhere. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
808
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
809 /* The state stack. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
810 short int yyssa[YYINITDEPTH];
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
811 short int *yyss = yyssa;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
812 register short int *yyssp;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
813
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
814 /* The semantic value stack. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
815 YYSTYPE yyvsa[YYINITDEPTH];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
816 YYSTYPE *yyvs = yyvsa;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
817 register YYSTYPE *yyvsp;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
818
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
819
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
820
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
821 #define YYPOPSTACK (yyvsp--, yyssp--)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
822
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
823 YYSIZE_T yystacksize = YYINITDEPTH;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
824
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
825 /* The variables used to return semantic value and location from the
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
826 action routines. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
827 YYSTYPE yyval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
828
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
829
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
830 /* When reducing, the number of symbols on the RHS of the reduced
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
831 rule. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
832 int yylen;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
833
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
834 YYDPRINTF ((stderr, "Starting parse\n"));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
835
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
836 yystate = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
837 yyerrstatus = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
838 yynerrs = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
839 yychar = YYEMPTY; /* Cause a token to be read. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
840
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
841 /* Initialize stack pointers.
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
842 Waste one element of value and location stack
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
843 so that they stay on the same level as the state stack.
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
844 The wasted elements are never initialized. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
845
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
846 yyssp = yyss;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
847 yyvsp = yyvs;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
848
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
849
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
850 goto yysetstate;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
851
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
852 /*------------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
853 | yynewstate -- Push a new state, which is found in yystate. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
854 `------------------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
855 yynewstate:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
856 /* In all cases, when you get here, the value and location stacks
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
857 have just been pushed. so pushing a state here evens the stacks.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
858 */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
859 yyssp++;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
860
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
861 yysetstate:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
862 *yyssp = yystate;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
863
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
864 if (yyss + yystacksize - 1 <= yyssp)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
865 {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
866 /* Get the current used size of the three stacks, in elements. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
867 YYSIZE_T yysize = yyssp - yyss + 1;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
868
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
869 #ifdef yyoverflow
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
870 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
871 /* Give user a chance to reallocate the stack. Use copies of
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
872 these so that the &'s don't force the real ones into
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
873 memory. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
874 YYSTYPE *yyvs1 = yyvs;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
875 short int *yyss1 = yyss;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
876
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
877
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
878 /* Each stack pointer address is followed by the size of the
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
879 data in use in that stack, in bytes. This used to be a
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
880 conditional around just the two extra args, but that might
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
881 be undefined if yyoverflow is a macro. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
882 yyoverflow ("parser stack overflow",
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
883 &yyss1, yysize * sizeof (*yyssp),
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
884 &yyvs1, yysize * sizeof (*yyvsp),
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
885
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
886 &yystacksize);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
887
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
888 yyss = yyss1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
889 yyvs = yyvs1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
890 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
891 #else /* no yyoverflow */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
892 # ifndef YYSTACK_RELOCATE
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
893 goto yyoverflowlab;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
894 # else
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
895 /* Extend the stack our own way. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
896 if (YYMAXDEPTH <= yystacksize)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
897 goto yyoverflowlab;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
898 yystacksize *= 2;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
899 if (YYMAXDEPTH < yystacksize)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
900 yystacksize = YYMAXDEPTH;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
901
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
902 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
903 short int *yyss1 = yyss;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
904 union yyalloc *yyptr =
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
905 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
906 if (! yyptr)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
907 goto yyoverflowlab;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
908 YYSTACK_RELOCATE (yyss);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
909 YYSTACK_RELOCATE (yyvs);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
910
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
911 # undef YYSTACK_RELOCATE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
912 if (yyss1 != yyssa)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
913 YYSTACK_FREE (yyss1);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
914 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
915 # endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
916 #endif /* no yyoverflow */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
917
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
918 yyssp = yyss + yysize - 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
919 yyvsp = yyvs + yysize - 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
920
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
921
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
922 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
923 (unsigned long int) yystacksize));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
924
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
925 if (yyss + yystacksize - 1 <= yyssp)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
926 YYABORT;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
927 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
928
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
929 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
930
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
931 goto yybackup;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
932
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
933 /*-----------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
934 | yybackup. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
935 `-----------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
936 yybackup:
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
937
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
938 /* Do appropriate processing given the current state. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
939 /* Read a lookahead token if we need one and don't already have one. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
940 /* yyresume: */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
941
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
942 /* First try to decide what to do without reference to lookahead token. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
943
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
944 yyn = yypact[yystate];
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
945 if (yyn == YYPACT_NINF)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
946 goto yydefault;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
947
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
948 /* Not known => get a lookahead token if don't already have one. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
949
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
950 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
951 if (yychar == YYEMPTY)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
952 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
953 YYDPRINTF ((stderr, "Reading a token: "));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
954 yychar = YYLEX;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
955 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
956
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
957 if (yychar <= YYEOF)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
958 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
959 yychar = yytoken = YYEOF;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
960 YYDPRINTF ((stderr, "Now at end of input.\n"));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
961 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
962 else
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
963 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
964 yytoken = YYTRANSLATE (yychar);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
965 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
966 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
967
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
968 /* If the proper action on seeing token YYTOKEN is to reduce or to
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
969 detect an error, take that action. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
970 yyn += yytoken;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
971 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
972 goto yydefault;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
973 yyn = yytable[yyn];
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
974 if (yyn <= 0)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
975 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
976 if (yyn == 0 || yyn == YYTABLE_NINF)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
977 goto yyerrlab;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
978 yyn = -yyn;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
979 goto yyreduce;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
980 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
981
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
982 if (yyn == YYFINAL)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
983 YYACCEPT;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
984
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
985 /* Shift the lookahead token. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
986 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
987
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
988 /* Discard the token being shifted unless it is eof. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
989 if (yychar != YYEOF)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
990 yychar = YYEMPTY;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
991
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
992 *++yyvsp = yylval;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
993
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
994
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
995 /* Count tokens shifted since error; after three, turn off error
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
996 status. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
997 if (yyerrstatus)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
998 yyerrstatus--;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
999
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1000 yystate = yyn;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1001 goto yynewstate;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1002
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1003
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1004 /*-----------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1005 | yydefault -- do the default action for the current state. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1006 `-----------------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1007 yydefault:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1008 yyn = yydefact[yystate];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1009 if (yyn == 0)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1010 goto yyerrlab;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1011 goto yyreduce;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1012
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1013
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1014 /*-----------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1015 | yyreduce -- Do a reduction. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1016 `-----------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1017 yyreduce:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1018 /* yyn is the number of a rule to reduce with. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1019 yylen = yyr2[yyn];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1020
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1021 /* If YYLEN is nonzero, implement the default value of the action:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1022 `$$ = $1'.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1023
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1024 Otherwise, the following line sets YYVAL to garbage.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1025 This behavior is undocumented and Bison
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1026 users should not rely upon it. Assigning to YYVAL
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1027 unconditionally makes the parser a bit smaller, and it avoids a
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1028 GCC warning that YYVAL may be used uninitialized. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1029 yyval = yyvsp[1-yylen];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1030
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1031
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1032 YY_REDUCE_PRINT (yyn);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1033 switch (yyn)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1034 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1035 case 5:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1036 #line 83 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1037 { ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1038 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1039
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1040 case 7:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1041 #line 86 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1042 { yyerrok; ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1043 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1044
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1045 case 8:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1046 #line 91 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1047 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1048 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1049 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1050
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1051 case 9:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1052 #line 94 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1053 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1054 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1055 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1056
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1057 case 10:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1058 #line 99 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1059 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1060 char *buf = g_strdup_printf ("c%f:", yyvsp[0].d_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1061 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1062 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1063 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1064 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1065
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1066 case 11:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1067 #line 105 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1068 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1069 char *buf = g_strdup_printf ("l%s:", yyvsp[0].s_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1070 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1071 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1072 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1073 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1074
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1075 case 12:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1076 #line 111 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1077 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1078 char *buf = g_strdup_printf ("s%s:", yyvsp[-2].s_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1079 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1080 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1081 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1082 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1083
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1084 case 13:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1085 #line 117 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1086 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1087 char *buf = g_strdup_printf ("f%s:", yyvsp[-3].s_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1088 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1089 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1090 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1091 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1092
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1093 case 14:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1094 #line 124 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1095 { GENERATE (">"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1096 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1097
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1098 case 15:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1099 #line 126 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1100 { GENERATE ("<"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1101 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1102
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1103 case 16:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1104 #line 129 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1105 { GENERATE ("+"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1106 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1107
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1108 case 17:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1109 #line 131 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1110 { GENERATE ("-"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1111 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1112
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1113 case 18:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1114 #line 133 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1115 { GENERATE ("*"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1116 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1117
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1118 case 19:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1119 #line 135 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1120 { GENERATE ("/"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1121 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1122
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1123 case 20:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1124 #line 137 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1125 { GENERATE ("n"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1126 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1127
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1128 case 21:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1129 #line 139 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1130 { GENERATE ("^"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1131 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1132
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1133 case 22:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1134 #line 141 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1135 { ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1136 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1137
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1138
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1139 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1140
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1141 /* Line 1010 of yacc.c. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1142 #line 1140 "parser.c"
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1143
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1144 yyvsp -= yylen;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1145 yyssp -= yylen;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1146
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1147
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1148 YY_STACK_PRINT (yyss, yyssp);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1149
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1150 *++yyvsp = yyval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1151
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1152
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1153 /* Now `shift' the result of the reduction. Determine what state
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1154 that goes to, based on the state we popped back to and the rule
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1155 number reduced by. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1156
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1157 yyn = yyr1[yyn];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1158
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1159 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1160 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1161 yystate = yytable[yystate];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1162 else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1163 yystate = yydefgoto[yyn - YYNTOKENS];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1164
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1165 goto yynewstate;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1166
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1167
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1168 /*------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1169 | yyerrlab -- here on detecting error |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1170 `------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1171 yyerrlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1172 /* If not already recovering from an error, report this error. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1173 if (!yyerrstatus)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1174 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1175 ++yynerrs;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1176 #if YYERROR_VERBOSE
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1177 yyn = yypact[yystate];
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1178
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1179 if (YYPACT_NINF < yyn && yyn < YYLAST)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1180 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1181 YYSIZE_T yysize = 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1182 int yytype = YYTRANSLATE (yychar);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1183 const char* yyprefix;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1184 char *yymsg;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1185 int yyx;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1186
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1187 /* Start YYX at -YYN if negative to avoid negative indexes in
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1188 YYCHECK. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1189 int yyxbegin = yyn < 0 ? -yyn : 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1190
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1191 /* Stay within bounds of both yycheck and yytname. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1192 int yychecklim = YYLAST - yyn;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1193 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1194 int yycount = 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1195
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1196 yyprefix = ", expecting ";
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1197 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1198 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1199 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1200 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1201 yycount += 1;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1202 if (yycount == 5)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1203 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1204 yysize = 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1205 break;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1206 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1207 }
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1208 yysize += (sizeof ("syntax error, unexpected ")
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1209 + yystrlen (yytname[yytype]));
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1210 yymsg = (char *) YYSTACK_ALLOC (yysize);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1211 if (yymsg != 0)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1212 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1213 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1214 yyp = yystpcpy (yyp, yytname[yytype]);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1215
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1216 if (yycount < 5)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1217 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1218 yyprefix = ", expecting ";
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1219 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1220 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1221 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1222 yyp = yystpcpy (yyp, yyprefix);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1223 yyp = yystpcpy (yyp, yytname[yyx]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1224 yyprefix = " or ";
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1225 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1226 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1227 yyerror (yymsg);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1228 YYSTACK_FREE (yymsg);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1229 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1230 else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1231 yyerror ("syntax error; also virtual memory exhausted");
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1232 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1233 else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1234 #endif /* YYERROR_VERBOSE */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1235 yyerror ("syntax error");
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1236 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1237
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1238
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1239
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1240 if (yyerrstatus == 3)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1241 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1242 /* If just tried and failed to reuse lookahead token after an
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1243 error, discard it. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1244
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1245 if (yychar <= YYEOF)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1246 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1247 /* If at end of input, pop the error token,
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1248 then the rest of the stack, then return failure. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1249 if (yychar == YYEOF)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1250 for (;;)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1251 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1252 YYPOPSTACK;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1253 if (yyssp == yyss)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1254 YYABORT;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1255 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1256 yydestruct (yystos[*yyssp], yyvsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1257 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1258 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1259 else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1260 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1261 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1262 yydestruct (yytoken, &yylval);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1263 yychar = YYEMPTY;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1264
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1265 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1266 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1267
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1268 /* Else will try to reuse lookahead token after shifting the error
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1269 token. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1270 goto yyerrlab1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1271
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1272
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1273 /*---------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1274 | yyerrorlab -- error raised explicitly by YYERROR. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1275 `---------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1276 yyerrorlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1277
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1278 #ifdef __GNUC__
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1279 /* Pacify GCC when the user code never invokes YYERROR and the label
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1280 yyerrorlab therefore never appears in user code. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1281 if (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1282 goto yyerrorlab;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1283 #endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1284
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1285 yyvsp -= yylen;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1286 yyssp -= yylen;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1287 yystate = *yyssp;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1288 goto yyerrlab1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1289
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1290
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1291 /*-------------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1292 | yyerrlab1 -- common code for both syntax error and YYERROR. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1293 `-------------------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1294 yyerrlab1:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1295 yyerrstatus = 3; /* Each real token shifted decrements this. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1296
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1297 for (;;)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1298 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1299 yyn = yypact[yystate];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1300 if (yyn != YYPACT_NINF)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1301 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1302 yyn += YYTERROR;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1303 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1304 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1305 yyn = yytable[yyn];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1306 if (0 < yyn)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1307 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1308 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1309 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1310
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1311 /* Pop the current state because it cannot handle the error token. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1312 if (yyssp == yyss)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1313 YYABORT;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1314
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1315 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1316 yydestruct (yystos[yystate], yyvsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1317 YYPOPSTACK;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1318 yystate = *yyssp;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1319 YY_STACK_PRINT (yyss, yyssp);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1320 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1321
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1322 if (yyn == YYFINAL)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1323 YYACCEPT;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1324
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1325 YYDPRINTF ((stderr, "Shifting error token, "));
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1326
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1327 *++yyvsp = yylval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1328
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1329
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1330 yystate = yyn;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1331 goto yynewstate;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1332
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1333
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1334 /*-------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1335 | yyacceptlab -- YYACCEPT comes here. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1336 `-------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1337 yyacceptlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1338 yyresult = 0;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1339 goto yyreturn;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1340
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1341 /*-----------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1342 | yyabortlab -- YYABORT comes here. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1343 `-----------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1344 yyabortlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1345 yyresult = 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1346 goto yyreturn;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1347
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1348 #ifndef yyoverflow
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1349 /*----------------------------------------------.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1350 | yyoverflowlab -- parser overflow comes here. |
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1351 `----------------------------------------------*/
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1352 yyoverflowlab:
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1353 yyerror ("parser stack overflow");
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1354 yyresult = 2;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1355 /* Fall through. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1356 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1357
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1358 yyreturn:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1359 #ifndef yyoverflow
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1360 if (yyss != yyssa)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1361 YYSTACK_FREE (yyss);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1362 #endif
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1363 return yyresult;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1364 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1365
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1366
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1367 #line 144 "parser.y"
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1368
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1369 /* End of grammar */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1370
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1371 /* Called by yyparse on error. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1372 int yyerror (char *s) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1373 /* Ignore errors, just print a warning. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1374 g_warning ("%s\n", s);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1375 return 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1376 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1377
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1378 int yylex (YYSTYPE *yylval, void *yyparam) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1379 int c;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1380 parser_control *pc = (parser_control *) yyparam;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1381
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1382 /* Ignore whitespace, get first nonwhite character. */
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1383 while ((c = aud_vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n');
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1384
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1385 /* End of input ? */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1386 if (c == EOF)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1387 return 0;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1388
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1389 /* Char starts a number => parse the number. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1390 if (isdigit (c)) {
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1391 aud_vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1392 {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1393 char *old_locale, *saved_locale;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1394
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1395 old_locale = setlocale (LC_ALL, NULL);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1396 saved_locale = g_strdup (old_locale);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1397 setlocale (LC_ALL, "C");
2321
6b427677621f killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents: 1978
diff changeset
1398 sscanf ((const char*)((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1399
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1400 while (isdigit(c) || c == '.')
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1401 {
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1402 c = aud_vfs_getc(pc->input);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1403 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1404
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1405 aud_vfs_fseek(pc->input, -1, SEEK_CUR);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1406
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1407 setlocale (LC_ALL, saved_locale);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1408 g_free (saved_locale);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1409 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1410 return NUMBER;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1411 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1412
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1413 /* Char starts an identifier => read the name. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1414 if (isalpha (c)) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1415 GString *sym_name;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1416
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1417 sym_name = g_string_new (NULL);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1418
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1419 do {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1420 sym_name = g_string_append_c (sym_name, c);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1421
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1422 /* Get another character. */
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1423 c = aud_vfs_getc (pc->input);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1424 } while (c != EOF && isalnum (c));
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1425
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1426 aud_vfs_fseek (pc->input, -1, SEEK_CUR);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1427
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1428 yylval->s_value = sym_name->str;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1429
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1430 g_string_free (sym_name, FALSE);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1431
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1432 return NAME;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1433 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1434
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1435 /* Any other character is a token by itself. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1436 return c;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1437 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1438
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1439 static int load_name (char *str, char **name) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1440 int count = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1441 GString *new = g_string_new (NULL);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1442
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1443 while (*str != 0 && *str != ':') {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1444 g_string_append_c (new, *str++);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1445 count++;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1446 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1447
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1448 *name = new->str;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1449 g_string_free (new, FALSE);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1450
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1451 return count;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1452 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1453
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1454 static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict,
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1455 char *str) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1456 char op;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1457 double dval;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1458 int i;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1459 char *name;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1460
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1461 while ((op = *str++)) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1462 switch (op) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1463 case 'c': /* A constant. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1464 store_byte (expr, 'c');
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1465 sscanf (str, "%lf%n", &dval, &i);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1466 str += i;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1467 store_double (expr, dval);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1468 str++; /* Skip ';' */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1469 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1470
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1471 case 'f': /* A function call. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1472 store_byte (expr, 'f');
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1473 str += load_name (str, &name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1474 i = function_lookup (name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1475 if (i < 0) return FALSE; /* Fail on error. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1476 store_int (expr, i);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1477 g_free (name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1478 str++; /* Skip ';' */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1479 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1480
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1481 case 'l': /* Load a variable. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1482 case 's': /* Store a variable. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1483 store_byte (expr, op);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1484 str += load_name (str, &name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1485 i = dict_lookup (dict, name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1486 store_int (expr, i);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1487 g_free (name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1488 str++; /* Skip ';' */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1489 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1490
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1491 default: /* Copy verbatim. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1492 store_byte (expr, op);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1493 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1494 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1495 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1496
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1497 return TRUE;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1498 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1499
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1500 expression_t *expr_compile_string (const char* str, symbol_dict_t *dict)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1501 {
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1502 parser_control pc;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1503 VFSFile *stream;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1504
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1505 g_return_val_if_fail(str != NULL && dict != NULL, NULL);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1506
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1507 stream = aud_vfs_buffer_new_from_string ( (char *) str );
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1508
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1509 pc.input = stream;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1510 pc.expr = expr_new ();
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1511 pc.dict = dict;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1512
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1513 if (yyparse (&pc) != 0) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1514 /* Check for error. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1515 expr_free (pc.expr);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1516 pc.expr = NULL;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1517 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1518
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1519 aud_vfs_fclose (stream);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1520
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1521 return pc.expr;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1522 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1523
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1524