Skip to content

Trying to make a little compiler, just for fun and learning.

Notifications You must be signed in to change notification settings

ramonmeza/Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler

This project is a C++ implementation of Yehonathan Sharvit's JavaScript compiler.

The project has 4 main parts:

  • Tokenizer
  • Parser
  • Emitter
  • Compiler

Tokenizer

The Tokenizer class takes input and converts it into a vector of Tokens. Each token consists of a type and a value.

Parser

The Parser class takes in tokens and converts it into an Abstract Syntax Tree (AST).

Emitter

The Emitter class takes the AST and converts it into C-like code syntax (string-ify).

Compiler

The Compiler class combines all of the previous parts.