ttcn3

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB added in v0.13.0

type DB struct {
	// Names is a map from symbol name to a list of files that contain the symbol.
	Names 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

func (db *DB) Index(files ...string)

Index parses TTCN-3 source files and adds names and dependencies to the database.

func (*DB) ResolveAt added in v0.13.0

func (db *DB) ResolveAt(file string, line int, col int) []*Definition

type Definition added in v0.13.0

type Definition struct {
	*ast.Ident
	Tree *Tree
	Next *Definition
}

type Scope added in v0.13.0

type Scope struct {
	ast.Node
	Tree  *Tree
	Names map[string]*Definition
}

func NewScope added in v0.13.0

func NewScope(n ast.Node, tree *Tree) *Scope

func (*Scope) Insert added in v0.13.0

func (scp *Scope) Insert(id *ast.Ident)

type Tree

type Tree struct {
	FileSet *loc.FileSet
	Root    ast.NodeList
	Names   map[string]bool
	Err     error
}

Tree represents the TTCN-3 syntax tree, usually of a file.

func Parse added in v0.11.0

func Parse(src string) *Tree

Parse parses a string and returns a syntax tree.

func ParseFile

func ParseFile(path string) *Tree

ParseFile parses a file and returns a syntax tree.

func (*Tree) Components added in v0.12.0

func (t *Tree) Components() []*ast.ComponentTypeDecl

func (*Tree) Controls added in v0.12.0

func (t *Tree) Controls() []*ast.ControlPart

func (*Tree) Funcs added in v0.12.0

func (t *Tree) Funcs() []*ast.FuncDecl

func (*Tree) Imports added in v0.12.0

func (t *Tree) Imports() []*ast.ImportDecl

func (*Tree) ModulePars added in v0.12.0

func (t *Tree) ModulePars() []*ast.Declarator

func (*Tree) Modules added in v0.9.6

func (t *Tree) Modules() []*ast.Module

func (*Tree) Ports added in v0.12.0

func (t *Tree) Ports() []*ast.PortTypeDecl

func (*Tree) Pos added in v0.13.0

func (tree *Tree) Pos(line int, column int) loc.Pos

Pos encodes a line and column tuple into a offset-based Pos tag. If file nas not been parsed yet, Pos will return loc.NoPos.

func (*Tree) Position added in v0.13.0

func (tree *Tree) Position(pos loc.Pos) loc.Position

Position return a human readable position of the node.

func (*Tree) SliceAt added in v0.13.0

func (tree *Tree) SliceAt(pos loc.Pos) []ast.Node

Directories

Path Synopsis
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 doc provides helper functions to extract test tags and documents from TTCN-3 comments.
package doc provides helper functions to extract test tags and documents from TTCN-3 comments.
Package parser implements a tolerant TTCN-3 parser library.
Package parser implements a tolerant TTCN-3 parser library.
Package scanner provides a TTCN-3 scanner
Package scanner provides a TTCN-3 scanner
Package token defines constants representing the lexical tokens of the TTCN-3 programming language and basic operations on tokens (printing, predicates).
Package token defines constants representing the lexical tokens of the TTCN-3 programming language and basic operations on tokens (printing, predicates).
Package types provides TTCN-3 types, functions for compatibilty checks and a builder to create and resolve types from a TTCN-3 syntax tree.
Package types provides TTCN-3 types, functions for compatibilty checks and a builder to create and resolve types from a TTCN-3 syntax tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL