Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 223 lines (191 sloc) 5.83 kb
2a905e4 include y.tab.h
Kyle Maxwell authored
1 /* A Bison parser, made by GNU Bison 2.3. */
2
3 /* Skeleton interface for Bison GLR parsers in C
4
5 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
21
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35 /* Tokens. */
36 #ifndef YYTOKENTYPE
37 # define YYTOKENTYPE
38 /* Put the tokens into the symbol table, so that GDB and other debuggers
39 know about them. */
40 enum yytokentype {
41 NUMBER = 258,
42 S = 259,
43 AT = 260,
44 LPAREN = 261,
45 RPAREN = 262,
46 PIPE = 263,
47 LT = 264,
48 SLASH = 265,
49 DBLSLASH = 266,
50 BANG = 267,
51 COLON = 268,
52 DBLCOLON = 269,
53 QUERY = 270,
54 HASH = 271,
55 COMMA = 272,
56 DOT = 273,
57 DBLDOT = 274,
58 GT = 275,
59 LBRA = 276,
60 RBRA = 277,
61 TILDE = 278,
62 SPLAT = 279,
63 PLUS = 280,
64 DASH = 281,
65 EQ = 282,
66 LTE = 283,
67 GTE = 284,
68 DOLLAR = 285,
69 BSLASHLIT = 286,
70 OTHER = 287,
71 XANCESTOR = 288,
72 XANCESTORSELF = 289,
73 XATTR = 290,
74 XCHILD = 291,
75 XDESC = 292,
76 XDESCSELF = 293,
77 XFOLLOW = 294,
78 XFOLLOWSIB = 295,
79 XNS = 296,
80 XPARENT = 297,
81 XPRE = 298,
82 XPRESIB = 299,
83 XSELF = 300,
84 XOR = 301,
85 XAND = 302,
86 XDIV = 303,
87 XMOD = 304,
88 XCOMMENT = 305,
89 XTEXT = 306,
90 XPI = 307,
91 XNODE = 308,
92 CXEQUATION = 309,
93 CXOPHE = 310,
94 CXOPNE = 311,
95 CXOPSTARTEQ = 312,
96 CXOPENDEQ = 313,
97 CXOPCONTAINS = 314,
98 CXOPCONTAINS2 = 315,
99 CXFIRST = 316,
100 CXLAST = 317,
101 CXNOT = 318,
102 CXEVEN = 319,
103 CXODD = 320,
104 CXEQ = 321,
105 CXGT = 322,
106 CXLT = 323,
107 CXHEADER = 324,
108 CXCONTAINS = 325,
109 CXEMPTY = 326,
110 CXHAS = 327,
111 CXPARENT = 328,
112 CXNTHCH = 329,
113 CXNTHLASTCH = 330,
114 CXNTHTYPE = 331,
115 CXNTHLASTTYPE = 332,
116 CXFIRSTCH = 333,
117 CXLASTCH = 334,
118 CXFIRSTTYPE = 335,
119 CXLASTTYPE = 336,
120 CXONLYCH = 337,
121 CXONLYTYPE = 338,
122 CXINPUT = 339,
123 CXTEXT = 340,
124 CXPASSWORD = 341,
125 CXRADIO = 342,
126 CXCHECKBOX = 343,
127 CXSUBMIT = 344,
128 CXIMAGE = 345,
129 CXRESET = 346,
130 CXBUTTON = 347,
131 CXFILE = 348,
132 CXENABLED = 349,
133 CXDISABLED = 350,
134 CXCHECKED = 351,
135 CXSELECTED = 352,
136 NAME = 353,
137 STRING = 354
138 };
139 #endif
140
141
142 /* Copy the first part of user declarations. */
143 #line 1 "parser.y"
144
145 #include <math.h>
146 #include <stdio.h>
147 #include <stdlib.h>
148 #include <string.h>
e22f309 cleaned up parser.y warnings
Kyle Maxwell authored
149 #include "parsed_xpath.h"
2a905e4 include y.tab.h
Kyle Maxwell authored
150 #include <libxml/hash.h>
151
152 #ifndef PARSER_Y_H_INCLUDED
153 #define PARSER_Y_H_INCLUDED
154
4e5efd0 WIP, tentative reworking of parser
Kyle Maxwell authored
155 static pxpathPtr parsed_answer;
2a905e4 include y.tab.h
Kyle Maxwell authored
156
157 int yylex (void);
158 void yyerror (char const *);
159
160 void prepare_parse(char*);
161 void cleanup_parse(void);
162 void start_debugging(void);
163
164 static xmlHashTablePtr alias_hash;
165
166 char* xpath_alias(char*);
167 void init_xpath_alias();
168
169 int yyparse(void);
4e5efd0 WIP, tentative reworking of parser
Kyle Maxwell authored
170 pxpathPtr myparse(char*);
171 void answer(pxpathPtr);
172
73db545 fixed calculations and //keyword
Kyle Maxwell authored
173 #define LIT_BIN_OP(A, B, C) pxpath_cat_literals(3, A, LIT(B), C)
174 #define BIN_OP(A, B, C) pxpath_cat_paths(3, A, OP(B), C)
175 #define PREP_OP(A, B) pxpath_cat_paths(2, OP(A), B)
19b3d0e WIP, many tests now pass
Kyle Maxwell authored
176 #define PXP(A) pxpath_new_path(1, A)
73db545 fixed calculations and //keyword
Kyle Maxwell authored
177 #define LIT(A) pxpath_new_literal(1, A)
178 #define OP(A) pxpath_new_operator(1, A)
19b3d0e WIP, many tests now pass
Kyle Maxwell authored
179 #define APPEND(A, S) pxpath_cat_paths(2, A, PXP(S));
180 #define PREPEND(A, S) pxpath_cat_paths(2, PXP(S), A);
181 #define PXPWRAP(A, B, C) pxpath_cat_paths(3, PXP(A), B, PXP(C))
182 #define P4E(A, B, C, D) pxpath_cat_paths(4, A, PXP(B), C, PXP(D))
183 #define P4O(A, B, C, D) pxpath_cat_paths(4, PXP(A), B, PXP(C), D)
184 #define P6E(A, B, C, D, E, F) pxpath_cat_paths(6, A, PXP(B), C, PXP(D), E, PXP(F));
185 #define INPUT_TYPE(A, S) APPEND(A, "[lower-case(name())='input' and lower-case(@type)='" #S "']")
4c102cc WIP, compiles bad XSLT
Kyle Maxwell authored
186 #define TRACE(A, B) fprintf(stderr, "trace(%s): ", A); fprintf(stderr, "%s\n", pxpath_to_string(B));
2a905e4 include y.tab.h
Kyle Maxwell authored
187
188 #endif
189
190
191
192 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
262584b WIP, moved parser to %union
Kyle Maxwell authored
193 typedef union YYSTYPE
73db545 fixed calculations and //keyword
Kyle Maxwell authored
194 #line 53 "parser.y"
262584b WIP, moved parser to %union
Kyle Maxwell authored
195 {
4e5efd0 WIP, tentative reworking of parser
Kyle Maxwell authored
196 int empty;
262584b WIP, moved parser to %union
Kyle Maxwell authored
197 char* string;
4e5efd0 WIP, tentative reworking of parser
Kyle Maxwell authored
198 pxpathPtr node;
262584b WIP, moved parser to %union
Kyle Maxwell authored
199 }
73db545 fixed calculations and //keyword
Kyle Maxwell authored
200 /* Line 2616 of glr.c. */
201 #line 202 "y.tab.h"
262584b WIP, moved parser to %union
Kyle Maxwell authored
202 YYSTYPE;
2a905e4 include y.tab.h
Kyle Maxwell authored
203 # define YYSTYPE_IS_DECLARED 1
204 # define YYSTYPE_IS_TRIVIAL 1
205 #endif
206
207 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
208 typedef struct YYLTYPE
209 {
210
211 char yydummy;
212
213 } YYLTYPE;
214 # define YYLTYPE_IS_DECLARED 1
215 # define YYLTYPE_IS_TRIVIAL 1
216 #endif
217
218
219 extern YYSTYPE yylval;
220
221
222
Something went wrong with that request. Please try again.