pa1.2: fix include and word type
This commit is contained in:
parent
ebece52aec
commit
4aa536e1ef
2 changed files with 10 additions and 4 deletions
|
@ -1,16 +1,21 @@
|
||||||
%{
|
%code requires {
|
||||||
|
#include <common.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
|
||||||
extern int yylex(void);
|
extern int yylex(void);
|
||||||
void yyerror(uint32_t *result, const char *err) {
|
}
|
||||||
|
%{
|
||||||
|
#include <common.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
void yyerror(word_t *result, const char *err) {
|
||||||
fprintf(stderr, "Error: %s\n", err);
|
fprintf(stderr, "Error: %s\n", err);
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%token NUMBER HEX_NUMBER
|
%token NUMBER HEX_NUMBER
|
||||||
%start input
|
%start input
|
||||||
%define api.value.type { uint32_t }
|
%define api.value.type { word_t }
|
||||||
%parse-param { uint32_t *result }
|
%parse-param { uint32_t *result }
|
||||||
%left '-' '+'
|
%left '-' '+'
|
||||||
%left '*' '/'
|
%left '*' '/'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
TEST_SRCS += tests/expr_test.c
|
TEST_SRCS += tests/expr_test.c
|
||||||
|
YACC = bison
|
||||||
|
|
||||||
$(OBJ_DIR)/%: %.c $(TEST_OBJS) app
|
$(OBJ_DIR)/%: %.c $(TEST_OBJS) app
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
|
|
Loading…
Reference in a new issue