Documentation ¶
Index ¶
- func BasicPrint(v Visitable, out io.Writer) error
- type ByteCode
- type CompilationUnit
- type CompilerEnv
- type CompilerOptions
- type ConstPool
- type Expression
- type INode
- type IVisitor
- type IdExpr
- type InvalidExpr
- type LiteralExpr
- type Node
- type ParenExpr
- type PostfixUnaryExpr
- type Scope
- type Symbol
- type SymbolType
- type Visitable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompilationUnit ¶
type CompilationUnit struct { Name string Target Expression Scope *Scope Unresolved []*IdExpr }
func (*CompilationUnit) Compile ¶
func (unit *CompilationUnit) Compile(env CompilerEnv) bool
func (*CompilationUnit) Generate ¶
func (unit *CompilationUnit) Generate(env CompilerEnv, byteCode ByteCode) bool
func (*CompilationUnit) Resolve ¶
func (unit *CompilationUnit) Resolve(globals *Scope) bool
type CompilerEnv ¶
type CompilerOptions ¶
type CompilerOptions interface {
WarningIsError() bool
}
type Expression ¶
type INode ¶
type INode interface { Pos() util.PositionRange Compile(env CompilerEnv) GetType() rs_api.Type Generate(env CompilerEnv, byteCode ByteCode) bool }
type IVisitor ¶
type IVisitor interface { VisitInvalidExpr(e *InvalidExpr) error VisitLiteralExpr(e *LiteralExpr) error VisitIdExpr(e *IdExpr) error VisitParenExpr(e *ParenExpr) error VisitPostfixUnaryExpr(e *PostfixUnaryExpr) error }
type InvalidExpr ¶
func CreateInvalidExpr ¶
func CreateInvalidExpr(message string, where util.PositionRange) *InvalidExpr
func (*InvalidExpr) Apply ¶
func (inv *InvalidExpr) Apply(v IVisitor) error
func (*InvalidExpr) Compile ¶
func (inv *InvalidExpr) Compile(env CompilerEnv)
func (*InvalidExpr) Generate ¶
func (inv *InvalidExpr) Generate(env CompilerEnv, _ ByteCode) bool
func (*InvalidExpr) GetType ¶
func (inv *InvalidExpr) GetType() rs_api.Type
func (*InvalidExpr) String ¶
func (inv *InvalidExpr) String() string
type LiteralExpr ¶
func CreateLiteral ¶
func CreateLiteral(text string, t token.Type, where util.PositionRange) (*LiteralExpr, error)
func (*LiteralExpr) Apply ¶
func (lit *LiteralExpr) Apply(v IVisitor) error
func (*LiteralExpr) Compile ¶
func (lit *LiteralExpr) Compile(env CompilerEnv)
func (*LiteralExpr) Generate ¶
func (lit *LiteralExpr) Generate(env CompilerEnv, byteCode ByteCode) bool
func (*LiteralExpr) GetType ¶
func (lit *LiteralExpr) GetType() rs_api.Type
func (*LiteralExpr) String ¶
func (lit *LiteralExpr) String() string
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) Pos ¶
func (node *Node) Pos() util.PositionRange
type ParenExpr ¶
type ParenExpr struct { Node LParen util.Position Target Expression RParen util.Position Type rs_api.Type }
func CreateParenExpr ¶
func CreateParenExpr(lParenPos, rParenPos util.Position, target Expression) *ParenExpr
func (*ParenExpr) Compile ¶
func (p *ParenExpr) Compile(env CompilerEnv)
type PostfixUnaryExpr ¶
type PostfixUnaryExpr struct { Node Target Expression Operator token.Type OperatorPos util.Position Type rs_api.Type // contains filtered or unexported fields }
func CreatePostfixUnaryExpr ¶
func CreatePostfixUnaryExpr(target Expression, operator token.Type, operatorPos util.Position) *PostfixUnaryExpr
func (*PostfixUnaryExpr) Apply ¶
func (un *PostfixUnaryExpr) Apply(v IVisitor) error
func (*PostfixUnaryExpr) Compile ¶
func (un *PostfixUnaryExpr) Compile(env CompilerEnv)
func (*PostfixUnaryExpr) Generate ¶
func (un *PostfixUnaryExpr) Generate(env CompilerEnv, byteCode ByteCode) bool
func (*PostfixUnaryExpr) GetType ¶
func (un *PostfixUnaryExpr) GetType() rs_api.Type
func (*PostfixUnaryExpr) String ¶
func (un *PostfixUnaryExpr) String() string
type Symbol ¶
type Symbol struct { Type SymbolType Name string Pos util.Position Data interface{} }
func NewSymbol ¶
func NewSymbol(name string, t SymbolType) *Symbol
type SymbolType ¶
type SymbolType byte
const ( SymbolTypeNone SymbolType = iota SymbolTypeVar SymbolTypeNativeType )
Click to show internal directories.
Click to hide internal directories.