projects
/
henge
/
webcc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed compiling errors for ir and parser
[henge/webcc.git]
/
src
/
apc
/
parser.y
diff --git
a/src/apc/parser.y
b/src/apc/parser.y
index
e4b1bb5
..
07bc28b
100644
(file)
--- a/
src/apc/parser.y
+++ b/
src/apc/parser.y
@@
-18,8
+18,16
@@
%}
%define parse.error verbose
%define lr.type ielr
%}
%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 CLOPEN // /
%token CLCLOSE // \
%token SOPEN
@@
-38,20
+46,20
@@
%token FS
%token ELE
//nonterminal types
%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
//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 <void
p
> FPTR
+%token <
NUM
> WIDTH
+%token <
NUM
> HEIGHT
+%token <
NUM
> NUM_PTRS
//precedence
%precedence LP
%precedence MP
//precedence
%precedence LP
%precedence MP