tree: 158454cdf3ba1c6929d6a7323974720ce8140451 [path history] [tgz]
  1. api.go
  2. context.go
  3. docs.go
  4. expression.go
  5. flow.go
  6. function.go
  7. inference.go
  8. internal.go
  9. operator.go
  10. README.md
  11. resolve.go
  12. rules.go
  13. statement.go
  14. type.go
api/resolver/README.md

resolver


import "android.googlesource.com/platform/tools/gpu/api/resolver"

Package resolver implements a semantic resolving for the api language. It is responsible for converting from an abstract syntax tree to a typed semantic graph ready for code generation.

Usage

func Resolve

func Resolve(compiled *ast.API) (*semantic.API, parse.ErrorList, ASTToSemantic)

Resolve takes a valid ast as produced by the parser and converts it to the semantic graph form. If the ast is not fully valid (ie there were parse errors) then the results are undefined, and may include null pointer access. If there are semantic problems with the ast, Resolve will return the set of errors it finds, and the returned graph may be incomplete/invalid.

type ASTToSemantic

type ASTToSemantic map[ast.Node]semantic.Node

ASTToSemantic is a relational map of AST nodes to semantic nodes.

type Alias

type Alias struct {
	AST  *ast.Alias
	Name string
	To   semantic.Type
}

Alias is used as a temporary type holder during type resolution. It is not present in the final semantic tree returned, but may be present in the AST -> semantic map.

func (Alias) Member

func (t Alias) Member(name string) semantic.Node

func (Alias) Typename

func (t Alias) Typename() string