visitors

package
v1.3.6-beta3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler struct {
	TmpData *vmstack.Stack
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler() *Compiler

func NewCompilerWithSymbolTable

func NewCompilerWithSymbolTable(table *yakvm.SymbolTable) *Compiler

func (*Compiler) AddError

func (c *Compiler) AddError(e error)

func (*Compiler) Compile

func (c *Compiler) Compile(code string) bool

func (*Compiler) Debug added in v1.2.2

func (c *Compiler) Debug(b bool)

func (*Compiler) GetCodePostion

func (c *Compiler) GetCodePostion() int

func (*Compiler) GetCodes

func (c *Compiler) GetCodes() []*yakvm.Code

func (*Compiler) GetErrors

func (c *Compiler) GetErrors() []error

func (*Compiler) GetExternalVariablesNamesMap

func (c *Compiler) GetExternalVariablesNamesMap() map[string]struct{}

func (*Compiler) GetMergeError

func (c *Compiler) GetMergeError() error

func (*Compiler) GetSymbolId

func (c *Compiler) GetSymbolId(name string) int

func (*Compiler) GetSymbolTable

func (c *Compiler) GetSymbolTable() *yakvm.SymbolTable

func (*Compiler) NeedPop

func (c *Compiler) NeedPop(b bool)

func (*Compiler) RegisterVisitHook added in v1.2.2

func (c *Compiler) RegisterVisitHook(id string, h func(compiler *Compiler, ctx antlr.ParserRuleContext))

func (*Compiler) SetCheckIdentifier

func (c *Compiler) SetCheckIdentifier(b bool)

func (*Compiler) SetExternalVariableNames

func (c *Compiler) SetExternalVariableNames(names []string)

func (*Compiler) SetNaslLib

func (c *Compiler) SetNaslLib(naslLib map[string]interface{})

func (*Compiler) SetSourceCode

func (c *Compiler) SetSourceCode(s string) func()

func (*Compiler) SetSourceCodeFilePath

func (c *Compiler) SetSourceCodeFilePath(s string) func()

func (*Compiler) SetStartPosition

func (c *Compiler) SetStartPosition(n1, n2 int)

func (*Compiler) SetStopPosition

func (c *Compiler) SetStopPosition(n1, n2 int)

func (*Compiler) UnregisterVisitHook added in v1.2.2

func (c *Compiler) UnregisterVisitHook(id string)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL