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 { *resolver.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. // 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 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 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 validate registers and implements the "validate" apic command.
|
Package validate registers and implements the "validate" apic command. |