Documentation ¶
Index ¶
- Constants
- Variables
- func FillCoreScope(scope Scope)
- func FillFragmentShaderScope(scope Scope)
- func FillGlobalScope(scope Scope)
- func FillVertexShaderScope(scope Scope)
- func IsLiteralBool(t Expression) bool
- func IsLiteralFloat(t Expression) bool
- func IsLiteralInt(t Expression) bool
- func IsMacroExpression(call *Call) bool
- func IsMacroStatement(call *Call) bool
- func PrecisionTypeToString(ptype PrecisionType) string
- func RoleToString(role FunctionArgumentRole) string
- type AddOp
- type AndOp
- type Assign
- func (t *Assign) Dump(indent string) string
- func (t *Assign) EvalStatement() error
- func (t *Assign) ResolveStatementActivity(usage Usage) error
- func (t *Assign) ResolveStatementNames(scope Scope) error
- func (t *Assign) UniqueStatementNames(ns Namespace) error
- func (t *Assign) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Attribute
- type BinaryOp
- type Block
- type Call
- func (t *Call) Args() []Expression
- func (t *Call) Dump(indent string) string
- func (t *Call) EvalExpression() (values.Value, error)
- func (t *Call) EvalStatement() error
- func (t *Call) Name() string
- func (t *Call) ResolveExpressionActivity(usage Usage) error
- func (t *Call) ResolveExpressionNames(scope Scope) error
- func (t *Call) ResolveStatementActivity(usage Usage) error
- func (t *Call) ResolveStatementNames(scope Scope) error
- func (t *Call) UniqueStatementNames(ns Namespace) error
- func (t *Call) WriteExpression() string
- func (t *Call) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Const
- func (t *Const) Dump(indent string) string
- func (t *Const) Length() int
- func (t *Const) ResolveStatementActivity(usage Usage) error
- func (t *Const) ResolveStatementNames(scope Scope) error
- func (t *Const) SetAltRHS(str string)
- func (t *Const) TypeName() string
- func (t *Const) UniqueStatementNames(ns Namespace) error
- func (t *Const) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type DivOp
- type DynamicIndexFunction
- type EqCompareOp
- type EqOp
- type Export
- func (t *Export) Dump(indent string) string
- func (t *Export) EvalStatement() error
- func (t *Export) ResolveStatementActivity(usage Usage) error
- func (t *Export) ResolveStatementNames(scope Scope) error
- func (t *Export) UniqueStatementNames(ns Namespace) error
- func (t *Export) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ExportedVariable
- type Expression
- type Extension
- type For
- func (t *For) Dump(indent string) string
- func (t *For) EvalStatement() error
- func (t *For) ResolveStatementActivity(usage Usage) error
- func (t *For) ResolveStatementNames(scope Scope) error
- func (t *For) UniqueStatementNames(ns Namespace) error
- func (t *For) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Function
- func (t *Function) Dump(indent string) string
- func (t *Function) EvalCall(args []values.Value, ctx context.Context) (values.Value, error)
- func (t *Function) EvalStatement() error
- func (t *Function) GetVariable() Variable
- func (t *Function) Name() string
- func (t *Function) NewScope(parent Scope) *FunctionScope
- func (t *Function) RegisterReturn(ret *Return)
- func (t *Function) ResolveStatementActivity(usage Usage) error
- func (t *Function) ResolveStatementNames(outer Scope) error
- func (t *Function) UniqueStatementNames(ns Namespace) error
- func (t *Function) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type FunctionArgument
- func (fa *FunctionArgument) Dump(indent string) string
- func (fa *FunctionArgument) GetTypeValue() (values.Value, error)
- func (fa *FunctionArgument) Name() string
- func (fa *FunctionArgument) ResolveNames(scope Scope) error
- func (fa *FunctionArgument) UniqueNames(ns Namespace) error
- func (fa *FunctionArgument) WriteArgument() string
- type FunctionArgumentRole
- type FunctionInterface
- func (fi *FunctionInterface) Context() context.Context
- func (fi *FunctionInterface) Dump(indent string) string
- func (fi *FunctionInterface) EvalCall(args []values.Value, ctx context.Context) (values.Value, error)
- func (fi *FunctionInterface) GetVariable() Variable
- func (fi *FunctionInterface) Name() string
- func (fi *FunctionInterface) ResolveNames(scope Scope) error
- func (fi *FunctionInterface) UniqueNames(ns Namespace) error
- func (fi *FunctionInterface) WriteInterface() string
- type FunctionScope
- type GEOp
- type GTOp
- type GetDynamicIndex
- type GetDynamicIndexFunction
- type GlobalScope
- type GlobalScopeData
- type If
- func (t *If) AddCondition(expr Expression) error
- func (t *If) AddElse() error
- func (t *If) AddStatement(statement Statement)
- func (t *If) Dump(indent string) string
- func (t *If) EvalStatement() error
- func (t *If) ResolveStatementActivity(usage Usage) error
- func (t *If) ResolveStatementNames(scope Scope) error
- func (t *If) UniqueStatementNames(ns Namespace) error
- func (t *If) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Import
- func (t *Import) Dump(indent string) string
- func (t *Import) EvalStatement() error
- func (t *Import) Path() *LiteralString
- func (t *Import) ResolveStatementActivity(usage Usage) error
- func (t *Import) ResolveStatementNames(scope Scope) error
- func (t *Import) UniqueStatementNames(ns Namespace) error
- func (t *Import) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type ImportExport
- type Index
- func (t *Index) Dump(indent string) string
- func (t *Index) EvalExpression() (values.Value, error)
- func (t *Index) EvalSet(rhsValue values.Value, ctx context.Context) error
- func (t *Index) ResolveExpressionActivity(usage Usage) error
- func (t *Index) ResolveExpressionNames(scope Scope) error
- func (t *Index) WriteExpression() string
- type InjectedStatement
- type LEOp
- type LTOp
- type LiteralBool
- type LiteralData
- type LiteralFloat
- type LiteralInt
- type LiteralString
- type LogicalBinaryOp
- type MacroExpression
- type MacroFunction
- func (t *MacroFunction) EvalStatement() error
- func (t *MacroFunction) GetVariable() Variable
- func (t *MacroFunction) Name() string
- func (t *MacroFunction) ResolveStatementActivity(usage Usage) error
- func (t *MacroFunction) ResolveStatementNames(scope Scope) error
- func (t *MacroFunction) UniqueStatementNames(ns Namespace) error
- type MacroStatement
- type Member
- func (t *Member) Dump(indent string) string
- func (t *Member) EvalExpression() (values.Value, error)
- func (t *Member) EvalSet(rhsValue values.Value, ctx context.Context) error
- func (t *Member) GetPackageMember() (Variable, error)
- func (t *Member) ResolveExpressionActivity(usage Usage) error
- func (t *Member) ResolveExpressionNames(scope Scope) error
- func (t *Member) WriteExpression() string
- type Module
- type ModuleData
- func (m *ModuleData) CollectVaryings(varyings map[string]string) error
- func (m *ModuleData) CollectVersion(version *Word) (*Word, error)
- func (m *ModuleData) Dependencies() []files.PathLang
- func (m *ModuleData) EvalTypes() error
- func (m *ModuleData) FinalizeInjected(usage Usage) error
- func (m *ModuleData) FindExportedConst(name string) *Const
- func (m *ModuleData) GetExportedVariable(gs GlobalScope, name string, nameCtx context.Context) (Variable, error)
- func (m *ModuleData) ResolveActivity(usage Usage) error
- func (m *ModuleData) ResolveEntryNames(gs GlobalScope) (Variable, error)
- func (m *ModuleData) ResolveNames(gs GlobalScope) error
- func (m *ModuleData) ResolveStatementNames(scope Scope) error
- func (m *ModuleData) SetExportedVariable(outerName string, v Variable, ctx context.Context) error
- func (m *ModuleData) UniqueNames(ns Namespace) error
- func (m *ModuleData) Write(usage Usage, nl string, tab string) (string, error)
- type ModuleScope
- type MulOp
- type NEOp
- type Namespace
- type NamespaceData
- func (ns *NamespaceData) ArgName(v Variable)
- func (ns *NamespaceData) CurrentFunctionNamespace() Namespace
- func (ns *NamespaceData) FunctionName(v Variable)
- func (ns *NamespaceData) HasName(newName string) bool
- func (ns *NamespaceData) HasVar(v Variable) bool
- func (ns *NamespaceData) NewBlockNamespace() Namespace
- func (ns *NamespaceData) NewFunctionNamespace() Namespace
- func (ns *NamespaceData) OrigName(v Variable) error
- func (ns *NamespaceData) VarName(v Variable)
- type NegOp
- type NotOp
- type OrOp
- type OrderCompareOp
- type Package
- func (t *Package) Constant() bool
- func (t *Package) GetObject() interface{}
- func (t *Package) GetValue() values.Value
- func (t *Package) Name() string
- func (t *Package) Rename(n string)
- func (t *Package) SetConstant()
- func (t *Package) SetObject(obj interface{})
- func (t *Package) SetValue(v values.Value)
- type Parens
- type Pointer
- type PosOp
- type PostDecrOp
- type PostIncrOp
- type PostUnaryOp
- func (t *PostUnaryOp) ResolveStatementActivity(usage Usage) error
- func (t *PostUnaryOp) ResolveStatementNames(scope Scope) error
- func (t *PostUnaryOp) UniqueStatementNames(ns Namespace) error
- func (t *PostUnaryOp) WriteExpression() string
- func (t *PostUnaryOp) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type PreProc
- type PreUnaryOp
- type Precision
- func (t *Precision) Dump(indent string) string
- func (t *Precision) EvalStatement() error
- func (t *Precision) ResolveStatementActivity(usage Usage) error
- func (t *Precision) ResolveStatementNames(scope Scope) error
- func (t *Precision) UniqueStatementNames(ns Namespace) error
- func (t *Precision) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type PrecisionType
- type Return
- func (t *Return) Dump(indent string) string
- func (t *Return) EvalStatement() error
- func (t *Return) ResolveStatementActivity(usage Usage) error
- func (t *Return) ResolveStatementNames(scope Scope) error
- func (t *Return) UniqueStatementNames(ns Namespace) error
- func (t *Return) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Scope
- type ScopeData
- type SetDynamicIndex
- func (t *SetDynamicIndex) Dump(indent string) string
- func (t *SetDynamicIndex) EvalStatement() error
- func (t *SetDynamicIndex) ResolveStatementActivity(usage Usage) error
- func (t *SetDynamicIndex) ResolveStatementNames(scope Scope) error
- func (t *SetDynamicIndex) UniqueStatementNames(ns Namespace) error
- func (t *SetDynamicIndex) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type SetDynamicIndexFunction
- type Statement
- type Struct
- func (t *Struct) CheckConstruction(args []values.Value, ctx context.Context) error
- func (t *Struct) Dump(indent string) string
- func (t *Struct) EvalStatement() error
- func (t *Struct) GetMember(key string, ctx context.Context) (values.Value, error)
- func (t *Struct) GetVariable() Variable
- func (t *Struct) Name() string
- func (t *Struct) ResolveStatementActivity(usage Usage) error
- func (t *Struct) ResolveStatementNames(scope Scope) error
- func (t *Struct) SetMember(key string, arg values.Value, ctx context.Context) error
- func (t *Struct) UniqueStatementNames(ns Namespace) error
- func (t *Struct) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type StructEntry
- type SubOp
- type Token
- type TokenData
- type TypeExpression
- func (t *TypeExpression) Dump(indent string) string
- func (t *TypeExpression) EvalExpression() (values.Value, error)
- func (t *TypeExpression) Instantiate(ctx context.Context) (values.Value, error)
- func (t *TypeExpression) InstantiateUniform(ctx context.Context) (values.Value, error)
- func (t *TypeExpression) WriteExpression() string
- type UnaryOp
- type Uniform
- type Usage
- type UsageData
- func (u *UsageData) DetectUnused() error
- func (u *UsageData) GetInjectedStatements(name string) []InjectedStatement
- func (u *UsageData) InjectStatement(name string, variable Variable, deps []Variable, st Statement)
- func (u *UsageData) IsUsed(v Variable) bool
- func (u *UsageData) PopInjectedStatements(dep Variable) []InjectedStatement
- func (u *UsageData) Rereference(v Variable, ctx context.Context) error
- func (u *UsageData) Use(v Variable, ctx context.Context) error
- type UsageState
- type VarExpression
- func (t *VarExpression) Dump(indent string) string
- func (t *VarExpression) EvalExpression() (values.Value, error)
- func (t *VarExpression) EvalSet(v values.Value, ctx context.Context) error
- func (t *VarExpression) GetVariable() Variable
- func (t *VarExpression) Name() string
- func (t *VarExpression) ResolveExpressionActivity(usage Usage) error
- func (t *VarExpression) ResolveExpressionNames(scope Scope) error
- func (t *VarExpression) WriteExpression() string
- type VarStatement
- func (t *VarStatement) Dump(indent string) string
- func (t *VarStatement) EvalStatement() error
- func (t *VarStatement) ResolveStatementActivity(usage Usage) error
- func (t *VarStatement) ResolveStatementNames(scope Scope) error
- func (t *VarStatement) UniqueStatementNames(ns Namespace) error
- func (t *VarStatement) WriteStatement(usage Usage, indent string, nl string, tab string) string
- type Variable
- type VariableData
- func (t *VariableData) Constant() bool
- func (t *VariableData) GetObject() interface{}
- func (t *VariableData) GetValue() values.Value
- func (v *VariableData) Name() string
- func (t *VariableData) Rename(newName string)
- func (t *VariableData) SetConstant()
- func (t *VariableData) SetObject(obj interface{})
- func (t *VariableData) SetValue(v values.Value)
- type Varying
- type Version
- type Word
- type XorOp
Constants ¶
View Source
const ( NO_ROLE FunctionArgumentRole = 0 IN_ROLE = 1 << 0 OUT_ROLE = 1 << 1 )
Variables ¶
View Source
var TARGET = "vertex"
Functions ¶
func FillCoreScope ¶
func FillCoreScope(scope Scope)
func FillFragmentShaderScope ¶
func FillFragmentShaderScope(scope Scope)
func FillGlobalScope ¶
func FillGlobalScope(scope Scope)
func FillVertexShaderScope ¶
func FillVertexShaderScope(scope Scope)
func IsLiteralBool ¶
func IsLiteralBool(t Expression) bool
func IsLiteralFloat ¶
func IsLiteralFloat(t Expression) bool
func IsLiteralInt ¶
func IsLiteralInt(t Expression) bool
func IsMacroExpression ¶
func IsMacroStatement ¶
func PrecisionTypeToString ¶
func PrecisionTypeToString(ptype PrecisionType) string
func RoleToString ¶
func RoleToString(role FunctionArgumentRole) string
Types ¶
type AndOp ¶
type AndOp struct {
LogicalBinaryOp
}
type Assign ¶
type Assign struct { TokenData // contains filtered or unexported fields }
func NewAssign ¶
func NewAssign(lhs Expression, rhs Expression, op string, ctx context.Context) *Assign
func (*Assign) EvalStatement ¶
func (*Assign) ResolveStatementActivity ¶
func (*Assign) ResolveStatementNames ¶
func (*Assign) UniqueStatementNames ¶
type Attribute ¶
type Attribute struct {
Pointer
}
func NewAttribute ¶
func NewAttribute(typeExpr *TypeExpression, name string, ctx context.Context) *Attribute
type BinaryOp ¶
type BinaryOp struct { TokenData // contains filtered or unexported fields }
func (*BinaryOp) ResolveExpressionActivity ¶
func (*BinaryOp) ResolveExpressionNames ¶
func (*BinaryOp) WriteExpression ¶
type Block ¶
type Block struct { TokenData // contains filtered or unexported fields }
func (*Block) AddStatement ¶
func (*Block) ResolveStatementActivity ¶
func (*Block) ResolveStatementNames ¶
func (*Block) UniqueStatementNames ¶
type Call ¶
type Call struct { TokenData // contains filtered or unexported fields }
func NewCall ¶
func NewCall(lhs Expression, args []Expression, ctx context.Context) *Call
func (*Call) Args ¶
func (t *Call) Args() []Expression
func (*Call) EvalStatement ¶
func (*Call) ResolveExpressionActivity ¶
func (*Call) ResolveExpressionNames ¶
func (*Call) ResolveStatementActivity ¶
func (*Call) ResolveStatementNames ¶
func (*Call) UniqueStatementNames ¶
func (*Call) WriteExpression ¶
type Const ¶
type Const struct { Pointer // contains filtered or unexported fields }
func NewConst ¶
func NewConst(typeExpr *TypeExpression, name string, n int, rhsExpr Expression, isExport bool, ctx context.Context) *Const
func (*Const) ResolveStatementActivity ¶ added in v0.2.0
func (*Const) ResolveStatementNames ¶
func (*Const) UniqueStatementNames ¶ added in v0.2.0
type DynamicIndexFunction ¶
type DynamicIndexFunction struct { MacroFunction // contains filtered or unexported fields }
type EqCompareOp ¶
type EqCompareOp struct {
BinaryOp
}
func (*EqCompareOp) EvalExpression ¶
func (t *EqCompareOp) EvalExpression() (values.Value, error)
type EqOp ¶
type EqOp struct {
EqCompareOp
}
type Export ¶
type Export struct { TokenData // contains filtered or unexported fields }
func (*Export) EvalStatement ¶
func (*Export) ResolveStatementActivity ¶
func (*Export) ResolveStatementNames ¶
func (*Export) UniqueStatementNames ¶
type ExportedVariable ¶
type ExportedVariable struct {
// contains filtered or unexported fields
}
type Expression ¶
type Expression interface { Token WriteExpression() string ResolveExpressionNames(scope Scope) error EvalExpression() (values.Value, error) ResolveExpressionActivity(usage Usage) error }
func DispatchMacroExpression ¶
func DispatchMacroExpression(call *Call) (Expression, error)
func NewGetDynamicIndex ¶
func NewGetDynamicIndex(args []Expression, ctx context.Context) (Expression, error)
type Extension ¶
type Extension struct { PreProc // contains filtered or unexported fields }
func NewExtension ¶
type For ¶ added in v0.2.0
type For struct { Block // contains filtered or unexported fields }
func (*For) EvalStatement ¶ added in v0.2.0
func (*For) ResolveStatementActivity ¶ added in v0.2.0
func (*For) ResolveStatementNames ¶ added in v0.2.0
func (*For) UniqueStatementNames ¶ added in v0.2.0
type Function ¶
type Function struct { Block // contains filtered or unexported fields }
func NewFunction ¶
func NewFunction(fi *FunctionInterface, statements []Statement, ctx context.Context) *Function
func (*Function) EvalStatement ¶
func (*Function) GetVariable ¶
func (*Function) NewScope ¶
func (t *Function) NewScope(parent Scope) *FunctionScope
func (*Function) RegisterReturn ¶
func (*Function) ResolveStatementActivity ¶
func (*Function) ResolveStatementNames ¶
func (*Function) UniqueStatementNames ¶
type FunctionArgument ¶
type FunctionArgument struct { TokenData // contains filtered or unexported fields }
func NewFunctionArgument ¶
func NewFunctionArgument(role FunctionArgumentRole, typeExpr *TypeExpression, name string, length int, ctx context.Context) *FunctionArgument
func (*FunctionArgument) Dump ¶
func (fa *FunctionArgument) Dump(indent string) string
func (*FunctionArgument) GetTypeValue ¶
func (fa *FunctionArgument) GetTypeValue() (values.Value, error)
func (*FunctionArgument) Name ¶
func (fa *FunctionArgument) Name() string
func (*FunctionArgument) ResolveNames ¶
func (fa *FunctionArgument) ResolveNames(scope Scope) error
func (*FunctionArgument) UniqueNames ¶
func (fa *FunctionArgument) UniqueNames(ns Namespace) error
func (*FunctionArgument) WriteArgument ¶
func (fa *FunctionArgument) WriteArgument() string
type FunctionArgumentRole ¶
type FunctionArgumentRole int
type FunctionInterface ¶
type FunctionInterface struct {
// contains filtered or unexported fields
}
func NewFunctionInterface ¶
func NewFunctionInterface(retTypeExpr *TypeExpression, name string, args []*FunctionArgument, ctx context.Context) *FunctionInterface
func (*FunctionInterface) Context ¶
func (fi *FunctionInterface) Context() context.Context
func (*FunctionInterface) Dump ¶
func (fi *FunctionInterface) Dump(indent string) string
func (*FunctionInterface) GetVariable ¶
func (fi *FunctionInterface) GetVariable() Variable
func (*FunctionInterface) Name ¶
func (fi *FunctionInterface) Name() string
func (*FunctionInterface) ResolveNames ¶
func (fi *FunctionInterface) ResolveNames(scope Scope) error
func (*FunctionInterface) UniqueNames ¶
func (fi *FunctionInterface) UniqueNames(ns Namespace) error
func (*FunctionInterface) WriteInterface ¶
func (fi *FunctionInterface) WriteInterface() string
type FunctionScope ¶
type FunctionScope struct { ScopeData // contains filtered or unexported fields }
func NewFunctionScope ¶
func NewFunctionScope(fn *Function, parent Scope) *FunctionScope
func (*FunctionScope) GetFunction ¶
func (fs *FunctionScope) GetFunction() *Function
func (*FunctionScope) SetVariable ¶
func (fs *FunctionScope) SetVariable(name string, v Variable) error
type GEOp ¶
type GEOp struct {
OrderCompareOp
}
type GTOp ¶
type GTOp struct {
OrderCompareOp
}
type GetDynamicIndex ¶
type GetDynamicIndex struct { Index // contains filtered or unexported fields }
func (*GetDynamicIndex) Dump ¶
func (t *GetDynamicIndex) Dump(indent string) string
func (*GetDynamicIndex) EvalExpression ¶
func (t *GetDynamicIndex) EvalExpression() (values.Value, error)
func (*GetDynamicIndex) ResolveExpressionActivity ¶
func (t *GetDynamicIndex) ResolveExpressionActivity(usage Usage) error
func (*GetDynamicIndex) WriteExpression ¶
func (t *GetDynamicIndex) WriteExpression() string
type GetDynamicIndexFunction ¶
type GetDynamicIndexFunction struct { DynamicIndexFunction // contains filtered or unexported fields }
func (*GetDynamicIndexFunction) Dump ¶
func (t *GetDynamicIndexFunction) Dump(indent string) string
func (*GetDynamicIndexFunction) WriteStatement ¶
type GlobalScope ¶
func GetGlobalScope ¶
func GetGlobalScope(s_ Scope) GlobalScope
type GlobalScopeData ¶
type GlobalScopeData struct {
ScopeData
}
wrapped by BundleScope in order to implement the GlobalScope interface
func NewFilledGlobalScope ¶
func NewFilledGlobalScope() *GlobalScopeData
type If ¶
type If struct { TokenData // contains filtered or unexported fields }
func (*If) AddCondition ¶
func (t *If) AddCondition(expr Expression) error
func (*If) AddStatement ¶
func (*If) EvalStatement ¶
func (*If) ResolveStatementActivity ¶
func (*If) ResolveStatementNames ¶
func (*If) UniqueStatementNames ¶
type Import ¶
type Import struct { TokenData // contains filtered or unexported fields }
func NewImport ¶
func NewImport(newName *Word, varExpr *VarExpression, path_ *LiteralString, ctx context.Context) (*Import, error)
func (*Import) EvalStatement ¶
func (*Import) Path ¶
func (t *Import) Path() *LiteralString
func (*Import) ResolveStatementActivity ¶
func (*Import) ResolveStatementNames ¶
func (*Import) UniqueStatementNames ¶
type ImportExport ¶
type ImportExport struct {
Import
}
func NewImportExport ¶
func NewImportExport(newName *Word, varExpr *VarExpression, path_ *LiteralString, ctx context.Context) (*ImportExport, error)
func (*ImportExport) Dump ¶
func (t *ImportExport) Dump(indent string) string
func (*ImportExport) ResolveStatementNames ¶
func (t *ImportExport) ResolveStatementNames(scope Scope) error
func (*ImportExport) WriteStatement ¶
type Index ¶
type Index struct { TokenData // contains filtered or unexported fields }
func NewIndex ¶
func NewIndex(container Expression, index Expression, ctx context.Context) *Index
func (*Index) ResolveExpressionActivity ¶
func (*Index) ResolveExpressionNames ¶
func (*Index) WriteExpression ¶
type InjectedStatement ¶
type InjectedStatement struct {
// contains filtered or unexported fields
}
type LEOp ¶
type LEOp struct {
OrderCompareOp
}
type LTOp ¶
type LTOp struct {
OrderCompareOp
}
type LiteralBool ¶
type LiteralBool struct { LiteralData // contains filtered or unexported fields }
func NewLiteralBool ¶
func NewLiteralBool(value bool, ctx context.Context) *LiteralBool
func (*LiteralBool) Dump ¶
func (t *LiteralBool) Dump(indent string) string
func (*LiteralBool) EvalExpression ¶
func (t *LiteralBool) EvalExpression() (values.Value, error)
func (*LiteralBool) Value ¶
func (t *LiteralBool) Value() bool
func (*LiteralBool) WriteExpression ¶
func (t *LiteralBool) WriteExpression() string
type LiteralData ¶
type LiteralData struct {
TokenData
}
intended for LiteralInt, LiteralBool, LiteralFloat and LiteralString
func (*LiteralData) ResolveExpressionActivity ¶
func (t *LiteralData) ResolveExpressionActivity(usage Usage) error
func (*LiteralData) ResolveExpressionNames ¶
func (t *LiteralData) ResolveExpressionNames(scope Scope) error
type LiteralFloat ¶
type LiteralFloat struct { LiteralData // contains filtered or unexported fields }
func NewLiteralFloat ¶
func NewLiteralFloat(value float64, ctx context.Context) *LiteralFloat
func (*LiteralFloat) Dump ¶
func (t *LiteralFloat) Dump(indent string) string
func (*LiteralFloat) EvalExpression ¶
func (t *LiteralFloat) EvalExpression() (values.Value, error)
func (*LiteralFloat) Value ¶
func (t *LiteralFloat) Value() float64
func (*LiteralFloat) WriteExpression ¶
func (t *LiteralFloat) WriteExpression() string
type LiteralInt ¶
type LiteralInt struct { LiteralData // contains filtered or unexported fields }
func NewLiteralInt ¶
func NewLiteralInt(value int, ctx context.Context) *LiteralInt
func (*LiteralInt) Dump ¶
func (t *LiteralInt) Dump(indent string) string
func (*LiteralInt) EvalExpression ¶
func (t *LiteralInt) EvalExpression() (values.Value, error)
func (*LiteralInt) Value ¶
func (t *LiteralInt) Value() int
func (*LiteralInt) WriteExpression ¶
func (t *LiteralInt) WriteExpression() string
type LiteralString ¶
type LiteralString struct { LiteralData // contains filtered or unexported fields }
func NewLiteralString ¶
func NewLiteralString(value string, ctx context.Context) *LiteralString
func (*LiteralString) EvalExpression ¶
func (t *LiteralString) EvalExpression() (values.Value, error)
func (*LiteralString) Value ¶
func (t *LiteralString) Value() string
type LogicalBinaryOp ¶
type LogicalBinaryOp struct {
BinaryOp
}
func (*LogicalBinaryOp) EvalExpression ¶
func (t *LogicalBinaryOp) EvalExpression() (values.Value, error)
type MacroExpression ¶
type MacroExpression func(args []Expression, ctx context.Context) (Expression, error)
type MacroFunction ¶
type MacroFunction struct { TokenData // contains filtered or unexported fields }
func (*MacroFunction) EvalStatement ¶
func (t *MacroFunction) EvalStatement() error
func (*MacroFunction) GetVariable ¶
func (t *MacroFunction) GetVariable() Variable
func (*MacroFunction) Name ¶
func (t *MacroFunction) Name() string
func (*MacroFunction) ResolveStatementActivity ¶
func (t *MacroFunction) ResolveStatementActivity(usage Usage) error
func (*MacroFunction) ResolveStatementNames ¶
func (t *MacroFunction) ResolveStatementNames(scope Scope) error
func (*MacroFunction) UniqueStatementNames ¶
func (t *MacroFunction) UniqueStatementNames(ns Namespace) error
type MacroStatement ¶
type MacroStatement func(args []Expression, ctx context.Context) (Statement, error)
type Member ¶
type Member struct { TokenData // contains filtered or unexported fields }
func (*Member) GetPackageMember ¶
func (*Member) ResolveExpressionActivity ¶
func (*Member) ResolveExpressionNames ¶
func (*Member) WriteExpression ¶
type ModuleData ¶
type ModuleData struct { Block // contains filtered or unexported fields }
func GetModule ¶
func GetModule(s_ Scope) *ModuleData
func NewModule ¶
func NewModule(ctx context.Context) *ModuleData
func (*ModuleData) CollectVaryings ¶
func (m *ModuleData) CollectVaryings(varyings map[string]string) error
func (*ModuleData) CollectVersion ¶
func (m *ModuleData) CollectVersion(version *Word) (*Word, error)
func (*ModuleData) Dependencies ¶
func (m *ModuleData) Dependencies() []files.PathLang
func (*ModuleData) EvalTypes ¶
func (m *ModuleData) EvalTypes() error
func (*ModuleData) FinalizeInjected ¶
func (m *ModuleData) FinalizeInjected(usage Usage) error
func (*ModuleData) FindExportedConst ¶
func (m *ModuleData) FindExportedConst(name string) *Const
func (*ModuleData) GetExportedVariable ¶
func (m *ModuleData) GetExportedVariable(gs GlobalScope, name string, nameCtx context.Context) (Variable, error)
called from within other module
func (*ModuleData) ResolveActivity ¶
func (m *ModuleData) ResolveActivity(usage Usage) error
func (*ModuleData) ResolveEntryNames ¶
func (m *ModuleData) ResolveEntryNames(gs GlobalScope) (Variable, error)
func (*ModuleData) ResolveNames ¶
func (m *ModuleData) ResolveNames(gs GlobalScope) error
func (*ModuleData) ResolveStatementNames ¶
func (m *ModuleData) ResolveStatementNames(scope Scope) error
func (*ModuleData) SetExportedVariable ¶
func (*ModuleData) UniqueNames ¶
func (m *ModuleData) UniqueNames(ns Namespace) error
type ModuleScope ¶
type ModuleScope struct { ScopeData // contains filtered or unexported fields }
type NEOp ¶
type NEOp struct {
EqCompareOp
}
type Namespace ¶
type Namespace interface { NewBlockNamespace() Namespace NewFunctionNamespace() Namespace CurrentFunctionNamespace() Namespace FunctionName(v Variable) ArgName(v Variable) VarName(v Variable) OrigName(v Variable) error HasName(newName string) bool HasVar(v Variable) bool }
func NewNamespace ¶
type NamespaceData ¶
type NamespaceData struct {
// contains filtered or unexported fields
}
func (*NamespaceData) ArgName ¶
func (ns *NamespaceData) ArgName(v Variable)
func (*NamespaceData) CurrentFunctionNamespace ¶
func (ns *NamespaceData) CurrentFunctionNamespace() Namespace
func (*NamespaceData) FunctionName ¶
func (ns *NamespaceData) FunctionName(v Variable)
func (*NamespaceData) HasName ¶
func (ns *NamespaceData) HasName(newName string) bool
func (*NamespaceData) HasVar ¶
func (ns *NamespaceData) HasVar(v Variable) bool
func (*NamespaceData) NewBlockNamespace ¶
func (ns *NamespaceData) NewBlockNamespace() Namespace
func (*NamespaceData) NewFunctionNamespace ¶
func (ns *NamespaceData) NewFunctionNamespace() Namespace
func (*NamespaceData) OrigName ¶
func (ns *NamespaceData) OrigName(v Variable) error
func (*NamespaceData) VarName ¶
func (ns *NamespaceData) VarName(v Variable)
type NegOp ¶
type NegOp struct {
PreUnaryOp
}
type NotOp ¶
type NotOp struct {
PreUnaryOp
}
type OrOp ¶
type OrOp struct {
LogicalBinaryOp
}
type OrderCompareOp ¶
type OrderCompareOp struct {
BinaryOp
}
func (*OrderCompareOp) EvalExpression ¶
func (t *OrderCompareOp) EvalExpression() (values.Value, error)
type Package ¶
type Package struct { TokenData // contains filtered or unexported fields }
func NewPackage ¶
user packages start nameless
func (*Package) SetConstant ¶
func (t *Package) SetConstant()
type Parens ¶
type Parens struct { TokenData // contains filtered or unexported fields }
func (*Parens) ResolveExpressionActivity ¶
func (*Parens) ResolveExpressionNames ¶
func (*Parens) WriteExpression ¶
type Pointer ¶
type Pointer struct { TokenData // contains filtered or unexported fields }
func (*Pointer) EvalStatement ¶
func (*Pointer) GetVariable ¶
func (*Pointer) ResolveStatementActivity ¶
func (*Pointer) ResolveStatementNames ¶
func (*Pointer) UniqueStatementNames ¶
likely exported, so keep original name
type PosOp ¶
type PosOp struct {
PreUnaryOp
}
type PostDecrOp ¶
type PostDecrOp struct {
PostUnaryOp
}
func NewPostDecrOp ¶
func NewPostDecrOp(a Expression, ctx context.Context) *PostDecrOp
func (*PostDecrOp) EvalStatement ¶
func (t *PostDecrOp) EvalStatement() error
type PostIncrOp ¶
type PostIncrOp struct {
PostUnaryOp
}
func NewPostIncrOp ¶
func NewPostIncrOp(a Expression, ctx context.Context) *PostIncrOp
func (*PostIncrOp) EvalStatement ¶
func (t *PostIncrOp) EvalStatement() error
type PostUnaryOp ¶
type PostUnaryOp struct {
UnaryOp
}
func (*PostUnaryOp) ResolveStatementActivity ¶
func (t *PostUnaryOp) ResolveStatementActivity(usage Usage) error
func (*PostUnaryOp) ResolveStatementNames ¶
func (t *PostUnaryOp) ResolveStatementNames(scope Scope) error
func (*PostUnaryOp) UniqueStatementNames ¶
func (t *PostUnaryOp) UniqueStatementNames(ns Namespace) error
func (*PostUnaryOp) WriteExpression ¶
func (t *PostUnaryOp) WriteExpression() string
func (*PostUnaryOp) WriteStatement ¶
type PreProc ¶
type PreProc struct {
TokenData
}
func (*PreProc) EvalStatement ¶
func (*PreProc) ResolveStatementActivity ¶
func (*PreProc) ResolveStatementNames ¶
func (*PreProc) UniqueStatementNames ¶
type PreUnaryOp ¶
type PreUnaryOp struct {
UnaryOp
}
func (*PreUnaryOp) WriteExpression ¶
func (t *PreUnaryOp) WriteExpression() string
type Precision ¶
type Precision struct { TokenData // contains filtered or unexported fields }
func NewPrecision ¶
func NewPrecision(precType PrecisionType, typeExpr *TypeExpression, ctx context.Context) *Precision
func (*Precision) EvalStatement ¶
func (*Precision) ResolveStatementActivity ¶
func (*Precision) ResolveStatementNames ¶
func (*Precision) UniqueStatementNames ¶
type PrecisionType ¶
type PrecisionType int
const ( DEFAULTP PrecisionType = iota LOWP MEDIUMP HIGHP )
type Return ¶
type Return struct { TokenData // contains filtered or unexported fields }
func (*Return) EvalStatement ¶
func (*Return) ResolveStatementActivity ¶
func (*Return) ResolveStatementNames ¶
func (*Return) UniqueStatementNames ¶
type ScopeData ¶
type ScopeData struct {
// contains filtered or unexported fields
}
func (*ScopeData) GetFunction ¶
func (*ScopeData) HasVariable ¶
type SetDynamicIndex ¶
type SetDynamicIndex struct { Index // contains filtered or unexported fields }
func (*SetDynamicIndex) Dump ¶
func (t *SetDynamicIndex) Dump(indent string) string
func (*SetDynamicIndex) EvalStatement ¶
func (t *SetDynamicIndex) EvalStatement() error
func (*SetDynamicIndex) ResolveStatementActivity ¶
func (t *SetDynamicIndex) ResolveStatementActivity(usage Usage) error
func (*SetDynamicIndex) ResolveStatementNames ¶
func (t *SetDynamicIndex) ResolveStatementNames(scope Scope) error
func (*SetDynamicIndex) UniqueStatementNames ¶
func (t *SetDynamicIndex) UniqueStatementNames(ns Namespace) error
func (*SetDynamicIndex) WriteStatement ¶
type SetDynamicIndexFunction ¶
type SetDynamicIndexFunction struct { DynamicIndexFunction // contains filtered or unexported fields }
func (*SetDynamicIndexFunction) Dump ¶
func (t *SetDynamicIndexFunction) Dump(indent string) string
func (*SetDynamicIndexFunction) WriteStatement ¶
type Statement ¶
type Statement interface { Token WriteStatement(usage Usage, indent string, nl string, tab string) string ResolveStatementNames(scope Scope) error EvalStatement() error ResolveStatementActivity(usage Usage) error UniqueStatementNames(ns Namespace) error }
func DispatchMacroStatement ¶
func NewSetDynamicIndex ¶
func NewSetDynamicIndex(args []Expression, ctx context.Context) (Statement, error)
type Struct ¶
type Struct struct { TokenData // contains filtered or unexported fields }
func NewStruct ¶
func NewStruct(nameExpr *VarExpression, entries []*StructEntry, ctx context.Context) (*Struct, error)
func (*Struct) CheckConstruction ¶
func (*Struct) EvalStatement ¶
func (*Struct) GetVariable ¶
func (*Struct) ResolveStatementActivity ¶
func (*Struct) ResolveStatementNames ¶
func (*Struct) UniqueStatementNames ¶
type StructEntry ¶
type StructEntry struct {
// contains filtered or unexported fields
}
func NewStructEntry ¶
func NewStructEntry(typeExpr *TypeExpression, nameExpr *VarExpression, length int, ctx context.Context) *StructEntry
func (*StructEntry) Context ¶
func (se *StructEntry) Context() context.Context
func (*StructEntry) Dump ¶
func (t *StructEntry) Dump(indent string) string
func (*StructEntry) Instantiate ¶
func (*StructEntry) Name ¶
func (se *StructEntry) Name() string
func (*StructEntry) ResolveNames ¶
func (se *StructEntry) ResolveNames(scope Scope) error
type TypeExpression ¶
type TypeExpression struct {
VarExpression
}
func NewTypeExpression ¶
func NewTypeExpression(name string, ctx context.Context) *TypeExpression
func (*TypeExpression) Dump ¶
func (t *TypeExpression) Dump(indent string) string
func (*TypeExpression) EvalExpression ¶
func (t *TypeExpression) EvalExpression() (values.Value, error)
func (*TypeExpression) Instantiate ¶
func (*TypeExpression) InstantiateUniform ¶
func (*TypeExpression) WriteExpression ¶
func (t *TypeExpression) WriteExpression() string
type UnaryOp ¶
type UnaryOp struct { TokenData // contains filtered or unexported fields }
func (*UnaryOp) ResolveExpressionActivity ¶
func (*UnaryOp) ResolveExpressionNames ¶
type Uniform ¶
type Uniform struct {
Pointer
}
func NewUniform ¶
func (*Uniform) EvalStatement ¶
different from Pointer.EvalStatement(), because different types are allowed
type Usage ¶
type Usage interface { Use(v Variable, ctx context.Context) error Rereference(v Variable, ctx context.Context) error IsUsed(v Variable) bool GetInjectedStatements(name string) []InjectedStatement InjectStatement(name string, variable Variable, deps []Variable, st Statement) PopInjectedStatements(dep Variable) []InjectedStatement DetectUnused() error }
type UsageData ¶
type UsageData struct {
// contains filtered or unexported fields
}
func (*UsageData) DetectUnused ¶
func (*UsageData) GetInjectedStatements ¶
func (u *UsageData) GetInjectedStatements(name string) []InjectedStatement
func (*UsageData) InjectStatement ¶
func (*UsageData) PopInjectedStatements ¶
func (u *UsageData) PopInjectedStatements(dep Variable) []InjectedStatement
func (*UsageData) Rereference ¶
type UsageState ¶
type UsageState struct {
// contains filtered or unexported fields
}
type VarExpression ¶
type VarExpression struct { TokenData // contains filtered or unexported fields }
func NewVarExpression ¶
func NewVarExpression(name string, ctx context.Context) *VarExpression
func (*VarExpression) Dump ¶
func (t *VarExpression) Dump(indent string) string
func (*VarExpression) EvalExpression ¶
func (t *VarExpression) EvalExpression() (values.Value, error)
func (*VarExpression) GetVariable ¶
func (t *VarExpression) GetVariable() Variable
func (*VarExpression) Name ¶
func (t *VarExpression) Name() string
func (*VarExpression) ResolveExpressionActivity ¶
func (t *VarExpression) ResolveExpressionActivity(usage Usage) error
func (*VarExpression) ResolveExpressionNames ¶
func (t *VarExpression) ResolveExpressionNames(scope Scope) error
func (*VarExpression) WriteExpression ¶
func (t *VarExpression) WriteExpression() string
type VarStatement ¶
type VarStatement struct { TokenData // contains filtered or unexported fields }
func NewVarStatement ¶
func NewVarStatement(typeExpr *TypeExpression, name string, length int, rhsExpr Expression, ctx context.Context) *VarStatement
func (*VarStatement) Dump ¶
func (t *VarStatement) Dump(indent string) string
func (*VarStatement) EvalStatement ¶
func (t *VarStatement) EvalStatement() error
func (*VarStatement) ResolveStatementActivity ¶
func (t *VarStatement) ResolveStatementActivity(usage Usage) error
func (*VarStatement) ResolveStatementNames ¶
func (t *VarStatement) ResolveStatementNames(scope Scope) error
func (*VarStatement) UniqueStatementNames ¶
func (t *VarStatement) UniqueStatementNames(ns Namespace) error
func (*VarStatement) WriteStatement ¶
type VariableData ¶
type VariableData struct { TokenData // contains filtered or unexported fields }
func NewVariable ¶
func NewVariable(name string, ctx context.Context) *VariableData
func (*VariableData) Constant ¶
func (t *VariableData) Constant() bool
func (*VariableData) GetObject ¶
func (t *VariableData) GetObject() interface{}
func (*VariableData) GetValue ¶
func (t *VariableData) GetValue() values.Value
func (*VariableData) Name ¶
func (v *VariableData) Name() string
func (*VariableData) Rename ¶
func (t *VariableData) Rename(newName string)
func (*VariableData) SetConstant ¶
func (t *VariableData) SetConstant()
func (*VariableData) SetObject ¶
func (t *VariableData) SetObject(obj interface{})
func (*VariableData) SetValue ¶
func (t *VariableData) SetValue(v values.Value)
type Varying ¶
type Varying struct { Pointer // contains filtered or unexported fields }
func NewVarying ¶
func NewVarying(precType PrecisionType, typeExpr *TypeExpression, name string, ctx context.Context) *Varying
func (*Varying) EvalStatement ¶
func (*Varying) ResolveStatementActivity ¶ added in v0.2.0
type Word ¶
type Word struct { TokenData // contains filtered or unexported fields }
eg. for key of member essentially a string-context pair
func AssertWord ¶
type XorOp ¶
type XorOp struct {
LogicalBinaryOp
}
Source Files ¶
- Assign.go
- Attribute.go
- Block.go
- Call.go
- Const.go
- DynamicIndexFunction.go
- Export.go
- Expression.go
- For.go
- Function.go
- FunctionArgument.go
- FunctionArgumentRole.go
- FunctionInterface.go
- FunctionScope.go
- GetDynamicIndex.go
- GetDynamicIndexFunction.go
- GlobalScope.go
- If.go
- Import.go
- ImportExport.go
- Index.go
- Literal.go
- LiteralBool.go
- LiteralFloat.go
- LiteralInt.go
- LiteralString.go
- MacroFunction.go
- Member.go
- Module.go
- ModuleScope.go
- Namespace.go
- Package.go
- Parens.go
- Pointer.go
- Precision.go
- PrecisionType.go
- Return.go
- Scope.go
- SetDynamicIndex.go
- SetDynamicIndexFunction.go
- Statement.go
- Struct.go
- Token.go
- TypeExpression.go
- Uniform.go
- Usage.go
- VarExpression.go
- VarStatement.go
- Variable.go
- Varying.go
- Word.go
- globals.go
- macros.go
- operators.go
- preprocessor.go
Click to show internal directories.
Click to hide internal directories.