Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compiler-with-rust

Our main objective is to compile a file.lang that contain a simple operation with + - * and /

example: src/file.lang

x = 1;
y = 5;
print(x + y);

After compiling we expect the result 6

Step 1 : Lexical analysis

According to wikipedia: Lexical analysis is conversion of a text into (semantically or syntactically) meaningful lexical tokens belonging to categorise defined by a "lexer" program

img.png

In this project we will create a list of tokens that will be later converted to assembly

Step 2 : Syntax Analysis (Parsing)

Parsing is the next phase after tokenization. It involves taking the stream of tokens from the lexer and analyzing how they fit together according to the grammar rules of the language.

The output of this phase is usually an Abstract Syntax Tree (AST), a hierarchical representation of the structure of the program.

Step 3 : Error Handling

We will add an error handler to show print error type and a message explaining the error

Todo: add diagram of error handing

Step 4: add commands to compile

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages