7 #define YYSTYPE CxxTokenType
8 #define YY_parse_STYPE CxxTokenType
9 #define YACC_BANG_TYPE size_t
10 #define YACC_MARK_TYPE size_t
12 #define YACC_BANG() push_bang()
13 #define YACC_UNBANG(bangValue, msg) pop_bang(bangValue); yyerrok; yyclearin; yyerror(msg);
15 #define ERRMSG(a) do { cout << "ERROR -- " << a << endl; increment_error_count(); } while (0)
18 enum bool { false, true };
22 #define PARSE_TOKEN(a) BISON_PP_CLASS::a
24 #define PARSE_TOKEN(a) a
27 extern size_t line_number;
28 extern bool c_keywords;
29 extern bool echo_line_numbers;
30 extern bool echo_line_text;
31 extern void increment_error_count();
32 extern int tokenMarkDepth;
38 CxxToken(const CxxToken&);
39 CxxToken& operator=(const CxxToken&);
41 CxxToken(int tokenValue = 0) : _value(tokenValue) {}
42 virtual ~CxxToken() {}
43 int value() const { return _value; }
46 enum CxxIsTemplate { IS_DEFAULT, IS_TEMPLATE };
47 enum CxxIsTree { IS_SCALAR, IS_TREE };
48 typedef CxxToken CxxTreeArgument;
50 class CxxStatement : public CxxToken {};
51 typedef CxxStatement CxxDeclaration;
52 class CxxExpression : public CxxStatement {};
53 class CxxName : public CxxExpression {};
54 class CxxTokens : public CxxToken {};
55 class CxxMetaObject : public CxxExpression {};
56 class CxxMetaStatement : public CxxStatement {};
58 class CxxStatements : public CxxStatement {};
59 typedef CxxStatements CxxDeclarations;
60 typedef CxxDeclarations CxxMemberDeclarations;
61 typedef CxxExpression CxxTreeExpression;
63 class CxxKeyword : public CxxName {};
64 class CxxDeclSpecifierId : public CxxKeyword {};
66 class CxxAccessSpecifier : public CxxKeyword {};
67 class CxxBaseSpecifier : public CxxToken {};
68 class CxxBaseSpecifiers : public CxxTokens {};
69 class CxxBrace : public CxxToken {};
70 class CxxBuiltInId : public CxxName {};
71 class CxxCharacterLiteral : public CxxToken {};
72 class CxxClass : public CxxToken {};
73 class CxxClassKey : public CxxKeyword {};
74 class CxxCondition : public CxxExpression {};
75 class CxxCvQualifiers : public CxxDeclSpecifierId {};
76 class CxxDeclarator : public CxxToken {};
77 typedef CxxExpression CxxDeleteExpression;
78 //class CxxDerived : public CxxToken {};
79 //class CxxEnum : public CxxToken {};
80 class CxxEnumerator : public CxxToken {};
81 class CxxEnumerators : public CxxTokens {};
82 class CxxExceptionDeclaration : public CxxToken {};
83 class CxxExceptionSpecification : public CxxToken {};
84 class CxxExpressions : public CxxExpression {};
85 class CxxFileId : public CxxToken {};
86 class CxxFileIds : public CxxTokens {};
87 class CxxFileName : public CxxToken {};
88 class CxxFloatingLiteral : public CxxToken {};
89 class CxxFunctionBody : public CxxStatement {};
90 class CxxFunctionDeclarations : public CxxDeclarations {};
91 class CxxHandler : public CxxToken {};
92 class CxxHandlers : public CxxTokens {};
93 class CxxIdentifier : public CxxName {};
94 //class CxxIds : public CxxTokens {};
95 class CxxInitializerClause : public CxxExpression {};
96 class CxxInitializerClauses : public CxxInitializerClause {};
97 class CxxIntegerLiteral : public CxxToken {};
98 class CxxLine : public CxxToken {};
99 //class CxxList : public CxxTokens {};
100 class CxxMemInitializer : public CxxToken {};
101 class CxxMemInitializers : public CxxTokens {};
102 class CxxMetaClass : public CxxStatement {};
103 class CxxMetaFunction : public CxxMetaObject {};
104 class CxxMetaInitializer : public CxxToken {};
105 class CxxMetaInitializers : public CxxTokens {};
106 class CxxMetaParameter : public CxxToken {};
107 class CxxMetaParameters : public CxxTokens {};
108 //class CxxMetaPrototype : public CxxToken {};
109 //class CxxMetaPrototypes : public CxxTokens {};
110 class CxxMetaType : public CxxName {};
111 class CxxMetaVariable : public CxxMetaObject {};
112 class CxxNamespace : public CxxToken {};
113 typedef CxxExpression CxxNewExpression;
114 class CxxNumberLiteral : public CxxExpression {};
115 class CxxParameter : public CxxExpression {};
116 class CxxParameters : public CxxExpression {};
117 class CxxParenthesised : public CxxToken {};
118 class CxxPointerDeclarator : public CxxDeclarator {};
119 class CxxPosition : public CxxName {};
120 class CxxSegment : public CxxName {};
121 class CxxSpacing : public CxxToken {};
122 class CxxStrings : public CxxToken {};
123 typedef CxxStrings CxxStringLiteral;
124 class CxxSubspace : public CxxToken {};
125 class CxxSyntaxMacroParameter : public CxxToken {};
126 class CxxSyntaxMacroParameters : public CxxTokens {};
127 class CxxTemplateArgument : public CxxToken {};
128 class CxxTemplateArguments : public CxxTokens {};
129 class CxxTemplateParameter : public CxxToken {};
130 class CxxTemplateParameters : public CxxTokens {};
131 class CxxSimpleTypeParameter : public CxxTemplateParameter {};
132 class CxxTemplatedTypeParameter : public CxxTemplateParameter {};
133 class CxxTokenStatements : public CxxTokens {};
134 class CxxTreeArguments : public CxxTokens {};
135 class CxxType1Parameters : public CxxTokens {};
136 class CxxTypeId : public CxxToken {};
137 class CxxTypeIds : public CxxTokens {};
138 class CxxUtility : public CxxToken {};
140 #define FOGPARSERVALUE_ENUM(T,N) \
141 const T *name2(u_,N); \
142 const T& N() const { return *name2(u_,N); } \
143 const T* & N() { return name2(u_,N); }
144 #define FOGPARSERVALUE_POINTER(T,N) T *N;
145 #define FOGPARSERVALUE_VALUE(T,N) T N;
151 FOGPARSERVALUE_VALUE(bool, _bool)
152 FOGPARSERVALUE_VALUE(long, _long)
153 FOGPARSERVALUE_POINTER(CxxBrace, brace)
154 FOGPARSERVALUE_POINTER(CxxSpacing, spacing)
156 FOGPARSERVALUE_POINTER(CxxAccessSpecifier, access_specifier)
157 FOGPARSERVALUE_POINTER(CxxBaseSpecifier, base_specifier)
158 FOGPARSERVALUE_POINTER(CxxBaseSpecifiers, base_specifiers)
159 FOGPARSERVALUE_POINTER(CxxBuiltInId, built_in_id)
160 FOGPARSERVALUE_POINTER(CxxCharacterLiteral, character_literal)
161 FOGPARSERVALUE_POINTER(CxxClass, _class)
162 FOGPARSERVALUE_POINTER(CxxClassKey, class_key)
163 FOGPARSERVALUE_POINTER(CxxCondition, condition)
164 FOGPARSERVALUE_POINTER(CxxCvQualifiers, cv_qualifiers)
165 FOGPARSERVALUE_POINTER(CxxDeclSpecifierId, decl_specifier_id)
166 FOGPARSERVALUE_POINTER(CxxDeclaration, declaration)
167 FOGPARSERVALUE_POINTER(CxxDeclarations, declarations)
168 FOGPARSERVALUE_POINTER(CxxDeclarator, declarator)
169 FOGPARSERVALUE_POINTER(CxxDeleteExpression, delete_expression)
170 FOGPARSERVALUE_POINTER(CxxEnumerator, enumerator)
171 FOGPARSERVALUE_POINTER(CxxEnumerators, enumerators)
172 FOGPARSERVALUE_POINTER(CxxExceptionDeclaration, exception_declaration)
173 FOGPARSERVALUE_POINTER(CxxExceptionSpecification, exception_specification)
174 FOGPARSERVALUE_POINTER(CxxExpression, expression)
175 FOGPARSERVALUE_POINTER(CxxExpressions, expressions)
176 FOGPARSERVALUE_POINTER(CxxFileId, file_id)
177 FOGPARSERVALUE_POINTER(CxxFileIds, file_ids)
178 FOGPARSERVALUE_POINTER(CxxFileName, file_name)
179 FOGPARSERVALUE_POINTER(CxxFloatingLiteral, floating_literal)
180 FOGPARSERVALUE_POINTER(CxxFunctionBody, function_body)
181 FOGPARSERVALUE_POINTER(CxxHandler, handler)
182 FOGPARSERVALUE_POINTER(CxxHandlers, handlers)
183 FOGPARSERVALUE_POINTER(CxxIdentifier, identifier)
184 FOGPARSERVALUE_POINTER(CxxInitializerClause, initializer_clause)
185 FOGPARSERVALUE_POINTER(CxxInitializerClauses, initializer_clauses)
186 FOGPARSERVALUE_POINTER(CxxIntegerLiteral, integer_literal)
187 FOGPARSERVALUE_POINTER(CxxKeyword, keyword)
188 FOGPARSERVALUE_POINTER(CxxLine, line)
189 FOGPARSERVALUE_POINTER(CxxMemInitializer, mem_initializer)
190 FOGPARSERVALUE_POINTER(CxxMemInitializers, mem_initializers)
191 FOGPARSERVALUE_POINTER(CxxMemberDeclarations, member_declarations)
192 FOGPARSERVALUE_POINTER(CxxMetaClass, meta_class)
193 FOGPARSERVALUE_POINTER(CxxMetaFunction, meta_function)
194 FOGPARSERVALUE_POINTER(CxxMetaInitializer, meta_initializer)
195 FOGPARSERVALUE_POINTER(CxxMetaInitializers, meta_initializers)
196 FOGPARSERVALUE_POINTER(CxxMetaObject, meta_object)
197 FOGPARSERVALUE_POINTER(CxxMetaStatement, meta_statement)
198 FOGPARSERVALUE_POINTER(CxxMetaType, meta_type)
199 FOGPARSERVALUE_POINTER(CxxMetaVariable, meta_variable)
200 FOGPARSERVALUE_POINTER(CxxName, name)
201 FOGPARSERVALUE_POINTER(CxxNewExpression, new_expression)
202 FOGPARSERVALUE_POINTER(CxxNumberLiteral, number_literal)
203 FOGPARSERVALUE_POINTER(CxxParameter, parameter)
204 FOGPARSERVALUE_POINTER(CxxParameters, parameters)
205 FOGPARSERVALUE_POINTER(CxxParenthesised, parenthesised)
206 FOGPARSERVALUE_POINTER(CxxPointerDeclarator, pointer_declarator)
207 FOGPARSERVALUE_POINTER(CxxPosition, position)
208 FOGPARSERVALUE_POINTER(CxxSegment, segment)
209 FOGPARSERVALUE_POINTER(CxxSimpleTypeParameter, simple_type_parameter)
210 FOGPARSERVALUE_POINTER(CxxStatement, statement)
211 FOGPARSERVALUE_POINTER(CxxStatements, statements)
212 FOGPARSERVALUE_POINTER(CxxStringLiteral, string_literal)
213 FOGPARSERVALUE_POINTER(CxxStrings, strings)
214 FOGPARSERVALUE_POINTER(CxxSubspace, subspace)
215 FOGPARSERVALUE_POINTER(CxxSyntaxMacroParameter, syntax_macro_parameter)
216 FOGPARSERVALUE_POINTER(CxxSyntaxMacroParameters, syntax_macro_parameters)
217 FOGPARSERVALUE_POINTER(CxxTemplateArgument, template_argument)
218 FOGPARSERVALUE_POINTER(CxxTemplateArguments, template_arguments)
219 FOGPARSERVALUE_POINTER(CxxTemplateParameter, template_parameter)
220 FOGPARSERVALUE_POINTER(CxxTemplateParameters, template_parameters)
221 FOGPARSERVALUE_POINTER(CxxTemplatedTypeParameter, templated_type_parameter)
222 FOGPARSERVALUE_POINTER(CxxToken, token)
223 FOGPARSERVALUE_POINTER(CxxTokenStatements, token_statements)
224 FOGPARSERVALUE_POINTER(CxxTokens, tokens)
225 FOGPARSERVALUE_POINTER(CxxTreeArgument, tree_argument)
226 FOGPARSERVALUE_POINTER(CxxTreeArguments, tree_arguments)
227 FOGPARSERVALUE_POINTER(CxxTreeExpression, tree_expression)
228 FOGPARSERVALUE_POINTER(CxxType1Parameters, type1_parameters)
229 FOGPARSERVALUE_POINTER(CxxUtility, utility)
231 FOGPARSERVALUE_VALUE(int, bang)
232 FOGPARSERVALUE_VALUE(CxxIsTemplate, is_template)
233 FOGPARSERVALUE_VALUE(YACC_MARK_TYPE, mark)
234 FOGPARSERVALUE_VALUE(size_t, nest)
236 CxxAccessSpecifier *access_specifier;
237 CxxBaseSpecifier *base_specifier;
238 CxxBaseSpecifiers *base_specifiers;
239 CxxBuiltInId *built_in_id;
240 CxxCharacterLiteral *character_literal;
242 CxxClassKey *class_key;
243 CxxCondition *condition;
244 CxxCvQualifiers *cv_qualifiers;
245 CxxDeclaration *declaration;
246 CxxDeclarations *declarations;
247 CxxDeclarator *declarator;
248 CxxDeclSpecifierId *decl_specifier_id;
249 // CxxDerived *derived;
251 CxxEnumerator *enumerator;
252 CxxEnumerators *enumerators;
253 CxxExceptionDeclaration *exception_declaration;
254 CxxExceptionSpecification *exception_specification;
255 CxxExpression *expression;
256 CxxExpressions *expressions;
258 CxxFileIds *file_ids;
259 CxxFileName *file_name;
260 CxxFloatingLiteral *floating_literal;
261 CxxFunctionBody *function_body;
262 CxxFunctionDeclarations *function_declarations;
264 CxxHandlers *handlers;
265 CxxIdentifier *identifier;
267 CxxInitializerClause *initializer_clause;
268 CxxInitializerClauses *initializer_clauses;
269 CxxIntegerLiteral *integer_literal;
273 CxxMemInitializer *mem_initializer;
274 CxxMemInitializers *mem_initializers;
275 CxxMemberDeclarations *member_declarations;
276 CxxMetaClass *meta_class;
277 // CxxMetaFunction *meta_function;
278 // CxxMetaInitializer *meta_initializer;
279 // CxxMetaInitializers *meta_initializers;
280 // CxxMetaObject *meta_object;
281 CxxMetaParameter *meta_parameter;
282 CxxMetaParameters *meta_parameters;
283 // CxxMetaPrototype *meta_prototype;
284 // CxxMetaPrototypes *meta_prototypes;
285 // CxxMetaStatement *meta_statement;
286 CxxMetaType *meta_type;
287 // CxxMetaVariable *meta_variable;
289 // CxxNamespace *_namespace;
290 CxxNumberLiteral *number_literal;
291 CxxParameter *parameter;
292 CxxParameters *parameters;
293 CxxParenthesised *parenthesised;
294 CxxPointerDeclarator *pointer_declarator;
296 CxxSimpleTypeParameter *simple_type_parameter;
297 CxxStatement *statement;
298 CxxStatements *statements;
299 CxxStringLiteral *string_literal;
301 CxxSyntaxMacroParameter *syntax_macro_parameter;
302 CxxSyntaxMacroParameters *syntax_macro_parameters;
303 CxxTemplateArgument *template_argument;
304 CxxTemplateArguments *template_arguments;
305 CxxTemplateParameter *template_parameter;
306 CxxTemplateParameters *template_parameters;
307 CxxTemplatedTypeParameter *templated_type_parameter;
310 // CxxTreeArgument *tree_argument;
311 // CxxTreeArguments *tree_arguments;
312 // CxxTreeExpression *tree_expression;
313 CxxType1Parameters *type1_parameters;
314 // CxxTypeId *type_id;
315 // CxxTypeIds *type_ids;
323 class CxxNaffToken : public CxxToken
325 typedef CxxToken Super;
329 CxxNaffToken(const CxxNaffToken&);
330 CxxNaffToken& operator=(const CxxNaffToken&);
332 CxxNaffToken(int tokenValue, const char *yyText, int yyLeng);
333 virtual ~CxxNaffToken();