Documentation ¶
Index ¶
- type Compiler
- func (c *Compiler) AddError(e error)
- func (c *Compiler) Compile(code string) bool
- func (c *Compiler) Debug(b bool)
- func (c *Compiler) GetCodePostion() int
- func (c *Compiler) GetCodes() []*yakvm.Code
- func (c *Compiler) GetErrors() []error
- func (c *Compiler) GetExternalVariablesNamesMap() map[string]struct{}
- func (c *Compiler) GetMergeError() error
- func (c *Compiler) GetSymbolId(name string) int
- func (c *Compiler) GetSymbolTable() *yakvm.SymbolTable
- func (c *Compiler) NeedPop(b bool)
- func (c *Compiler) RegisterVisitHook(id string, h func(compiler *Compiler, ctx antlr.ParserRuleContext))
- func (c *Compiler) SetCheckIdentifier(b bool)
- func (c *Compiler) SetExternalVariableNames(names []string)
- func (c *Compiler) SetNaslLib(naslLib map[string]interface{})
- func (c *Compiler) SetSourceCode(s string) func()
- func (c *Compiler) SetSourceCodeFilePath(s string) func()
- func (c *Compiler) SetStartPosition(n1, n2 int)
- func (c *Compiler) SetStopPosition(n1, n2 int)
- func (c *Compiler) UnregisterVisitHook(id string)
- func (c *Compiler) VisitAdditiveExpression(i *nasl.AdditiveExpressionContext)
- func (c *Compiler) VisitArrayLiteralExpression(i *nasl.ArrayLiteralExpressionContext)
- func (c *Compiler) VisitAssignmentExpression(i *nasl.AssignmentExpressionContext)
- func (c *Compiler) VisitBitAndExpression(i *nasl.BitAndExpressionContext)
- func (c *Compiler) VisitBitNotExpression(i *nasl.BitNotExpressionContext)
- func (c *Compiler) VisitBitOrExpression(i *nasl.BitOrExpressionContext)
- func (c *Compiler) VisitBitShiftExpression(i *nasl.BitShiftExpressionContext)
- func (c *Compiler) VisitBitXOrExpression(i *nasl.BitXOrExpressionContext)
- func (c *Compiler) VisitBlock(i nasl.IBlockContext)
- func (c *Compiler) VisitBreakStatement(i nasl.IBreakStatementContext)
- func (c *Compiler) VisitCallExpression(i *nasl.CallExpressionContext)
- func (c *Compiler) VisitContinueStatement(i nasl.IContinueStatementContext)
- func (c *Compiler) VisitEqualityExpression(i *nasl.EqualityExpressionContext)
- func (c *Compiler) VisitExitStatement(i nasl.IExitStatementContext)
- func (c *Compiler) VisitExpressionSequence(i nasl.IExpressionSequenceContext)
- func (c *Compiler) VisitExpressionStatement(i nasl.IExpressionStatementContext)
- func (c *Compiler) VisitForEachStatement(i *nasl.ForEachContext)
- func (c *Compiler) VisitForStatement(i *nasl.TraditionalForContext)
- func (c *Compiler) VisitFunctionDeclarationStatement(i nasl.IFunctionDeclarationStatementContext)
- func (c *Compiler) VisitIdentifier(i *nasl.IdentifierContext)
- func (c *Compiler) VisitIdentifierExpression(i *nasl.IdentifierExpressionContext)
- func (c *Compiler) VisitIfStatement(i nasl.IIfStatementContext)
- func (c *Compiler) VisitIterationStatement(i nasl.IIterationStatementContext)
- func (c *Compiler) VisitLiteralExpression(i *nasl.LiteralExpressionContext)
- func (c *Compiler) VisitLogicalAndExpression(i *nasl.LogicalAndExpressionContext)
- func (c *Compiler) VisitLogicalOrExpression(i *nasl.LogicalOrExpressionContext)
- func (c *Compiler) VisitMemberDotExpression(i *nasl.MemberDotExpressionContext)
- func (c *Compiler) VisitMemberIndexExpression(i *nasl.MemberIndexExpressionContext)
- func (c *Compiler) VisitMultiplicativeExpression(i *nasl.MultiplicativeExpressionContext)
- func (c *Compiler) VisitNotExpression(i *nasl.NotExpressionContext)
- func (c *Compiler) VisitParenthesizedExpression(i *nasl.ParenthesizedExpressionContext)
- func (c *Compiler) VisitPostDecreaseExpression(i *nasl.PostDecreaseExpressionContext)
- func (c *Compiler) VisitPostIncrementExpression(i *nasl.PostIncrementExpressionContext)
- func (c *Compiler) VisitPreDecreaseExpression(i *nasl.PreDecreaseExpressionContext)
- func (c *Compiler) VisitPreIncrementExpression(i *nasl.PreIncrementExpressionContext)
- func (c *Compiler) VisitProgram(i nasl.IProgramContext)
- func (c *Compiler) VisitRelationalExpression(i *nasl.RelationalExpressionContext)
- func (c *Compiler) VisitRepeatStatement(i *nasl.RepeatContext)
- func (c *Compiler) VisitReturnStatement(i nasl.IReturnStatementContext)
- func (c *Compiler) VisitSingleExpression(i nasl.ISingleExpressionContext)
- func (c *Compiler) VisitStatement(i nasl.IStatementContext)
- func (c *Compiler) VisitStatementList(i nasl.IStatementListContext)
- func (c *Compiler) VisitUnaryMinusExpression(i *nasl.UnaryMinusExpressionContext)
- func (c *Compiler) VisitUnaryPlusExpression(i *nasl.UnaryPlusExpressionContext)
- func (c *Compiler) VisitVariableDeclarationStatement(i nasl.IVariableDeclarationStatementContext)
- func (c *Compiler) VisitWhileStatement(i *nasl.WhileContext)
- func (c *Compiler) VisitXExpression(i *nasl.XExpressionContext)
- type ErrorListener
- type ParseTreeListener
- func (p *ParseTreeListener) EnterEveryRule(ctx antlr.ParserRuleContext)
- func (p *ParseTreeListener) ExitEveryRule(ctx antlr.ParserRuleContext)
- func (p *ParseTreeListener) SetEnter(h func(ctx antlr.ParserRuleContext))
- func (p *ParseTreeListener) SetExit(h func(ctx antlr.ParserRuleContext))
- func (p *ParseTreeListener) VisitErrorNode(node antlr.ErrorNode)
- func (p *ParseTreeListener) VisitTerminal(node antlr.TerminalNode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
func NewCompiler ¶
func NewCompiler() *Compiler
func NewCompilerWithSymbolTable ¶
func NewCompilerWithSymbolTable(table *yakvm.SymbolTable) *Compiler
func (*Compiler) GetCodePostion ¶
func (*Compiler) GetExternalVariablesNamesMap ¶
func (*Compiler) GetMergeError ¶
func (*Compiler) GetSymbolId ¶
func (*Compiler) GetSymbolTable ¶
func (c *Compiler) GetSymbolTable() *yakvm.SymbolTable
func (*Compiler) RegisterVisitHook ¶ added in v1.2.2
func (*Compiler) SetCheckIdentifier ¶
func (*Compiler) SetExternalVariableNames ¶
func (*Compiler) SetNaslLib ¶
func (*Compiler) SetSourceCode ¶
func (*Compiler) SetSourceCodeFilePath ¶
func (*Compiler) SetStartPosition ¶
func (*Compiler) SetStopPosition ¶
func (*Compiler) UnregisterVisitHook ¶ added in v1.2.2
func (*Compiler) VisitAdditiveExpression ¶
func (c *Compiler) VisitAdditiveExpression(i *nasl.AdditiveExpressionContext)
func (*Compiler) VisitArrayLiteralExpression ¶
func (c *Compiler) VisitArrayLiteralExpression(i *nasl.ArrayLiteralExpressionContext)
func (*Compiler) VisitAssignmentExpression ¶
func (c *Compiler) VisitAssignmentExpression(i *nasl.AssignmentExpressionContext)
func (*Compiler) VisitBitAndExpression ¶
func (c *Compiler) VisitBitAndExpression(i *nasl.BitAndExpressionContext)
func (*Compiler) VisitBitNotExpression ¶
func (c *Compiler) VisitBitNotExpression(i *nasl.BitNotExpressionContext)
func (*Compiler) VisitBitOrExpression ¶
func (c *Compiler) VisitBitOrExpression(i *nasl.BitOrExpressionContext)
func (*Compiler) VisitBitShiftExpression ¶
func (c *Compiler) VisitBitShiftExpression(i *nasl.BitShiftExpressionContext)
func (*Compiler) VisitBitXOrExpression ¶
func (c *Compiler) VisitBitXOrExpression(i *nasl.BitXOrExpressionContext)
func (*Compiler) VisitBlock ¶
func (c *Compiler) VisitBlock(i nasl.IBlockContext)
func (*Compiler) VisitBreakStatement ¶
func (c *Compiler) VisitBreakStatement(i nasl.IBreakStatementContext)
func (*Compiler) VisitCallExpression ¶
func (c *Compiler) VisitCallExpression(i *nasl.CallExpressionContext)
func (*Compiler) VisitContinueStatement ¶
func (c *Compiler) VisitContinueStatement(i nasl.IContinueStatementContext)
func (*Compiler) VisitEqualityExpression ¶
func (c *Compiler) VisitEqualityExpression(i *nasl.EqualityExpressionContext)
func (*Compiler) VisitExitStatement ¶
func (c *Compiler) VisitExitStatement(i nasl.IExitStatementContext)
func (*Compiler) VisitExpressionSequence ¶
func (c *Compiler) VisitExpressionSequence(i nasl.IExpressionSequenceContext)
func (*Compiler) VisitExpressionStatement ¶
func (c *Compiler) VisitExpressionStatement(i nasl.IExpressionStatementContext)
func (*Compiler) VisitForEachStatement ¶
func (c *Compiler) VisitForEachStatement(i *nasl.ForEachContext)
func (*Compiler) VisitForStatement ¶
func (c *Compiler) VisitForStatement(i *nasl.TraditionalForContext)
func (*Compiler) VisitFunctionDeclarationStatement ¶
func (c *Compiler) VisitFunctionDeclarationStatement(i nasl.IFunctionDeclarationStatementContext)
func (*Compiler) VisitIdentifier ¶ added in v1.2.2
func (c *Compiler) VisitIdentifier(i *nasl.IdentifierContext)
func (*Compiler) VisitIdentifierExpression ¶
func (c *Compiler) VisitIdentifierExpression(i *nasl.IdentifierExpressionContext)
func (*Compiler) VisitIfStatement ¶
func (c *Compiler) VisitIfStatement(i nasl.IIfStatementContext)
func (*Compiler) VisitIterationStatement ¶
func (c *Compiler) VisitIterationStatement(i nasl.IIterationStatementContext)
func (*Compiler) VisitLiteralExpression ¶
func (c *Compiler) VisitLiteralExpression(i *nasl.LiteralExpressionContext)
func (*Compiler) VisitLogicalAndExpression ¶
func (c *Compiler) VisitLogicalAndExpression(i *nasl.LogicalAndExpressionContext)
func (*Compiler) VisitLogicalOrExpression ¶
func (c *Compiler) VisitLogicalOrExpression(i *nasl.LogicalOrExpressionContext)
func (*Compiler) VisitMemberDotExpression ¶
func (c *Compiler) VisitMemberDotExpression(i *nasl.MemberDotExpressionContext)
func (*Compiler) VisitMemberIndexExpression ¶
func (c *Compiler) VisitMemberIndexExpression(i *nasl.MemberIndexExpressionContext)
func (*Compiler) VisitMultiplicativeExpression ¶
func (c *Compiler) VisitMultiplicativeExpression(i *nasl.MultiplicativeExpressionContext)
func (*Compiler) VisitNotExpression ¶
func (c *Compiler) VisitNotExpression(i *nasl.NotExpressionContext)
func (*Compiler) VisitParenthesizedExpression ¶
func (c *Compiler) VisitParenthesizedExpression(i *nasl.ParenthesizedExpressionContext)
func (*Compiler) VisitPostDecreaseExpression ¶
func (c *Compiler) VisitPostDecreaseExpression(i *nasl.PostDecreaseExpressionContext)
func (*Compiler) VisitPostIncrementExpression ¶
func (c *Compiler) VisitPostIncrementExpression(i *nasl.PostIncrementExpressionContext)
func (*Compiler) VisitPreDecreaseExpression ¶
func (c *Compiler) VisitPreDecreaseExpression(i *nasl.PreDecreaseExpressionContext)
func (*Compiler) VisitPreIncrementExpression ¶
func (c *Compiler) VisitPreIncrementExpression(i *nasl.PreIncrementExpressionContext)
func (*Compiler) VisitProgram ¶
func (c *Compiler) VisitProgram(i nasl.IProgramContext)
func (*Compiler) VisitRelationalExpression ¶
func (c *Compiler) VisitRelationalExpression(i *nasl.RelationalExpressionContext)
func (*Compiler) VisitRepeatStatement ¶
func (c *Compiler) VisitRepeatStatement(i *nasl.RepeatContext)
func (*Compiler) VisitReturnStatement ¶
func (c *Compiler) VisitReturnStatement(i nasl.IReturnStatementContext)
func (*Compiler) VisitSingleExpression ¶
func (c *Compiler) VisitSingleExpression(i nasl.ISingleExpressionContext)
func (*Compiler) VisitStatement ¶
func (c *Compiler) VisitStatement(i nasl.IStatementContext)
func (*Compiler) VisitStatementList ¶
func (c *Compiler) VisitStatementList(i nasl.IStatementListContext)
func (*Compiler) VisitUnaryMinusExpression ¶
func (c *Compiler) VisitUnaryMinusExpression(i *nasl.UnaryMinusExpressionContext)
func (*Compiler) VisitUnaryPlusExpression ¶
func (c *Compiler) VisitUnaryPlusExpression(i *nasl.UnaryPlusExpressionContext)
func (*Compiler) VisitVariableDeclarationStatement ¶
func (c *Compiler) VisitVariableDeclarationStatement(i nasl.IVariableDeclarationStatementContext)
func (*Compiler) VisitWhileStatement ¶
func (c *Compiler) VisitWhileStatement(i *nasl.WhileContext)
func (*Compiler) VisitXExpression ¶
func (c *Compiler) VisitXExpression(i *nasl.XExpressionContext)
type ErrorListener ¶
type ErrorListener struct { antlr.DefaultErrorListener // contains filtered or unexported fields }
func NewErrorListener ¶
func NewErrorListener(handle func(msg string)) *ErrorListener
func (*ErrorListener) SyntaxError ¶
func (el *ErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)
type ParseTreeListener ¶
type ParseTreeListener struct { EnterEveryRuleHandle func(ctx antlr.ParserRuleContext) ExitEveryRuleHandle func(ctx antlr.ParserRuleContext) }
func NewParseTreeListener ¶
func NewParseTreeListener() *ParseTreeListener
func (*ParseTreeListener) EnterEveryRule ¶
func (p *ParseTreeListener) EnterEveryRule(ctx antlr.ParserRuleContext)
func (*ParseTreeListener) ExitEveryRule ¶
func (p *ParseTreeListener) ExitEveryRule(ctx antlr.ParserRuleContext)
func (*ParseTreeListener) SetEnter ¶
func (p *ParseTreeListener) SetEnter(h func(ctx antlr.ParserRuleContext))
func (*ParseTreeListener) SetExit ¶
func (p *ParseTreeListener) SetExit(h func(ctx antlr.ParserRuleContext))
func (*ParseTreeListener) VisitErrorNode ¶
func (p *ParseTreeListener) VisitErrorNode(node antlr.ErrorNode)
func (*ParseTreeListener) VisitTerminal ¶
func (p *ParseTreeListener) VisitTerminal(node antlr.TerminalNode)
Click to show internal directories.
Click to hide internal directories.