Documentation ¶
Index ¶
- Constants
- func EscapeString(s string) string
- func UnescapeString(s string) string
- type AccessExpr
- type AssignStat
- type Attr
- type BinOpType
- type BinaryExpr
- type Block
- type BracketExpr
- type CallExpr
- type CallStat
- type CastExpr
- type Decl
- type DerefExpr
- type DocComment
- type Expr
- type File
- type FloatingLiteral
- type Function
- type FunctionDecl
- type IfStat
- type IntegerLiteral
- type Locatable
- type LoopStat
- type LoopStatType
- type MangleType
- type Node
- type OpCategory
- type PointerType
- type PrimitiveType
- func (v PrimitiveType) Attrs() []*Attr
- func (v PrimitiveType) CanCastTo(t Type) bool
- func (v PrimitiveType) IsFloatingType() bool
- func (v PrimitiveType) IsIntegerType() bool
- func (v PrimitiveType) LevelsOfIndirection() int
- func (v PrimitiveType) RawType() Type
- func (i PrimitiveType) String() string
- func (v PrimitiveType) TypeName() string
- type ReturnStat
- type RuneLiteral
- type Scope
- func (v *Scope) GetFunction(name string) *Function
- func (v *Scope) GetType(name string) Type
- func (v *Scope) GetVariable(name string) *Variable
- func (v *Scope) InsertFunction(t *Function) *Function
- func (v *Scope) InsertType(t Type) Type
- func (v *Scope) InsertVariable(t *Variable) *Variable
- func (v *Scope) IsGlobal() bool
- type Stat
- type StringLiteral
- type StructDecl
- type StructType
- func (v *StructType) Attrs() []*Attr
- func (v *StructType) CanCastTo(t Type) bool
- func (v *StructType) IsFloatingType() bool
- func (v *StructType) IsIntegerType() bool
- func (v *StructType) LevelsOfIndirection() int
- func (v *StructType) MangledName(typ MangleType) string
- func (v *StructType) RawType() Type
- func (v *StructType) String() string
- func (v *StructType) TypeName() string
- type Type
- type UnOpType
- type UnaryExpr
- type Variable
- type VariableDecl
Constants ¶
View Source
const ( KEYWORD_ALLOC string = "alloc" KEYWORD_AS string = "as" KEYWORD_BREAK string = "break" KEYWORD_CONTINUE string = "continue" KEYWORD_ELSE string = "else" KEYWORD_ENUM string = "enum" KEYWORD_EXT string = "ext" KEYWORD_FOR string = "for" KEYWORD_FREE string = "free" KEYWORD_FUNC string = "func" KEYWORD_IF string = "if" KEYWORD_IMPL string = "impl" KEYWORD_MATCH string = "match" KEYWORD_MUT string = "mut" KEYWORD_RETURN string = "return" KEYWORD_SET string = "set" KEYWORD_SIZEOF string = "sizeof" KEYWORD_STRUCT string = "struct" KEYWORD_USE string = "use" KEYWORD_VOID string = "void" )
View Source
const ( SIMPLE_ESCAPE_VALUES string = "\a\b\f\n\r\t\v\\'\"" SIMPLE_ESCAPE_NAMES string = "abfnrtv\\'\"" )
Variables ¶
This section is empty.
Functions ¶
func EscapeString ¶
escape for debug output only things that can't be displayed need to be escaped
func UnescapeString ¶
Types ¶
type AccessExpr ¶
type AccessExpr struct { StructVariables []*Variable Variable *Variable // contains filtered or unexported fields }
func (*AccessExpr) GetType ¶
func (v *AccessExpr) GetType() Type
func (*AccessExpr) NodeName ¶
func (v *AccessExpr) NodeName() string
func (*AccessExpr) String ¶
func (v *AccessExpr) String() string
type AssignStat ¶
type AssignStat struct { Deref *DerefExpr // one of these should be nil, not neither or both Access *AccessExpr Assignment Expr // contains filtered or unexported fields }
func (*AssignStat) NodeName ¶
func (v *AssignStat) NodeName() string
func (*AssignStat) String ¶
func (v *AssignStat) String() string
type BinOpType ¶
type BinOpType int
func (BinOpType) Category ¶
func (v BinOpType) Category() OpCategory
type BinaryExpr ¶
type BinaryExpr struct {
Lhand, Rhand Expr
Op BinOpType
Type Type
// contains filtered or unexported fields
}
func (*BinaryExpr) GetType ¶
func (v *BinaryExpr) GetType() Type
func (*BinaryExpr) NodeName ¶
func (v *BinaryExpr) NodeName() string
func (*BinaryExpr) String ¶
func (v *BinaryExpr) String() string
type BracketExpr ¶
type BracketExpr struct { Expr Expr // contains filtered or unexported fields }
func (*BracketExpr) GetType ¶
func (v *BracketExpr) GetType() Type
func (*BracketExpr) NodeName ¶
func (v *BracketExpr) NodeName() string
func (*BracketExpr) String ¶
func (v *BracketExpr) String() string
type CallExpr ¶
type Decl ¶
type Decl interface { Node DocComments() []*DocComment // contains filtered or unexported methods }
type DocComment ¶
type FloatingLiteral ¶
func (*FloatingLiteral) GetType ¶
func (v *FloatingLiteral) GetType() Type
func (*FloatingLiteral) NodeName ¶
func (v *FloatingLiteral) NodeName() string
func (*FloatingLiteral) String ¶
func (v *FloatingLiteral) String() string
type Function ¶
type Function struct { Name string Parameters []*VariableDecl ReturnType Type Mutable bool Attrs []*Attr Body *Block // contains filtered or unexported fields }
func (*Function) MangledName ¶
func (v *Function) MangledName(typ MangleType) string
type FunctionDecl ¶
type FunctionDecl struct { Function *Function // contains filtered or unexported fields }
func (*FunctionDecl) DocComments ¶
func (v *FunctionDecl) DocComments() []*DocComment
func (*FunctionDecl) NodeName ¶
func (v *FunctionDecl) NodeName() string
func (*FunctionDecl) String ¶
func (v *FunctionDecl) String() string
type IfStat ¶
type IntegerLiteral ¶
func (*IntegerLiteral) GetType ¶
func (v *IntegerLiteral) GetType() Type
func (*IntegerLiteral) NodeName ¶
func (v *IntegerLiteral) NodeName() string
func (*IntegerLiteral) String ¶
func (v *IntegerLiteral) String() string
type Locatable ¶
type Locatable interface { Pos() (line, char int) // contains filtered or unexported methods }
type LoopStat ¶
type LoopStat struct { LoopType LoopStatType Body *Block // LOOP_TYPE_CONDITIONAL Condition Expr // contains filtered or unexported fields }
type LoopStatType ¶
type LoopStatType int
const ( LOOP_TYPE_UNSET LoopStatType = iota LOOP_TYPE_INFINITE LOOP_TYPE_CONDITIONAL )
type MangleType ¶
type MangleType int
In case we support multiple name mangline schemes
const (
MANGLE_ARK_UNSTABLE MangleType = iota // see https://github.com/ark-lang/ark/issues/401
)
type OpCategory ¶
type OpCategory int
const ( OP_ARITHMETIC OpCategory = iota OP_COMPARISON OP_BITWISE OP_LOGICAL OP_ASSIGN )
func (OpCategory) PrettyString ¶
func (v OpCategory) PrettyString() string
type PointerType ¶
type PointerType struct {
Addressee Type
}
func (PointerType) Attrs ¶
func (v PointerType) Attrs() []*Attr
func (PointerType) CanCastTo ¶
func (v PointerType) CanCastTo(t Type) bool
func (PointerType) IsFloatingType ¶
func (v PointerType) IsFloatingType() bool
func (PointerType) IsIntegerType ¶
func (v PointerType) IsIntegerType() bool
func (PointerType) LevelsOfIndirection ¶
func (v PointerType) LevelsOfIndirection() int
func (PointerType) RawType ¶
func (v PointerType) RawType() Type
func (PointerType) TypeName ¶
func (v PointerType) TypeName() string
type PrimitiveType ¶
type PrimitiveType int
const ( PRIMITIVE_i8 PrimitiveType = iota PRIMITIVE_i16 PRIMITIVE_i32 PRIMITIVE_i64 PRIMITIVE_i128 PRIMITIVE_u8 PRIMITIVE_u16 PRIMITIVE_u32 PRIMITIVE_u64 PRIMITIVE_u128 PRIMITIVE_f32 PRIMITIVE_f64 PRIMITIVE_f128 PRIMITIVE_str PRIMITIVE_rune PRIMITIVE_int PRIMITIVE_uint PRIMITIVE_bool )
func (PrimitiveType) Attrs ¶
func (v PrimitiveType) Attrs() []*Attr
func (PrimitiveType) CanCastTo ¶
func (v PrimitiveType) CanCastTo(t Type) bool
func (PrimitiveType) IsFloatingType ¶
func (v PrimitiveType) IsFloatingType() bool
func (PrimitiveType) IsIntegerType ¶
func (v PrimitiveType) IsIntegerType() bool
func (PrimitiveType) LevelsOfIndirection ¶
func (v PrimitiveType) LevelsOfIndirection() int
func (PrimitiveType) RawType ¶
func (v PrimitiveType) RawType() Type
func (PrimitiveType) String ¶
func (i PrimitiveType) String() string
func (PrimitiveType) TypeName ¶
func (v PrimitiveType) TypeName() string
type ReturnStat ¶
type ReturnStat struct { Value Expr // contains filtered or unexported fields }
func (*ReturnStat) NodeName ¶
func (v *ReturnStat) NodeName() string
func (*ReturnStat) String ¶
func (v *ReturnStat) String() string
type RuneLiteral ¶
type RuneLiteral struct { Value rune // contains filtered or unexported fields }
func (*RuneLiteral) GetType ¶
func (v *RuneLiteral) GetType() Type
func (*RuneLiteral) NodeName ¶
func (v *RuneLiteral) NodeName() string
func (*RuneLiteral) String ¶
func (v *RuneLiteral) String() string
type Scope ¶
type Scope struct { Outer *Scope Vars map[string]*Variable Types map[string]Type Funcs map[string]*Function }
func (*Scope) GetFunction ¶
func (*Scope) GetVariable ¶
func (*Scope) InsertFunction ¶
func (*Scope) InsertType ¶
func (*Scope) InsertVariable ¶
type StringLiteral ¶
func (*StringLiteral) GetType ¶
func (v *StringLiteral) GetType() Type
func (*StringLiteral) NodeName ¶
func (v *StringLiteral) NodeName() string
func (*StringLiteral) String ¶
func (v *StringLiteral) String() string
type StructDecl ¶
type StructDecl struct { Struct *StructType // contains filtered or unexported fields }
func (*StructDecl) DocComments ¶
func (v *StructDecl) DocComments() []*DocComment
func (*StructDecl) NodeName ¶
func (v *StructDecl) NodeName() string
func (*StructDecl) String ¶
func (v *StructDecl) String() string
type StructType ¶
type StructType struct { Name string Variables []*VariableDecl // contains filtered or unexported fields }
func (*StructType) Attrs ¶
func (v *StructType) Attrs() []*Attr
func (*StructType) CanCastTo ¶
func (v *StructType) CanCastTo(t Type) bool
func (*StructType) IsFloatingType ¶
func (v *StructType) IsFloatingType() bool
func (*StructType) IsIntegerType ¶
func (v *StructType) IsIntegerType() bool
func (*StructType) LevelsOfIndirection ¶
func (v *StructType) LevelsOfIndirection() int
func (*StructType) MangledName ¶
func (v *StructType) MangledName(typ MangleType) string
func (*StructType) RawType ¶
func (v *StructType) RawType() Type
func (*StructType) String ¶
func (v *StructType) String() string
func (*StructType) TypeName ¶
func (v *StructType) TypeName() string
type Variable ¶
type Variable struct { Type Type Name string Mutable bool Attrs []*Attr ParentStruct *StructType // contains filtered or unexported fields }
func (*Variable) MangledName ¶
func (v *Variable) MangledName(typ MangleType) string
type VariableDecl ¶
type VariableDecl struct { Variable *Variable Assignment Expr // contains filtered or unexported fields }
func (*VariableDecl) DocComments ¶
func (v *VariableDecl) DocComments() []*DocComment
func (*VariableDecl) NodeName ¶
func (v *VariableDecl) NodeName() string
func (*VariableDecl) String ¶
func (v *VariableDecl) String() string
Click to show internal directories.
Click to hide internal directories.