1.0.5 • Published 4 years ago

tzo-analyze v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Tzo-Analyze

Analyze Tzo code (Standard Representation and ConciseText formats) and emit various details/statistics/formats.

Currently, the main thing this does is analyze Tzo code and return a nice syntax tree.

Can also be used as a library and imported.

Running

  1. make sure you have dependencies installed: npm i
  2. npm run start -- --input <path to Tzo VMState .json or Tzo conciseText .txt file> --output out.json

to output a GraphViz .dot file for the Syntax Tree, use the --dot <PATH> parameter.

Unit tests

To run the unit tests: npm test

Example Syntax Tree graphs

(blue: function/opcode, black: literal, purple: block, green: root)

Hello world

"Hello" "," " world" rconcat rconcat

hello world example

if/else

1 1 + 2 eq dup jgz {
  "1 + 1 = 2!" pop
} jz {
  "1 + 1 is not 2!?"
}

if/else example

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago