GitHub repository: https://github.com/adiasg/SymbolTable-Parser
This is an implementation of symbol table and parser for an assignment of CSF302 (Principles of Programming Languages) at BITS-Pilani, KK Birla Goa Campus.
The symbol table has been designed for the semantic analysis stage of the compiler.
- A symbol is defined to be a set containing
id
,type
, andkind
struct symbol
is defined asstruct symbol { const char* id; enum type type; enum kind kind; };
- Identifier is restricted to
char[32]
- Types are restricted to {
INT
,FLOAT
,DOUBLE
,BOOL
} - Constructs are restricted to {
variable
,function
,parameter
} enum type
andenum kind
have been defined insymbol.h
- Functions are assumed to have up to two parameters
- To build:
SetCC
to your choice of C compiler inMakefile
. Then execute:make main.out
- To run:
./main.out