diff --git a/doc/src/01_introduction_and_goals.adoc b/doc/src/01_introduction_and_goals.adoc index 608d505..dd0f34e 100644 --- a/doc/src/01_introduction_and_goals.adoc +++ b/doc/src/01_introduction_and_goals.adoc @@ -1,22 +1,27 @@ [[section-introduction-and-goals]] == Introduction and Goals - - === Requirements Overview +==== What is Crapderive? + +Crapderive is a small assembly-like programming language. It's implemented as a Rust interpreter. + === Quality Goals +* Ease of implementation: It must not be too complex to implement Crapderive, while still being interesting. A simpler language makes for a simpler implementation, which is easier to document. +* Interpreter UX: The interpreter must be easy to use, and should give clear error messages. +* Performance: While performance isn't a strict requirement, the interpreter should be decently fast. === Stakeholders - -[options="header",cols="1,2,2"] +[options="header",cols="1,2"] |=== -|Role/Name|Contact|Expectations -| __ | __ | __ -| __ | __ | __ +|Role/Name|Expectations +| Teacher | An interesting programming language with good documentation. +| Other students | An interesting programming language they can try out and have fun with. +| Author | Get a good mark with it. |=== diff --git a/doc/src/02_architecture_constraints.adoc b/doc/src/02_architecture_constraints.adoc index 335f45d..636968b 100644 --- a/doc/src/02_architecture_constraints.adoc +++ b/doc/src/02_architecture_constraints.adoc @@ -1,5 +1,21 @@ [[section-architecture-constraints]] == Architecture Constraints +[options="header",cols="1,2"] +|=== +|Constraint|Reason +|Interpreter|Because the time for implementation is limited, the simpler option of an interpreter has to be chosen over a compiler. +|4 weeks limited time|The time of the assignment +|=== +== Conventions +[options="header",cols="1,2"] +|=== +|Type|Convention +|Naming|Standard Rust naming according to the official API Guidelines: https://rust-lang.github.io/api-guidelines/naming.html +|Formatting|Default `rustfmt` configuration with `imports_granularity = "Crate"` and `group_imports = "StdExternalCrate"`. +|Linting|The default `clippy` rules. +|General|https://rust-lang.github.io/api-guidelines/about.html +|Build System/Package Manager|`cargo` +|=== \ No newline at end of file diff --git a/doc/src/03_system_scope_and_context.adoc b/doc/src/03_system_scope_and_context.adoc index 9193e34..d0bf901 100644 --- a/doc/src/03_system_scope_and_context.adoc +++ b/doc/src/03_system_scope_and_context.adoc @@ -3,16 +3,6 @@ - - -=== Business Context - - - -**** - -**** - === Technical Context diff --git a/doc/src/04_solution_strategy.adoc b/doc/src/04_solution_strategy.adoc index bd50f00..b50c8dd 100644 --- a/doc/src/04_solution_strategy.adoc +++ b/doc/src/04_solution_strategy.adoc @@ -1,5 +1,17 @@ [[section-solution-strategy]] == Solution Strategy +[options="header",cols="1,2"] +|=== +|Quality Goal|Approaches +|Ease of implementation| Simple language with not too many features. Many features out of scope, like static data. +|Interpreter UX|Keeping track of source locations throughout the compilation/interpretation process, usage of the library `ariadne` (https://crates.io/crates/ariadne) for displaying diagnostics. +|Performance|Written in the native compiled language. Internally, the AST is compiled into a lower level IR, where jump labels are resolved to instruction offsets. +|=== +[plantuml] +---- +[Compiler] --> [Interpreter] : Resolve labels +[Ariadne] --> [Output] : Diagnostics +---- \ No newline at end of file diff --git a/doc/src/05_building_block_view.adoc b/doc/src/05_building_block_view.adoc index 43c5e57..76d46a1 100644 --- a/doc/src/05_building_block_view.adoc +++ b/doc/src/05_building_block_view.adoc @@ -3,7 +3,15 @@ == Building Block View - +[plantuml] +---- +() IO -> [Lexer] +[Lexer] -> [Parser] +[Parser] -> [Compiler] +[Compiler] --> [Interpreter] +[Interpreter] -> () IO +() IO --> [Interpreter] +---- === Whitebox Overall System