Documentation ¶
Overview ¶
Package types provides TTCN-3 types, functions for compatibilty checks and a builder to create and resolve types from a TTCN-3 syntax tree.
Index ¶
- Variables
- type BasicType
- type ComponentType
- func (obj *ComponentType) End() loc.Pos
- func (c *ComponentType) Insert(obj Object) Object
- func (s *ComponentType) Lookup(name string) Object
- func (obj *ComponentType) Name() string
- func (s *ComponentType) Names() []string
- func (obj *ComponentType) Node() ast.Node
- func (obj *ComponentType) Parent() Scope
- func (obj *ComponentType) Pos() loc.Pos
- func (c *ComponentType) String() string
- func (obj *ComponentType) Type() Type
- func (c *ComponentType) Underlying() Type
- type EnumeratedType
- func (obj *EnumeratedType) End() loc.Pos
- func (s *EnumeratedType) Insert(obj Object) Object
- func (s *EnumeratedType) Lookup(name string) Object
- func (obj *EnumeratedType) Name() string
- func (s *EnumeratedType) Names() []string
- func (obj *EnumeratedType) Node() ast.Node
- func (obj *EnumeratedType) Parent() Scope
- func (obj *EnumeratedType) Pos() loc.Pos
- func (obj *EnumeratedType) Type() Type
- type Func
- type Import
- type Info
- type Kind
- type LocalScope
- type Module
- func (obj *Module) End() loc.Pos
- func (s *Module) Insert(obj Object) Object
- func (m *Module) Lookup(name string) Object
- func (obj *Module) Name() string
- func (s *Module) Names() []string
- func (obj *Module) Node() ast.Node
- func (obj *Module) Parent() Scope
- func (obj *Module) Pos() loc.Pos
- func (obj *Module) Type() Type
- type NoFieldError
- type Object
- type Port
- type Range
- type RedefinitionError
- type Scope
- type Struct
- type Type
- type TypeName
- type UnknownIdentifierError
- type Var
Constants ¶
This section is empty.
Variables ¶
View Source
var Typ = []*BasicType{ Invalid: {Invalid, "invalid"}, Bitstring: {Bitstring, "bitstring"}, Boolean: {Boolean, "boolean"}, Charstring: {Charstring, "charstring"}, Component: {Component, "component"}, Float: {Float, "float"}, Hexstring: {Hexstring, "hexstring"}, Integer: {Integer, "integer"}, Octetstring: {Octetstring, "octetstring"}, Omit: {Omit, "omit"}, Template: {Template, "template"}, Timer: {Timer, "timer"}, UniversalCharstring: {UniversalCharstring, "universal charstring"}, Verdict: {Verdict, "verdict"}, String: {String, "string"}, Numerical: {Numerical, "numerical"}, }
View Source
var Universe scope
Functions ¶
This section is empty.
Types ¶
type BasicType ¶
type BasicType struct {
// contains filtered or unexported fields
}
func (*BasicType) Underlying ¶
type ComponentType ¶
func NewComponentType ¶
func NewComponentType(n ast.Node, name string) *ComponentType
func (*ComponentType) Insert ¶
func (c *ComponentType) Insert(obj Object) Object
func (*ComponentType) String ¶
func (c *ComponentType) String() string
func (*ComponentType) Underlying ¶
func (c *ComponentType) Underlying() Type
type EnumeratedType ¶ added in v0.7.0
func NewEnumeratedType ¶ added in v0.7.0
func NewEnumeratedType(n ast.Node, name string, typ Type) *EnumeratedType
type Func ¶
type Func struct {
// contains filtered or unexported fields
}
Func describes testcases, altsteps, functions and external functions.
type Import ¶
type Import struct {
// contains filtered or unexported fields
}
Import describes the view to an imported module.
type Info ¶
type Info struct { // Scopes associates identifiers with their enclosing scope. Scopes map[*ast.Ident]Scope // Types associcates expressions with their evaluated type. Types map[ast.Expr]Type // Fset *loc.FileSet // Modules map[string]*Module // Error func(error) Import func(name string) error // contains filtered or unexported fields }
Info holds various information about TTCN-3 symbols and types.
type Kind ¶
type Kind int
const ( Invalid Kind = iota Bitstring Boolean Charstring Component Float Hexstring Integer Octetstring Omit Template Timer UniversalCharstring Verdict // TODO(5nord) Merge strings types into String and merge integer, float into // Numerical. Or make them sort of untyped types like unused, omit and // template? String Numerical )
type LocalScope ¶
type LocalScope struct {
// contains filtered or unexported fields
}
func NewLocalScope ¶
func NewLocalScope(rng Range, parent Scope) *LocalScope
func (*LocalScope) Lookup ¶
func (ls *LocalScope) Lookup(name string) Object
type Module ¶
type Module struct { Imports []string // contains filtered or unexported fields }
Module describes a Module.
type NoFieldError ¶
func (*NoFieldError) Error ¶
func (err *NoFieldError) Error() string
type Object ¶
type Object interface { Name() string // Object name. // Parent returns the (lexical) scope the object is defined in. Parent() Scope // Type returns the type of the object. Type() Type // Node returns the representing AST node of the object. Node() ast.Node Range // contains filtered or unexported methods }
Object describes a named language entity, such as a function or const.
type Range ¶
Range interface is identical to ast.Node interface and helps handling source code locations.
type RedefinitionError ¶
func (*RedefinitionError) Error ¶
func (err *RedefinitionError) Error() string
type Scope ¶
type Scope interface { // Insert attemps to insert an object obj into the Scope. If the scope // already contains an alternative object alt with the same name, Insert // leaves the scope unchanged and returns altnative object. Otherwise it // inserts obj, sets the object's parent scope, if not already set, and // returns nil. Insert(obj Object) Object // Lookup returns the object for a given name. Lookup may follow scope chains. Lookup(name string) Object // Names lists all names defined in this scope. Names() []string }
type Struct ¶
type Struct struct { Fields []*Var // contains filtered or unexported fields }
Struct can be an union, a record or a set structure.
func (*Struct) Underlying ¶
type Type ¶
type Type interface { // Underlying returns the underlying type of a type. Underlying() Type // String returns a string representation of a type. String() string }
Type represents a type in TTCN-3
type UnknownIdentifierError ¶
func (*UnknownIdentifierError) Error ¶
func (err *UnknownIdentifierError) Error() string
Click to show internal directories.
Click to hide internal directories.