A tiny programming language built using C.
This language was create following the tutorial series by Ianertson. The original developed repository from the videos is available here https://github.com/sebbekarlsson/hello
The lexer receives the source code and creates tokens from it. Then the parser gets the tokens from the lexer and generates the AST (Abstract Syntax Tree) from it. After that, the visitor receives the AST root node and then it knows what to do with each AST node type.
src
├── AST.c
├── include
│ ├── AST.h
│ ├── lexer.h
│ ├── main.h
│ ├── parser.h
│ ├── token.h
│ └── visitor.h
├── lexer.c
├── main.c
├── parser.c
├── token.c
└── visitor.c
The syntax is similar to JavaScript and it requires semicolons at the end of each statement.
var name = "John Doe";
var othername = "Sarah";
print(name, othername);$ hello examples/print.hello
Jhon Doe
Sarah
Local cmd
- Run
make - Execute
hello.outwith a filename, like this$ hello.out examples/print.hello
Global cmd
- Run
sudo make install - Execute
hellowith a filename, like this$ hello examples/print.hello
Clean workspace
- Run
make clean