Documentation ¶
Overview ¶
Package ttcn3 provides routines for evaluating TTCN-3 source code.
This package is in alpha stage, as we are still figuring out requirements and interfaces.
Index ¶
- func JoinNames(names ...string) string
- func ModuleName(s string) string
- type DB
- type Node
- type NodeEvent
- type Scope
- type Source
- type Tree
- func (t *Tree) Components() []*Node
- func (t *Tree) Controls() []*Node
- func (t *Tree) ExprAt(pos int) syntax.Expr
- func (t *Tree) Filename() string
- func (t *Tree) Funcs() []*Node
- func (t *Tree) IdentifierAt(line, col int) syntax.Expr
- func (t *Tree) Imports() []*Node
- func (t *Tree) Lookup(n syntax.Expr) []*Node
- func (t *Tree) LookupWithDB(n syntax.Expr, db *DB) []*Node
- func (t *Tree) ModuleOf(n syntax.Node) *syntax.Module
- func (t *Tree) ModulePars() []*Node
- func (t *Tree) Modules() []*Node
- func (t *Tree) ParentOf(n syntax.Node) syntax.Node
- func (t *Tree) Ports() []*Node
- func (t *Tree) QualifiedName(n syntax.Node) string
- func (tree *Tree) Tags() []syntax.Node
- func (t *Tree) Tests() []*Node
- func (t *Tree) TypeOf(n syntax.Node, db *DB) []*Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModuleName ¶ added in v0.18.0
ModuleName returns the module name part of a name string or an empty string if there is no module name.
Types ¶
type DB ¶ added in v0.13.0
type DB struct { // Names is a map from symbol name to a list of files that define the symbol. Names map[string]map[string]bool // Uses maps from symbol name to a list of files that use the symbol. Uses map[string]map[string]bool // Modules maps from module name to file path. Modules map[string]map[string]bool // contains filtered or unexported fields }
DB implements database for querying TTCN-3 source code bases.
func (*DB) Index ¶ added in v0.13.0
Index parses TTCN-3 source files and adds names and dependencies to the database.
func (*DB) VisibleModules ¶ added in v0.14.0
VisibleModules returns a list of modules that may contain the given symbol. First parameter id specifies the symbol to look for and second parameter module specifies where the imports come from.
type NodeEvent ¶ added in v0.16.2
type NodeEvent struct { // Kind is the type of an node event (AddToken, OpenFooBar, CloseFooBar). Kind string `json:"kind"` // Text is the text of a AddToken event. Text string `json:"text,omitempty"` // Offset is the position of the first character belonging to the node. Offs int `json:"offs"` // End is the position of the first character immediately after the node. Len int `json:"len"` // Other is the index of the matching node event. Other int `json:"other,omitempty"` }
type Scope ¶ added in v0.13.0
type Tree ¶
type Tree struct { *syntax.Root Names map[string]bool Uses map[string]bool Err error // contains filtered or unexported fields }
Tree represents the TTCN-3 syntax tree, usually of a file.
func (*Tree) Components ¶ added in v0.12.0
func (*Tree) IdentifierAt ¶ added in v0.18.0
IdentifierAt returns the primary expression enclosing the identifer at the given position.
func (*Tree) Lookup ¶ added in v0.14.0
Lookup returns the definitions of the given expression. For handling imports and multiple modules, use LookupWithDB.
func (*Tree) LookupWithDB ¶ added in v0.14.0
LookupWithDB returns the definitions of the given expression, but uses the database for import resoltion.
func (*Tree) ModuleOf ¶ added in v0.14.0
ModuleOf returns the module of the given node, by walking up the tree.
func (*Tree) ModulePars ¶ added in v0.12.0
func (*Tree) QualifiedName ¶ added in v0.16.2
Returns the qualified name of the given node.
Directories ¶
Path | Synopsis |
---|---|
Package format implements pretty printers for TTCN-3 source code.
|
Package format implements pretty printers for TTCN-3 source code. |
Package ast provides TTCN-3 syntax tree nodes and functions for tree traversal.
|
Package ast provides TTCN-3 syntax tree nodes and functions for tree traversal. |
Package types implements a type system for TTCN-3.
|
Package types implements a type system for TTCN-3. |
v2
|
|
syntax/internal/gen
This program reads the TTCN-3 grammar file and generates a parser for it.
|
This program reads the TTCN-3 grammar file and generates a parser for it. |