make it compile on code.cs

This commit is contained in:
vel 2024-11-14 17:47:59 -08:00
parent 2bab25cad9
commit 6bdc28b8fe
Signed by: velvox
GPG Key ID: 59D9762F674151DF
3 changed files with 15 additions and 3 deletions

View File

@ -16,7 +16,7 @@ extern int yylex();
/* Clunky: Declare the result of the parser from parser.bison */ /* Clunky: Declare the result of the parser from parser.bison */
struct stmt *parser_result; extern struct stmt *parser_result;
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
printf("Lab 6 Example Interpreter Compiler\n"); printf("Lab 6 Example Interpreter Compiler\n");

View File

@ -24,7 +24,7 @@ void yyerror(const char*);
extern int yylineno; extern int yylineno;
struct stmt *parser_result = 0; extern struct stmt *parser_result = 0;
%} %}

View File

@ -111,7 +111,19 @@ extern int yydebug;
/* Value type. */ /* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE; union YYSTYPE
{
#line 91 "parser.bison"
struct expr *expr;
struct stmt *stmt;
struct decl *decl;
struct type *type;
#line 124 "token.h"
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
#endif #endif