anton icon indicating copy to clipboard operation
anton copied to clipboard

Parse TL-B descriptors

Open iam047801 opened this issue 2 years ago • 2 comments

Some contracts already have TL-B descriptions for its messages. For example, Telemint or STON.FI. Anton should be able to understand TL-B constructors to make adding new contracts as easy as Ctrl+C / Ctrl+V. Tongo library has already implemented TL-B parser and code generation of structs for messages, it can be used as a reference.

iam047801 avatar May 19 '23 08:05 iam047801

Some possible tools to use for schema generation from TL-B description:

  1. ANTLR (Another Tool for Language Recognition): https://www.antlr.org
  2. PEG (Parsing Expression Grammar): https://github.com/mna/pigeon
  3. Yacc (Yet Another Compiler-Compiler): https://pkg.go.dev/golang.org/x/tools/cmd/goyacc
  4. Parsec: https://github.com/prataprc/goparsec
  5. Participle: https://github.com/alecthomas/participle

iam047801 avatar May 19 '23 08:05 iam047801

It is possible to just use tongo.tlb.Parser.Parse function to generate abi definitions.

iam047801 avatar Oct 09 '23 07:10 iam047801