ast

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AclCidr

type AclCidr struct {
	*Meta
	Inverse *Boolean
	IP      *IP
	Mask    *Integer
}

func (*AclCidr) GetMeta added in v0.0.7

func (c *AclCidr) GetMeta() *Meta

func (*AclCidr) String

func (c *AclCidr) String() string

type AclDeclaration

type AclDeclaration struct {
	*Meta
	Name  *Ident
	CIDRs []*AclCidr
}

func (*AclDeclaration) GetMeta added in v0.0.7

func (a *AclDeclaration) GetMeta() *Meta

func (*AclDeclaration) String

func (a *AclDeclaration) String() string

type AddStatement

type AddStatement struct {
	*Meta
	Ident    *Ident
	Operator *Operator
	Value    Expression
}

func (*AddStatement) GetMeta added in v0.0.7

func (a *AddStatement) GetMeta() *Meta

func (*AddStatement) String

func (a *AddStatement) String() string

type BackendDeclaration

type BackendDeclaration struct {
	*Meta
	Name       *Ident
	Properties []*BackendProperty
}

func (*BackendDeclaration) GetMeta added in v0.0.7

func (b *BackendDeclaration) GetMeta() *Meta

func (*BackendDeclaration) String

func (b *BackendDeclaration) String() string

type BackendProbeObject

type BackendProbeObject struct {
	*Meta
	Values []*BackendProperty
}

func (*BackendProbeObject) GetMeta added in v0.0.7

func (o *BackendProbeObject) GetMeta() *Meta

func (*BackendProbeObject) String

func (o *BackendProbeObject) String() string

type BackendProperty

type BackendProperty struct {
	*Meta
	Key   *Ident
	Value Expression
}

func (*BackendProperty) GetMeta added in v0.0.7

func (p *BackendProperty) GetMeta() *Meta

func (*BackendProperty) String

func (p *BackendProperty) String() string

type BlockStatement

type BlockStatement struct {
	*Meta
	Statements []Statement
}

func (*BlockStatement) GetMeta added in v0.0.7

func (b *BlockStatement) GetMeta() *Meta

func (*BlockStatement) String

func (b *BlockStatement) String() string

type Boolean

type Boolean struct {
	*Meta
	Value bool
}

func (*Boolean) GetMeta added in v0.0.7

func (b *Boolean) GetMeta() *Meta

func (*Boolean) String

func (b *Boolean) String() string

type BreakStatement added in v1.4.0

type BreakStatement struct {
	*Meta
}

func (*BreakStatement) GetMeta added in v1.4.0

func (r *BreakStatement) GetMeta() *Meta

func (*BreakStatement) String added in v1.4.0

func (r *BreakStatement) String() string

type CallStatement

type CallStatement struct {
	*Meta
	Subroutine *Ident
}

func (*CallStatement) GetMeta added in v0.0.7

func (c *CallStatement) GetMeta() *Meta

func (*CallStatement) String

func (c *CallStatement) String() string

type CaseStatement added in v1.4.0

type CaseStatement struct {
	*Meta
	Test        *InfixExpression
	Statements  []Statement
	Fallthrough bool
}

func (*CaseStatement) GetMeta added in v1.4.0

func (s *CaseStatement) GetMeta() *Meta

func (*CaseStatement) String added in v1.4.0

func (s *CaseStatement) String() string

type Comment added in v0.0.7

type Comment struct {
	Token token.Token
	Value string
	// PrefixedLineFeed represents the previous token of this comment is token.LF.
	// For example:
	//
	// ...some statements...
	// } // comment with PrefixedLineFeed: false
	// ----
	// ...some statements ...
	// }
	// // comment with PrefixedLineFeed: true
	// This flag is used for parsing trailing comment,
	// If this flag is false, it should be treated as trailing comment
	// because the comment presents on the same line.
	// Otherwise, this flag is true, it should be the leading comment for a next token.
	PrefixedLineFeed   bool
	PreviousEmptyLines int
}

func (*Comment) String added in v0.0.7

func (c *Comment) String() string

type Comments

type Comments []*Comment

func (*Comments) Annotations

func (c *Comments) Annotations() []string

func (Comments) String

func (c Comments) String() string

type DeclareStatement

type DeclareStatement struct {
	*Meta
	Name      *Ident
	ValueType *Ident
}

func (*DeclareStatement) GetMeta added in v0.0.7

func (d *DeclareStatement) GetMeta() *Meta

func (*DeclareStatement) String

func (d *DeclareStatement) String() string

type DirectorBackendObject

type DirectorBackendObject struct {
	*Meta
	Values []*DirectorProperty
}

func (*DirectorBackendObject) GetMeta added in v0.0.7

func (d *DirectorBackendObject) GetMeta() *Meta

func (*DirectorBackendObject) String

func (d *DirectorBackendObject) String() string

type DirectorDeclaration

type DirectorDeclaration struct {
	*Meta
	Name         *Ident
	DirectorType *Ident
	Properties   []Expression
}

func (*DirectorDeclaration) GetMeta added in v0.0.7

func (d *DirectorDeclaration) GetMeta() *Meta

func (*DirectorDeclaration) String

func (d *DirectorDeclaration) String() string

type DirectorProperty

type DirectorProperty struct {
	*Meta
	Key   *Ident
	Value Expression
}

func (*DirectorProperty) GetMeta added in v0.0.7

func (d *DirectorProperty) GetMeta() *Meta

func (*DirectorProperty) String

func (d *DirectorProperty) String() string

type ElseStatement added in v1.6.0

type ElseStatement struct {
	*Meta
	Consequence *BlockStatement
}

func (*ElseStatement) GetMeta added in v1.6.0

func (e *ElseStatement) GetMeta() *Meta

func (*ElseStatement) String added in v1.6.0

func (e *ElseStatement) String() string

type ErrorStatement

type ErrorStatement struct {
	*Meta
	Code     Expression
	Argument Expression
}

func (*ErrorStatement) GetMeta added in v0.0.7

func (e *ErrorStatement) GetMeta() *Meta

func (*ErrorStatement) String

func (e *ErrorStatement) String() string

type EsiStatement

type EsiStatement struct {
	*Meta
}

func (*EsiStatement) GetMeta added in v0.0.7

func (e *EsiStatement) GetMeta() *Meta

func (*EsiStatement) String

func (e *EsiStatement) String() string

type Expression

type Expression interface {
	Node

	LeadingComment(combinationMode) string
	TrailingComment(combinationMode) string
	InfixComment(combinationMode) string
	// contains filtered or unexported methods
}

type FallthroughStatement added in v1.4.0

type FallthroughStatement struct {
	*Meta
}

func (*FallthroughStatement) GetMeta added in v1.4.0

func (r *FallthroughStatement) GetMeta() *Meta

func (*FallthroughStatement) String added in v1.4.0

func (r *FallthroughStatement) String() string

type Float

type Float struct {
	*Meta
	Value float64
}

func (*Float) GetMeta added in v0.0.7

func (f *Float) GetMeta() *Meta

func (*Float) String

func (f *Float) String() string

type FunctionCallExpression

type FunctionCallExpression struct {
	*Meta
	Function  *Ident
	Arguments []Expression
}

func (*FunctionCallExpression) GetMeta added in v0.0.7

func (f *FunctionCallExpression) GetMeta() *Meta

func (*FunctionCallExpression) String

func (f *FunctionCallExpression) String() string

type FunctionCallStatement added in v0.9.3

type FunctionCallStatement struct {
	*Meta
	Function  *Ident
	Arguments []Expression
}

func (*FunctionCallStatement) GetMeta added in v0.9.3

func (fc *FunctionCallStatement) GetMeta() *Meta

func (*FunctionCallStatement) String added in v0.9.3

func (fc *FunctionCallStatement) String() string

type GotoDestinationStatement added in v0.9.3

type GotoDestinationStatement struct {
	*Meta
	Name *Ident
}

func (*GotoDestinationStatement) GetMeta added in v0.9.3

func (gd *GotoDestinationStatement) GetMeta() *Meta

func (*GotoDestinationStatement) String added in v0.9.3

func (gd *GotoDestinationStatement) String() string

type GotoStatement added in v0.9.3

type GotoStatement struct {
	*Meta
	Destination *Ident
}

func (*GotoStatement) GetMeta added in v0.9.3

func (g *GotoStatement) GetMeta() *Meta

func (*GotoStatement) String added in v0.9.3

func (g *GotoStatement) String() string

type GroupedExpression

type GroupedExpression struct {
	*Meta
	Right Expression
}

func (*GroupedExpression) GetMeta added in v0.0.7

func (g *GroupedExpression) GetMeta() *Meta

func (*GroupedExpression) String

func (g *GroupedExpression) String() string

type IP

type IP struct {
	*Meta
	Value string
}

func (*IP) GetMeta added in v0.0.7

func (i *IP) GetMeta() *Meta

func (*IP) String

func (i *IP) String() string

type Ident

type Ident struct {
	*Meta
	Value string
}

func (*Ident) GetMeta added in v0.0.7

func (i *Ident) GetMeta() *Meta

func (*Ident) String

func (i *Ident) String() string

type IfExpression

type IfExpression struct {
	*Meta
	Condition   Expression
	Consequence Expression
	Alternative Expression
}

func (*IfExpression) GetMeta added in v0.0.7

func (i *IfExpression) GetMeta() *Meta

func (*IfExpression) String

func (i *IfExpression) String() string

type IfStatement

type IfStatement struct {
	*Meta
	Keyword     string
	Condition   Expression
	Consequence *BlockStatement
	Another     []*IfStatement
	Alternative *ElseStatement
}

func (*IfStatement) GetMeta added in v0.0.7

func (i *IfStatement) GetMeta() *Meta

func (*IfStatement) String

func (i *IfStatement) String() string

type ImportStatement

type ImportStatement struct {
	*Meta
	Name *Ident
}

func (*ImportStatement) GetMeta added in v0.0.7

func (i *ImportStatement) GetMeta() *Meta

func (*ImportStatement) String

func (i *ImportStatement) String() string

type IncludeStatement

type IncludeStatement struct {
	*Meta
	Module *String
}

func (*IncludeStatement) GetMeta added in v0.0.7

func (i *IncludeStatement) GetMeta() *Meta

func (*IncludeStatement) String

func (i *IncludeStatement) String() string

type InfixExpression

type InfixExpression struct {
	*Meta
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) GetMeta added in v0.0.7

func (i *InfixExpression) GetMeta() *Meta

func (*InfixExpression) String

func (i *InfixExpression) String() string

type Integer

type Integer struct {
	*Meta
	Value int64
}

func (*Integer) GetMeta added in v0.0.7

func (i *Integer) GetMeta() *Meta

func (*Integer) String

func (i *Integer) String() string

type LogStatement

type LogStatement struct {
	*Meta
	Value Expression
}

func (*LogStatement) GetMeta added in v0.0.7

func (l *LogStatement) GetMeta() *Meta

func (*LogStatement) String

func (l *LogStatement) String() string

type Meta added in v0.0.7

type Meta struct {
	Token              token.Token
	Leading            Comments
	Trailing           Comments
	Infix              Comments
	Nest               int
	PreviousEmptyLines int
}

Meta struct of all nodes

func New added in v0.0.7

func New(t token.Token, nest int, comments ...Comments) *Meta

func (*Meta) InfixComment added in v0.0.7

func (m *Meta) InfixComment(cm combinationMode) string

func (*Meta) LeadingComment added in v0.0.7

func (m *Meta) LeadingComment(cm combinationMode) string

func (*Meta) TrailingComment added in v0.0.7

func (m *Meta) TrailingComment(cm combinationMode) string

type Node

type Node interface {
	String() string
	GetMeta() *Meta
}

type Operator

type Operator struct {
	*Meta
	Operator string
}

func (*Operator) String

func (o *Operator) String() string

type PenaltyboxDeclaration added in v0.9.3

type PenaltyboxDeclaration struct {
	*Meta
	Name  *Ident
	Block *BlockStatement
}

func (*PenaltyboxDeclaration) GetMeta added in v0.9.3

func (p *PenaltyboxDeclaration) GetMeta() *Meta

func (*PenaltyboxDeclaration) String added in v0.9.3

func (p *PenaltyboxDeclaration) String() string

type PostfixExpression added in v1.5.0

type PostfixExpression struct {
	*Meta
	Left     Expression
	Operator string
}

func (*PostfixExpression) GetMeta added in v1.5.0

func (i *PostfixExpression) GetMeta() *Meta

func (*PostfixExpression) String added in v1.5.0

func (i *PostfixExpression) String() string

type PrefixExpression

type PrefixExpression struct {
	*Meta
	Operator string
	Right    Expression
}

func (*PrefixExpression) GetMeta added in v0.0.7

func (p *PrefixExpression) GetMeta() *Meta

func (*PrefixExpression) String

func (p *PrefixExpression) String() string

type RTime

type RTime struct {
	*Meta
	Value string
}

func (*RTime) GetMeta added in v0.0.7

func (r *RTime) GetMeta() *Meta

func (*RTime) String

func (r *RTime) String() string

type RatecounterDeclaration added in v0.9.3

type RatecounterDeclaration struct {
	*Meta
	Name  *Ident
	Block *BlockStatement
}

func (*RatecounterDeclaration) GetMeta added in v0.9.3

func (r *RatecounterDeclaration) GetMeta() *Meta

func (*RatecounterDeclaration) String added in v0.9.3

func (r *RatecounterDeclaration) String() string

type RemoveStatement

type RemoveStatement struct {
	*Meta
	Ident *Ident
}

func (*RemoveStatement) GetMeta added in v0.0.7

func (r *RemoveStatement) GetMeta() *Meta

func (*RemoveStatement) String

func (r *RemoveStatement) String() string

type RestartStatement

type RestartStatement struct {
	*Meta
}

func (*RestartStatement) GetMeta added in v0.0.7

func (r *RestartStatement) GetMeta() *Meta

func (*RestartStatement) String

func (r *RestartStatement) String() string

type ReturnStatement

type ReturnStatement struct {
	*Meta
	ReturnExpression            Expression
	HasParenthesis              bool
	ParenthesisLeadingComments  Comments
	ParenthesisTrailingComments Comments
}

func (*ReturnStatement) GetMeta added in v0.0.7

func (r *ReturnStatement) GetMeta() *Meta

func (*ReturnStatement) String

func (r *ReturnStatement) String() string

type SetStatement

type SetStatement struct {
	*Meta
	Ident    *Ident
	Operator *Operator
	Value    Expression
}

func (*SetStatement) GetMeta added in v0.0.7

func (s *SetStatement) GetMeta() *Meta

func (*SetStatement) String

func (s *SetStatement) String() string

type Statement

type Statement interface {
	Node

	LeadingComment(combinationMode) string
	TrailingComment(combinationMode) string
	InfixComment(combinationMode) string
	// contains filtered or unexported methods
}

type String

type String struct {
	*Meta
	Value string
}

func (*String) GetMeta added in v0.0.7

func (s *String) GetMeta() *Meta

func (*String) String

func (s *String) String() string

type SubroutineDeclaration

type SubroutineDeclaration struct {
	*Meta
	Name       *Ident
	Block      *BlockStatement
	ReturnType *Ident
}

func (*SubroutineDeclaration) GetMeta added in v0.0.7

func (s *SubroutineDeclaration) GetMeta() *Meta

func (*SubroutineDeclaration) String

func (s *SubroutineDeclaration) String() string

type SwitchControl added in v1.6.0

type SwitchControl struct {
	*Meta
	Expression Expression
}

func (*SwitchControl) GetMeta added in v1.6.0

func (s *SwitchControl) GetMeta() *Meta

func (*SwitchControl) String added in v1.6.0

func (s *SwitchControl) String() string

type SwitchStatement added in v1.4.0

type SwitchStatement struct {
	*Meta
	Control *SwitchControl
	Cases   []*CaseStatement
	Default int
}

func (*SwitchStatement) GetMeta added in v1.4.0

func (s *SwitchStatement) GetMeta() *Meta

func (*SwitchStatement) String added in v1.4.0

func (s *SwitchStatement) String() string

type SyntheticBase64Statement

type SyntheticBase64Statement struct {
	*Meta
	Value Expression
}

func (*SyntheticBase64Statement) GetMeta added in v0.0.7

func (s *SyntheticBase64Statement) GetMeta() *Meta

func (*SyntheticBase64Statement) String

func (s *SyntheticBase64Statement) String() string

type SyntheticStatement

type SyntheticStatement struct {
	*Meta
	Value Expression
}

func (*SyntheticStatement) GetMeta added in v0.0.7

func (s *SyntheticStatement) GetMeta() *Meta

func (*SyntheticStatement) String

func (s *SyntheticStatement) String() string

type TableDeclaration

type TableDeclaration struct {
	*Meta
	Name       *Ident
	ValueType  *Ident
	Properties []*TableProperty
}

func (*TableDeclaration) GetMeta added in v0.0.7

func (t *TableDeclaration) GetMeta() *Meta

func (*TableDeclaration) String

func (t *TableDeclaration) String() string

type TableProperty

type TableProperty struct {
	*Meta
	Key      *String
	Value    Expression
	HasComma bool
}

func (*TableProperty) String

func (t *TableProperty) String() string

type UnsetStatement

type UnsetStatement struct {
	*Meta
	Ident *Ident
}

func (*UnsetStatement) GetMeta added in v0.0.7

func (u *UnsetStatement) GetMeta() *Meta

func (*UnsetStatement) String

func (u *UnsetStatement) String() string

type VCL

type VCL struct {
	Statements []Statement
}

VCL is a root of program

func (*VCL) GetMeta added in v0.0.7

func (v *VCL) GetMeta() *Meta

func (*VCL) String

func (v *VCL) String() string

Jump to

Keyboard shortcuts

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