Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Codegen ¶
func Codegen(prog TreeNodeIf) string
Codegen runs code generation for a node and returns the program as a string
func ParseOneLineCond ¶
func ParseOneLineCond(source string) (TreeNodeIf, []ParserError)
ParseOneLineCond is for parsing one-liners like "(txn.fee == 1) && (global.MinTxnFee < 2000)"
func ParseProgram ¶
func ParseProgram(input InputDesc) (TreeNodeIf, []ParserError)
ParseProgram accepts InputDesc that describes source location
Types ¶
type ExprNodeIf ¶
type ExprNodeIf interface { TreeNodeIf // contains filtered or unexported methods }
ExprNodeIf extends TreeNode and can be evaluated and typed
type InputDesc ¶
InputDesc struct describe location of the source file This info is later used for imports
type ParserError ¶
type ParserError struct {
// contains filtered or unexported fields
}
ParserError provides generic info about the error
func (*ParserError) String ¶
func (err *ParserError) String() (msg string)
type TreeNode ¶
type TreeNode struct {
// contains filtered or unexported fields
}
TreeNode contains base info about an AST node
type TreeNodeIf ¶
type TreeNodeIf interface { String() string Print() Codegen(ostream io.Writer) // contains filtered or unexported methods }
TreeNodeIf represents a node in AST
Source Files ¶
Click to show internal directories.
Click to hide internal directories.