Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultFileFilter(cfg *Config, importPath string, matchedFSPaths []string, withTestFiles bool) (pkgFiles []string, err error)
- func NodeSource(n Node, full bool, kill map[Node]struct{}) string
- type ABI
- type ABIType
- type AST
- type AliasDeclNode
- type Arguments1Node
- type Arguments2Node
- type Arguments3Node
- type ArgumentsNode
- type ArrayLiteralTypeNode
- type ArrayTypeNode
- type AssignmentNode
- type BasicLitNode
- type BinaryExpressionNode
- type BlockNode
- type BreakStmtNode
- type Cache
- type ChanDir
- type ChannelTypeNode
- func (n *ChannelTypeNode) Align() int
- func (n *ChannelTypeNode) FieldAlign() int
- func (n *ChannelTypeNode) Kind() Kind
- func (n *ChannelTypeNode) Position() (r token.Position)
- func (n *ChannelTypeNode) Size() int64
- func (n *ChannelTypeNode) Source(full bool) string
- func (n *ChannelTypeNode) String() string
- type CommCaseNode
- type CommClauseListNode
- type CommClauseNode
- type CompositeLitNode
- type Config
- type ConfigOption
- type ConstDeclNode
- type ConstSpec2Node
- type ConstSpecListNode
- type ConstSpecNode
- type ContinueStmtNode
- type ConversionNode
- type DeferStmtNode
- type EmbeddedFieldNode
- type EmptyStmtNode
- type ErrWithPosition
- type ExprCaseClauseListNode
- type ExprSwitchCase2Node
- type ExprSwitchCaseNode
- type ExprSwitchStmtNode
- type Expression
- type ExpressionListNode
- type FallthroughStmtNode
- type Field
- type FieldDeclListNode
- type FieldDeclNode
- type FileFilter
- type ForClauseNode
- type ForStmtNode
- type FunctionBodyNode
- type FunctionDeclNode
- type FunctionLitNode
- type FunctionNameNode
- type FunctionTypeNode
- func (n *FunctionTypeNode) Align() int
- func (n *FunctionTypeNode) FieldAlign() int
- func (n *FunctionTypeNode) Kind() Kind
- func (n *FunctionTypeNode) Position() (r token.Position)
- func (n *FunctionTypeNode) Size() int64
- func (n *FunctionTypeNode) Source(full bool) string
- func (n *FunctionTypeNode) String() string
- type GoStmtNode
- type GotoStmtNode
- type IdentifierListNode
- type IfElseStmtNode
- type IfStmtNode
- type ImportDeclListNode
- type ImportDeclNode
- type ImportSpecListNode
- type ImportSpecNode
- type IncDecStmtNode
- type IndexNode
- type InterfaceElemListNode
- type InterfaceElemNode
- type InterfaceTypeNode
- func (n *InterfaceTypeNode) Align() int
- func (n *InterfaceTypeNode) FieldAlign() int
- func (n *InterfaceTypeNode) Kind() Kind
- func (n *InterfaceTypeNode) Position() (r token.Position)
- func (n *InterfaceTypeNode) Size() int64
- func (n *InterfaceTypeNode) Source(full bool) string
- func (n *InterfaceTypeNode) String() string
- type InvalidType
- type IotaNode
- type KeyedElementListNode
- type KeyedElementNode
- type Kind
- type LabelNode
- type LabeledStmtNode
- type LiteralValueNode
- type MapTypeNode
- type MethodDeclNode
- type MethodElemNode
- type MethodExprNode
- type Node
- type OperandNameNode
- type OperandNode
- type OperandQualifiedNameNode
- type Package
- type PackageClauseNode
- type ParameterDeclListNode
- type ParameterDeclNode
- type ParametersNode
- type ParenthesizedExpressionNode
- type ParenthesizedTypeNode
- func (n *ParenthesizedTypeNode) Align() int
- func (n *ParenthesizedTypeNode) FieldAlign() int
- func (n *ParenthesizedTypeNode) Kind() Kind
- func (n *ParenthesizedTypeNode) Position() (r token.Position)
- func (n *ParenthesizedTypeNode) Size() int64
- func (n *ParenthesizedTypeNode) Source(full bool) string
- func (n *ParenthesizedTypeNode) String() string
- type PointerTypeNode
- func (n *PointerTypeNode) Align() int
- func (n *PointerTypeNode) FieldAlign() int
- func (n *PointerTypeNode) Kind() Kind
- func (n *PointerTypeNode) Position() (r token.Position)
- func (n *PointerTypeNode) Size() int64
- func (n *PointerTypeNode) Source(full bool) string
- func (n *PointerTypeNode) String() string
- type PredeclaredType
- type PrimaryExprNode
- type QualifiedIdentNode
- type RangeClauseNode
- type RecvStmtNode
- type ResultNode
- type ReturnStmtNode
- type Scope
- type ScopeKind
- type SelectStmtNode
- type SelectorNode
- type SendStmtNode
- type ShortVarDeclNode
- type SignatureNode
- type SliceNode
- type SliceTypeNode
- type SourceFileNode
- type StatementListNode
- type StructTypeNode
- type SwitchStmtNode
- type TagNode
- type Token
- func (t Token) Ch() token.Token
- func (t Token) IsValid() bool
- func (t Token) Next() (r Token)
- func (t Token) Position() (r token.Position)
- func (t Token) Prev() (r Token)
- func (t Token) Sep() string
- func (t Token) SetSep(s string)
- func (t Token) SetSrc(s string)
- func (t Token) Source(full bool) string
- func (t Token) Src() string
- type TopLevelDeclListNode
- type TupleType
- type Type
- type TypeArgsNode
- type TypeAssertionNode
- type TypeCaseClauseListNode
- type TypeCaseClauseNode
- type TypeCheck
- type TypeConstraintNode
- type TypeDeclNode
- type TypeDefNode
- func (n *TypeDefNode) Align() int
- func (n *TypeDefNode) FieldAlign() int
- func (n *TypeDefNode) Kind() Kind
- func (n *TypeDefNode) Position() (r token.Position)
- func (n *TypeDefNode) Size() int64
- func (n *TypeDefNode) Source(full bool) string
- func (n *TypeDefNode) String() string
- func (n *TypeDefNode) Visible() int
- type TypeElemListNode
- type TypeListNode
- type TypeNameNode
- func (n *TypeNameNode) Align() int
- func (n *TypeNameNode) FieldAlign() int
- func (n *TypeNameNode) Kind() Kind
- func (n *TypeNameNode) LexicalScope() *Scope
- func (n *TypeNameNode) Position() (r token.Position)
- func (n *TypeNameNode) Size() int64
- func (n *TypeNameNode) Source(full bool) string
- func (n *TypeNameNode) String() string
- type TypeNode
- type TypeParamDeclNode
- type TypeParamListNode
- type TypeParametersNode
- type TypeSpecListNode
- type TypeSwitchCaseNode
- type TypeSwitchGuardNode
- type TypeSwitchStmtNode
- type TypeTermNode
- type UnaryExprNode
- type UnderlyingTypeNode
- type ValueExpression
- type VarDeclNode
- type VarSpec2Node
- type VarSpecListNode
- type VarSpecNode
Constants ¶
const ( // Special tokens ILLEGAL = token.ILLEGAL EOF = token.EOF COMMENT = token.COMMENT // Identifiers and basic type literals // (these tokens stand for classes of literals) IDENT = token.IDENT // main INT = token.INT // 12345 FLOAT = token.FLOAT // 123.45 IMAG = token.IMAG // 123.45i CHAR = token.CHAR // 'a' STRING = token.STRING // "abc" // Operators and delimiters ADD = token.ADD // + SUB = token.SUB // - MUL = token.MUL // * QUO = token.QUO // / REM = token.REM // % AND = token.AND // & OR = token.OR // | XOR = token.XOR // ^ SHL = token.SHL // << SHR = token.SHR // >> AND_NOT = token.AND_NOT // &^ ADD_ASSIGN = token.ADD_ASSIGN // += SUB_ASSIGN = token.SUB_ASSIGN // -= MUL_ASSIGN = token.MUL_ASSIGN // *= QUO_ASSIGN = token.QUO_ASSIGN // /= REM_ASSIGN = token.REM_ASSIGN // %= AND_ASSIGN = token.AND_ASSIGN // &= OR_ASSIGN = token.OR_ASSIGN // |= XOR_ASSIGN = token.XOR_ASSIGN // ^= SHL_ASSIGN = token.SHL_ASSIGN // <<= SHR_ASSIGN = token.SHR_ASSIGN // >>= AND_NOT_ASSIGN = token.AND_NOT_ASSIGN // &^= LAND = token.LAND // && LOR = token.LOR // || ARROW = token.ARROW // <- INC = token.INC // ++ DEC = token.DEC // -- EQL = token.EQL // == LSS = token.LSS // < GTR = token.GTR // > ASSIGN = token.ASSIGN // = NOT = token.NOT // ! NEQ = token.NEQ // != LEQ = token.LEQ // <= GEQ = token.GEQ // >= DEFINE = token.DEFINE // := ELLIPSIS = token.ELLIPSIS // ... LPAREN = token.LPAREN // ( LBRACK = token.LBRACK // [ LBRACE = token.LBRACE // { COMMA = token.COMMA // , PERIOD = token.PERIOD // . RPAREN = token.RPAREN // ) RBRACK = token.RBRACK // ] RBRACE = token.RBRACE // } SEMICOLON = token.SEMICOLON // ; COLON = token.COLON // : // Keywords BREAK = token.BREAK CASE = token.CASE CHAN = token.CHAN CONST = token.CONST CONTINUE = token.CONTINUE DEFAULT = token.DEFAULT DEFER = token.DEFER ELSE = token.ELSE FALLTHROUGH = token.FALLTHROUGH FOR = token.FOR FUNC = token.FUNC GO = token.GO GOTO = token.GOTO IF = token.IF IMPORT = token.IMPORT INTERFACE = token.INTERFACE MAP = token.MAP PACKAGE = token.PACKAGE RANGE = token.RANGE RETURN = token.RETURN SELECT = token.SELECT STRUCT = token.STRUCT SWITCH = token.SWITCH TYPE = token.TYPE VAR = token.VAR // additional tokens, handled in an ad-hoc manner TILDE = token.TILDE )
The list of tokens.
Variables ¶
var (
Invalid = &InvalidType{}
)
Functions ¶
func DefaultFileFilter ¶
Types ¶
type ABI ¶
type ABI struct {
ByteOrder binary.ByteOrder
Types map[Kind]ABIType
// contains filtered or unexported fields
}
ABI describes selected parts of the Application Binary Interface.
type AST ¶
type AST struct {
EOF Token
FileScope *Scope
SourceFile *SourceFileNode
// contains filtered or unexported fields
}
type AliasDeclNode ¶
type AliasDeclNode struct {
IDENT Token
ASSIGN Token
TypeNode Type
// contains filtered or unexported fields
}
AliasDeclNode represents the production
AliasDecl = identifier "=" Type .
func (*AliasDeclNode) Position ¶
func (n *AliasDeclNode) Position() (r token.Position)
Position implements Node.
func (*AliasDeclNode) Source ¶
func (n *AliasDeclNode) Source(full bool) string
Source implements Node.
type Arguments1Node ¶
type Arguments1Node struct {
LPAREN Token
Expression Expression
TypeNode Type
COMMA Token
ELLIPSIS Token
COMMA2 Token
RPAREN Token
}
Arguments1Node represents the production
Arguments = "(" [ ( Expression | Type [ "," Expression ] ) [ "..." ] [ "," ] ] ")" .
func (*Arguments1Node) Position ¶
func (n *Arguments1Node) Position() (r token.Position)
Position implements Node.
func (*Arguments1Node) Source ¶
func (n *Arguments1Node) Source(full bool) string
Source implements Node.
type Arguments2Node ¶
type Arguments2Node struct {
LPAREN Token
ExpressionList *ExpressionListNode
RPAREN Token
}
Arguments2Node represents the production
Arguments = "(" ExpressionList ")" .
func (*Arguments2Node) Position ¶
func (n *Arguments2Node) Position() (r token.Position)
Position implements Node.
func (*Arguments2Node) Source ¶
func (n *Arguments2Node) Source(full bool) string
Source implements Node.
type Arguments3Node ¶
type Arguments3Node struct {
LPAREN Token
ExpressionList *ExpressionListNode
TypeNode Type
COMMA Token
ELLIPSIS Token
COMMA2 Token
RPAREN Token
}
Arguments3Node represents the production
Arguments = "(" [ ( ExpressionList | Type [ "," ExpressionList ] ) [ "..." ] [ "," ] ] ")" .
func (*Arguments3Node) Position ¶
func (n *Arguments3Node) Position() (r token.Position)
Position implements Node.
func (*Arguments3Node) Source ¶
func (n *Arguments3Node) Source(full bool) string
Source implements Node.
type ArgumentsNode ¶
type ArgumentsNode struct {
LPAREN Token
Expression Expression
RPAREN Token
}
ArgumentsNode represents the production
Arguments = "(" [ Expression ] ")" .
func (*ArgumentsNode) Position ¶
func (n *ArgumentsNode) Position() (r token.Position)
Position implements Node.
func (*ArgumentsNode) Source ¶
func (n *ArgumentsNode) Source(full bool) string
Source implements Node.
type ArrayLiteralTypeNode ¶
ArrayLiteralTypeNode represents the production
ArrayLiteralType = StructType | ArrayType | "[" "..." "]" ElementType | SliceType | MapType .
func (*ArrayLiteralTypeNode) Position ¶
func (n *ArrayLiteralTypeNode) Position() (r token.Position)
Position implements Node.
func (*ArrayLiteralTypeNode) Source ¶
func (n *ArrayLiteralTypeNode) Source(full bool) string
Source implements Node.
type ArrayTypeNode ¶
type ArrayTypeNode struct {
LBRACK Token
ArrayLength Expression
RBRACK Token
ElementType Type
}
ArrayTypeNode represents the production
ArrayType = "[" ArrayLength "]" ElementType .
func (*ArrayTypeNode) Align ¶
func (n *ArrayTypeNode) Align() int
func (*ArrayTypeNode) FieldAlign ¶
func (n *ArrayTypeNode) FieldAlign() int
func (*ArrayTypeNode) Kind ¶
func (n *ArrayTypeNode) Kind() Kind
func (*ArrayTypeNode) Position ¶
func (n *ArrayTypeNode) Position() (r token.Position)
Position implements Node.
func (*ArrayTypeNode) Size ¶
func (n *ArrayTypeNode) Size() int64
func (*ArrayTypeNode) Source ¶
func (n *ArrayTypeNode) Source(full bool) string
Source implements Node.
func (*ArrayTypeNode) String ¶
func (n *ArrayTypeNode) String() string
type AssignmentNode ¶
type AssignmentNode struct {
ExpressionList *ExpressionListNode
Op Token
ExpressionList2 *ExpressionListNode
}
AssignmentNode represents the production
Assignment = ExpressionList ( "=" | "+=" | "-=" | "|=" | "^=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | "&=" | "&^=" ) ExpressionList .
func (*AssignmentNode) Position ¶
func (n *AssignmentNode) Position() (r token.Position)
Position implements Node.
func (*AssignmentNode) Source ¶
func (n *AssignmentNode) Source(full bool) string
Source implements Node.
type BasicLitNode ¶
type BasicLitNode struct {
Token
// contains filtered or unexported fields
}
BasicLitNode represents the production
BasicLit = int_lit | float_lit | imaginary_lit | rune_lit | string_lit .
func (*BasicLitNode) Type ¶
func (n *BasicLitNode) Type() Type
func (*BasicLitNode) Value ¶
func (n *BasicLitNode) Value() constant.Value
type BinaryExpressionNode ¶
type BinaryExpressionNode struct {
LHS Expression
Op Token
RHS Expression
// contains filtered or unexported fields
}
func (*BinaryExpressionNode) Position ¶
func (n *BinaryExpressionNode) Position() (r token.Position)
Position implements Node.
func (*BinaryExpressionNode) Source ¶
func (n *BinaryExpressionNode) Source(full bool) string
Source implements Node.
type BlockNode ¶
type BlockNode struct {
LBRACE Token
StatementList *StatementListNode
RBRACE Token
}
BlockNode represents the production
Block = "{" StatementList "}" .
type BreakStmtNode ¶
BreakStmtNode represents the production
BreakStmt = "break" [ Label ] .
func (*BreakStmtNode) Position ¶
func (n *BreakStmtNode) Position() (r token.Position)
Position implements Node.
func (*BreakStmtNode) Source ¶
func (n *BreakStmtNode) Source(full bool) string
Source implements Node.
type Cache ¶
func MustNewCache ¶
type ChannelTypeNode ¶
ChannelTypeNode represents the production
ChannelType = ( "chan" "<-" | "chan" | "<-" "chan" ) ElementType .
func (*ChannelTypeNode) Align ¶
func (n *ChannelTypeNode) Align() int
func (*ChannelTypeNode) FieldAlign ¶
func (n *ChannelTypeNode) FieldAlign() int
func (*ChannelTypeNode) Kind ¶
func (n *ChannelTypeNode) Kind() Kind
func (*ChannelTypeNode) Position ¶
func (n *ChannelTypeNode) Position() (r token.Position)
Position implements Node.
func (*ChannelTypeNode) Size ¶
func (n *ChannelTypeNode) Size() int64
func (*ChannelTypeNode) Source ¶
func (n *ChannelTypeNode) Source(full bool) string
Source implements Node.
func (*ChannelTypeNode) String ¶
func (n *ChannelTypeNode) String() string
type CommCaseNode ¶
type CommCaseNode struct {
CASE Token
SendStmt *SendStmtNode
RecvStmt *RecvStmtNode
DEFAULT Token
}
CommCaseNode represents the production
CommCase = "case" ( SendStmt | RecvStmt ) | "default" .
func (*CommCaseNode) Position ¶
func (n *CommCaseNode) Position() (r token.Position)
Position implements Node.
func (*CommCaseNode) Source ¶
func (n *CommCaseNode) Source(full bool) string
Source implements Node.
type CommClauseListNode ¶
type CommClauseListNode struct {
CommClause *CommClauseNode
List *CommClauseListNode
}
CommClauseListNode represents the production
CommClauseListNode = { CommClause } .
func (*CommClauseListNode) Position ¶
func (n *CommClauseListNode) Position() (r token.Position)
Position implements Node.
func (*CommClauseListNode) Source ¶
func (n *CommClauseListNode) Source(full bool) string
Source implements Node.
type CommClauseNode ¶
type CommClauseNode struct {
CommCase *CommCaseNode
COLON Token
StatementList *StatementListNode
}
CommClauseNode represents the production
CommClause = CommCase ":" StatementList .
func (*CommClauseNode) Position ¶
func (n *CommClauseNode) Position() (r token.Position)
Position implements Node.
func (*CommClauseNode) Source ¶
func (n *CommClauseNode) Source(full bool) string
Source implements Node.
type CompositeLitNode ¶
type CompositeLitNode struct {
LiteralType Node
LiteralValue *LiteralValueNode
// contains filtered or unexported fields
}
CompositeLitNode represents the production
CompositeLit = LiteralType LiteralValue .
func (*CompositeLitNode) Position ¶
func (n *CompositeLitNode) Position() (r token.Position)
Position implements Node.
func (*CompositeLitNode) Source ¶
func (n *CompositeLitNode) Source(full bool) string
Source implements Node.
func (*CompositeLitNode) Type ¶
func (n *CompositeLitNode) Type() Type
func (*CompositeLitNode) Value ¶
func (n *CompositeLitNode) Value() constant.Value
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config configures NewPackage
Config instances can be shared, they are not mutated once created and configured.
func NewConfig ¶
func NewConfig(opts ...ConfigOption) (r *Config, err error)
NewConfig returns a newly created config or an error, if any.
func (*Config) DefaultLookup ¶
Default lookup translates import paths, possibly relative to rel, to file system paths.
func (*Config) NewPackage ¶
func (c *Config) NewPackage(dir, importPath, version string, fileFilter FileFilter, withTestFiles bool, typeCheck TypeCheck) (pkg *Package, err error)
NewPackage returns a Package, possibly cached, for importPath@version or an error, if any. The fileFilter argument can be nil, in such case DefaultFileFilter is used, which ignores Files with suffix _test.go unless withTestFiles is true.
NewPackage is safe for concurrent use by multiple goroutines.
type ConfigOption ¶
func ConfigBuildTags ¶
func ConfigBuildTags(tags []string) ConfigOption
ConfigBuildTags configures build tags.
func ConfigEnviron ¶
func ConfigEnviron(env []string) ConfigOption
ConfigEnviron configures environment variables.
func ConfigFS ¶
func ConfigFS(fs fs.FS) ConfigOption
ConfigFS configures a file system used for opening Go source files. If not explicitly configured, a default os.DirFS("/") is used on Unix-like operating systems. On Windows it will be rooted on the volume where runtime.GOROOT() is.
func ConfigLookup ¶
func ConfigLookup(f func(dir, importPath, version string) (fsPath string, err error)) ConfigOption
ConfigLookup configures a lookup function.
type ConstDeclNode ¶
ConstDeclNode represents the production
ConstDecl = "const" ( ConstSpec | "(" { ConstSpec ";" } ")" ) .
func (*ConstDeclNode) Position ¶
func (n *ConstDeclNode) Position() (r token.Position)
Position implements Node.
func (*ConstDeclNode) Source ¶
func (n *ConstDeclNode) Source(full bool) string
Source implements Node.
type ConstSpec2Node ¶
type ConstSpec2Node struct {
IdentifierList *IdentifierListNode
TypeNode Type
ASSIGN Token
ExpressionList *ExpressionListNode
// contains filtered or unexported fields
}
ConstSpec2Node represents the production
ConstSpec = IdentifierList [ [ Type ] "=" ExpressionList ] .
func (*ConstSpec2Node) Position ¶
func (n *ConstSpec2Node) Position() (r token.Position)
Position implements Node.
func (*ConstSpec2Node) Source ¶
func (n *ConstSpec2Node) Source(full bool) string
Source implements Node.
type ConstSpecListNode ¶
type ConstSpecListNode struct {
ConstSpec Node
SEMICOLON Token
List *ConstSpecListNode
}
ConstSpecListNode represents the production
ConstSpecListNode = { ConstSpec ";" } .
func (*ConstSpecListNode) Position ¶
func (n *ConstSpecListNode) Position() (r token.Position)
Position implements Node.
func (*ConstSpecListNode) Source ¶
func (n *ConstSpecListNode) Source(full bool) string
Source implements Node.
type ConstSpecNode ¶
type ConstSpecNode struct {
IDENT Token
TypeNode Type
ASSIGN Token
Expression Expression
// contains filtered or unexported fields
}
ConstSpecNode represents the production
ConstSpec = Identifier [ [ Type ] "=" Expression ] .
func (*ConstSpecNode) Position ¶
func (n *ConstSpecNode) Position() (r token.Position)
Position implements Node.
func (*ConstSpecNode) Source ¶
func (n *ConstSpecNode) Source(full bool) string
Source implements Node.
type ContinueStmtNode ¶
ContinueStmtNode represents the production
ContinueStmt = "continue" [ Label ] .
func (*ContinueStmtNode) Position ¶
func (n *ContinueStmtNode) Position() (r token.Position)
Position implements Node.
func (*ContinueStmtNode) Source ¶
func (n *ContinueStmtNode) Source(full bool) string
Source implements Node.
type ConversionNode ¶
type ConversionNode struct {
TypeNode Type
LPAREN Token
Expression Expression
COMMA Token
RPAREN Token
// contains filtered or unexported fields
}
ConversionNode represents the production
Conversion = Type "(" Expression [ "," ] ")" .
func (*ConversionNode) Position ¶
func (n *ConversionNode) Position() (r token.Position)
Position implements Node.
func (*ConversionNode) Source ¶
func (n *ConversionNode) Source(full bool) string
Source implements Node.
func (*ConversionNode) Type ¶
func (n *ConversionNode) Type() Type
type DeferStmtNode ¶
type DeferStmtNode struct {
DEFER Token
Expression Expression
}
DeferStmtNode represents the production
DeferStmt = "defer" Expression .
func (*DeferStmtNode) Position ¶
func (n *DeferStmtNode) Position() (r token.Position)
Position implements Node.
func (*DeferStmtNode) Source ¶
func (n *DeferStmtNode) Source(full bool) string
Source implements Node.
type EmbeddedFieldNode ¶
type EmbeddedFieldNode struct {
MUL Token
TypeName *TypeNameNode
TypeArgs *TypeArgsNode
}
EmbeddedFieldNode represents the production
EmbeddedField = [ "*" ] TypeName [ TypeArgs ] .
func (*EmbeddedFieldNode) Position ¶
func (n *EmbeddedFieldNode) Position() (r token.Position)
Position implements Node.
func (*EmbeddedFieldNode) Source ¶
func (n *EmbeddedFieldNode) Source(full bool) string
Source implements Node.
type EmptyStmtNode ¶
type EmptyStmtNode struct {
}
EmptyStmtNode represents the production
EmptyStmt = .
func (*EmptyStmtNode) Position ¶
func (n *EmptyStmtNode) Position() (r token.Position)
Position implements Node.
func (*EmptyStmtNode) Source ¶
func (n *EmptyStmtNode) Source(full bool) string
Source implements Node.
type ErrWithPosition ¶
type ErrWithPosition struct {
// contains filtered or unexported fields
}
func (ErrWithPosition) String ¶
func (e ErrWithPosition) String() string
type ExprCaseClauseListNode ¶
type ExprCaseClauseListNode struct {
ExprSwitchCase Node
COLON Token
StatementList *StatementListNode
List *ExprCaseClauseListNode
}
ExprCaseClauseListNode represents the production
ExprCaseClause = ExprSwitchCase ":" StatementList .
func (*ExprCaseClauseListNode) Position ¶
func (n *ExprCaseClauseListNode) Position() (r token.Position)
Position implements Node.
func (*ExprCaseClauseListNode) Source ¶
func (n *ExprCaseClauseListNode) Source(full bool) string
Source implements Node.
type ExprSwitchCase2Node ¶
type ExprSwitchCase2Node struct {
CASE Token
ExpressionList *ExpressionListNode
DEFAULT Token
}
ExprSwitchCase2Node represents the production
ExprSwitchCase = "case" ExpressionList | "default" .
func (*ExprSwitchCase2Node) Position ¶
func (n *ExprSwitchCase2Node) Position() (r token.Position)
Position implements Node.
func (*ExprSwitchCase2Node) Source ¶
func (n *ExprSwitchCase2Node) Source(full bool) string
Source implements Node.
type ExprSwitchCaseNode ¶
type ExprSwitchCaseNode struct {
CASE Token
Expression Expression
DEFAULT Token
}
ExprSwitchCaseNode represents the production
ExprSwitchCase = "case" ExpressionList | "default" .
func (*ExprSwitchCaseNode) Position ¶
func (n *ExprSwitchCaseNode) Position() (r token.Position)
Position implements Node.
func (*ExprSwitchCaseNode) Source ¶
func (n *ExprSwitchCaseNode) Source(full bool) string
Source implements Node.
type ExprSwitchStmtNode ¶
type ExprSwitchStmtNode struct {
SWITCH Token
Expression Expression
LBRACE Token
ExprCaseClauseList *ExprCaseClauseListNode
RBRACE Token
SimpleStmt Node
SEMICOLON Token
}
ExprSwitchStmtNode represents the production
ExprSwitchStmt = "switch" [ Expression ] "{" { ExprCaseClause } "}" | "switch" SimpleStmt ";" [ Expression ] "{" { ExprCaseClause } "}" .
func (*ExprSwitchStmtNode) Position ¶
func (n *ExprSwitchStmtNode) Position() (r token.Position)
Position implements Node.
func (*ExprSwitchStmtNode) Source ¶
func (n *ExprSwitchStmtNode) Source(full bool) string
Source implements Node.
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
type ExpressionListNode ¶
type ExpressionListNode struct {
COMMA Token
Expression Expression
List *ExpressionListNode
}
ExpressionListNode represents the production
ExpressionList = Expression { "," Expression } .
func (*ExpressionListNode) Len ¶
func (n *ExpressionListNode) Len() (r int)
Len reports the number of items in n.
func (*ExpressionListNode) Position ¶
func (n *ExpressionListNode) Position() (r token.Position)
Position implements Node.
func (*ExpressionListNode) Source ¶
func (n *ExpressionListNode) Source(full bool) string
Source implements Node.
type FallthroughStmtNode ¶
type FallthroughStmtNode struct {
FALLTHROUGH Token
}
FallthroughStmtNode represents the production
FallthroughStmt = "fallthrough" .
func (*FallthroughStmtNode) Position ¶
func (n *FallthroughStmtNode) Position() (r token.Position)
Position implements Node.
func (*FallthroughStmtNode) Source ¶
func (n *FallthroughStmtNode) Source(full bool) string
Source implements Node.
type Field ¶
type Field struct {
Declaration *FieldDeclNode
Name string
}
type FieldDeclListNode ¶
type FieldDeclListNode struct {
FieldDecl *FieldDeclNode
SEMICOLON Token
List *FieldDeclListNode
}
FieldDeclListNode represents the production
FieldDeclListNode = { FieldDecl ";" } .
func (*FieldDeclListNode) Position ¶
func (n *FieldDeclListNode) Position() (r token.Position)
Position implements Node.
func (*FieldDeclListNode) Source ¶
func (n *FieldDeclListNode) Source(full bool) string
Source implements Node.
type FieldDeclNode ¶
type FieldDeclNode struct {
IdentifierList *IdentifierListNode
TypeNode Type
EmbeddedField *EmbeddedFieldNode
Tag *TagNode
}
FieldDeclNode represents the production
FieldDecl = ( IdentifierList Type | EmbeddedField ) [ Tag ] .
func (*FieldDeclNode) Position ¶
func (n *FieldDeclNode) Position() (r token.Position)
Position implements Node.
func (*FieldDeclNode) Source ¶
func (n *FieldDeclNode) Source(full bool) string
Source implements Node.
type FileFilter ¶
type ForClauseNode ¶
type ForClauseNode struct {
InitStmt Node
SEMICOLON Token
Condition Expression
SEMICOLON2 Token
PostStmt Node
}
ForClauseNode represents the production
ForClause = [ InitStmt ] ";" [ Condition ] ";" [ PostStmt ] .
func (*ForClauseNode) Position ¶
func (n *ForClauseNode) Position() (r token.Position)
Position implements Node.
func (*ForClauseNode) Source ¶
func (n *ForClauseNode) Source(full bool) string
Source implements Node.
type ForStmtNode ¶
type ForStmtNode struct {
FOR Token
ForClause *ForClauseNode
RangeClause *RangeClauseNode
Condition Expression
Block *BlockNode
}
ForStmtNode represents the production
ForStmt = "for" [ ForClause | RangeClause | Condition ] Block .
func (*ForStmtNode) Position ¶
func (n *ForStmtNode) Position() (r token.Position)
Position implements Node.
type FunctionBodyNode ¶
type FunctionBodyNode struct {
Block *BlockNode
}
FunctionBodyNode represents the production
FunctionBody = Block .
func (*FunctionBodyNode) Position ¶
func (n *FunctionBodyNode) Position() (r token.Position)
Position implements Node.
func (*FunctionBodyNode) Source ¶
func (n *FunctionBodyNode) Source(full bool) string
Source implements Node.
type FunctionDeclNode ¶
type FunctionDeclNode struct {
FUNC Token
FunctionName *FunctionNameNode
TypeParameters *TypeParametersNode
Signature *SignatureNode
FunctionBody *FunctionBodyNode
// contains filtered or unexported fields
}
FunctionDeclNode represents the production
FunctionDecl = "func" FunctionName [ TypeParameters ] Signature [ FunctionBody ] .
func (*FunctionDeclNode) Position ¶
func (n *FunctionDeclNode) Position() (r token.Position)
Position implements Node.
func (*FunctionDeclNode) Source ¶
func (n *FunctionDeclNode) Source(full bool) string
Source implements Node.
type FunctionLitNode ¶
type FunctionLitNode struct {
FUNC Token
Signature *SignatureNode
FunctionBody *FunctionBodyNode
}
FunctionLitNode represents the production
FunctionLit = "func" Signature FunctionBody .
func (*FunctionLitNode) Position ¶
func (n *FunctionLitNode) Position() (r token.Position)
Position implements Node.
func (*FunctionLitNode) Source ¶
func (n *FunctionLitNode) Source(full bool) string
Source implements Node.
func (*FunctionLitNode) Type ¶
func (n *FunctionLitNode) Type() Type
func (*FunctionLitNode) Value ¶
func (n *FunctionLitNode) Value() constant.Value
type FunctionNameNode ¶
type FunctionNameNode struct {
IDENT Token
}
FunctionNameNode represents the production
FunctionName = identifier .
func (*FunctionNameNode) Position ¶
func (n *FunctionNameNode) Position() (r token.Position)
Position implements Node.
func (*FunctionNameNode) Source ¶
func (n *FunctionNameNode) Source(full bool) string
Source implements Node.
type FunctionTypeNode ¶
type FunctionTypeNode struct {
FUNC Token
Signature *SignatureNode
// contains filtered or unexported fields
}
FunctionTypeNode represents the production
FunctionType = "func" Signature .
func (*FunctionTypeNode) Align ¶
func (n *FunctionTypeNode) Align() int
func (*FunctionTypeNode) FieldAlign ¶
func (n *FunctionTypeNode) FieldAlign() int
func (*FunctionTypeNode) Kind ¶
func (n *FunctionTypeNode) Kind() Kind
func (*FunctionTypeNode) Position ¶
func (n *FunctionTypeNode) Position() (r token.Position)
Position implements Node.
func (*FunctionTypeNode) Size ¶
func (n *FunctionTypeNode) Size() int64
func (*FunctionTypeNode) Source ¶
func (n *FunctionTypeNode) Source(full bool) string
Source implements Node.
func (*FunctionTypeNode) String ¶
func (n *FunctionTypeNode) String() string
type GoStmtNode ¶
type GoStmtNode struct {
GO Token
Expression Expression
}
GoStmtNode represents the production
GoStmt = "go" Expression .
func (*GoStmtNode) Position ¶
func (n *GoStmtNode) Position() (r token.Position)
Position implements Node.
type GotoStmtNode ¶
GotoStmtNode represents the production
GotoStmt = "goto" Label .
func (*GotoStmtNode) Position ¶
func (n *GotoStmtNode) Position() (r token.Position)
Position implements Node.
func (*GotoStmtNode) Source ¶
func (n *GotoStmtNode) Source(full bool) string
Source implements Node.
type IdentifierListNode ¶
type IdentifierListNode struct {
COMMA Token
IDENT Token
List *IdentifierListNode
}
IdentifierListNode represents the production
IdentifierList = identifier { "," identifier } .
func (*IdentifierListNode) Len ¶
func (n *IdentifierListNode) Len() (r int)
Len reports the number of items in n.
func (*IdentifierListNode) Position ¶
func (n *IdentifierListNode) Position() (r token.Position)
Position implements Node.
func (*IdentifierListNode) Source ¶
func (n *IdentifierListNode) Source(full bool) string
Source implements Node.
type IfElseStmtNode ¶
type IfElseStmtNode struct {
IF Token
Expression Expression
Block *BlockNode
ELSE Token
ElseClause Node
SimpleStmt Node
SEMICOLON Token
}
IfElseStmtNode represents the production
IfStmt = "if" Expression Block [ "else" ( IfStmt | Block ) ] | "if" SimpleStmt ";" Expression Block [ "else" ( IfStmt | Block ) ] .
func (*IfElseStmtNode) Position ¶
func (n *IfElseStmtNode) Position() (r token.Position)
Position implements Node.
func (*IfElseStmtNode) Source ¶
func (n *IfElseStmtNode) Source(full bool) string
Source implements Node.
type IfStmtNode ¶
type IfStmtNode struct {
IF Token
Expression Expression
Block *BlockNode
SimpleStmt Node
SEMICOLON Token
}
IfStmtNode represents the production
IfStmt = "if" Expression Block [ "else" ( IfStmt | Block ) ] | "if" SimpleStmt ";" Expression Block [ "else" ( IfStmt | Block ) ] .
func (*IfStmtNode) Position ¶
func (n *IfStmtNode) Position() (r token.Position)
Position implements Node.
type ImportDeclListNode ¶
type ImportDeclListNode struct {
ImportDecl *ImportDeclNode
SEMICOLON Token
List *ImportDeclListNode
}
ImportDeclListNode represents the production
ImportDeclListNode = { ImportDecl ";" } .
func (*ImportDeclListNode) Position ¶
func (n *ImportDeclListNode) Position() (r token.Position)
Position implements Node.
func (*ImportDeclListNode) Source ¶
func (n *ImportDeclListNode) Source(full bool) string
Source implements Node.
type ImportDeclNode ¶
type ImportDeclNode struct {
IMPORT Token
LPAREN Token
ImportSpecList *ImportSpecListNode
RPAREN Token
}
ImportDeclNode represents the production
ImportDecl = "import" ( ImportSpec | "(" { ImportSpec ";" } ")" ) .
func (*ImportDeclNode) Position ¶
func (n *ImportDeclNode) Position() (r token.Position)
Position implements Node.
func (*ImportDeclNode) Source ¶
func (n *ImportDeclNode) Source(full bool) string
Source implements Node.
type ImportSpecListNode ¶
type ImportSpecListNode struct {
ImportSpec *ImportSpecNode
SEMICOLON Token
List *ImportSpecListNode
}
ImportSpecListNode represents the production
ImportSpecListNode = { ImportSpec ";" } .
func (*ImportSpecListNode) Position ¶
func (n *ImportSpecListNode) Position() (r token.Position)
Position implements Node.
func (*ImportSpecListNode) Source ¶
func (n *ImportSpecListNode) Source(full bool) string
Source implements Node.
type ImportSpecNode ¶
type ImportSpecNode struct {
PERIOD Token
PackageName Token
ImportPath *BasicLitNode
// contains filtered or unexported fields
}
ImportSpecNode represents the production
ImportSpec = [ "." | PackageName ] ImportPath .
func (*ImportSpecNode) Position ¶
func (n *ImportSpecNode) Position() (r token.Position)
Position implements Node.
func (*ImportSpecNode) Source ¶
func (n *ImportSpecNode) Source(full bool) string
Source implements Node.
type IncDecStmtNode ¶
type IncDecStmtNode struct {
Expression Expression
Token Token
}
IncDecStmtNode represents the production
IncDecStmt = Expression ( "++" | "--" ) .
func (*IncDecStmtNode) Position ¶
func (n *IncDecStmtNode) Position() (r token.Position)
Position implements Node.
func (*IncDecStmtNode) Source ¶
func (n *IncDecStmtNode) Source(full bool) string
Source implements Node.
type IndexNode ¶
type IndexNode struct {
LBRACK Token
Expression Expression
RBRACK Token
}
IndexNode represents the production
Index = "[" Expression "]" .
type InterfaceElemListNode ¶
type InterfaceElemListNode struct {
InterfaceElem *InterfaceElemNode
SEMICOLON Token
List *InterfaceElemListNode
}
InterfaceElemListNode represents the production
InterfaceElemListNode = { InterfaceElem ";" } .
func (*InterfaceElemListNode) Position ¶
func (n *InterfaceElemListNode) Position() (r token.Position)
Position implements Node.
func (*InterfaceElemListNode) Source ¶
func (n *InterfaceElemListNode) Source(full bool) string
Source implements Node.
type InterfaceElemNode ¶
type InterfaceElemNode struct {
MethodElem *MethodElemNode
TypeElem *TypeElemListNode
}
InterfaceElemNode represents the production
InterfaceElem = MethodElem | TypeElem .
func (*InterfaceElemNode) Position ¶
func (n *InterfaceElemNode) Position() (r token.Position)
Position implements Node.
func (*InterfaceElemNode) Source ¶
func (n *InterfaceElemNode) Source(full bool) string
Source implements Node.
type InterfaceTypeNode ¶
type InterfaceTypeNode struct {
INTERFACE Token
LBRACE Token
InterfaceElemList *InterfaceElemListNode
RBRACE Token
// contains filtered or unexported fields
}
InterfaceTypeNode represents the production
InterfaceType = "interface" "{" { InterfaceElem ";" } "}" .
func (*InterfaceTypeNode) Align ¶
func (n *InterfaceTypeNode) Align() int
func (*InterfaceTypeNode) FieldAlign ¶
func (n *InterfaceTypeNode) FieldAlign() int
func (*InterfaceTypeNode) Kind ¶
func (n *InterfaceTypeNode) Kind() Kind
func (*InterfaceTypeNode) Position ¶
func (n *InterfaceTypeNode) Position() (r token.Position)
Position implements Node.
func (*InterfaceTypeNode) Size ¶
func (n *InterfaceTypeNode) Size() int64
func (*InterfaceTypeNode) Source ¶
func (n *InterfaceTypeNode) Source(full bool) string
Source implements Node.
func (*InterfaceTypeNode) String ¶
func (n *InterfaceTypeNode) String() string
type InvalidType ¶
type InvalidType struct{}
func (*InvalidType) Align ¶
func (n *InvalidType) Align() int
func (*InvalidType) FieldAlign ¶
func (n *InvalidType) FieldAlign() int
func (*InvalidType) Kind ¶
func (n *InvalidType) Kind() Kind
func (*InvalidType) Position ¶
func (n *InvalidType) Position() (r token.Position)
func (*InvalidType) Size ¶
func (n *InvalidType) Size() int64
func (*InvalidType) Source ¶
func (n *InvalidType) Source(full bool) string
func (*InvalidType) String ¶
func (n *InvalidType) String() string
type IotaNode ¶
type IotaNode struct {
Iota Token
// contains filtered or unexported fields
}
IotaNode represents the production
IotaNode = identifier .
func (*IotaNode) LexicalScope ¶
func (n *IotaNode) LexicalScope() *Scope
type KeyedElementListNode ¶
type KeyedElementListNode struct {
KeyedElement Expression
COMMA Token
List *KeyedElementListNode
}
KeyedElementListNode represents the production
KeyedElementListNode = { KeyedElement "," } .
func (*KeyedElementListNode) Position ¶
func (n *KeyedElementListNode) Position() (r token.Position)
Position implements Node.
func (*KeyedElementListNode) Source ¶
func (n *KeyedElementListNode) Source(full bool) string
Source implements Node.
type KeyedElementNode ¶
type KeyedElementNode struct {
Element Expression
COLON Token
Element2 Expression
}
KeyedElementNode represents the production
KeyedElement = Element [ ":" Element ] .
func (*KeyedElementNode) Position ¶
func (n *KeyedElementNode) Position() (r token.Position)
Position implements Node.
func (*KeyedElementNode) Source ¶
func (n *KeyedElementNode) Source(full bool) string
Source implements Node.
func (*KeyedElementNode) Type ¶
func (n *KeyedElementNode) Type() Type
func (*KeyedElementNode) Value ¶
func (n *KeyedElementNode) Value() constant.Value
type Kind ¶
type Kind byte
A Kind represents the specific kind of type that a Type represents. The zero Kind is not a valid kind.
const ( InvalidKind Kind = iota // <invalid type> Array // array Bool // bool Chan // chan Complex128 // complex128 Complex64 // complex64 Float32 // float32 Float64 // float64 Function // function Int // int Int16 // int16 Int32 // int32 Int64 // int64 Int8 // int8 Interface // interface Map // map Pointer // pointer Slice // slice String // string Struct // struct Tuple // tuple Uint // uint Uint16 // uint16 Uint32 // uint32 Uint64 // uint64 Uint8 // uint8 Uintptr // uintptr UnsafePointer // unsafe.Pointer UntypedBool // untyped bool UntypedComplex // untyped complex UntypedFloat // untyped float UntypedInt // untyped int UntypedNil // untyped nil UntypedRune // untyped rune UntypedString // untyped string )
Values of type Kind
type LabelNode ¶
type LabelNode struct {
IDENT Token
}
LabelNode represents the production
Label = identifier .
type LabeledStmtNode ¶
LabeledStmtNode represents the production
LabeledStmt = Label ":" Statement .
func (*LabeledStmtNode) Position ¶
func (n *LabeledStmtNode) Position() (r token.Position)
Position implements Node.
func (*LabeledStmtNode) Source ¶
func (n *LabeledStmtNode) Source(full bool) string
Source implements Node.
type LiteralValueNode ¶
type LiteralValueNode struct {
LBRACE Token
KeyedElementList *KeyedElementListNode
RBRACE Token
}
LiteralValueNode represents the production
LiteralValue = "{" { KeyedElement "," } "}" .
func (*LiteralValueNode) Position ¶
func (n *LiteralValueNode) Position() (r token.Position)
Position implements Node.
func (*LiteralValueNode) Source ¶
func (n *LiteralValueNode) Source(full bool) string
Source implements Node.
func (*LiteralValueNode) Type ¶
func (n *LiteralValueNode) Type() Type
func (*LiteralValueNode) Value ¶
func (n *LiteralValueNode) Value() constant.Value
type MapTypeNode ¶
MapTypeNode represents the production
MapType = "map" "[" KeyType "]" ElementType .
func (*MapTypeNode) Align ¶
func (n *MapTypeNode) Align() int
func (*MapTypeNode) FieldAlign ¶
func (n *MapTypeNode) FieldAlign() int
func (*MapTypeNode) Kind ¶
func (n *MapTypeNode) Kind() Kind
func (*MapTypeNode) Position ¶
func (n *MapTypeNode) Position() (r token.Position)
Position implements Node.
func (*MapTypeNode) Size ¶
func (n *MapTypeNode) Size() int64
func (*MapTypeNode) String ¶
func (n *MapTypeNode) String() string
type MethodDeclNode ¶
type MethodDeclNode struct {
FUNC Token
Receiver *ParametersNode
MethodName Token
Signature *SignatureNode
FunctionBody *FunctionBodyNode
}
MethodDeclNode represents the production
MethodDecl = "func" Receiver MethodName Signature [ FunctionBody ] .
func (*MethodDeclNode) Position ¶
func (n *MethodDeclNode) Position() (r token.Position)
Position implements Node.
func (*MethodDeclNode) Source ¶
func (n *MethodDeclNode) Source(full bool) string
Source implements Node.
type MethodElemNode ¶
type MethodElemNode struct {
MethodName Token
Signature *SignatureNode
// contains filtered or unexported fields
}
MethodElemNode represents the production
MethodElem = MethodName Signature .
func (*MethodElemNode) Position ¶
func (n *MethodElemNode) Position() (r token.Position)
Position implements Node.
func (*MethodElemNode) Source ¶
func (n *MethodElemNode) Source(full bool) string
Source implements Node.
type MethodExprNode ¶
MethodExprNode represents the production
MethodExpr = ReceiverType "." MethodName .
func (*MethodExprNode) Position ¶
func (n *MethodExprNode) Position() (r token.Position)
Position implements Node.
func (*MethodExprNode) Source ¶
func (n *MethodExprNode) Source(full bool) string
Source implements Node.
func (*MethodExprNode) Type ¶
func (n *MethodExprNode) Type() Type
func (*MethodExprNode) Value ¶
func (n *MethodExprNode) Value() constant.Value
type OperandNameNode ¶
type OperandNameNode struct {
Name Token
// contains filtered or unexported fields
}
OperandNameNode represents the production
OperandName = identifier .
func (*OperandNameNode) LexicalScope ¶
func (n *OperandNameNode) LexicalScope() *Scope
func (*OperandNameNode) Position ¶
func (n *OperandNameNode) Position() (r token.Position)
Position implements Node.
func (*OperandNameNode) Source ¶
func (n *OperandNameNode) Source(full bool) string
Source implements Node.
func (*OperandNameNode) Type ¶
func (n *OperandNameNode) Type() Type
func (*OperandNameNode) Value ¶
func (n *OperandNameNode) Value() constant.Value
type OperandNode ¶
type OperandNode struct {
OperandName Expression
TypeArgs *TypeArgsNode
LiteralValue *LiteralValueNode
}
OperandNode represents the production
Operand = Literal | OperandName [ TypeArgs ] [ LiteralValue ] .
func (*OperandNode) Position ¶
func (n *OperandNode) Position() (r token.Position)
Position implements Node.
func (*OperandNode) Type ¶
func (n *OperandNode) Type() Type
func (*OperandNode) Value ¶
func (n *OperandNode) Value() constant.Value
type OperandQualifiedNameNode ¶
type OperandQualifiedNameNode struct {
Name *QualifiedIdentNode
// contains filtered or unexported fields
}
OperandQualifiedNameNode represents the production
OperandQualifiedName = QualifiedIdent .
func (*OperandQualifiedNameNode) LexicalScope ¶
func (n *OperandQualifiedNameNode) LexicalScope() *Scope
func (*OperandQualifiedNameNode) Position ¶
func (n *OperandQualifiedNameNode) Position() (r token.Position)
Position implements Node.
func (*OperandQualifiedNameNode) Source ¶
func (n *OperandQualifiedNameNode) Source(full bool) string
Source implements Node.
func (*OperandQualifiedNameNode) Type ¶
func (n *OperandQualifiedNameNode) Type() Type
func (*OperandQualifiedNameNode) Value ¶
func (n *OperandQualifiedNameNode) Value() constant.Value
type Package ¶
type Package struct {
AST map[string]*AST // AST maps fsPaths of individual files to their respective ASTs
FSPath string
GoFiles []fs.FileInfo
ImportPath string
InvalidGoFiles map[string]error // errors for particular files, if any
Name Token
Scope *Scope // Package scope.
Version string
// contains filtered or unexported fields
}
Package represents a Go package. The instance must not be mutated.
type PackageClauseNode ¶
PackageClauseNode represents the production
PackageClause = "package" PackageName .
func (*PackageClauseNode) Position ¶
func (n *PackageClauseNode) Position() (r token.Position)
Position implements Node.
func (*PackageClauseNode) Source ¶
func (n *PackageClauseNode) Source(full bool) string
Source implements Node.
type ParameterDeclListNode ¶
type ParameterDeclListNode struct {
ParameterDecl *ParameterDeclNode
COMMA Token
List *ParameterDeclListNode
}
ParameterDeclListNode represents the production
ParameterDeclListNode = { ParameterDecl "," } .
func (*ParameterDeclListNode) Position ¶
func (n *ParameterDeclListNode) Position() (r token.Position)
Position implements Node.
func (*ParameterDeclListNode) Source ¶
func (n *ParameterDeclListNode) Source(full bool) string
Source implements Node.
type ParameterDeclNode ¶
type ParameterDeclNode struct {
IdentifierList *IdentifierListNode
ELLIPSIS Token
TypeNode Type
// contains filtered or unexported fields
}
ParameterDeclNode represents the production
ParameterDecl = [ IdentifierList ] [ "..." ] Type .
func (*ParameterDeclNode) Position ¶
func (n *ParameterDeclNode) Position() (r token.Position)
Position implements Node.
func (*ParameterDeclNode) Source ¶
func (n *ParameterDeclNode) Source(full bool) string
Source implements Node.
type ParametersNode ¶
type ParametersNode struct {
LPAREN Token
ParameterDeclList *ParameterDeclListNode
RPAREN Token
}
ParametersNode represents the production
Parameters = "(" { ParameterDecl "," } ")" .
func (*ParametersNode) Position ¶
func (n *ParametersNode) Position() (r token.Position)
Position implements Node.
func (*ParametersNode) Source ¶
func (n *ParametersNode) Source(full bool) string
Source implements Node.
type ParenthesizedExpressionNode ¶
type ParenthesizedExpressionNode struct {
LPAREN Token
Expression Expression
RPAREN Token
}
func (*ParenthesizedExpressionNode) Position ¶
func (n *ParenthesizedExpressionNode) Position() (r token.Position)
Position implements Node.
func (*ParenthesizedExpressionNode) Source ¶
func (n *ParenthesizedExpressionNode) Source(full bool) string
Source implements Node.
func (*ParenthesizedExpressionNode) Type ¶
func (n *ParenthesizedExpressionNode) Type() Type
func (*ParenthesizedExpressionNode) Value ¶
func (n *ParenthesizedExpressionNode) Value() constant.Value
type ParenthesizedTypeNode ¶
ParenthesizedTypeNode represents the production
ParenthesizedType = "(" Type ")" .
func (*ParenthesizedTypeNode) Align ¶
func (n *ParenthesizedTypeNode) Align() int
func (*ParenthesizedTypeNode) FieldAlign ¶
func (n *ParenthesizedTypeNode) FieldAlign() int
func (*ParenthesizedTypeNode) Kind ¶
func (n *ParenthesizedTypeNode) Kind() Kind
func (*ParenthesizedTypeNode) Position ¶
func (n *ParenthesizedTypeNode) Position() (r token.Position)
Position implements Node.
func (*ParenthesizedTypeNode) Size ¶
func (n *ParenthesizedTypeNode) Size() int64
func (*ParenthesizedTypeNode) Source ¶
func (n *ParenthesizedTypeNode) Source(full bool) string
Source implements Node.
func (*ParenthesizedTypeNode) String ¶
func (n *ParenthesizedTypeNode) String() string
type PointerTypeNode ¶
PointerTypeNode represents the production
PointerType = "*" BaseType .
func (*PointerTypeNode) Align ¶
func (n *PointerTypeNode) Align() int
func (*PointerTypeNode) FieldAlign ¶
func (n *PointerTypeNode) FieldAlign() int
func (*PointerTypeNode) Kind ¶
func (n *PointerTypeNode) Kind() Kind
func (*PointerTypeNode) Position ¶
func (n *PointerTypeNode) Position() (r token.Position)
Position implements Node.
func (*PointerTypeNode) Size ¶
func (n *PointerTypeNode) Size() int64
func (*PointerTypeNode) Source ¶
func (n *PointerTypeNode) Source(full bool) string
Source implements Node.
func (*PointerTypeNode) String ¶
func (n *PointerTypeNode) String() string
type PredeclaredType ¶
type PredeclaredType struct {
Node
// contains filtered or unexported fields
}
func (*PredeclaredType) Align ¶
func (n *PredeclaredType) Align() int
func (*PredeclaredType) FieldAlign ¶
func (n *PredeclaredType) FieldAlign() int
func (*PredeclaredType) Kind ¶
func (n *PredeclaredType) Kind() Kind
func (*PredeclaredType) Size ¶
func (n *PredeclaredType) Size() int64
func (*PredeclaredType) String ¶
func (n *PredeclaredType) String() string
type PrimaryExprNode ¶
type PrimaryExprNode struct {
PrimaryExpr Expression
Postfix Node
}
PrimaryExprNode represents the production
PrimaryExpr = Operand | Conversion | MethodExpr { Selector | Index | Slice | TypeAssertion | Arguments } .
func (*PrimaryExprNode) Position ¶
func (n *PrimaryExprNode) Position() (r token.Position)
Position implements Node.
func (*PrimaryExprNode) Source ¶
func (n *PrimaryExprNode) Source(full bool) string
Source implements Node.
func (*PrimaryExprNode) Type ¶
func (n *PrimaryExprNode) Type() Type
func (*PrimaryExprNode) Value ¶
func (n *PrimaryExprNode) Value() constant.Value
type QualifiedIdentNode ¶
QualifiedIdentNode represents the production
QualifiedIdent = PackageName "." identifier .
func (*QualifiedIdentNode) Position ¶
func (n *QualifiedIdentNode) Position() (r token.Position)
Position implements Node.
func (*QualifiedIdentNode) Source ¶
func (n *QualifiedIdentNode) Source(full bool) string
Source implements Node.
type RangeClauseNode ¶
type RangeClauseNode struct {
RANGE Token
Expression Expression
ExpressionList *ExpressionListNode
ASSIGN Token
IdentifierList *IdentifierListNode
DEFINE Token
}
RangeClauseNode represents the production
RangeClause = "range" Expression | ExpressionList "=" "range" Expression | IdentifierList ":=" "range" Expression .
func (*RangeClauseNode) Position ¶
func (n *RangeClauseNode) Position() (r token.Position)
Position implements Node.
func (*RangeClauseNode) Source ¶
func (n *RangeClauseNode) Source(full bool) string
Source implements Node.
type RecvStmtNode ¶
type RecvStmtNode struct {
ExpressionList *ExpressionListNode
Token Token
IdentifierList *IdentifierListNode
RecvExpr Expression
}
RecvStmtNode represents the production
RecvStmt = [ ExpressionList "=" | IdentifierList ":=" ] RecvExpr .
func (*RecvStmtNode) Position ¶
func (n *RecvStmtNode) Position() (r token.Position)
Position implements Node.
func (*RecvStmtNode) Source ¶
func (n *RecvStmtNode) Source(full bool) string
Source implements Node.
type ResultNode ¶
type ResultNode struct {
Parameters *ParametersNode
TypeNode Type
}
ResultNode represents the production
Result = Parameters | Type .
func (*ResultNode) Position ¶
func (n *ResultNode) Position() (r token.Position)
Position implements Node.
type ReturnStmtNode ¶
type ReturnStmtNode struct {
RETURN Token
ExpressionList *ExpressionListNode
}
ReturnStmtNode represents the production
ReturnStmt = "return" [ ExpressionList ] .
func (*ReturnStmtNode) Position ¶
func (n *ReturnStmtNode) Position() (r token.Position)
Position implements Node.
func (*ReturnStmtNode) Source ¶
func (n *ReturnStmtNode) Source(full bool) string
Source implements Node.
type ScopeKind ¶
type ScopeKind int
const ( UniverseScope ScopeKind PackageScope FileScope OtherScope )
type SelectStmtNode ¶
type SelectStmtNode struct {
SELECT Token
LBRACE Token
CommClauseList *CommClauseListNode
RBRACE Token
}
SelectStmtNode represents the production
SelectStmt = "select" "{" { CommClause } "}" .
func (*SelectStmtNode) Position ¶
func (n *SelectStmtNode) Position() (r token.Position)
Position implements Node.
func (*SelectStmtNode) Source ¶
func (n *SelectStmtNode) Source(full bool) string
Source implements Node.
type SelectorNode ¶
SelectorNode represents the production
Selector = "." identifier .
func (*SelectorNode) Position ¶
func (n *SelectorNode) Position() (r token.Position)
Position implements Node.
func (*SelectorNode) Source ¶
func (n *SelectorNode) Source(full bool) string
Source implements Node.
type SendStmtNode ¶
type SendStmtNode struct {
Channel Expression
ARROW Token
Expression Expression
}
SendStmtNode represents the production
SendStmt = Channel "<-" Expression .
func (*SendStmtNode) Position ¶
func (n *SendStmtNode) Position() (r token.Position)
Position implements Node.
func (*SendStmtNode) Source ¶
func (n *SendStmtNode) Source(full bool) string
Source implements Node.
type ShortVarDeclNode ¶
type ShortVarDeclNode struct {
IdentifierList *IdentifierListNode
DEFINE Token
ExpressionList *ExpressionListNode
// contains filtered or unexported fields
}
ShortVarDeclNode represents the production
ShortVarDecl = IdentifierList ":=" ExpressionList .
func (*ShortVarDeclNode) Position ¶
func (n *ShortVarDeclNode) Position() (r token.Position)
Position implements Node.
func (*ShortVarDeclNode) Source ¶
func (n *ShortVarDeclNode) Source(full bool) string
Source implements Node.
type SignatureNode ¶
type SignatureNode struct {
Parameters *ParametersNode
Result *ResultNode
// contains filtered or unexported fields
}
SignatureNode represents the production
Signature = Parameters [ Result ] .
func (*SignatureNode) Position ¶
func (n *SignatureNode) Position() (r token.Position)
Position implements Node.
func (*SignatureNode) Source ¶
func (n *SignatureNode) Source(full bool) string
Source implements Node.
type SliceNode ¶
type SliceNode struct {
LBRACK Token
Expression Expression
COLON Token
Expression2 Expression
RBRACK Token
COLON2 Token
Expression3 Expression
}
SliceNode represents the production
Slice = "[" [ Expression ] ":" [ Expression ] "]" | "[" [ Expression ] ":" Expression ":" Expression "]" .
type SliceTypeNode ¶
type SliceTypeNode struct {
LBRACK Token
RBRACK Token
ElementType Node
// contains filtered or unexported fields
}
SliceTypeNode represents the production
SliceType = "[" "]" ElementType .
func (*SliceTypeNode) Align ¶
func (n *SliceTypeNode) Align() int
func (*SliceTypeNode) FieldAlign ¶
func (n *SliceTypeNode) FieldAlign() int
func (*SliceTypeNode) Kind ¶
func (n *SliceTypeNode) Kind() Kind
func (*SliceTypeNode) Position ¶
func (n *SliceTypeNode) Position() (r token.Position)
Position implements Node.
func (*SliceTypeNode) Size ¶
func (n *SliceTypeNode) Size() int64
func (*SliceTypeNode) Source ¶
func (n *SliceTypeNode) Source(full bool) string
Source implements Node.
func (*SliceTypeNode) String ¶
func (n *SliceTypeNode) String() string
type SourceFileNode ¶
type SourceFileNode struct {
PackageClause *PackageClauseNode
SEMICOLON Token
ImportDeclList *ImportDeclListNode
TopLevelDeclList *TopLevelDeclListNode
}
SourceFileNode represents the production
SourceFile = PackageClause ";" { ImportDecl ";" } { TopLevelDecl ";" } .
func (*SourceFileNode) Position ¶
func (n *SourceFileNode) Position() (r token.Position)
Position implements Node.
func (*SourceFileNode) Source ¶
func (n *SourceFileNode) Source(full bool) string
Source implements Node.
type StatementListNode ¶
type StatementListNode struct {
Statement Node
SEMICOLON Token
List *StatementListNode
}
StatementListNode represents the production
StatementList = { Statement ";" } .
func (*StatementListNode) Position ¶
func (n *StatementListNode) Position() (r token.Position)
Position implements Node.
func (*StatementListNode) Source ¶
func (n *StatementListNode) Source(full bool) string
Source implements Node.
type StructTypeNode ¶
type StructTypeNode struct {
STRUCT Token
LBRACE Token
FieldDeclList *FieldDeclListNode
RBRACE Token
// contains filtered or unexported fields
}
StructTypeNode represents the production
StructType = "struct" "{" { FieldDecl ";" } "}" .
func (*StructTypeNode) Align ¶
func (n *StructTypeNode) Align() int
func (*StructTypeNode) FieldAlign ¶
func (n *StructTypeNode) FieldAlign() int
func (*StructTypeNode) Kind ¶
func (n *StructTypeNode) Kind() Kind
func (*StructTypeNode) Position ¶
func (n *StructTypeNode) Position() (r token.Position)
Position implements Node.
func (*StructTypeNode) Size ¶
func (n *StructTypeNode) Size() int64
func (*StructTypeNode) Source ¶
func (n *StructTypeNode) Source(full bool) string
Source implements Node.
func (*StructTypeNode) String ¶
func (n *StructTypeNode) String() string
type SwitchStmtNode ¶
type SwitchStmtNode struct {
ExprSwitchStmt *ExprSwitchStmtNode
TypeSwitchStmt *TypeSwitchStmtNode
}
SwitchStmtNode represents the production
SwitchStmt = ExprSwitchStmt | TypeSwitchStmt .
func (*SwitchStmtNode) Position ¶
func (n *SwitchStmtNode) Position() (r token.Position)
Position implements Node.
func (*SwitchStmtNode) Source ¶
func (n *SwitchStmtNode) Source(full bool) string
Source implements Node.
type TagNode ¶
type TagNode struct {
STRING Token
}
TagNode represents the production
Tag = string_lit .
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token represents a lexeme, its position and its semantic value.
type TopLevelDeclListNode ¶
type TopLevelDeclListNode struct {
TopLevelDecl Node
SEMICOLON Token
List *TopLevelDeclListNode
}
TopLevelDeclListNode represents the production
TopLevelDeclListNode = { TopLevelDecl ";" .
func (*TopLevelDeclListNode) Position ¶
func (n *TopLevelDeclListNode) Position() (r token.Position)
Position implements Node.
func (*TopLevelDeclListNode) Source ¶
func (n *TopLevelDeclListNode) Source(full bool) string
Source implements Node.
type TupleType ¶
func (*TupleType) FieldAlign ¶
type Type ¶
type Type interface {
Node
// Align returns the alignment in bytes of a value of this type when allocated
// in memory.
Align() int
// FieldAlign returns the alignment in bytes of a value of this type when used
// as a field in a struct.
FieldAlign() int
// Kind returns the specific kind of this type.
Kind() Kind
// Size returns the number of bytes needed to store a value of the given type;
// it is analogous to unsafe.Sizeof.
Size() int64
// String returns a string representation of the type. The string
// representation is not guaranteed to be unique among types.
String() string
// contains filtered or unexported methods
}
type TypeArgsNode ¶
type TypeArgsNode struct {
LBRACK Token
TypeList *TypeListNode
COMMA Token
RBRACK Token
}
TypeArgsNode represents the production
TypeArgs = "[" TypeList [ "," ] "]" .
func (*TypeArgsNode) Position ¶
func (n *TypeArgsNode) Position() (r token.Position)
Position implements Node.
func (*TypeArgsNode) Source ¶
func (n *TypeArgsNode) Source(full bool) string
Source implements Node.
type TypeAssertionNode ¶
TypeAssertionNode represents the production
TypeAssertion = "." "(" Type ")" .
func (*TypeAssertionNode) Position ¶
func (n *TypeAssertionNode) Position() (r token.Position)
Position implements Node.
func (*TypeAssertionNode) Source ¶
func (n *TypeAssertionNode) Source(full bool) string
Source implements Node.
type TypeCaseClauseListNode ¶
type TypeCaseClauseListNode struct {
TypeCaseClause *TypeCaseClauseNode
List *TypeCaseClauseListNode
}
TypeCaseClauseListNode represents the production
TypeCaseClauseListNode = { TypeCaseClause } .
func (*TypeCaseClauseListNode) Position ¶
func (n *TypeCaseClauseListNode) Position() (r token.Position)
Position implements Node.
func (*TypeCaseClauseListNode) Source ¶
func (n *TypeCaseClauseListNode) Source(full bool) string
Source implements Node.
type TypeCaseClauseNode ¶
type TypeCaseClauseNode struct {
TypeSwitchCase *TypeSwitchCaseNode
COLON Token
StatementList *StatementListNode
}
TypeCaseClauseNode represents the production
TypeCaseClause = TypeSwitchCase ":" StatementList .
func (*TypeCaseClauseNode) Position ¶
func (n *TypeCaseClauseNode) Position() (r token.Position)
Position implements Node.
func (*TypeCaseClauseNode) Source ¶
func (n *TypeCaseClauseNode) Source(full bool) string
Source implements Node.
type TypeConstraintNode ¶
type TypeConstraintNode struct {
TypeElem *TypeElemListNode
}
TypeConstraintNode represents the production
TypeConstraint = TypeElem .
func (*TypeConstraintNode) Position ¶
func (n *TypeConstraintNode) Position() (r token.Position)
Position implements Node.
func (*TypeConstraintNode) Source ¶
func (n *TypeConstraintNode) Source(full bool) string
Source implements Node.
type TypeDeclNode ¶
type TypeDeclNode struct {
TYPE Token
LPAREN Token
TypeSpecList *TypeSpecListNode
RPAREN Token
}
TypeDeclNode represents the production
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
func (*TypeDeclNode) Position ¶
func (n *TypeDeclNode) Position() (r token.Position)
Position implements Node.
func (*TypeDeclNode) Source ¶
func (n *TypeDeclNode) Source(full bool) string
Source implements Node.
type TypeDefNode ¶
type TypeDefNode struct {
IDENT Token
TypeParameters *TypeParametersNode
TypeNode Type
// contains filtered or unexported fields
}
TypeDefNode represents the production
TypeDef = identifier [ TypeParameters ] Type .
func (*TypeDefNode) Align ¶
func (n *TypeDefNode) Align() int
func (*TypeDefNode) FieldAlign ¶
func (n *TypeDefNode) FieldAlign() int
func (*TypeDefNode) Kind ¶
func (n *TypeDefNode) Kind() Kind
func (*TypeDefNode) Position ¶
func (n *TypeDefNode) Position() (r token.Position)
Position implements Node.
func (*TypeDefNode) Size ¶
func (n *TypeDefNode) Size() int64
func (*TypeDefNode) String ¶
func (n *TypeDefNode) String() string
type TypeElemListNode ¶
type TypeElemListNode struct {
OR Token
TypeTerm *TypeTermNode
List *TypeElemListNode
}
TypeElemListNode represents the production
TypeElem = TypeTerm { "|" TypeTerm } .
func (*TypeElemListNode) Position ¶
func (n *TypeElemListNode) Position() (r token.Position)
Position implements Node.
func (*TypeElemListNode) Source ¶
func (n *TypeElemListNode) Source(full bool) string
Source implements Node.
type TypeListNode ¶
type TypeListNode struct {
COMMA Token
TypeNode Type
List *TypeListNode
}
TypeListNode represents the production
TypeList = Type { "," Type } .
func (*TypeListNode) Position ¶
func (n *TypeListNode) Position() (r token.Position)
Position implements Node.
func (*TypeListNode) Source ¶
func (n *TypeListNode) Source(full bool) string
Source implements Node.
type TypeNameNode ¶
type TypeNameNode struct {
Name Node
// contains filtered or unexported fields
}
TypeNameNode represents the production
TypeName = QualifiedIdent | identifier .
func (*TypeNameNode) Align ¶
func (n *TypeNameNode) Align() int
func (*TypeNameNode) FieldAlign ¶
func (n *TypeNameNode) FieldAlign() int
func (*TypeNameNode) Kind ¶
func (n *TypeNameNode) Kind() Kind
func (*TypeNameNode) LexicalScope ¶
func (n *TypeNameNode) LexicalScope() *Scope
func (*TypeNameNode) Position ¶
func (n *TypeNameNode) Position() (r token.Position)
Position implements Node.
func (*TypeNameNode) Size ¶
func (n *TypeNameNode) Size() int64
func (*TypeNameNode) Source ¶
func (n *TypeNameNode) Source(full bool) string
Source implements Node.
func (*TypeNameNode) String ¶
func (n *TypeNameNode) String() string
type TypeNode ¶
type TypeNode struct {
TypeName *TypeNameNode
TypeArgs *TypeArgsNode
}
TypeNode represents the production
Type = TypeName TypeArgs .
func (*TypeNode) FieldAlign ¶
type TypeParamDeclNode ¶
type TypeParamDeclNode struct {
IdentifierList *IdentifierListNode
TypeConstraint *TypeConstraintNode
}
TypeParamDeclNode represents the production
TypeParamDecl = IdentifierList TypeConstraint .
func (*TypeParamDeclNode) Position ¶
func (n *TypeParamDeclNode) Position() (r token.Position)
Position implements Node.
func (*TypeParamDeclNode) Source ¶
func (n *TypeParamDeclNode) Source(full bool) string
Source implements Node.
type TypeParamListNode ¶
type TypeParamListNode struct {
COMMA Token
TypeParamDecl *TypeParamDeclNode
List *TypeParamListNode
}
TypeParamListNode represents the production
TypeParamList = TypeParamDecl { "," TypeParamDecl } .
func (*TypeParamListNode) Position ¶
func (n *TypeParamListNode) Position() (r token.Position)
Position implements Node.
func (*TypeParamListNode) Source ¶
func (n *TypeParamListNode) Source(full bool) string
Source implements Node.
type TypeParametersNode ¶
type TypeParametersNode struct {
LBRACK Token
TypeParamList *TypeParamListNode
COMMA Token
RBRACK Token
}
TypeParametersNode represents the production
TypeParameters = "[" TypeParamList [ "," ] "]" .
func (*TypeParametersNode) Position ¶
func (n *TypeParametersNode) Position() (r token.Position)
Position implements Node.
func (*TypeParametersNode) Source ¶
func (n *TypeParametersNode) Source(full bool) string
Source implements Node.
type TypeSpecListNode ¶
type TypeSpecListNode struct {
TypeSpec Node
SEMICOLON Token
List *TypeSpecListNode
}
TypeSpecListNode represents the production
TypeSpecListNode = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
func (*TypeSpecListNode) Position ¶
func (n *TypeSpecListNode) Position() (r token.Position)
Position implements Node.
func (*TypeSpecListNode) Source ¶
func (n *TypeSpecListNode) Source(full bool) string
Source implements Node.
type TypeSwitchCaseNode ¶
type TypeSwitchCaseNode struct {
CASE Token
TypeList *TypeListNode
DEFAULT Token
}
TypeSwitchCaseNode represents the production
TypeSwitchCase = "case" TypeList | "default" .
func (*TypeSwitchCaseNode) Position ¶
func (n *TypeSwitchCaseNode) Position() (r token.Position)
Position implements Node.
func (*TypeSwitchCaseNode) Source ¶
func (n *TypeSwitchCaseNode) Source(full bool) string
Source implements Node.
type TypeSwitchGuardNode ¶
type TypeSwitchGuardNode struct {
IDENT Token
DEFINE Token
PrimaryExpr Expression
PERIOD Token
LPAREN Token
TYPE Token
RPAREN Token
}
TypeSwitchGuardNode represents the production
TypeSwitchGuard = [ identifier ":=" ] PrimaryExpr "." "(" "type" ")" .
func (*TypeSwitchGuardNode) Position ¶
func (n *TypeSwitchGuardNode) Position() (r token.Position)
Position implements Node.
func (*TypeSwitchGuardNode) Source ¶
func (n *TypeSwitchGuardNode) Source(full bool) string
Source implements Node.
type TypeSwitchStmtNode ¶
type TypeSwitchStmtNode struct {
SWITCH Token
SimpleStmt Node
SEMICOLON Token
TypeSwitchGuard *TypeSwitchGuardNode
LBRACE Token
TypeCaseClauseList *TypeCaseClauseListNode
RBRACE Token
}
TypeSwitchStmtNode represents the production
TypeSwitchStmt = "switch" [ SimpleStmt ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
func (*TypeSwitchStmtNode) Position ¶
func (n *TypeSwitchStmtNode) Position() (r token.Position)
Position implements Node.
func (*TypeSwitchStmtNode) Source ¶
func (n *TypeSwitchStmtNode) Source(full bool) string
Source implements Node.
type TypeTermNode ¶
type TypeTermNode struct {
TypeNode Type
UnderlyingType *UnderlyingTypeNode
}
TypeTermNode represents the production
TypeTerm = Type | UnderlyingType .
func (*TypeTermNode) Position ¶
func (n *TypeTermNode) Position() (r token.Position)
Position implements Node.
func (*TypeTermNode) Source ¶
func (n *TypeTermNode) Source(full bool) string
Source implements Node.
type UnaryExprNode ¶
type UnaryExprNode struct {
Op Token
UnaryExpr Expression
// contains filtered or unexported fields
}
UnaryExprNode represents the production
UnaryExpr = PrimaryExpr | ( "+" | "-" | "!" | "^" | "*" | "&" | "<-" ) UnaryExpr .
func (*UnaryExprNode) Position ¶
func (n *UnaryExprNode) Position() (r token.Position)
Position implements Node.
func (*UnaryExprNode) Source ¶
func (n *UnaryExprNode) Source(full bool) string
Source implements Node.
type UnderlyingTypeNode ¶
UnderlyingTypeNode represents the production
UnderlyingType = "~" Type .
func (*UnderlyingTypeNode) Position ¶
func (n *UnderlyingTypeNode) Position() (r token.Position)
Position implements Node.
func (*UnderlyingTypeNode) Source ¶
func (n *UnderlyingTypeNode) Source(full bool) string
Source implements Node.
type ValueExpression ¶
type ValueExpression struct {
Node
// contains filtered or unexported fields
}
type VarDeclNode ¶
VarDeclNode represents the production
VarDecl = "var" ( VarSpec | "(" { VarSpec ";" } ")" ) .
func (*VarDeclNode) Position ¶
func (n *VarDeclNode) Position() (r token.Position)
Position implements Node.
type VarSpec2Node ¶
type VarSpec2Node struct {
IdentifierList *IdentifierListNode
TypeNode Type
ASSIGN Token
ExpressionList *ExpressionListNode
// contains filtered or unexported fields
}
VarSpec2Node represents the production
VarSpec = IdentifierList ( Type [ "=" ExpressionList ] | "=" ExpressionList ) .
func (*VarSpec2Node) LexicalScope ¶
func (n *VarSpec2Node) LexicalScope() *Scope
func (*VarSpec2Node) Position ¶
func (n *VarSpec2Node) Position() (r token.Position)
Position implements Node.
func (*VarSpec2Node) Source ¶
func (n *VarSpec2Node) Source(full bool) string
Source implements Node.
type VarSpecListNode ¶
type VarSpecListNode struct {
VarSpec Node
SEMICOLON Token
List *VarSpecListNode
}
VarSpecListNode represents the production
VarSpecListNode = { VarSpec ";" } .
func (*VarSpecListNode) Position ¶
func (n *VarSpecListNode) Position() (r token.Position)
Position implements Node.
func (*VarSpecListNode) Source ¶
func (n *VarSpecListNode) Source(full bool) string
Source implements Node.
type VarSpecNode ¶
type VarSpecNode struct {
IDENT Token
TypeNode Type
ASSIGN Token
ExpressionList *ExpressionListNode
// contains filtered or unexported fields
}
VarSpecNode represents the production
VarSpec = identifier ( Type [ "=" ExpressionList ] | "=" ExpressionList ) .
func (*VarSpecNode) LexicalScope ¶
func (n *VarSpecNode) LexicalScope() *Scope
func (*VarSpecNode) Position ¶
func (n *VarSpecNode) Position() (r token.Position)
Position implements Node.