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 <stdlib.h>
|
||||
#include <stdint.h>
|
||||
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);
|
||||
}
|
||||
%}
|
||||
|
||||
%token NUMBER HEX_NUMBER
|
||||
%start input
|
||||
%define api.value.type { uint32_t }
|
||||
%define api.value.type { word_t }
|
||||
%parse-param { uint32_t *result }
|
||||
%left '-' '+'
|
||||
%left '*' '/'
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
TEST_SRCS += tests/expr_test.c
|
||||
YACC = bison
|
||||
|
||||
$(OBJ_DIR)/%: %.c $(TEST_OBJS) app
|
||||
@mkdir -p $(dir $@)
|
||||
|
|
Loading…
Reference in a new issue