Documentation
¶
Index ¶
- func NewBlockStatement(statements []api.IStatement) api.IStatement
- func NewExpressionStatement(expression api.IExpression) api.IStatement
- func NewFunctionStatement(name api.IToken, params []api.IToken, body []api.IStatement) api.IStatement
- func NewIfStatement(condition api.IExpression, thenBranch, elseBranch api.IStatement) api.IStatement
- func NewInterruptStatement(name api.IToken, iType api.InterruptType) api.IStatement
- func NewPrintStatement(expression api.IExpression) api.IStatement
- func NewReturnStatement(keyword api.IToken, value api.IExpression) api.IStatement
- func NewVarStatement(name api.IToken, initializer api.IExpression) api.IStatement
- func NewWhileStatement(condition api.IExpression, body api.IStatement) api.IStatement
- type BlockStatement
- type ExpressionStatement
- type FunctionStatement
- type IfStatement
- type InterruptStatement
- type PrintStatement
- type ReturnStatement
- func (s *ReturnStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
- func (s *ReturnStatement) Keyword() api.IToken
- func (s *ReturnStatement) StmtType() api.StatementType
- func (s ReturnStatement) String() string
- func (s *ReturnStatement) Type() api.InterruptType
- func (s *ReturnStatement) Value() api.IExpression
- type Statement
- func (s *Statement) Body() []api.IStatement
- func (s *Statement) Condition() api.IExpression
- func (s *Statement) ElseBranch() api.IStatement
- func (s *Statement) Expression() api.IExpression
- func (s *Statement) Initializer() api.IExpression
- func (s *Statement) Keyword() api.IToken
- func (s *Statement) Name() api.IToken
- func (s *Statement) Parameters() []api.IToken
- func (s *Statement) Statements() []api.IStatement
- func (s *Statement) StmtType() api.StatementType
- func (s Statement) String() string
- func (s *Statement) ThenBranch() api.IStatement
- func (s *Statement) Type() api.InterruptType
- func (s *Statement) Value() api.IExpression
- type VarStatement
- type WhileStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBlockStatement ¶
func NewBlockStatement(statements []api.IStatement) api.IStatement
func NewExpressionStatement ¶
func NewExpressionStatement(expression api.IExpression) api.IStatement
func NewFunctionStatement ¶
func NewFunctionStatement(name api.IToken, params []api.IToken, body []api.IStatement) api.IStatement
func NewIfStatement ¶
func NewIfStatement(condition api.IExpression, thenBranch, elseBranch api.IStatement) api.IStatement
func NewInterruptStatement ¶
func NewInterruptStatement(name api.IToken, iType api.InterruptType) api.IStatement
func NewPrintStatement ¶
func NewPrintStatement(expression api.IExpression) api.IStatement
func NewReturnStatement ¶
func NewReturnStatement(keyword api.IToken, value api.IExpression) api.IStatement
func NewVarStatement ¶
func NewVarStatement(name api.IToken, initializer api.IExpression) api.IStatement
func NewWhileStatement ¶
func NewWhileStatement(condition api.IExpression, body api.IStatement) api.IStatement
Types ¶
type BlockStatement ¶
type BlockStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- Block statement ---------------------------------------------------
func (*BlockStatement) Accept ¶
func (s *BlockStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*BlockStatement) Statements ¶
func (s *BlockStatement) Statements() []api.IStatement
func (BlockStatement) String ¶
func (s BlockStatement) String() string
type ExpressionStatement ¶
type ExpressionStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- Expression statement ---------------------------------------------------
func (*ExpressionStatement) Accept ¶
func (s *ExpressionStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*ExpressionStatement) Expression ¶
func (s *ExpressionStatement) Expression() api.IExpression
func (ExpressionStatement) String ¶
func (s ExpressionStatement) String() string
type FunctionStatement ¶
type FunctionStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- "fun" statement ---------------------------------------------------
func (*FunctionStatement) Accept ¶
func (s *FunctionStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*FunctionStatement) Body ¶
func (s *FunctionStatement) Body() []api.IStatement
func (*FunctionStatement) Name ¶
func (s *FunctionStatement) Name() api.IToken
func (*FunctionStatement) Parameters ¶
func (s *FunctionStatement) Parameters() []api.IToken
func (FunctionStatement) String ¶
func (s FunctionStatement) String() string
type IfStatement ¶
type IfStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- "if" statement ---------------------------------------------------
func (*IfStatement) Accept ¶
func (s *IfStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*IfStatement) Condition ¶
func (s *IfStatement) Condition() api.IExpression
func (*IfStatement) ElseBranch ¶
func (s *IfStatement) ElseBranch() api.IStatement
func (IfStatement) String ¶
func (s IfStatement) String() string
func (*IfStatement) ThenBranch ¶
func (s *IfStatement) ThenBranch() api.IStatement
type InterruptStatement ¶
type InterruptStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- "break", "continue" interrupt statements ---------------------------------------------------
func (*InterruptStatement) Accept ¶
func (s *InterruptStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*InterruptStatement) Name ¶
func (s *InterruptStatement) Name() api.IToken
func (InterruptStatement) String ¶
func (s InterruptStatement) String() string
func (*InterruptStatement) Type ¶
func (s *InterruptStatement) Type() api.InterruptType
type PrintStatement ¶
type PrintStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- Print statement ---------------------------------------------------
func (*PrintStatement) Accept ¶
func (s *PrintStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*PrintStatement) Expression ¶
func (s *PrintStatement) Expression() api.IExpression
func (PrintStatement) String ¶
func (s PrintStatement) String() string
type ReturnStatement ¶
type ReturnStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- "return" statement ---------------------------------------------------
func (*ReturnStatement) Accept ¶
func (s *ReturnStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*ReturnStatement) Keyword ¶
func (s *ReturnStatement) Keyword() api.IToken
func (*ReturnStatement) StmtType ¶
func (s *ReturnStatement) StmtType() api.StatementType
func (ReturnStatement) String ¶
func (s ReturnStatement) String() string
func (*ReturnStatement) Type ¶
func (s *ReturnStatement) Type() api.InterruptType
func (*ReturnStatement) Value ¶
func (s *ReturnStatement) Value() api.IExpression
type Statement ¶
type Statement struct { }
func (*Statement) Body ¶
func (s *Statement) Body() []api.IStatement
func (*Statement) Condition ¶
func (s *Statement) Condition() api.IExpression
func (*Statement) ElseBranch ¶
func (s *Statement) ElseBranch() api.IStatement
func (*Statement) Expression ¶
func (s *Statement) Expression() api.IExpression
func (*Statement) Initializer ¶
func (s *Statement) Initializer() api.IExpression
func (*Statement) Parameters ¶
func (*Statement) Statements ¶
func (s *Statement) Statements() []api.IStatement
func (*Statement) StmtType ¶
func (s *Statement) StmtType() api.StatementType
func (*Statement) ThenBranch ¶
func (s *Statement) ThenBranch() api.IStatement
func (*Statement) Type ¶
func (s *Statement) Type() api.InterruptType
func (*Statement) Value ¶
func (s *Statement) Value() api.IExpression
type VarStatement ¶
type VarStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- var statement ---------------------------------------------------
func (*VarStatement) Accept ¶
func (s *VarStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*VarStatement) Initializer ¶
func (s *VarStatement) Initializer() api.IExpression
func (*VarStatement) Name ¶
func (s *VarStatement) Name() api.IToken
func (VarStatement) String ¶
func (s VarStatement) String() string
type WhileStatement ¶
type WhileStatement struct { Statement // contains filtered or unexported fields }
--------------------------------------------------- "while" statement ---------------------------------------------------
func (*WhileStatement) Accept ¶
func (s *WhileStatement) Accept(visitor api.IVisitorStatement) (err api.IRuntimeError)
func (*WhileStatement) Body ¶
func (s *WhileStatement) Body() []api.IStatement
func (*WhileStatement) Condition ¶
func (s *WhileStatement) Condition() api.IExpression
func (WhileStatement) String ¶
func (s WhileStatement) String() string