blob: 7a79b058379122fb40896dd85610d4f146b69dd8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# Frontend for language
Tiny beginnings of a parser for a toy language, written in C99.
Currently only a lexer.
## Compiling
To build `frontend`:
```
make
```
## Running
Simply run `./frontend INPUT_FILE` and it should parse and print the abbreviated
tokens (ie. `+ => +`, instead of `+ => ADD`) with spacing around it.
Next baby steps is to make the token type store a line, column, and length of
the token, and the parser should ideally return an array of offsets into the
input string of each newline (or, ideally the character AFTER `\n`). Next is
constructing an AST of the arithmetic expression(s).
Currently only simple arithmetic is implemented.
|