Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
OJddJO committed Oct 30, 2024
1 parent 2f66a3b commit a8b4547
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ The source code of the project.
- `src/`: The source code of the project.
- `src/interpreter.c`: The interpreter of the language. Main file.

# WordLang Interpreter
## WordLang Interpreter

The interpreter of the language is coded in `c`. It is a simple interpreter that reads the source code from a file, tokenizes it, parses it, and executes it.

## How it works
### How it works

The **interpreter** reads the **source code** from a file and gives it to the **lexer**. The lexer **tokenizes** the source code and gives the tokens to the **parser**. Until now, it seems to be a normal language interpreter. \
**BUT** the parser **does not parse the tokens to an AST**. It creates a list of list of list of tokens *(... yes I know)*. The big list represents the source code, the lists inside represents the lines, and the lists inside the lines represents something to evaluate (if the list contains multiple tokens, it is an operation, if it contains only one token, it is a single token to evaluate). The interpreter then evaluates the list of list of list of tokens and execute the code.
Expand Down

0 comments on commit a8b4547

Please sign in to comment.