Documentation
¶
Index ¶
- Constants
- Variables
- func Fdump(w io.Writer, n Node) (err error)
- func Fprint(w io.Writer, x Node, linebreaks bool) (n int, err error)
- func String(n Node) string
- type ArrayType
- type AssignStmt
- type BadExpr
- type BasicLit
- type BlockPolyStmt
- type BlockStmt
- type BranchStmt
- type CallExpr
- type CallStmt
- type CaseClause
- type ChanDir
- type ChanType
- type CommClause
- type CompositeLit
- type ConstDecl
- type Decl
- type DeclStmt
- type DotsType
- type EmptyStmt
- type Error
- type ErrorHandler
- type Expr
- type ExprStmt
- type Field
- type ForStmt
- type FuncDecl
- type FuncLit
- type FuncType
- type GFile
- type Group
- type IfStmt
- type ImportDecl
- type IndexExpr
- type InterfaceType
- type KeyValueExpr
- type LabeledStmt
- type ListExpr
- type LitKind
- type MapType
- type Mode
- type Name
- type Node
- type Operation
- type Operator
- type ParenExpr
- type PolyEvalDecl
- type PolyExpr
- type PolyField
- type PolyStmt
- type PolyStructDecl
- type PolyType
- type Pos
- type PosBase
- type RangeClause
- type ReturnStmt
- type SelectStmt
- type SelectorExpr
- type SendStmt
- type SimpleStmt
- type SliceExpr
- type SliceType
- type Stmt
- type StructType
- type SwitchStmt
- type TypeDecl
- type VarDecl
Constants ¶
View Source
const ( Break = _Break Continue = _Continue Fallthrough = _Fallthrough Goto = _Goto //for CallStmt CX = _CX Green = _Green )
View Source
const PosMax = 1 << 30
View Source
const (
StandardScanMode = 1 << iota
)
scanner modes. Currently only one.
Variables ¶
View Source
var ImplicitOne = &BasicLit{Value: "1"}
Golang is retarded and represents inc/dec as x (+/-)= ImplicitOne
Functions ¶
Types ¶
type AssignStmt ¶
type BadExpr ¶
type BadExpr struct {
// contains filtered or unexported fields
}
placeholder for an expression failing to parse correctly and where no better one can be found.
type BlockPolyStmt ¶
type BranchStmt ¶
type BranchStmt struct {
Tok token //Break, Continue, Fallthrough, or Goto
Label *Name
//Target is the continuation of the control folow after the branch
//has been executed, and is computed by the parser if CheckBranches
//is set (which is pretty much always). Target is *LabeledStmt for gotos,
//and *SwitchStmt, *SelectStmt, or *ForStmt for breaks and continues
//(depending on branch context). Target is unset for fallthroughs.
Target Stmt
// contains filtered or unexported fields
}
type CallStmt ¶
type CallStmt struct {
Tok token //CX/Green or Defer
Call *CallExpr
// contains filtered or unexported fields
}
type CaseClause ¶
type CommClause ¶
type CommClause struct {
Comm SimpleStmt //send or receive stmt, nil means default clause
Body []Stmt
Colon Pos
// contains filtered or unexported fields
}
type CompositeLit ¶
type ErrorHandler ¶
type ErrorHandler func(err error)
Called for each error encountered in reading source file.
type Field ¶
type ForStmt ¶
type ForStmt struct {
Init SimpleStmt //includes *RangeClause
Cond Expr
Post SimpleStmt
Body *BlockStmt
// contains filtered or unexported fields
}
type GFile ¶
type GFile struct {
PkgName *Name
DeclList []Decl
Lines uint
// contains filtered or unexported fields
}
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
All declarations belonging to the same group will point to the same Group node.
type IfStmt ¶
type IfStmt struct {
Init SimpleStmt
Cond Expr
Then *BlockStmt
Else Stmt //either nil, *IfStmt, or *BlockStmt
// contains filtered or unexported fields
}
type ImportDecl ¶
type InterfaceType ¶
type InterfaceType struct {
MethodList []*Field
// contains filtered or unexported fields
}
type KeyValueExpr ¶
type KeyValueExpr struct {
Key, Value Expr
// contains filtered or unexported fields
}
type LabeledStmt ¶
type Node ¶
type Node interface {
/* Pos() will return filepath, line, and column of the syntax object. */
Pos() Pos
// contains filtered or unexported methods
}
type Operator ¶
type Operator uint
const ( //Def is the : in := Def Operator //: Not //! Recv //<- //precOrOr OrOr //|| //precAndAnd AndAnd //&& //precCmp Eql //== Neq //!= Lss //< Leq //<= Gtr //> Geq //>= //precAdd Add //+ Sub //- Or //| Xor //^ //precMul Mul //* Div /// Rem //% And //& AndNot //&^ Shl //<< Shr //>> )
type PolyEvalDecl ¶
type PolyEvalDecl struct {
Name *Name
RecvName *Name //name of PolyStruct type that can be the receiver
Body *BlockPolyStmt //nil means no body
Type *FuncType
// contains filtered or unexported fields
}
type PolyStructDecl ¶
type PolyType ¶
type PolyType struct {
FieldList []*PolyField
// contains filtered or unexported fields
}
type PosBase ¶
type PosBase struct {
// contains filtered or unexported fields
}
represents base for relative position. filename:line:col
func NewFileBase ¶
func (*PosBase) IsFileBase ¶
type RangeClause ¶
type ReturnStmt ¶
type ReturnStmt struct {
Results Expr //nil means no explicit return values.
// contains filtered or unexported fields
}
type SelectStmt ¶
type SelectStmt struct {
Body []*CommClause
Rbrace Pos
// contains filtered or unexported fields
}
type SelectorExpr ¶
type SimpleStmt ¶
type SimpleStmt interface {
Stmt
// contains filtered or unexported methods
}
type StructType ¶
type StructType struct {
FieldList []*Field
// contains filtered or unexported fields
}
type SwitchStmt ¶
type SwitchStmt struct {
Init SimpleStmt
Tag Expr
Body []*CaseClause
Rbrace Pos
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.