https://github.com/matissoss/psyn
minimal syntax specification format
https://github.com/matissoss/psyn
Last synced: 4 months ago
JSON representation
minimal syntax specification format
- Host: GitHub
- URL: https://github.com/matissoss/psyn
- Owner: Matissoss
- License: mit
- Created: 2025-07-04T17:12:23.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-05T10:07:47.000Z (11 months ago)
- Last Synced: 2025-08-06T15:58:06.629Z (10 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
psyn
## about
`psyn` (`POLON Syntax Notation`) is minimalistic syntax description format. `psyn` is:
- Format for people, not machines
- Very easy to adapt/learn (you can learn `psyn` in ~10 minutes)
- Very simple (there are only 3 core components, rest are derivatives)
- Universal (`psyn` can fit into tiny CLI's as well as into assemblers/languages)
`psyn` **DOES/IS NOT**:
- Standalone file format
- Format to generate ready parsers
- Inform user of everything (it only presents shape of syntax, rest is informed by author)
It aims to solve following problem:
> How to inform user of syntax of tool in a way that is expressive, minimal and easy to understand?
## entirety of format
### psyn v1.1
`psyn` v1.1 is currently latest version of `psyn`.
#### nodes
- ``: variable value
- `[VALUE]`: optional value
- `VALUE`: static value
- `[]`: optional variable data
***IMPORTANT***: if any node is put inside string literals (`""`), then you can consider it just text.
#### abbreviations
Abbreviations are used (as name implies) to abbreviate node combination. Let's take a look at example of following assembly code that can be described using PSYN format.
```
mov rax, rcx
```
Here we can use two abbreviations, that is: `X86Instruction` and `X86Register`. In PSYN format these are declared using `*ABBREVIATION_NAME* = `.
Shortened declaration of these 2 abbreviations:
```
*X86Instruction* = MOV, [...]
*X86Register* = RAX, RCX, [...]
```
If abbreviation has any variable data, its name must be put inside parentheses (`()`).
Example Declaration:
```
*SomeAbbreviation*(SOMEVAR) =
```
If we now want to reference it (with some value):
```
*SomeOtherAbbreviation* = *SomeAbbreviation*("Hello") World
```
## credits
`psyn` was made by matissoss for `POLON` project and licensed under MIT license.