Skip to content

bohdan-vykhovanets/sysprog_lab3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler source code for a simple language

Simple language supports variables, arithmetic operations and printing to console and is compiled (translated) to C language

In order to compile the compiler you'll need gcc, flex and bison. To install them on Ubuntu:

sudo apt-get update
sudo apt-get install build-essential flex bison

Generate syntax analyzer code:

bison -d -o parser.c parser.y

Generate semantic analyzer code:

flex -o scanner.c scanner.l

Compile the compiler:

gcc -o compiler parser.c scanner.c ast.c -lfl

Compile any .mylang file:

./compiler example.mylang > example.c

View generated C code:

cat example.c

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors