Skip to content

Matissoss/psyn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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

  • <VALUE>: variable value
  • [VALUE]: optional value
  • VALUE: static value
  • [<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* = <NODE>.

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) = <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.

About

minimal syntax specification format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published