Skip to content

Commit fb7afaa

Browse files
authored
Merge pull request #25 from mrLSD/feat/extend-ast-expr-value
Feat: Extend `ExpressionValue` with a custom generic extensible field
2 parents 53b67a0 + 4e8388d commit fb7afaa

22 files changed

+615
-264
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Run grcov
6262
run: |
6363
mkdir ./target/debug/coverage/
64-
grcov . -s . -b ./target/debug/ -o ./target/debug/coverage/ --ignore-not-existing --excl-line="grcov-excl-line|#\\[derive\\(|//!|///" --ignore="*.cargo/*" --ignore="src/lib.rs" --ignore="tests/*"
64+
grcov . -s . -b ./target/debug/ -o ./target/debug/coverage/ --ignore-not-existing --excl-line="grcov-excl-line|#\\[derive\\(|//!|///" --excl-start="grcov-excl-start" --excl-stop="grcov-excl-end" --ignore="*.cargo/*" --ignore="src/lib.rs" --ignore="tests/*"
6565
- name: Upload coverage reports to Codecov
6666
uses: codecov/codecov-action@v3
6767
env:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "semantic-analyzer"
3-
version = "0.3.3"
3+
version = "0.4.0"
44
authors = ["Evgeny Ukhanov <[email protected]>"]
55
description = "Semantic analyzer library for compilers written in Rust for semantic analysis of programming languages AST"
66
keywords = ["compiler", "semantic-analisis", "semantic-alalyzer", "compiler-design", "semantic"]

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010

1111
Semantic analyzer is an open source semantic analyzer for programming languages
12-
that makes it easy to build your own efficient compilers.
12+
that makes it easy to build your own efficient compilers with extensibility in mind.
1313

1414
## 🌀 What is the library for and what tasks does it solve
1515

@@ -53,6 +53,10 @@ Supported condition expressions and condition expression correctness check.
5353
**Building the Symbol Table**: For analyzing used the symbol table as data structure used by the semantic analyzer to keep track of
5454
symbols (variables, functions, constants) in the source code. Each entry in the symbol table contains the symbol's name, type, and scope related for block state, and other relevant information.
5555

56+
**Generic expression value**: The ability to expand custom expressions for AST,
57+
according to compiler requirements. And the ability to implement custom instructions
58+
for these custom expressions in the **Semantic Stack Context**.
59+
5660
### 🌳 Semantic State Tree
5761

5862
The result of executing and passing stages of the semantic analyzer is: **Semantic State Tree**.
@@ -104,6 +108,17 @@ analysis and source code parsing, it is recommended to use: [nom is a parser com
104108

105109
AST displays the **Turing complete** programming language and contains all the necessary elements for this.
106110

111+
## 🔋 🔌 Extensibility
112+
113+
Since `AST` is predefined, but in real conditions it may be necessary to expand the
114+
functionality for the specific needs of the `compiler`, has been added the functionality
115+
of the `AST` extensibility and the additional generated set of `Instructions` for
116+
the **Semantic Stack Context**.
117+
118+
- [x] 🚨 **Genetic expression value**: The ability to expand custom expressions for z, according to compiler requirements.
119+
The ability to implement custom instructions for these custom expressions in the
120+
**Semantic Stack Context**.
121+
107122
## 🛋️ Examples
108123

109124
- 🔎 There is the example implementation separate project [💾 Toy Codegen](https://github.com/mrLSD/toy-codegen).

0 commit comments

Comments
 (0)