anton
anton copied to clipboard
Parse TL-B descriptors
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.
Some possible tools to use for schema generation from TL-B description:
- ANTLR (Another Tool for Language Recognition): https://www.antlr.org
- PEG (Parsing Expression Grammar): https://github.com/mna/pigeon
- Yacc (Yet Another Compiler-Compiler): https://pkg.go.dev/golang.org/x/tools/cmd/goyacc
- Parsec: https://github.com/prataprc/goparsec
- Participle: https://github.com/alecthomas/participle
It is possible to just use tongo.tlb.Parser.Parse function to generate abi definitions.