1 /* $XConsortium: defParser.y /main/2 1996/11/11 11:51:02 drk $ */
9 #include "FeatureDefDictionary.h"
11 #define alloca(x) (malloc(x))
13 def_list_t* g_def_list = 0;
15 extern void yyerror(char*);
24 unsigned char charData;
25 unsigned char* charPtrData;
28 FeatureValue* valueData;
30 defv_t* valueListPtrData;
31 TypeValues* typeValuesPtrData;
32 type_values_list_t* typeValuesListPtrData;
34 def_list_t* defListPtrData;
35 FeatureDef* defPtrData;
67 %type<valueListPtrData>
71 %type<typeValuesPtrData>
74 %type<typeValuesListPtrData>
102 if ( $2 -> type() == FeatureDef::WILDCARD )
133 CompositeDef : Name FSOPEN DefList FSCLOSE
135 $$= new FeatureDefComposite((char*)$1, $3);
140 PrimitiveDef : Name COLON TypeValuesList SEMI_COLON
142 $$= new FeatureDefPrimitive((char*)$1, $3);
147 DefReference : Name SEMI_COLON
149 $$= new FeatureDefReference((char*)$1);
154 WildCardDef : STAR SEMI_COLON
156 $$= new FeatureDefWildCard("*");
166 TypeValuesList : TypeValuesList COMMA TypeValues
173 $$=new type_values_list_t();
178 TypeValues : TYPE OPER_parenopen ValueList OPER_parenclose
180 $$=new TypeValues((char*)$1, $3);
185 $$=new TypeValues((char*)$1, 0);
190 ValueList : ValueList COMMA Value
206 $$=new FeatureValueInt($1);
210 $$=new FeatureValueString((char*)$1);
215 $$=new FeatureValueReal($1);
223 void yyerror(char *errorstr)