Skip to content

YounesBensafia/Phynix

Repository files navigation

How to Build and Run the Compiler

Follow these steps to compile and execute the compiler using the commands provided in commands.bat:

1. Compile the Source Files

bison -d parser.y           # Generate parser source and header files
flex lexical.l              # Generate lexical analyzer source file
gcc -c SymbolTable.c -o SymbolTable.o   # Compile symbol table module
gcc -c parser.tab.c -o parser.o         # Compile parser module
gcc -c lex.yy.c -o lexical.o            # Compile lexical analyzer module
gcc -o compilateur SymbolTable.o lexical.o parser.o -lfl  # Link all modules into executable

2. Run the Compiler

To test the compiler with an example input file:

./compilateur < exemple.txt
Symbol Table Quadruplets Table
Symbol Table Quadruplets Table (Before optimization)
Avant optimisation Apres optimisation
During optimization After optimization

Code Objet
Code Objet

Note: Make sure all dependencies (Bison, Flex, GCC) are installed and available in your system's PATH.

About

A compiler for the PHYLOG language, built with FLEX and BISON, featuring lexical, syntax, and semantic analysis, symbol table management, error handling, and object file generation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors