@nix2/zuse-stdsyntax
v1.0.8
Published
Standard syntax parser.
Downloads
4
Readme
Installation
yarn add @nix2/zuse-stdsyntax-typescript
About
This is used to parse Zuse Stardard Syntax into the Zuse Program Structure.
All this package does is convert a string of the program into an Abstract Syntax Tree which can be run with a Zuse Interpreter.
Usage
import { parse } from '@nix2/zuse-stdsyntax';
const code = `Stdout("Hi World!");`;
const [tokens, error] = parse('<stdin>', code);
console.log(tokens);
Output:
[
"Call",
{
"func": [
"Var",
{
"name": "Stdout"
}
],
"args": [
[
"Text",
{
"value": "Hi World!"
}
]
],
"kwargs": {}
}
]
Grammer
The grammer can be found here