Documentation
¶
Index ¶
- type ArrayType
- type BadDecl
- type BadExpr
- type BasicLit
- type BasicType
- type BeanDecl
- type Comment
- type CommentGroup
- type ConstSpec
- type Decl
- type Expr
- type Field
- type FieldList
- type File
- type FuncType
- type GenDecl
- type GroupDecl
- type Ident
- type ImportSpec
- type MapType
- type Node
- type ObjKind
- type Object
- type Package
- type Scope
- type Spec
- type StructType
- type Type
- type Values
- type VectorType
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicType ¶
type BasicType struct {
Name *Ident
}
builtin basic types(int,uint,string,bool,...)
type BeanDecl ¶
type BeanDecl struct {
Kind string // struct or protocol
Pos lexer.Pos
Doc *CommentGroup
Name *Ident
Extends []Type
Tag *BasicLit
Fields *FieldList
}
bean declaration node: struct or protocol
type CommentGroup ¶
type CommentGroup struct {
List []*Comment
}
func (*CommentGroup) Begin ¶
func (g *CommentGroup) Begin() lexer.Pos
func (*CommentGroup) Text ¶
func (g *CommentGroup) Text() string
type ConstSpec ¶
type ConstSpec struct {
Doc *CommentGroup // doc or nil
Name *Ident // name
Value Expr // value node
Comment *CommentGroup // line comments or nil
}
type Decl ¶
type Decl interface {
Node
// contains filtered or unexported methods
}
----------- Decl node -----------
type Expr ¶
type Expr interface {
Node
// contains filtered or unexported methods
}
----------- expr node -----------
type Field ¶
type Field struct {
Doc *CommentGroup // doc comment or nil
Options []*Ident // required/optional etc, maybe nil
Type Type // Field type
Names []*Ident // Field is a placeholder if len(Names) == 0
Default Expr // default node or nil
Tag *BasicLit // tag or nil
Comment *CommentGroup // line comment or nil
}
Field node
type File ¶
type File struct {
Filename string
Doc *CommentGroup // associated documentation; or nil
Package lexer.Pos // position of "package" keyword
Name *Ident // package name
Decls []Decl // top-level declarations; or nil
Scope *Scope // package scope (this file only)
Imports []*ImportSpec // imports in this file
Unresolved []*Ident // unresolved identifiers in this file
Comments []*CommentGroup // list of all comments in the source file
}
File node
type FuncType ¶
type GenDecl ¶
type GenDecl struct {
Doc *CommentGroup // doc or nil
TokPos lexer.Pos
Tok lexer.Token // import or const
Lparen lexer.Pos // (
Specs []Spec
Rparen lexer.Pos // )
}
generic declaration node
type ImportSpec ¶
type ImportSpec struct {
Doc *CommentGroup // doc or nil
Name *Ident // local name or nil
Package *BasicLit // package path
Comment *CommentGroup // line comments or nil
}
func (*ImportSpec) Begin ¶
func (is *ImportSpec) Begin() lexer.Pos
type Object ¶
type Object struct {
Kind ObjKind
Name string
Decl interface{} // Field,Spec,Decl or Scope
Data interface{}
}
type Package ¶
type Package struct {
Name string // package name
Scope *Scope // package scope across all files
Imports map[string]*Object // map of package id -> package object
Files map[string]*File // source files by filename
}
Package node
type Scope ¶
A Scope maintains the set of named language entities declared in the scope and a link to the immediately surrounding (outer) scope.
func (*Scope) Insert ¶
Insert attempts to insert a named object obj into the scope s. If the scope already contains an object alt with the same name, Insert leaves the scope unchanged and returns alt. Otherwise it inserts obj and returns nil.
type Spec ¶
type Spec interface {
Node
// contains filtered or unexported methods
}
----------- spec node -----------
type StructType ¶
struct/protocol
func (*StructType) Begin ¶
func (st *StructType) Begin() lexer.Pos
func (*StructType) Ident ¶
func (t *StructType) Ident() *Ident
type VectorType ¶
vector<T>
func (*VectorType) Begin ¶
func (vt *VectorType) Begin() lexer.Pos
func (*VectorType) Ident ¶
func (t *VectorType) Ident() *Ident
Click to show internal directories.
Click to hide internal directories.