ast

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymousField

type AnonymousField struct {
	*common.Node
	IsPointerReceiver bool
	Type              string
}

func (*AnonymousField) Eval

func (this *AnonymousField) Eval() string

type Arguments

type Arguments struct {
	*common.Node
	TemplateSpec *TemplateSpec
	Expressions  *ExpressionList
	Type         *Type
	IsVariadic   bool
}

func (Arguments) Eval

func (this Arguments) Eval() string

type ArrayType

type ArrayType struct {
	*common.Node
	Length      *Expression
	ElementType *Type
}

func (ArrayType) Eval

func (this ArrayType) Eval() string

type Assignment

type Assignment struct {
	*common.Node
	Left  *ExpressionList
	Op    string
	Right *ExpressionList
}

func (Assignment) Eval

func (this Assignment) Eval() string

type Block

type Block struct {
	*common.Node
	Statements []*Statement
}

func (*Block) AddReturn added in v0.5.0

func (this *Block) AddReturn()

func (Block) Eval

func (this Block) Eval() string

type BreakStmt

type BreakStmt struct {
	*common.Node
	Name string
}

func (BreakStmt) Eval

func (this BreakStmt) Eval() string

type ChannelType

type ChannelType struct {
	*common.Node
	ChannelDecl string
	Type        *Type
}

func (ChannelType) Eval

func (this ChannelType) Eval() string

type CommCase

type CommCase struct {
	*common.Node
	SendStmt  *SendStmt
	RecvStmt  *RecvStmt
	IsDefault bool
}

func (CommCase) Eval

func (this CommCase) Eval() string

type CommClause

type CommClause struct {
	*common.Node
	CommCase *CommCase
	Block    *Block
}

func (CommClause) Eval

func (this CommClause) Eval() string

type CompositeLit

type CompositeLit struct {
	*common.Node
	LiteralType  *LiteralType
	TemplateSpec *TemplateSpec
	LiteralValue *LiteralValue
}

func (CompositeLit) Eval

func (this CompositeLit) Eval() string

type ConstDecl

type ConstDecl struct {
	*common.Node
	ConstSpecs []*ConstSpec
}

func (ConstDecl) Eval

func (this ConstDecl) Eval() string

type ConstSpec

type ConstSpec struct {
	*common.Node
	IdentifierList *IdentifierList
	Type           *Type
	ExpressionList *ExpressionList
}

func (ConstSpec) Eval

func (this ConstSpec) Eval() string

type ContinueStmt

type ContinueStmt struct {
	*common.Node
	Name string
}

func (ContinueStmt) Eval

func (this ContinueStmt) Eval() string

type Conversion

type Conversion struct {
	*common.Node
	Type       *Type
	Expression *Expression
}

func (Conversion) Eval

func (this Conversion) Eval() string

type Declaration

type Declaration struct {
	*common.Node
	ConstDecl *ConstDecl
	TypeDecl  *TypeDecl
	VarDecl   *VarDecl
}

func (Declaration) Eval

func (this Declaration) Eval() string

type DeferStmt

type DeferStmt struct {
	*common.Node
	Expression *Expression
}

func (DeferStmt) Eval

func (this DeferStmt) Eval() string

type Element

type Element struct {
	*common.Node
	Expression   *Expression
	LiteralValue *LiteralValue
}

func (Element) Eval

func (this Element) Eval() string

type ExprCaseClause

type ExprCaseClause struct {
	*common.Node
	ExprSwitchCase *ExprSwitchCase
	Statements     []*Statement
}

func (ExprCaseClause) Eval

func (this ExprCaseClause) Eval() string

type ExprSwitchCase

type ExprSwitchCase struct {
	*common.Node
	Expressions *ExpressionList
	IsDefault   bool
}

func (ExprSwitchCase) Eval

func (this ExprSwitchCase) Eval() string

type ExprSwitchStmt

type ExprSwitchStmt struct {
	*common.Node
	SimpleStmt      *SimpleStmt
	Expression      *Expression
	ExprCaseClauses []*ExprCaseClause
}

func (ExprSwitchStmt) Eval

func (this ExprSwitchStmt) Eval() string

type Expression

type Expression struct {
	*common.Node
	UnaryExpr       *UnaryExpr
	LeftExpression  *Expression
	Op              string
	RightExpression *Expression
}

func (Expression) Eval

func (this Expression) Eval() string

type ExpressionList

type ExpressionList struct {
	*common.Node
	Expressions []*Expression
}

func (ExpressionList) Eval

func (this ExpressionList) Eval() string

type FallthroughStmt

type FallthroughStmt struct {
	*common.Node
}

func (FallthroughStmt) Eval

func (this FallthroughStmt) Eval() string

type FieldDecl

type FieldDecl struct {
	*common.Node
	IdentifierList     *IdentifierList
	Type               *Type
	Anonymous          *AnonymousField
	Tag                string
	InlineStructMethod *InlineStructMethod
}

func (FieldDecl) Eval

func (this FieldDecl) Eval() string

type ForClause

type ForClause struct {
	*common.Node
	LeftSimpleStmt  *SimpleStmt
	Expression      *Expression
	RightSimpleStmt *SimpleStmt
}

func (ForClause) Eval

func (this ForClause) Eval() string

type ForStmt

type ForStmt struct {
	*common.Node
	Expression  *Expression
	ForClause   *ForClause
	RangeClause *RangeClause
	Block       *Block
}

func (ForStmt) Eval

func (this ForStmt) Eval() string

type Function

type Function struct {
	*common.Node
	Signature *Signature
	Block     *Block
}

func (Function) Eval

func (this Function) Eval() string

type FunctionDecl

type FunctionDecl struct {
	*common.Node
	Name      string
	Function  *Function
	Signature *Signature
}

func (FunctionDecl) Eval

func (this FunctionDecl) Eval() string

type FunctionLit

type FunctionLit struct {
	*common.Node
	Function *Function
}

func (FunctionLit) Eval

func (this FunctionLit) Eval() string

type FunctionType

type FunctionType struct {
	*common.Node
	Signature *Signature
}

func (FunctionType) Eval

func (this FunctionType) Eval() string

type GoStmt

type GoStmt struct {
	*common.Node
	Function   *Function
	Expression *Expression
}

func (GoStmt) Eval

func (this GoStmt) Eval() string

type GotoStmt

type GotoStmt struct {
	*common.Node
	Name string
}

func (GotoStmt) Eval

func (this GotoStmt) Eval() string

type IdentifierList added in v0.7.2

type IdentifierList struct {
	*common.Node
	List []string
}

func (IdentifierList) Eval added in v0.7.2

func (this IdentifierList) Eval() string

type IfStmt

type IfStmt struct {
	*common.Node
	SimpleStmt *SimpleStmt
	Expression *Expression
	Block      *Block
	IfStmt     *IfStmt
	BlockElse  *Block
}

func (*IfStmt) AddReturn added in v0.5.0

func (this *IfStmt) AddReturn()

func (IfStmt) Eval

func (this IfStmt) Eval() string

func (*IfStmt) MakeReturnClosureStatement added in v0.5.0

func (this *IfStmt) MakeReturnClosureStatement(t *Type) *Statement

type Import

type Import struct {
	*common.Node
	Items []*ImportSpec
}

func (Import) Eval

func (this Import) Eval() string

type ImportSpec

type ImportSpec struct {
	*common.Node
	Path  string
	Alias string
}

func (ImportSpec) Eval

func (this ImportSpec) Eval() string

type IncDecStmt

type IncDecStmt struct {
	*common.Node
	Expression *Expression
	IsInc      bool
}

func (IncDecStmt) Eval

func (this IncDecStmt) Eval() string

type Index

type Index struct {
	*common.Node
	Expression *Expression
}

func (Index) Eval

func (this Index) Eval() string

type InlineStructMethod

type InlineStructMethod struct {
	*common.Node
	IsPointerReceiver bool
	FunctionDecl      *FunctionDecl
}

func (InlineStructMethod) Eval

func (this InlineStructMethod) Eval() string

type InterfaceType

type InterfaceType struct {
	*common.Node
	Name        string
	MethodSpecs []*MethodSpec
}

func (InterfaceType) Eval

func (this InterfaceType) Eval() string

type Interpret

type Interpret struct {
	*common.Node
	Statement *Statement
	TopLevel  *TopLevel
}

func (Interpret) Eval

func (this Interpret) Eval() string

type Key

type Key struct {
	*common.Node
	Name         string
	Expression   *Expression
	LiteralValue *LiteralValue
}

func (Key) Eval

func (this Key) Eval() string

type KeyedElement

type KeyedElement struct {
	*common.Node
	Key     *Key
	Element *Element
}

func (KeyedElement) Eval

func (this KeyedElement) Eval() string

type LabeledStmt

type LabeledStmt struct {
	*common.Node
	Name      string
	Statement *Statement
}

func (LabeledStmt) Eval

func (this LabeledStmt) Eval() string

type Literal

type Literal struct {
	*common.Node
	Basic       string
	Composite   *CompositeLit
	FunctionLit *FunctionLit
}

func (Literal) Eval

func (this Literal) Eval() string

type LiteralType

type LiteralType struct {
	*common.Node
	Struct  *StructType
	Array   *ArrayType
	Element *Type
	Slice   *SliceType
	Map     *MapType
	Type    string
}

func (LiteralType) Eval

func (this LiteralType) Eval() string

type LiteralValue

type LiteralValue struct {
	*common.Node
	Elements []*KeyedElement
}

func (LiteralValue) Eval

func (this LiteralValue) Eval() string

type MapType

type MapType struct {
	*common.Node
	InnerType *Type
	OuterType *Type
}

func (MapType) Eval

func (this MapType) Eval() string

type MethodDecl

type MethodDecl struct {
	*common.Node
	Receiver  *Receiver
	Function  *Function
	Signature *Signature
}

func (MethodDecl) Eval

func (this MethodDecl) Eval() string

type MethodExpr

type MethodExpr struct {
	*common.Node
	ReceiverType *ReceiverType
	Name         string
}

func (MethodExpr) Eval

func (this MethodExpr) Eval() string

type MethodSpec

type MethodSpec struct {
	*common.Node
	Name       string
	Parameters *Parameters
	Result     *Result
	Type       string
}

func (MethodSpec) Eval

func (this MethodSpec) Eval() string

type Operand

type Operand struct {
	*common.Node
	Literal     *Literal
	OperandName *OperandName
	MethodExpr  *MethodExpr
	Expression  *Expression
}

func (Operand) Eval

func (this Operand) Eval() string

type OperandName

type OperandName struct {
	*common.Node
	Name string
}

func (OperandName) Eval

func (this OperandName) Eval() string

type Package

type Package struct {
	*common.Node
	Name string
}

func (Package) Eval

func (this Package) Eval() string

type Parameter

type Parameter struct {
	*common.Node
	IdentifierList *IdentifierList
	Type           *Type
	IsVariadic     bool
}

func (Parameter) Eval

func (this Parameter) Eval() string

type Parameters

type Parameters struct {
	*common.Node
	List []*Parameter
}

func (Parameters) Eval

func (this Parameters) Eval() string

type PointerType

type PointerType struct {
	*common.Node
	Type *Type
}

func (*PointerType) Eval

func (this *PointerType) Eval() string

type PrimaryExpr

type PrimaryExpr struct {
	*common.Node
	Operand       *Operand
	Conversion    *Conversion
	PrimaryExpr   *PrimaryExpr
	SecondaryExpr *SecondaryExpr
}

func (PrimaryExpr) Eval

func (this PrimaryExpr) Eval() string

type RangeClause

type RangeClause struct {
	*common.Node
	IdentifierList *IdentifierList
	Expression     *Expression
}

func (RangeClause) Eval

func (this RangeClause) Eval() string

type Receiver

type Receiver struct {
	*common.Node
	Package           string
	IsPointerReceiver bool
	Method            string
}

func (*Receiver) Eval

func (this *Receiver) Eval() string

type ReceiverType

type ReceiverType struct {
	*common.Node
	Type         string
	IsPointer    bool
	ReceiverType *ReceiverType
}

func (*ReceiverType) Eval

func (this *ReceiverType) Eval() string

type RecvStmt

type RecvStmt struct {
	*common.Node
	Expressions    *ExpressionList
	IdentifierList *IdentifierList
	Expression     *Expression
}

func (RecvStmt) Eval

func (this RecvStmt) Eval() string

type Result

type Result struct {
	*common.Node
	Types []*Type
}

func (Result) Eval

func (this Result) Eval() string

type ReturnStmt

type ReturnStmt struct {
	*common.Node
	Expressions *ExpressionList
}

func (ReturnStmt) Eval

func (this ReturnStmt) Eval() string

type SecondaryExpr

type SecondaryExpr struct {
	*common.Node
	Selector      string
	Index         *Index
	Slice         *Slice
	TypeAssertion *TypeAssertion
	Arguments     *Arguments
}

func (SecondaryExpr) Eval

func (this SecondaryExpr) Eval() string

type SelectStmt

type SelectStmt struct {
	*common.Node
	CommClauses []*CommClause
}

func (SelectStmt) Eval

func (this SelectStmt) Eval() string

type SendStmt

type SendStmt struct {
	*common.Node
	Left  *Expression
	Right *Expression
}

func (SendStmt) Eval

func (this SendStmt) Eval() string

type ShortVarDecl

type ShortVarDecl struct {
	*common.Node
	IdentifierList *IdentifierList
	Expressions    *ExpressionList
}

func (ShortVarDecl) Eval

func (this ShortVarDecl) Eval() string

type Signature

type Signature struct {
	*common.Node
	TemplateSpec *TemplateSpec
	Parameters   *Parameters
	Result       *Result
}

func (Signature) Eval

func (this Signature) Eval() string

type SimpleStmt

type SimpleStmt struct {
	*common.Node
	SendStmt     *SendStmt
	Expression   *Expression
	IncDecStmt   *IncDecStmt
	ShortVarDecl *ShortVarDecl
	Assignment   *Assignment
	EmptyStmt    bool
}

func (SimpleStmt) Eval

func (this SimpleStmt) Eval() string

type Slice

type Slice struct {
	*common.Node
	LeftExpr   *Expression
	MiddleExpr *Expression
	RightExpr  *Expression
}

func (Slice) Eval

func (this Slice) Eval() string

type SliceType

type SliceType struct {
	*common.Node
	Type *Type
}

func (SliceType) Eval

func (this SliceType) Eval() string

type SourceFile

type SourceFile struct {
	*common.Node
	Package   *Package
	Import    *Import
	TopLevels []*TopLevel
}

func (SourceFile) Eval

func (this SourceFile) Eval() string

func (SourceFile) GetImports added in v0.7.2

func (this SourceFile) GetImports() map[string]string

type Statement

type Statement struct {
	*common.Node
	SimpleStmt      *SimpleStmt
	LabeledStmt     *LabeledStmt
	GoStmt          *GoStmt
	ReturnStmt      *ReturnStmt
	BreakStmt       *BreakStmt
	ContinueStmt    *ContinueStmt
	GotoStmt        *GotoStmt
	FallthroughStmt *FallthroughStmt
	IfStmt          *IfStmt
	SwitchStmt      *SwitchStmt
	SelectStmt      *SelectStmt
	ForStmt         *ForStmt
	Block           *Block
	DeferStmt       *DeferStmt
	Declaration     *Declaration
}

func (Statement) Eval

func (this Statement) Eval() string

type StructType

type StructType struct {
	*common.Node
	Name         string
	TemplateSpec *TemplateSpec
	Fields       []*FieldDecl
}

func (*StructType) Eval

func (this *StructType) Eval() string

type SwitchStmt

type SwitchStmt struct {
	*common.Node
	ExprSwitchStmt *ExprSwitchStmt
	TypeSwitchStmt *TypeSwitchStmt
}

func (SwitchStmt) Eval

func (this SwitchStmt) Eval() string

type TemplateSpec added in v0.6.0

type TemplateSpec struct {
	*common.Node
	Result *Result
}

type TopLevel

type TopLevel struct {
	*common.Node
	Declaration  *Declaration
	FunctionDecl *FunctionDecl
	MethodDecl   *MethodDecl
}

func (TopLevel) Eval

func (this TopLevel) Eval() string

type Type

type Type struct {
	*common.Node
	TypeName string
	TypeLit  *TypeLit
	Type     *Type
}

func (Type) Eval

func (this Type) Eval() string

type TypeAssertion

type TypeAssertion struct {
	*common.Node
	Type *Type
}

func (TypeAssertion) Eval

func (this TypeAssertion) Eval() string

type TypeCaseClause

type TypeCaseClause struct {
	*common.Node
	TypeSwitchCase *TypeSwitchCase
	Statements     []*Statement
}

func (TypeCaseClause) Eval

func (this TypeCaseClause) Eval() string

type TypeDecl

type TypeDecl struct {
	*common.Node
	TypeSpecs     []*TypeSpec
	StructType    *StructType
	InterfaceType *InterfaceType
}

func (TypeDecl) Eval

func (this TypeDecl) Eval() string

type TypeLit

type TypeLit struct {
	*common.Node
	ArrayType     *ArrayType
	StructType    *StructType
	PointerType   *PointerType
	FunctionType  *FunctionType
	InterfaceType *InterfaceType
	SliceType     *SliceType
	MapType       *MapType
	ChannelType   *ChannelType
}

func (TypeLit) Eval

func (this TypeLit) Eval() string

type TypeSpec

type TypeSpec struct {
	*common.Node
	Name string
	Type *Type
}

func (TypeSpec) Eval

func (this TypeSpec) Eval() string

type TypeSwitchCase

type TypeSwitchCase struct {
	*common.Node
	Types []*Type
}

func (TypeSwitchCase) Eval

func (this TypeSwitchCase) Eval() string

type TypeSwitchGuard

type TypeSwitchGuard struct {
	*common.Node
	Name        string
	PrimaryExpr *PrimaryExpr
}

func (TypeSwitchGuard) Eval

func (this TypeSwitchGuard) Eval() string

type TypeSwitchStmt

type TypeSwitchStmt struct {
	*common.Node
	SimpleStmt      *SimpleStmt
	TypeSwitchGuard *TypeSwitchGuard
	TypeCaseClauses []*TypeCaseClause
}

func (TypeSwitchStmt) Eval

func (this TypeSwitchStmt) Eval() string

type UnaryExpr

type UnaryExpr struct {
	*common.Node
	PrimaryExpr *PrimaryExpr
	Op          string
	UnaryExpr   *UnaryExpr
}

func (UnaryExpr) Eval

func (this UnaryExpr) Eval() string

type VarDecl

type VarDecl struct {
	*common.Node
	VarSpecs []*VarSpec
}

func (VarDecl) Eval

func (this VarDecl) Eval() string

type VarSpec

type VarSpec struct {
	*common.Node
	IdentifierList *IdentifierList
	Type           *Type
	ExpressionList *ExpressionList
	Statement      *Statement
}

func (VarSpec) Eval

func (this VarSpec) Eval() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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