This commit is contained in:
nora 2022-07-04 09:09:26 +02:00
parent be1305bbb8
commit e3b554bd41
2 changed files with 14 additions and 16 deletions

View file

@ -5,21 +5,6 @@
== Building Block View
[plantuml]
----
() IO <- [Main] : read input file
[Main] <-> [Parser] : lex and parse code
[Main] <--> [IR] : compile
[Main] <--> [Interpreter] : interpret code
[Interpreter] <--> () IO : stdin and stdout
----
The interpreter follows a classic interpreter architecture. First, the source is tokenized by a lexer, implemented using the `logos` library (https://crates.io/crates/logos).
Then, a handwritten recursive descent parser parses the token stream. The abstract syntax tree is then given to a small compiler, that compiles it down to a smaller and more limited IR. It also resolves jump labels to offsets.
The interpreter then executes this lower level IR.
==== Parser `parser.rs`
Lexes the source code, and then parses those tokens into an abstract syntax tree.

View file

@ -2,11 +2,24 @@
== Runtime View
[plantuml]
----
() IO <- [Main] : read input file
[Main] <-> [Parser] : lex and parse code
[Main] <--> [IR] : compile
[Main] <--> [Interpreter] : interpret code
[Interpreter] <--> () IO : stdin and stdout
----
The interpreter follows a classic interpreter architecture. First, the source is tokenized by a lexer, implemented using the `logos` library (https://crates.io/crates/logos).
Then, a handwritten recursive descent parser parses the token stream. The abstract syntax tree is then given to a small compiler, that compiles it down to a smaller and more limited IR. It also resolves jump labels to offsets.
The interpreter then executes this lower level IR.
=== <Runtime Scenario 1>
* _<insert runtime diagram or textual description of the scenario>_
* _<insert description of the notable aspects of the interactions between the
building block instances depicted in this diagram.>_