Documentation
¶
Index ¶
- Variables
- func ParseInt(b []byte) (int64, error)
- type AssignmentStatement
- type Attribute
- func Add(val1, val2 Attribute) (Attribute, error)
- func Div(val1, val2 Attribute) (Attribute, error)
- func Mul(val1, val2 Attribute) (Attribute, error)
- func NewScopeIn(context, declarationList Attribute) (Attribute, error)
- func NewScopeOut(context, declarationList Attribute) (Attribute, error)
- func Sub(val1, val2 Attribute) (Attribute, error)
- type Connection
- type ConnectionList
- type Declaration
- type DeclarationList
- type Expression
- type IfStatement
- type Junction
- type LocalVar
- type Node
- type NodeContext
- type NodeList
- type NodeVar
- type ParseContext
- func (ctx *ParseContext) AddNodeContext(nodeName nodeKey, nodeContext *NodeContext)
- func (ctx *ParseContext) BabushkaPopScopeIn()
- func (ctx *ParseContext) BabushkaPopScopeNode(nodeId string)
- func (ctx *ParseContext) BabushkaPopScopeOut()
- func (ctx *ParseContext) BabushkaPopScopeProc()
- func (ctx *ParseContext) GetNodeContext(id string) *NodeContext
- func (ctx *ParseContext) NewNodeScope()
- func (ctx *ParseContext) NewScope()
- type Program
- type Statement
- type StatementList
- type Template
- type TemplateUse
- type Variable
- type WhileStatement
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalDeclarationError = errors.New("local declaration error")
Functions ¶
Types ¶
type AssignmentStatement ¶
type AssignmentStatement struct { Identifier Attribute `json:"identifier"` Expression Attribute `json:"expression"` }
func NewAssignmentStatement ¶
func NewAssignmentStatement(identifier, expression Attribute) (AssignmentStatement, error)
type Connection ¶
func NewConnection ¶
func NewConnection(out, in Attribute) (Connection, error)
type ConnectionList ¶
type ConnectionList []Connection
func AppendConnection ¶
func AppendConnection(connectionList, connection Attribute) (ConnectionList, error)
func NewConnectionList ¶
func NewConnectionList() (ConnectionList, error)
type Declaration ¶
type Declaration struct { Type string `json:"type"` AssigneeId Attribute `json:"assigneeId"` Expression Attribute `json:"expression"` }
func NewDeclaration ¶
func NewDeclaration(context, varType, varId, expression Attribute) (Declaration, error)
type DeclarationList ¶
type DeclarationList []Declaration
func AppendDeclaration ¶
func AppendDeclaration(declarationList, declaration Attribute) (DeclarationList, error)
func NewDeclarationList ¶
func NewDeclarationList() (DeclarationList, error)
type Expression ¶
type Expression struct { FirstOperand Attribute `json:"firstOperand"` SecondOperand Attribute `json:"secondOperand"` Operator Attribute `json:"operator"` }
func NewExpression ¶
func NewExpression(firstOperand, operator, secondOperand Attribute) (Expression, error)
type IfStatement ¶
type IfStatement struct { Expression Expression `json:"expression"` BodyStatements StatementList `json:"bodyStatements"` ElseStatements StatementList `json:"elseStatements"` }
func NewIfStatement ¶
func NewIfStatement(condition, bodyBlock, elseBlock Attribute) (*IfStatement, error)
type Junction ¶
func NewJunction ¶
type Node ¶
type Node struct { Id string `json:"id"` TemplateId string `json:"templateId"` InDeclarations DeclarationList `json:"inDeclarations"` OutDeclarations DeclarationList `json:"outDeclarations"` ProcStatements StatementList `json:"procStatements"` }
func UseTemplate ¶
type NodeContext ¶
type NodeContext struct { InVariables symbolTable OutVariables symbolTable ProcVariables symbolTable }
type NodeVar ¶
func NewNodeVar ¶
type ParseContext ¶
type ParseContext struct { Templates map[string]*Node Nodes map[nodeKey]*NodeContext CurrentNode *NodeContext CurrentScope symbolTable }
func NewParseContext ¶
func NewParseContext() ParseContext
func (*ParseContext) AddNodeContext ¶
func (ctx *ParseContext) AddNodeContext(nodeName nodeKey, nodeContext *NodeContext)
func (*ParseContext) BabushkaPopScopeIn ¶
func (ctx *ParseContext) BabushkaPopScopeIn()
func (*ParseContext) BabushkaPopScopeNode ¶
func (ctx *ParseContext) BabushkaPopScopeNode(nodeId string)
func (*ParseContext) BabushkaPopScopeOut ¶
func (ctx *ParseContext) BabushkaPopScopeOut()
func (*ParseContext) BabushkaPopScopeProc ¶
func (ctx *ParseContext) BabushkaPopScopeProc()
func (*ParseContext) GetNodeContext ¶ added in v1.2.0
func (ctx *ParseContext) GetNodeContext(id string) *NodeContext
func (*ParseContext) NewNodeScope ¶
func (ctx *ParseContext) NewNodeScope()
func (*ParseContext) NewScope ¶
func (ctx *ParseContext) NewScope()
type Program ¶
type Program struct { Nodes NodeList `json:"nodes"` Connections ConnectionList `json:"connections"` }
func NewProgram ¶
type StatementList ¶
type StatementList []Statement
func AppendStatement ¶
func AppendStatement(statementList, statement Attribute) (StatementList, error)
func NewScopeProc ¶
func NewScopeProc(context, statementList Attribute) (StatementList, error)
func NewStatementList ¶
func NewStatementList(statement Attribute) (StatementList, error)
type TemplateUse ¶
type WhileStatement ¶
type WhileStatement struct { Condition Expression `json:"condition"` BodyStatements StatementList `json:"bodyStatements"` }
Click to show internal directories.
Click to hide internal directories.