Files
compiler-the-translators/src/grammar.h
Meyer Simon 2b07464f84 Not working
2025-04-30 21:55:36 -04:00

37 lines
729 B
C

/* Syntax Analyzer with Bison (3.8.2) */
/* The Translators - Spring 2025 */
#pragma once
#include "../src/codegen.h"
#include "../src/intermediate_code.h"
#include "../src/symbol_table.h"
extern FILE *asc_flag;
extern bool tc_flag;
extern void insert_code_line(char * error_message, int line_number);
typedef enum {
ERROR_RUNTIME = 1,
ERROR_SYNTAX = 2,
ERROR_TYPE = 3,
ERROR_UNDEFINED = 4
} ErrorType;
int token_tracker;
TableNode *tn;
void yyerror(const char *err);
void throw_error(ErrorType error_type, const char *format, ...);
int label_count;
Instruction *begin;
Instruction *current;
int offset;
int currentsp;
CGNode *cgList;
Stack* stack;
Stack* TrueList;
Stack* FalseList;