fixed compiling errors for ir and parser
[henge/webcc.git] / src / apc / parser.y
index e4b1bb5..07bc28b 100644 (file)
 %}
 %define parse.error verbose
 %define lr.type ielr
-%define api.value.type union
-//operators
+
+%union {
+  uint64_t ref;
+  int NUM;
+  char *str;
+  void *voidp;
+
+}
+
+ //operators
 %token         CLOPEN   // /
 %token         CLCLOSE  // \
 %token         SOPEN
 %token         FS
 %token         ELE
 //nonterminal types
-%type <uint64_t> olink
-%type <uint64_t> ele_svlink
-%type <uint64_t> set_svlink
+%type <ref> olink
+%type <ref> ele_svlink
+%type <ref> set_svlink
 //terminals
-%token <int> NUM
-%token <char*> STR
-%token <int> SS
-%token <char*> NAME
-%token <uint64_t> REF
-%token <int> SSD
-%token <void*> FPTR
-%token <int> WIDTH
-%token <int> HEIGHT
-%token <int> NUM_PTRS
+%token <NUM> NUM
+%token <str> STR
+%token <NUM> SS
+%token <str> NAME
+%token <ref> REF
+%token <NUM> SSD
+%token <voidp> FPTR
+%token <NUM> WIDTH
+%token <NUM> HEIGHT
+%token <NUM> NUM_PTRS
 //precedence
 %precedence LP
 %precedence MP