Documentation ¶
Index ¶
- Constants
- func DebugDump(w io.Writer, n Node)
- func Lex(path string, r io.Reader) (<-chan *Token, chan<- struct{})
- type ArrayOf
- type Assign
- type Binop
- type Call
- type ConstDecl
- type Constant
- type EmptyStatement
- type ExpressionStatement
- type File
- type FilePos
- type FileSpan
- type For
- type FuncDecl
- type Ident
- type If
- type IndexInto
- type Initializer
- type Node
- type PointerTo
- type Return
- type Selector
- type SpanProvider
- type String
- type Struct
- type Token
- type TokenKind
- type TypeDecl
- type Unop
- type VarDecl
Constants ¶
View Source
const ( ERROR = 0xffff + iota EOF FOR PACKAGE IMPORT FUNC RETURN STRUCT CONSTANT STRING IDENTIFIER VAR CONST ELLIPSIS TYPE IF BREAK CONTINUE ELSE NEQ EQ LTEQ GTEQ INC DEC ADDASSIGN ANDASSIGN SUBASSIGN XORASSIGN MULASSIGN ORASSIGN AND ANDNOT OR LSHIFT RSHIFT )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayOf ¶
type ArrayOf struct { SpanProvider Dim uint SubType Node }
type Assign ¶
type Assign struct { SpanProvider Op TokenKind L, R Node }
type Binop ¶
type Binop struct { SpanProvider Op TokenKind L, R Node }
type Call ¶
type Call struct { SpanProvider FuncLike Node Args []Node }
type ConstDecl ¶
type ConstDecl struct { SpanProvider Name string Body Node }
type Constant ¶
type Constant struct { SpanProvider Val int64 }
type EmptyStatement ¶
type EmptyStatement struct {
SpanProvider
}
type ExpressionStatement ¶
type ExpressionStatement struct { SpanProvider Expr Node }
type File ¶
type FilePos ¶
Represents a single point in the file as shown in most text editors. Tabs are treated as being aligned to 4 places.
type For ¶
type For struct { SpanProvider Init, Cond, Step Node Body []Node }
type Ident ¶
type Ident struct { SpanProvider Val string }
type IndexInto ¶
type IndexInto struct { SpanProvider Index Node Expr Node }
type Initializer ¶
type Initializer struct { SpanProvider Sub []Node }
type PointerTo ¶
type PointerTo struct { SpanProvider PointsTo Node }
type Return ¶
type Return struct { SpanProvider Expr Node }
type Selector ¶
type Selector struct { SpanProvider Name string Expr Node }
type SpanProvider ¶
type SpanProvider struct { // The file span of the token. Span FileSpan }
func (*SpanProvider) GetSpan ¶
func (s *SpanProvider) GetSpan() FileSpan
type String ¶
type String struct { SpanProvider Val string }
type Struct ¶
type Struct struct { SpanProvider Names []string Types []Node }
type Token ¶
type Token struct { // Tag for the token kind. Kind TokenKind // The raw contents of the token. Val string // The file span of the token. Span FileSpan }
The type representing a G lexical token.
type TypeDecl ¶
type TypeDecl struct { SpanProvider Name string Type Node }
type Unop ¶
type Unop struct { SpanProvider Op TokenKind Expr Node }
Click to show internal directories.
Click to hide internal directories.