annotate src/paranormal/libcalc/parser.c @ 1978:fa9f85cebade

s/vfs_/aud_vfs_/g
author William Pitcock <nenolod@atheme.org>
date Sun, 07 Oct 2007 00:25:33 -0500
parents 17311560f45f
children 6b427677621f
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
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
18 Foundation, Inc., 59 Temple Place - Suite 330,
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
19 Boston, MA 02111-1307, 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
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
492 # define YYLEX yylex (&yylval, YYLEX_PARAM)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
493 #else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
494 # define YYLEX yylex (&yylval)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
495 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
496
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
497 /* Enable debugging if requested. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
498 #if YYDEBUG
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
499
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
500 # ifndef YYFPRINTF
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
501 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
502 # define YYFPRINTF fprintf
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
503 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
504
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
505 # define YYDPRINTF(Args) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
506 do { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
507 if (yydebug) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
508 YYFPRINTF Args; \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
509 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
510
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
511 # define YYDSYMPRINT(Args) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
512 do { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
513 if (yydebug) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
514 yysymprint Args; \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
515 } while (0)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
516
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
517 # define YYDSYMPRINTF(Title, Token, Value, Location) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
518 do { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
519 if (yydebug) \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
520 { \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
521 YYFPRINTF (stderr, "%s ", Title); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
522 yysymprint (stderr, \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
523 Token, Value); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
524 YYFPRINTF (stderr, "\n"); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
525 } \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
526 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
527
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
528 /*------------------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
529 | 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
530 | TOP (included). |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
531 `------------------------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
532
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
533 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
534 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
535 yy_stack_print (short int *bottom, short int *top)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
536 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
537 static void
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
538 yy_stack_print (bottom, top)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
539 short int *bottom;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
540 short int *top;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
541 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
542 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
543 YYFPRINTF (stderr, "Stack now");
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
544 for (/* Nothing. */; bottom <= top; ++bottom)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
545 YYFPRINTF (stderr, " %d", *bottom);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
546 YYFPRINTF (stderr, "\n");
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
547 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
548
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
549 # define YY_STACK_PRINT(Bottom, Top) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
550 do { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
551 if (yydebug) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
552 yy_stack_print ((Bottom), (Top)); \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
553 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
554
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
555
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 | Report that the YYRULE is going to be reduced. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
558 `------------------------------------------------*/
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
559
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
560 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
561 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
562 yy_reduce_print (int yyrule)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
563 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
564 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
565 yy_reduce_print (yyrule)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
566 int yyrule;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
567 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
568 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
569 int yyi;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
570 unsigned int yylno = yyrline[yyrule];
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
571 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
572 yyrule - 1, yylno);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
573 /* Print the symbols being reduced, and their result. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
574 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
575 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
576 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
577 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
578
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
579 # define YY_REDUCE_PRINT(Rule) \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
580 do { \
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
581 if (yydebug) \
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
582 yy_reduce_print (Rule); \
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
583 } while (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
584
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
585 /* Nonzero means print parse trace. It is left uninitialized so that
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
586 multiple parsers can coexist. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
587 int yydebug;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
588 #else /* !YYDEBUG */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
589 # define YYDPRINTF(Args)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
590 # define YYDSYMPRINT(Args)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
591 # define YYDSYMPRINTF(Title, Token, Value, Location)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
592 # define YY_STACK_PRINT(Bottom, Top)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
593 # define YY_REDUCE_PRINT(Rule)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
594 #endif /* !YYDEBUG */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
595
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
596
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
597 /* YYINITDEPTH -- initial size of the parser's stacks. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
598 #ifndef YYINITDEPTH
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
599 # define YYINITDEPTH 200
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
600 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
601
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
602 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
603 if the built-in stack extension method is used).
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
604
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
605 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
606 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
607 evaluated with infinite-precision integer arithmetic. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
608
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
609 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
610 # undef YYMAXDEPTH
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
611 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
612
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
613 #ifndef YYMAXDEPTH
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
614 # define YYMAXDEPTH 10000
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
615 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
616
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
617
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
618
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
619 #if YYERROR_VERBOSE
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 # ifndef yystrlen
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
622 # if defined (__GLIBC__) && defined (_STRING_H)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
623 # define yystrlen strlen
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
624 # else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
625 /* Return the length of YYSTR. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
626 static YYSIZE_T
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
627 # if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
628 yystrlen (const char *yystr)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
629 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
630 yystrlen (yystr)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
631 const char *yystr;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
632 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
633 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
634 register const char *yys = yystr;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
635
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
636 while (*yys++ != '\0')
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
637 continue;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
638
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
639 return yys - yystr - 1;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
640 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
641 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
642 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
643
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
644 # ifndef yystpcpy
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
645 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
646 # define yystpcpy stpcpy
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
647 # else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
648 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
649 YYDEST. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
650 static char *
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
651 # if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
652 yystpcpy (char *yydest, const char *yysrc)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
653 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
654 yystpcpy (yydest, yysrc)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
655 char *yydest;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
656 const char *yysrc;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
657 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
658 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
659 register char *yyd = yydest;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
660 register const char *yys = yysrc;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
661
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
662 while ((*yyd++ = *yys++) != '\0')
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
663 continue;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
664
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
665 return yyd - 1;
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 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
668 # endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
669
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
670 #endif /* !YYERROR_VERBOSE */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
671
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
672
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
673
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
674 #if YYDEBUG
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
675 /*--------------------------------.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
676 | Print this symbol on YYOUTPUT. |
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
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
679 #if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
680 static void
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
681 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
682 #else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
683 static void
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
684 yysymprint (yyoutput, yytype, yyvaluep)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
685 FILE *yyoutput;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
686 int yytype;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
687 YYSTYPE *yyvaluep;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
688 #endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
689 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
690 /* Pacify ``unused variable'' warnings. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
691 (void) yyvaluep;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
692
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
693 if (yytype < YYNTOKENS)
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 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
696 # ifdef YYPRINT
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
697 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
698 # endif
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
699 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
700 else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
701 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
702
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
703 switch (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 default:
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
706 break;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
707 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
708 YYFPRINTF (yyoutput, ")");
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
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
711 #endif /* ! YYDEBUG */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
712 /*-----------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
713 | Release the memory associated to this symbol. |
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
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
716 #if defined (__STDC__) || defined (__cplusplus)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
717 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
718 yydestruct (int yytype, YYSTYPE *yyvaluep)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
719 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
720 static void
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
721 yydestruct (yytype, yyvaluep)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
722 int yytype;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
723 YYSTYPE *yyvaluep;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
724 #endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
725 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
726 /* Pacify ``unused variable'' warnings. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
727 (void) yyvaluep;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
728
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
729 switch (yytype)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
730 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
731
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
732 default:
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
733 break;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
734 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
735 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
736
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
737
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
738 /* Prevent warnings from -Wmissing-prototypes. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
739
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
740 #ifdef YYPARSE_PARAM
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
741 # if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
742 int yyparse (void *YYPARSE_PARAM);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
743 # else
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
744 int yyparse ();
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
745 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
746 #else /* ! YYPARSE_PARAM */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
747 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
748 int yyparse (void);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
749 #else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
750 int yyparse ();
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
751 #endif
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
752 #endif /* ! YYPARSE_PARAM */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
753
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
754
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
755
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
756
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
757
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
758
295
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 | yyparse. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
761 `----------*/
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
762
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
763 #ifdef YYPARSE_PARAM
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
764 # if defined (__STDC__) || defined (__cplusplus)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
765 int yyparse (void *YYPARSE_PARAM)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
766 # else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
767 int yyparse (YYPARSE_PARAM)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
768 void *YYPARSE_PARAM;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
769 # endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
770 #else /* ! YYPARSE_PARAM */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
771 #if defined (__STDC__) || defined (__cplusplus)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
772 int
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
773 yyparse (void)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
774 #else
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 ()
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
777
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
778 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
779 #endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
780 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
781 /* The lookahead symbol. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
782 int yychar;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
783
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
784 /* The semantic value of the lookahead symbol. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
785 YYSTYPE yylval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
786
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
787 /* Number of syntax errors so far. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
788 int yynerrs;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
789
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
790 register int yystate;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
791 register int yyn;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
792 int yyresult;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
793 /* Number of tokens to shift before error messages enabled. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
794 int yyerrstatus;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
795 /* Lookahead token as an internal (translated) token number. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
796 int yytoken = 0;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
797
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
798 /* Three stacks and their tools:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
799 `yyss': related to states,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
800 `yyvs': related to semantic values,
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
801 `yyls': related to locations.
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
802
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
803 Refer to the stacks thru separate pointers, to allow yyoverflow
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
804 to reallocate them elsewhere. */
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 /* The state stack. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
807 short int yyssa[YYINITDEPTH];
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
808 short int *yyss = yyssa;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
809 register short int *yyssp;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
810
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
811 /* The semantic value stack. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
812 YYSTYPE yyvsa[YYINITDEPTH];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
813 YYSTYPE *yyvs = yyvsa;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
814 register YYSTYPE *yyvsp;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
815
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
816
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
817
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
818 #define YYPOPSTACK (yyvsp--, yyssp--)
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 YYSIZE_T yystacksize = YYINITDEPTH;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
821
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
822 /* The variables used to return semantic value and location from the
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
823 action routines. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
824 YYSTYPE yyval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
825
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
826
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
827 /* 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
828 rule. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
829 int yylen;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
830
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
831 YYDPRINTF ((stderr, "Starting parse\n"));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
832
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
833 yystate = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
834 yyerrstatus = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
835 yynerrs = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
836 yychar = YYEMPTY; /* Cause a token to be read. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
837
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
838 /* Initialize stack pointers.
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
839 Waste one element of value and location stack
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
840 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
841 The wasted elements are never initialized. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
842
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
843 yyssp = yyss;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
844 yyvsp = yyvs;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
845
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
846
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
847 goto yysetstate;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
848
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
849 /*------------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
850 | yynewstate -- Push a new state, which is found in yystate. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
851 `------------------------------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
852 yynewstate:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
853 /* 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
854 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
855 */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
856 yyssp++;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
857
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
858 yysetstate:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
859 *yyssp = yystate;
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 if (yyss + yystacksize - 1 <= yyssp)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
862 {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
863 /* Get the current used size of the three stacks, in elements. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
864 YYSIZE_T yysize = yyssp - yyss + 1;
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 #ifdef yyoverflow
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
867 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
868 /* Give user a chance to reallocate the stack. Use copies of
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
869 these so that the &'s don't force the real ones into
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
870 memory. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
871 YYSTYPE *yyvs1 = yyvs;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
872 short int *yyss1 = yyss;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
873
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
874
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
875 /* Each stack pointer address is followed by the size of the
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
876 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
877 conditional around just the two extra args, but that might
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
878 be undefined if yyoverflow is a macro. */
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
879 yyoverflow ("parser stack overflow",
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
880 &yyss1, yysize * sizeof (*yyssp),
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
881 &yyvs1, yysize * sizeof (*yyvsp),
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
882
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
883 &yystacksize);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
884
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
885 yyss = yyss1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
886 yyvs = yyvs1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
887 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
888 #else /* no yyoverflow */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
889 # ifndef YYSTACK_RELOCATE
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
890 goto yyoverflowlab;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
891 # else
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
892 /* Extend the stack our own way. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
893 if (YYMAXDEPTH <= yystacksize)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
894 goto yyoverflowlab;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
895 yystacksize *= 2;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
896 if (YYMAXDEPTH < yystacksize)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
897 yystacksize = YYMAXDEPTH;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
898
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
899 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
900 short int *yyss1 = yyss;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
901 union yyalloc *yyptr =
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
902 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
903 if (! yyptr)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
904 goto yyoverflowlab;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
905 YYSTACK_RELOCATE (yyss);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
906 YYSTACK_RELOCATE (yyvs);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
907
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
908 # undef YYSTACK_RELOCATE
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
909 if (yyss1 != yyssa)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
910 YYSTACK_FREE (yyss1);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
911 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
912 # endif
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
913 #endif /* no yyoverflow */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
914
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
915 yyssp = yyss + yysize - 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
916 yyvsp = yyvs + yysize - 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
917
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
918
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
919 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
920 (unsigned long int) yystacksize));
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 if (yyss + yystacksize - 1 <= yyssp)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
923 YYABORT;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
924 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
925
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
926 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
282
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 goto yybackup;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
929
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
930 /*-----------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
931 | yybackup. |
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 yybackup:
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
934
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
935 /* Do appropriate processing given the current state. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
936 /* 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
937 /* yyresume: */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
938
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
939 /* 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
940
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
941 yyn = yypact[yystate];
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
942 if (yyn == YYPACT_NINF)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
943 goto yydefault;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
944
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
945 /* 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
946
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
947 /* 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
948 if (yychar == YYEMPTY)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
949 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
950 YYDPRINTF ((stderr, "Reading a token: "));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
951 yychar = YYLEX;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
952 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
953
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
954 if (yychar <= YYEOF)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
955 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
956 yychar = yytoken = YYEOF;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
957 YYDPRINTF ((stderr, "Now at end of input.\n"));
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
958 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
959 else
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
960 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
961 yytoken = YYTRANSLATE (yychar);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
962 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
963 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
964
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
965 /* 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
966 detect an error, take that action. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
967 yyn += yytoken;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
968 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
969 goto yydefault;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
970 yyn = yytable[yyn];
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
971 if (yyn <= 0)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
972 {
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
973 if (yyn == 0 || yyn == YYTABLE_NINF)
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
974 goto yyerrlab;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
975 yyn = -yyn;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
976 goto yyreduce;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
977 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
978
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
979 if (yyn == YYFINAL)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
980 YYACCEPT;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
981
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
982 /* Shift the lookahead token. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
983 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
984
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
985 /* 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
986 if (yychar != YYEOF)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
987 yychar = YYEMPTY;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
988
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
989 *++yyvsp = yylval;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
990
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
991
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
992 /* Count tokens shifted since error; after three, turn off error
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
993 status. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
994 if (yyerrstatus)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
995 yyerrstatus--;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
996
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
997 yystate = yyn;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
998 goto yynewstate;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
999
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1000
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1001 /*-----------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1002 | yydefault -- do the default action for the current state. |
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 yydefault:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1005 yyn = yydefact[yystate];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1006 if (yyn == 0)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1007 goto yyerrlab;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1008 goto yyreduce;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1009
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1010
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1011 /*-----------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1012 | yyreduce -- Do a reduction. |
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 yyreduce:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1015 /* yyn is the number of a rule to reduce with. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1016 yylen = yyr2[yyn];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1017
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1018 /* If YYLEN is nonzero, implement the default value of the action:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1019 `$$ = $1'.
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 Otherwise, the following line sets YYVAL to garbage.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1022 This behavior is undocumented and Bison
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1023 users should not rely upon it. Assigning to YYVAL
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1024 unconditionally makes the parser a bit smaller, and it avoids a
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1025 GCC warning that YYVAL may be used uninitialized. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1026 yyval = yyvsp[1-yylen];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1027
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1028
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1029 YY_REDUCE_PRINT (yyn);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1030 switch (yyn)
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 case 5:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1033 #line 83 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1034 { ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1035 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1036
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1037 case 7:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1038 #line 86 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1039 { yyerrok; ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1040 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1041
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1042 case 8:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1043 #line 91 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1044 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1045 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1046 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1047
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1048 case 9:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1049 #line 94 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1050 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1051 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1052 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1053
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1054 case 10:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1055 #line 99 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1056 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1057 char *buf = g_strdup_printf ("c%f:", yyvsp[0].d_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1058 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1059 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1060 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1061 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1062
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1063 case 11:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1064 #line 105 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1065 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1066 char *buf = g_strdup_printf ("l%s:", yyvsp[0].s_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1067 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1068 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1069 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1070 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1071
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1072 case 12:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1073 #line 111 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1074 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1075 char *buf = g_strdup_printf ("s%s:", yyvsp[-2].s_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1076 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1077 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1078 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1079 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1080
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1081 case 13:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1082 #line 117 "parser.y"
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1083 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1084 char *buf = g_strdup_printf ("f%s:", yyvsp[-3].s_value);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1085 GENERATE (buf);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1086 g_free (buf);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1087 ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1088 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1089
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1090 case 14:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1091 #line 124 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1092 { GENERATE (">"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1093 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1094
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1095 case 15:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1096 #line 126 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1097 { GENERATE ("<"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1098 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1099
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1100 case 16:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1101 #line 129 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1102 { GENERATE ("+"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1103 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1104
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1105 case 17:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1106 #line 131 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1107 { GENERATE ("-"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1108 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1109
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1110 case 18:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1111 #line 133 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1112 { GENERATE ("*"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1113 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1114
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1115 case 19:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1116 #line 135 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1117 { GENERATE ("/"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1118 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1119
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1120 case 20:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1121 #line 137 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1122 { GENERATE ("n"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1123 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1124
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1125 case 21:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1126 #line 139 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1127 { GENERATE ("^"); ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1128 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1129
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1130 case 22:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1131 #line 141 "parser.y"
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1132 { ;}
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1133 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1134
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1135
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1136 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1137
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1138 /* Line 1010 of yacc.c. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1139 #line 1140 "parser.c"
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1140
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1141 yyvsp -= yylen;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1142 yyssp -= yylen;
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
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1145 YY_STACK_PRINT (yyss, yyssp);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1146
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1147 *++yyvsp = yyval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1148
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 /* Now `shift' the result of the reduction. Determine what state
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1151 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
1152 number reduced by. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1153
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1154 yyn = yyr1[yyn];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1155
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1156 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1157 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1158 yystate = yytable[yystate];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1159 else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1160 yystate = yydefgoto[yyn - YYNTOKENS];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1161
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1162 goto yynewstate;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1163
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 /*------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1166 | yyerrlab -- here on detecting error |
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 yyerrlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1169 /* If not already recovering from an error, report this error. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1170 if (!yyerrstatus)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1171 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1172 ++yynerrs;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1173 #if YYERROR_VERBOSE
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1174 yyn = yypact[yystate];
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1175
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1176 if (YYPACT_NINF < yyn && yyn < YYLAST)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1177 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1178 YYSIZE_T yysize = 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1179 int yytype = YYTRANSLATE (yychar);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1180 const char* yyprefix;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1181 char *yymsg;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1182 int yyx;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1183
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1184 /* 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
1185 YYCHECK. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1186 int yyxbegin = yyn < 0 ? -yyn : 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1187
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1188 /* Stay within bounds of both yycheck and yytname. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1189 int yychecklim = YYLAST - yyn;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1190 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1191 int yycount = 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1192
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1193 yyprefix = ", expecting ";
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1194 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1195 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1196 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1197 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1198 yycount += 1;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1199 if (yycount == 5)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1200 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1201 yysize = 0;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1202 break;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1203 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1204 }
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1205 yysize += (sizeof ("syntax error, unexpected ")
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1206 + yystrlen (yytname[yytype]));
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1207 yymsg = (char *) YYSTACK_ALLOC (yysize);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1208 if (yymsg != 0)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1209 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1210 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1211 yyp = yystpcpy (yyp, yytname[yytype]);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1212
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1213 if (yycount < 5)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1214 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1215 yyprefix = ", expecting ";
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1216 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1217 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1218 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1219 yyp = yystpcpy (yyp, yyprefix);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1220 yyp = yystpcpy (yyp, yytname[yyx]);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1221 yyprefix = " or ";
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1222 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1223 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1224 yyerror (yymsg);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1225 YYSTACK_FREE (yymsg);
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 else
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1228 yyerror ("syntax error; also virtual memory exhausted");
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 #endif /* YYERROR_VERBOSE */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1232 yyerror ("syntax error");
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1233 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1234
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1235
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1236
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1237 if (yyerrstatus == 3)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1238 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1239 /* If just tried and failed to reuse lookahead token after an
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1240 error, discard it. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1241
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1242 if (yychar <= YYEOF)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1243 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1244 /* 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
1245 then the rest of the stack, then return failure. */
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1246 if (yychar == YYEOF)
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1247 for (;;)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1248 {
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1249 YYPOPSTACK;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1250 if (yyssp == yyss)
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1251 YYABORT;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1252 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1253 yydestruct (yystos[*yyssp], yyvsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1254 }
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1255 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1256 else
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1257 {
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1258 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1259 yydestruct (yytoken, &yylval);
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1260 yychar = YYEMPTY;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1261
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1262 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1263 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1264
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1265 /* Else will try to reuse lookahead token after shifting the error
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1266 token. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1267 goto yyerrlab1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1268
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1269
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1270 /*---------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1271 | yyerrorlab -- error raised explicitly by YYERROR. |
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 yyerrorlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1274
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1275 #ifdef __GNUC__
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1276 /* 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
1277 yyerrorlab therefore never appears in user code. */
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1278 if (0)
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1279 goto yyerrorlab;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1280 #endif
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1281
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1282 yyvsp -= yylen;
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1283 yyssp -= yylen;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1284 yystate = *yyssp;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1285 goto yyerrlab1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1286
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1287
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1288 /*-------------------------------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1289 | yyerrlab1 -- common code for both syntax error and YYERROR. |
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 yyerrlab1:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1292 yyerrstatus = 3; /* Each real token shifted decrements this. */
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 for (;;)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1295 {
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1296 yyn = yypact[yystate];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1297 if (yyn != YYPACT_NINF)
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 += YYTERROR;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1300 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
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 = yytable[yyn];
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1303 if (0 < yyn)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1304 break;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1305 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1306 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1307
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1308 /* Pop the current state because it cannot handle the error token. */
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1309 if (yyssp == yyss)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1310 YYABORT;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1311
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1312 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1313 yydestruct (yystos[yystate], yyvsp);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1314 YYPOPSTACK;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1315 yystate = *yyssp;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1316 YY_STACK_PRINT (yyss, yyssp);
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1317 }
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1318
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1319 if (yyn == YYFINAL)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1320 YYACCEPT;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1321
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1322 YYDPRINTF ((stderr, "Shifting error token, "));
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1323
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1324 *++yyvsp = yylval;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1325
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1326
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1327 yystate = yyn;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1328 goto yynewstate;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1329
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1330
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1331 /*-------------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1332 | yyacceptlab -- YYACCEPT comes here. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1333 `-------------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1334 yyacceptlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1335 yyresult = 0;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1336 goto yyreturn;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1337
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1338 /*-----------------------------------.
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1339 | yyabortlab -- YYABORT comes here. |
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1340 `-----------------------------------*/
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1341 yyabortlab:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1342 yyresult = 1;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1343 goto yyreturn;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1344
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1345 #ifndef yyoverflow
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1346 /*----------------------------------------------.
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1347 | yyoverflowlab -- parser overflow comes here. |
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1348 `----------------------------------------------*/
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1349 yyoverflowlab:
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1350 yyerror ("parser stack overflow");
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1351 yyresult = 2;
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1352 /* Fall through. */
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1353 #endif
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1354
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1355 yyreturn:
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1356 #ifndef yyoverflow
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1357 if (yyss != yyssa)
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1358 YYSTACK_FREE (yyss);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1359 #endif
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1360 return yyresult;
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1361 }
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1362
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1363
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1364 #line 144 "parser.y"
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 /* End of grammar */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1367
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1368 /* Called by yyparse on error. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1369 int yyerror (char *s) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1370 /* Ignore errors, just print a warning. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1371 g_warning ("%s\n", s);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1372 return 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1373 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1374
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1375 int yylex (YYSTYPE *yylval, void *yyparam) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1376 int c;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1377 parser_control *pc = (parser_control *) yyparam;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1378
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1379 /* Ignore whitespace, get first nonwhite character. */
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1380 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
1381
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1382 /* End of input ? */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1383 if (c == EOF)
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1384 return 0;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1385
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1386 /* Char starts a number => parse the number. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1387 if (isdigit (c)) {
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1388 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
1389 {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1390 char *old_locale, *saved_locale;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1391
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1392 old_locale = setlocale (LC_ALL, NULL);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1393 saved_locale = g_strdup (old_locale);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1394 setlocale (LC_ALL, "C");
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1395 sscanf (((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value);
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1396
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1397 while (isdigit(c) || c == '.')
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1398 {
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1399 c = aud_vfs_getc(pc->input);
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1400 }
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 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
1403
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1404 setlocale (LC_ALL, saved_locale);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1405 g_free (saved_locale);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1406 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1407 return NUMBER;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1408 }
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 /* Char starts an identifier => read the name. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1411 if (isalpha (c)) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1412 GString *sym_name;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1413
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1414 sym_name = g_string_new (NULL);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1415
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1416 do {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1417 sym_name = g_string_append_c (sym_name, c);
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 /* Get another character. */
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1420 c = aud_vfs_getc (pc->input);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1421 } while (c != EOF && isalnum (c));
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1422
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1423 aud_vfs_fseek (pc->input, -1, SEEK_CUR);
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1424
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1425 yylval->s_value = sym_name->str;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1426
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1427 g_string_free (sym_name, FALSE);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1428
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1429 return NAME;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1430 }
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 /* Any other character is a token by itself. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1433 return c;
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
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1436 static int load_name (char *str, char **name) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1437 int count = 0;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1438 GString *new = g_string_new (NULL);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1439
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1440 while (*str != 0 && *str != ':') {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1441 g_string_append_c (new, *str++);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1442 count++;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1443 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1444
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1445 *name = new->str;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1446 g_string_free (new, FALSE);
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 return count;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1449 }
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 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
1452 char *str) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1453 char op;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1454 double dval;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1455 int i;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1456 char *name;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1457
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1458 while ((op = *str++)) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1459 switch (op) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1460 case 'c': /* A constant. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1461 store_byte (expr, 'c');
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1462 sscanf (str, "%lf%n", &dval, &i);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1463 str += i;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1464 store_double (expr, dval);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1465 str++; /* Skip ';' */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1466 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1467
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1468 case 'f': /* A function call. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1469 store_byte (expr, 'f');
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1470 str += load_name (str, &name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1471 i = function_lookup (name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1472 if (i < 0) return FALSE; /* Fail on error. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1473 store_int (expr, i);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1474 g_free (name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1475 str++; /* Skip ';' */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1476 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1477
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1478 case 'l': /* Load a variable. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1479 case 's': /* Store a variable. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1480 store_byte (expr, op);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1481 str += load_name (str, &name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1482 i = dict_lookup (dict, name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1483 store_int (expr, i);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1484 g_free (name);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1485 str++; /* Skip ';' */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1486 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1487
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1488 default: /* Copy verbatim. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1489 store_byte (expr, op);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1490 break;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1491 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1492 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1493
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1494 return TRUE;
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
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1497 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
1498 {
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1499 parser_control pc;
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1500 VFSFile *stream;
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1501
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1502 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
1503
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1504 stream = aud_vfs_buffer_new_from_string ( (char *) str );
282
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1505
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1506 pc.input = stream;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1507 pc.expr = expr_new ();
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1508 pc.dict = dict;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1509
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1510 if (yyparse (&pc) != 0) {
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1511 /* Check for error. */
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1512 expr_free (pc.expr);
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1513 pc.expr = NULL;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1514 }
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1515
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 342
diff changeset
1516 aud_vfs_fclose (stream);
282
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 return pc.expr;
3e160f6c04d2 [svn] - add libcalc from xvs and link to build
nenolod
parents:
diff changeset
1519 }
295
795d83dcfdb7 [svn] - modify parser.y for warnings
yaz
parents: 282
diff changeset
1520
342
17311560f45f [svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents: 295
diff changeset
1521