Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcinbrojek/zpo-mgr
Explore dynamic code analysis in an interpreter for a language that allows on-the-fly customization of syntax rules, small-step operational semantics, and typing. This project facilitates real-time modifications to language interpretation, empowering users to adapt coding experiences according to specific needs.
https://github.com/marcinbrojek/zpo-mgr
dynamic-analysis interpreter language-design operational-semantics python syntax-rules type-system
Last synced: 22 days ago
JSON representation
Explore dynamic code analysis in an interpreter for a language that allows on-the-fly customization of syntax rules, small-step operational semantics, and typing. This project facilitates real-time modifications to language interpretation, empowering users to adapt coding experiences according to specific needs.
- Host: GitHub
- URL: https://github.com/marcinbrojek/zpo-mgr
- Owner: MarcinBrojek
- License: mit
- Created: 2024-01-08T09:10:07.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-08-24T17:11:28.000Z (4 months ago)
- Last Synced: 2024-08-25T18:07:18.244Z (4 months ago)
- Topics: dynamic-analysis, interpreter, language-design, operational-semantics, python, syntax-rules, type-system
- Language: Python
- Homepage:
- Size: 1.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## General info
The project was developed as part of a master's thesis. It is a tool that enables designing and using a custom programming language by defining syntax rules, operational semantics in small steps, and typing. Subsequently, code can be written in the invented language. Essentially, this tool is a language interpreter that facilitates what was described above. This happens because we assume a constant structure of the written programs - they consist of individual parts, such as syntax modification. These parts are dynamically analyzed and processed, allowing the created language or its part to be used and tested during development. More information about the project's [structure](./docs/structure.md) and operation principles can be found in the [docs](./docs/) folder.
The project requires further testing and development, so please be aware that there may be bugs in it.## Dependencies & quick set up
The project / interpreter was developed in the Python language and solely relies on Python libraries available at https://pypi.org. Dependencies can be found in the [requirements.txt](./requirements.txt) file.
1. Download repository. (suggested: create virualenv)
2. Download dependecies with pip.
3. You can start work with repository.## Short example of use.
1. Design your language and use it - all in one file.
(The contents of the file: [test_02.txt](./programs/original_02.txt))@syntax(sp){sp: /unit/ | /print/ "(" sp ")" | string}
@syntax(string){string: STR}@typing(t1){
---
@G |- `@sp` : `unit`
}pred_print(`@sp` |)`
print("OUT: " + sp[0])
`@semantics(o1){
pred_print(`@sp` |)
---
<`print(@sp)`, @s> => @s
}{
pred_print(`@string` |)`
print("IN: " + string[0])
`@code`print("printed in block")`
}@syntax(sp){sp: /unit/ | /print/ "(" sp ")" | STR}
@code`print( "printed outside of block" )`
2. Run [main.py](./main.py) with one argument - file from point 1.```console
> python main.py programs/original_02.txt
```
3. Watch the resulsts of calling programs. (on your own)