Documentation ¶
Overview ¶
Package types implements a type system for TTCN-3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Predefined = map[string]Type{ "any": &PrimitiveType{Kind: Any, Name: "any"}, "integer": &PrimitiveType{Kind: Integer, Name: "integer"}, "float": &PrimitiveType{Kind: Float, Name: "float"}, "boolean": &PrimitiveType{Kind: Boolean, Name: "boolean"}, "verdicttype": &PrimitiveType{Kind: Verdict, Name: "verdicttype"}, "bitstring": &ListType{Kind: Bitstring, Name: "bitstring"}, "charstring": &ListType{Kind: Charstring, Name: "charstring"}, "hexstring": &ListType{Kind: Hexstring, Name: "hexstring"}, "octetstring": &ListType{Kind: Octetstring, Name: "octetstring"}, "universal charstring": &ListType{Kind: UniversalCharstring, Name: "universal charstring"}, "default": &BehaviourType{Kind: Altstep, Name: "default"}, "timer": &StructuredType{Kind: Object, Name: "timer"}, "anytype": &StructuredType{Kind: Union, Name: "anytype"}, }
Functions ¶
This section is empty.
Types ¶
type BehaviourType ¶ added in v0.18.0
type BehaviourType struct { Kind Name string External bool Parameters []Type Receiver Type RunsOn Type System Type MTC Type Port Type ExecuteOn Type Return Type }
A BehaviourType represents behaviour (testcases, functions, behaviour types, ...)
func (*BehaviourType) String ¶ added in v0.18.0
func (t *BehaviourType) String() string
type Kind ¶
type Kind uint64
Kind is a bitmask describing the kinds of values a type can have, such as "integer" or "record".
const ( Any Kind = 0 Error Kind = 1 << iota Incomplete // Primitive types Boolean Enumerated Float Integer Verdict // List types Array Bitstring Charstring Hexstring Octetstring RecordOf SetOf UniversalCharstring // Structured types Anytype Component Object Port Record Set Timer Trait Union // Behaviour types Altstep Configuration Default Function Testcase )
type ListType ¶ added in v0.18.0
type ListType struct { Kind Name string ElementType Type ValueConstraints []Value LengthConstraint Value Methods map[string]Type }
A ListType represents a collection of values of the same type, such as a record, set, map, hexstring, ...
The behaviour of a list type is determined by its kind:
- a RecordOf is a ordered collection, while SetOf is an unordered collection or pairs.
- an Array has a different string representation than a RecordOf: `integer[5]` vs. `record length(5) of integer`
The behaviour for other kinds than Array, RecordOf, Hexstring, Bitstring, Octetstring, Charstring, UniversalCharstring is undefined and may or may not cause a runtime error.
type PrimitiveType ¶ added in v0.18.0
A PrimitiveType represents a non-composite type, such as integer, boolean, verdicttype, ...
func (*PrimitiveType) String ¶ added in v0.18.0
func (t *PrimitiveType) String() string
type StructuredType ¶ added in v0.18.0
type StructuredType struct { Kind Name string External bool Fields []Field Extends []Type ValueConstraints []Value Methods map[string]Type }
A StructuredType represents structured types, such as record, set, union, class, ...
func (*StructuredType) String ¶ added in v0.18.0
func (t *StructuredType) String() string