Documentation ¶
Index ¶
- Constants
- func IsExported(name string) bool
- type Error
- type ErrorList
- type File
- func (f *File) AddLine(offset int)
- func (f *File) Base() int
- func (f *File) End() int
- func (f *File) Line(p Pos) int
- func (f *File) Name() string
- func (*File) Offset(p Pos) int
- func (f *File) Pos(offset int) Pos
- func (f *File) Position(p Pos) Position
- func (f *File) PositionFor(p Pos, _ bool) Position
- func (f *File) SetSize(size int)
- func (f *File) SetSkipLines(skipLines int)
- func (f *File) Size() int
- type FileSet
- type Kind
- func (k Kind) Category() Kind
- func (k Kind) IsBasic() bool
- func (k Kind) IsComplex() bool
- func (k Kind) IsFloat() bool
- func (k Kind) IsInteger() bool
- func (k Kind) IsNillable() bool
- func (k Kind) IsOrdered() bool
- func (k Kind) IsUntyped() bool
- func (k Kind) Size() uint64
- func (k Kind) String() string
- type Pos
- type Position
- type Token
Constants ¶
View Source
const ( LowestPrec = 0 // non-operators UnaryPrec = 6 HighestPrec = 7 )
Variables ¶
This section is empty.
Functions ¶
func IsExported ¶
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
functionally equivalent to go/token.File
func (*File) SetSkipLines ¶
type FileSet ¶
type FileSet struct {
// contains filtered or unexported fields
}
functionally equivalent to go/token.FileSet
func NewFileSet ¶
type Kind ¶
type Kind uint8
equivalent to go/token.Kind
const ( Invalid Kind = iota Bool Int Int8 Int16 Int32 Int64 Uint Uint8 Uint16 Uint32 Uint64 Uintptr Float32 Float64 Complex64 Complex128 ArrayKind ChanKind FuncKind InterfaceKind MapKind PtrKind SliceKind String StructKind UnsafePointer // types for untyped values UntypedBool UntypedInt UntypedRune UntypedFloat UntypedComplex UntypedString UntypedNil // aliases Byte = Uint8 Rune = Int32 )
func (Kind) Category ¶
group together typed and untyped: 1. booleans 2. integers 3. floats 4. complex numbers 5. strings
func (Kind) IsNillable ¶
type Token ¶
type Token int
equivalent to go/token.Token
const ( ILLEGAL Token = iota EOF COMMENT IDENT INT FLOAT IMAG CHAR STRING // Operators ADD SUB MUL QUO REM AND OR XOR SHL SHR AND_NOT ADD_ASSIGN SUB_ASSIGN MUL_ASSIGN QUO_ASSIGN REM_ASSIGN AND_ASSIGN OR_ASSIGN XOR_ASSIGN SHL_ASSIGN SHR_ASSIGN AND_NOT_ASSIGN LAND LOR ARROW INC DEC EQL LSS GTR ASSIGN NOT NEQ LEQ GEQ DEFINE ELLIPSIS LPAREN LBRACK LBRACE COMMA PERIOD RPAREN RBRACK RBRACE SEMICOLON COLON // Keywords BREAK CASE CHAN CONST CONTINUE DEFAULT DEFER ELSE FALLTHROUGH FOR FUNC GO GOTO IF IMPORT INTERFACE MAP PACKAGE RANGE RETURN SELECT STRUCT SWITCH TYPE VAR // array or slice type. if first child is nil => slice type. // otherwise first child is array length (possibly '...') ARRAY BLOCK BOTH_DIR CALL COMPOSITE_LIT // type { elem0, elem1 ... } DECLS // list of declarations DIR // list of files EXPRS // struct field, interface element, function param or result. // stored in *ast.Field FIELD FILE GENERIC // generic type parameters [T0 i0, T1 i1, ...] IMPORT_SPEC // single import line 'alias "full/pkg/path"' IMPORTS // list of IMPORT nodes INDEX // array/map/slice indexing a[b] or generic instantiation a[b,c...] KEY_VALUE // key: value inside a composite literal LABEL // label: statement LAMBDA // function literal NAMES // list of identifiers PARAMS RECV_DIR RESULTS SEND_DIR SLICE // slice expression a[b:c] or a[b:c:d] TYPE_ASSERT TYPES // list of types. used by generics in 'interface { type /* typelist */ }' TYPESWITCH // switch x.(type) { } VALUE_SPEC )
func LookupOperator ¶
func (Token) IsOperator ¶
func (Token) Precedence ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.