Documentation ¶
Overview ¶
Package gapil holds the main interface to the api language libraries. It provides functions for going from api files to abstract syntax trees and processed semantic trees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckErrors ¶
CheckErrors will, if len(errs) > 0, print each of the error messages for the specified api and then return the list as a single error. If errs is zero length, CheckErrors does nothing and returns nil.
Types ¶
type Loader ¶
type Loader interface { // Find recieves the path to a desired import relative to the current file. // The path it is supplied may not be valid, the loader should transform it // into a valid path if possible or return a fully invalid path if the api // file cannot be found. Find(path file.Path) file.Path // Load takes a path returned by Find and returns the content the path // represents, or an error if the path was not valid. Load(file.Path) ([]byte, error) }
Loader is the interface to something that finds and loads api imports.
func NewDataLoader ¶
func NewSearchLoader ¶
type ParseResult ¶
ParseResult holds the result of parsing a file.
type Processor ¶
type Processor struct { *semantic.Mappings Loader Loader Parsed map[string]ParseResult // guarded by parsedLock Resolved map[string]ResolveResult ResolveOnParseError bool // If true, resolving will be attempted even if parsing failed. Options resolver.Options // contains filtered or unexported fields }
Processor holds the state when resolving multiple api files.
func NewProcessor ¶
func NewProcessor() *Processor
NewProcessor returns a new initialized Processor.
func (*Processor) Parse ¶
Parse returns an ast that represents the supplied filename. It if the file has already been parsed, the cached ast will be returned, otherwise it invokes parser.Parse on the content of the supplied file name. It is safe to parse multiple files simultaniously.
func (*Processor) Resolve ¶
Resolve returns a semantic.API that represents the supplied api file name. If the file has already been resolved, the cached semantic tree is returned, otherwise the file and all dependant files are parsed using Processor.Parse. Recursive calls are made to Resolve for all named imports, and then finally the ast and all included ast's are handed to resolver.Resolve to do semantic processing.
Directories ¶
Path | Synopsis |
---|---|
Package analysis performs static program data flow analysis of an API file.
|
Package analysis performs static program data flow analysis of an API file. |
Package ast holds the set of types used in the abstract syntax tree representation of the api language.
|
Package ast holds the set of types used in the abstract syntax tree representation of the api language. |
Package bapi exposes functions for serializing and deserializing resolved APIs.
|
Package bapi exposes functions for serializing and deserializing resolved APIs. |
Package compiler implements the core gapil language compiler.
|
Package compiler implements the core gapil language compiler. |
mangling
Package mangling exposes a minimal collection of types used to build mangled strings using any of the sub-packages.
|
Package mangling exposes a minimal collection of types used to build mangled strings using any of the sub-packages. |
mangling/c
Package c implements a basic symbol mangling for that is compatible with C.
|
Package c implements a basic symbol mangling for that is compatible with C. |
mangling/ia64
Package ia64 implements a subset of the symbol mangling for the itanium ABI (standard for GCC).
|
Package ia64 implements a subset of the symbol mangling for the itanium ABI (standard for GCC). |
plugins/cloner
Package cloner is a plugin for the gapil compiler to generate deep clone functions for reference types, maps and commands.
|
Package cloner is a plugin for the gapil compiler to generate deep clone functions for reference types, maps and commands. |
plugins/encoder
Package encoder is a plugin for the gapil compiler to generate command and state encode functions.
|
Package encoder is a plugin for the gapil compiler to generate command and state encode functions. |
plugins/encoder/test/encoder_pb
Package encoder_pb describes the serialization format for the serialzation test api.
|
Package encoder_pb describes the serialization format for the serialzation test api. |
plugins/replay
Package replay is a plugin for the gapil compiler to generate replay streams for commands.
|
Package replay is a plugin for the gapil compiler to generate replay streams for commands. |
testutils
Package testutils implements reusable helpers for writing compiler tests.
|
Package testutils implements reusable helpers for writing compiler tests. |
Package constset provides structures for storing large numbers of value-string pairs efficently.
|
Package constset provides structures for storing large numbers of value-string pairs efficently. |
Package executor provides an interface for executing compiled API programs.
|
Package executor provides an interface for executing compiled API programs. |
Package format registers and implements the "format" apic command.
|
Package format registers and implements the "format" apic command. |
The langsvr command implements a language server for the graphics API language.
|
The langsvr command implements a language server for the graphics API language. |
Package parser implements a parser for converting the api language into abstract syntax trees.
|
Package parser implements a parser for converting the api language into abstract syntax trees. |
Package resolver implements a semantic resolving for the api language.
|
Package resolver implements a semantic resolving for the api language. |
Package semantic holds the set of types used in the abstract semantic graph representation of the api language.
|
Package semantic holds the set of types used in the abstract semantic graph representation of the api language. |
printer
Package printer provides a human-readable printer for the semantic tree nodes.
|
Package printer provides a human-readable printer for the semantic tree nodes. |
Package serialization contains constants and utility methods used to serialize .gfxtrace files.
|
Package serialization contains constants and utility methods used to serialize .gfxtrace files. |
Package validate registers and implements the "validate" apic command.
|
Package validate registers and implements the "validate" apic command. |