Documentation
¶
Overview ¶
Package parser implements a SPIR-V assembly parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsResult ¶
func IsResult(k *schema.OperandKind) bool
IsResult returns true if k is used to store the result of an instruction.
Types ¶
type Diagnostic ¶
Diagnostic holds a single diagnostic message that was generated while parsing.
type Identifier ¶
type Identifier struct { Definition *Instruction // where the identifier was defined References []*Token // all the places the identifier was referenced }
Identifier describes a single, unique SPIR-V identifier (i.e. %32)
type Instruction ¶
type Instruction struct { Tokens []*Token // all the tokens that make up the instruction Result *Token // the token that represents the result of the instruction, or nil Operands []*Operand // the operands of the instruction Range Range // the textual range of the instruction Opcode *schema.Opcode // the opcode for the instruction }
Instruction describes a single instruction instance
type Operand ¶
type Operand struct { Name string // name of the operand Kind *schema.OperandKind // kind of the operand Tokens []*Token // all the tokens that make up the operand Parameters []*Operand // all the parameters for the operand }
Operand describes a single operand instance
type Position ¶
type Position struct {
Line, Column int
}
Position holds a line and column position in a text file.
func (Position) GreaterThan ¶
GreaterThan returns true iff o is greater than p.
func (Position) IsValid ¶
IsValid returns true if the position has a line and column greater than 1.
type Range ¶
Range represents an interval in a text file.
type Results ¶
type Results struct { Lines []string Tokens []*Token Diagnostics []Diagnostic Identifiers map[string]*Identifier // identifiers by name Mappings map[*Token]interface{} // tokens to semantic map }
Results holds the output of Parse().
Click to show internal directories.
Click to hide internal directories.