started updating values to types
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
//%define api.location.type {location_t}
|
||||
%locations
|
||||
%union {
|
||||
int integ;
|
||||
//int integ;
|
||||
char * words;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
%token <words> T_BOOLEAN 203
|
||||
%token <words> T_CHARACTER 204
|
||||
%token <words> T_STRING 205
|
||||
%token <integ> C_INTEGER 301
|
||||
%token <words> C_INTEGER 301
|
||||
%token <words> C_NULL 302
|
||||
%token <words> C_CHARACTER 303
|
||||
%token <words> C_STRING 304
|
||||
@ -180,8 +180,10 @@ rec_op :
|
||||
|
||||
expression:
|
||||
|
||||
constant {printf("constant expression\n");}
|
||||
| SUB_OR_NEG expression %prec UMINUS {printf("negative expression\n");}
|
||||
constant {printf("constant expression\n");} {$$ = $<words>1;}
|
||||
| SUB_OR_NEG expression {if(strcmp($2,integer) != 0) {printf("cant negate something not an integer at
|
||||
line %d and column %d\n",@2.first_line,@2.first_column);}} %prec UMINUS {printf("negative expression\n");}
|
||||
|
||||
| NOT expression {printf("not expression\n");}
|
||||
| expression ADD expression {printf("add expression\n");}
|
||||
| expression SUB_OR_NEG expression {printf("subtract expression\n");}
|
||||
@ -215,12 +217,12 @@ memOp:
|
||||
|
||||
|
||||
constant:
|
||||
C_STRING
|
||||
| C_INTEGER
|
||||
| C_NULL
|
||||
| C_CHARACTER
|
||||
| C_TRUE
|
||||
| C_FALSE
|
||||
C_STRING {$$ = $<words>1;}
|
||||
| C_INTEGER {$$ = $<words>1;}
|
||||
| C_NULL {$$ = $<words>1;}
|
||||
| C_CHARACTER {$$ = $<words>1;}
|
||||
| C_TRUE {$$ = $<words>1;}
|
||||
| C_FALSE {$$ = $<words>1;}
|
||||
;
|
||||
|
||||
types:
|
||||
|
Reference in New Issue
Block a user