Skip to content

Commit

Permalink
changed yacc, previous commit msg mistake...
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilcm committed Apr 27, 2012
1 parent 6cc6a5b commit 40c5f3b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spsil.y
Expand Up @@ -7,8 +7,8 @@
{
struct tree *n;
}
%token ALIAS DEFINE DO ELSE ENDIF ENDWHILE IF IRETURN LOAD STORE STRCMP STRCPY THEN WHILE REG NUM ASSIGNOP ARITHOP1 ARITHOP2 RELOP LOGOP NOTOP ID BREAK CONTINUE
%type<n> IF IRETURN LOAD STORE STRCMP STRCPY WHILE REG NUM ASSIGNOP ARITHOP1 ARITHOP2 RELOP LOGOP NOTOP ID stmtlist stmt expr ids ifpad whilepad BREAK CONTINUE
%token ALIAS DEFINE DO ELSE ENDIF ENDWHILE IF IRETURN LOAD STORE STRCMP STRCPY THEN WHILE HALT REG NUM ASSIGNOP ARITHOP1 ARITHOP2 RELOP LOGOP NOTOP ID BREAK CONTINUE
%type<n> IF IRETURN LOAD STORE STRCMP STRCPY WHILE HALT REG NUM ASSIGNOP ARITHOP1 ARITHOP2 RELOP LOGOP NOTOP ID stmtlist stmt expr ids ifpad whilepad BREAK CONTINUE
%left LOGOP
%left RELOP
%left ARITHOP1 // + and -
Expand Down Expand Up @@ -115,7 +115,11 @@ stmt: STRCPY '(' ids ',' ids ')' ';' {
}
$$=$1;
}
|HALT ';' {
$$=$1;
}
;


expr: expr ARITHOP1 expr {
$$=create_tree($2,$1,$3,NULL);
Expand Down

0 comments on commit 40c5f3b

Please sign in to comment.