Versions in this module Expand all Collapse all v1 v1.1.1 Jun 21, 2020 v1.1.0 Dec 27, 2019 Changes in this version + const NodeACCESS + const NodeAND + const NodeASSIGN + const NodeBEGINSWITH + const NodeBREAK + const NodeCOND + const NodeCONTINUE + const NodeDIV + const NodeDIVINT + const NodeENDSWITH + const NodeEOF + const NodeEQ + const NodeFALSE + const NodeFUNCCALL + const NodeGEQ + const NodeGT + const NodeGUARD + const NodeIN + const NodeKINDMATCH + const NodeLEQ + const NodeLIKE + const NodeLIST + const NodeLOOP + const NodeLT + const NodeMAP + const NodeMAPENTRY + const NodeMINUS + const NodeMODINT + const NodeNEQ + const NodeNOT + const NodeNOTIN + const NodeNULL + const NodeOR + const NodePLUS + const NodePRIORITY + const NodeSCOPEMATCH + const NodeSINK + const NodeSTATEMATCH + const NodeSTATEMENTS + const NodeSUPPRESSES + const NodeTIMES + const NodeTRUE + const NodeVALUE + const RuneEOF + const TokenSHOWTERM + var ErrImpossibleLeftDenotation = errors.New("Term can only start an expression") + var ErrImpossibleNullDenotation = errors.New("Term cannot start an expression") + var ErrLexicalError = errors.New("Lexical error") + var ErrUnexpectedEnd = errors.New("Unexpected end") + var ErrUnexpectedToken = errors.New("Unexpected term") + var ErrUnknownToken = errors.New("Unknown term") + var KeywordMap = map[string]LexTokenID + var SymbolMap = map[string]LexTokenID + func Lex(name string, input string) chan LexToken + func PrettyPrint(ast *ASTNode) (string, error) + type ASTNode struct + Children []*ASTNode + Name string + Runtime Runtime + Token *LexToken + func ASTFromPlain(plainAST map[string]interface{}) (*ASTNode, error) + func Parse(name string, input string) (*ASTNode, error) + func ParseWithRuntime(name string, input string, rp RuntimeProvider) (*ASTNode, error) + func (n *ASTNode) Plain() map[string]interface{} + func (n *ASTNode) String() string + type Error struct + Detail string + Line int + Pos int + Source string + Type error + func (pe *Error) Error() string + type LexToken struct + ID LexTokenID + Literal bool + Lline int + Lpos int + Pos int + Val string + func LexToList(name string, input string) []LexToken + func (t LexToken) PosString() string + func (t LexToken) String() string + type LexTokenID int + const TOKENodeKEYWORDS + const TOKENodeSYMBOLS + const TokenACCESS + const TokenAND + const TokenASSIGN + const TokenAT + const TokenBEGINSWITH + const TokenBREAK + const TokenCOLON + const TokenCOMMA + const TokenCONTINUE + const TokenDIV + const TokenDIVINT + const TokenELIF + const TokenELSE + const TokenENDSWITH + const TokenEOF + const TokenEQ + const TokenError + const TokenFALSE + const TokenFOR + const TokenGEQ + const TokenGT + const TokenGUARD + const TokenGeneral + const TokenIF + const TokenIN + const TokenKINDMATCH + const TokenLBRACE + const TokenLBRACK + const TokenLEQ + const TokenLIKE + const TokenLIST + const TokenLPAREN + const TokenLT + const TokenMAP + const TokenMINUS + const TokenMODINT + const TokenNEQ + const TokenNOT + const TokenNOTIN + const TokenNULL + const TokenOR + const TokenPLUS + const TokenPRIORITY + const TokenRBRACE + const TokenRBRACK + const TokenRPAREN + const TokenSCOPEMATCH + const TokenSEMICOLON + const TokenSINK + const TokenSTATEMATCH + const TokenSTATEMENTS + const TokenSUPPRESSES + const TokenTIMES + const TokenTRUE + const TokenVALUE + type Runtime interface + Eval func(VarsScope, map[string]interface{}) (interface{}, error) + Validate func() error + type RuntimeProvider interface + Runtime func(node *ASTNode) Runtime + type VarsScope interface + GetValue func(varName string) (interface{}, bool, error) + NewChild func(name string) VarsScope + SetValue func(varName string, varValue interface{}) error + String func() string