Skip to content

Commit 708da2f

Browse files
committed
Complete semantics.
Signed-off-by: hyrathb <[email protected]>
1 parent 414fc0e commit 708da2f

File tree

3 files changed

+116
-479
lines changed

3 files changed

+116
-479
lines changed

decaf.l

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
#include <string.h>
88

9-
#include "sym.h"
9+
#include "defs.h"
1010
#include "decaf.h"
1111

1212
#define TOKEN(t) return t
13-
#define SAVE {yylval.text = malloc(strlen(yytext)+1); \
14-
strcpy(yylval.text, yytext);}
13+
#define SAVE {yylval = malloc(sizeof(struct semantics)); yylval->text = malloc(strlen(yytext)+1); \
14+
strcpy(yylval->text, yytext);}
1515
#define YY_USER_ACTION { if (yylineno != lineno) \
1616
{ col = 1;\
1717
lineno = yylineno; \

0 commit comments

Comments
 (0)