Documentation ¶
Overview ¶
Package ast provides TTCN-3 syntax tree nodes and functions for tree traversal.
Package parser implements a tolerant TTCN-3 parser library.
It implements most of TTCN-3 core language specification 4.10 (2018), Advanced Parametrisation, Behaviour Types, Performance and Realtime Testing, simplistic preprocessor support, multi-line string literals for Titan TestPorts, and optional semicolon for backward compatibility.
Index ¶
- Constants
- func Doc(n Node) string
- func Filename(n Node) string
- func Inspect(n Node, f func(Node) bool)
- func IsNil(n Node) bool
- func Name(n Node) string
- func NewParser(src []byte) *parser
- func Unquote(s string) (string, error)
- type AltStmt
- type BehaviourSpec
- type BehaviourTypeDecl
- type BinaryExpr
- type BlockStmt
- type BranchStmt
- type CallExpr
- type CallStmt
- type CaseClause
- type ClassTypeDecl
- type CommClause
- type ComponentTypeDecl
- type CompositeLiteral
- type ConstructorDecl
- type ControlPart
- type Decl
- type DeclStmt
- type Declarator
- type DecmatchExpr
- type DecodedExpr
- type DefKindExpr
- type DoWhileStmt
- type EnumSpec
- type EnumTypeDecl
- type Error
- type ErrorNode
- type ExceptExpr
- type Expr
- type ExprStmt
- type Field
- type ForRangeStmt
- type ForStmt
- type FormalPar
- type FormalPars
- type FriendDecl
- type FromExpr
- type FuncDecl
- type GroupDecl
- type Ident
- type IfStmt
- type ImportDecl
- type IndexExpr
- type Kind
- type LanguageSpec
- type LengthExpr
- type ListSpec
- type MapSpec
- type MapTypeDecl
- type Mode
- type ModifiesExpr
- type Module
- type ModuleDef
- type ModuleParameterGroup
- type MtcSpec
- type Node
- type NodeList
- type ParamExpr
- type ParametrizedIdent
- type ParenExpr
- type ParserOption
- type PatternExpr
- type PortAttribute
- type PortMapAttribute
- type PortTypeDecl
- type Position
- type PostExpr
- type RedirectExpr
- type RefSpec
- type RegexpExpr
- type RestrictionSpec
- type ReturnSpec
- type ReturnStmt
- type Root
- func (n *Root) Children() []Node
- func (n *Root) End() int
- func (n *Root) Err() error
- func (n *Root) FirstTok() Token
- func (n *Root) Inspect(f func(Node) bool)
- func (n *Root) LastTok() Token
- func (n *Root) Pos() int
- func (n *Root) PosFor(line, col int) int
- func (n *Root) Position(offset int) Position
- type RunsOnSpec
- type Scanner
- type SelectStmt
- type SelectorExpr
- type SignatureDecl
- type Span
- type Stmt
- type StructSpec
- type StructTypeDecl
- type SubTypeDecl
- type SystemSpec
- type TemplateDecl
- type Token
- type TypeSpec
- type UnaryExpr
- type ValueDecl
- type ValueExpr
- type ValueLiteral
- type WhileStmt
- type WithSpec
- type WithStmt
Constants ¶
const ( PedanticSemicolon = 1 << iota // expect semicolons pedantically IgnoreComments // ignore comments Trace // print a trace of parsed productions )
const ( LowestPrec = 0 // non-operators UnaryPrec = 6 HighestPrec = 15 )
A set of constants for precedence-based expression parsing. Non-operators have lowest precedence, followed by operators starting with precedence 1 up to unary operators. The highest precedence serves as "catch-all" precedence for selector, indexing, and other operator and delimiter tokens.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AltStmt ¶
type AltStmt struct { Tok Token // ALT or INTERLEAVE NoDefault Token Body *BlockStmt // Block statement with alternations }
A AltStmt represents an alternative statement.
type BehaviourSpec ¶ added in v0.18.0
type BehaviourSpec struct { Kind Token // TESTCASE, FUNCTION, ALTSTEP Params *FormalPars // Parameter list or nil RunsOn *RunsOnSpec // runs on spec or nil System *SystemSpec // system spec or nil Return *ReturnSpec // return value spec or nil }
A BehaviourSpec represents a behaviour type specification.
func (*BehaviourSpec) Children ¶ added in v0.18.0
func (n *BehaviourSpec) Children() []Node
func (*BehaviourSpec) End ¶ added in v0.18.0
func (n *BehaviourSpec) End() int
func (*BehaviourSpec) FirstTok ¶ added in v0.18.0
func (n *BehaviourSpec) FirstTok() Token
func (*BehaviourSpec) Inspect ¶ added in v0.18.0
func (n *BehaviourSpec) Inspect(f func(Node) bool)
func (*BehaviourSpec) LastTok ¶ added in v0.18.0
func (n *BehaviourSpec) LastTok() Token
func (*BehaviourSpec) Pos ¶ added in v0.18.0
func (n *BehaviourSpec) Pos() int
type BehaviourTypeDecl ¶ added in v0.18.0
type BehaviourTypeDecl struct { TypeTok Token // Position of "type" Kind Token // TESTCASE, ALTSTEP, FUNCTION Name *Ident TypePars *FormalPars Params *FormalPars // Formal parameter list RunsOn *RunsOnSpec // Optional runs-on spec System *SystemSpec // Optional system spec Return *ReturnSpec // Optional return spec With *WithSpec }
A BehaviourTypeDecl represents a named behaviour type.
func (*BehaviourTypeDecl) Children ¶ added in v0.18.0
func (n *BehaviourTypeDecl) Children() []Node
func (*BehaviourTypeDecl) End ¶ added in v0.18.0
func (n *BehaviourTypeDecl) End() int
func (*BehaviourTypeDecl) FirstTok ¶ added in v0.18.0
func (n *BehaviourTypeDecl) FirstTok() Token
func (*BehaviourTypeDecl) Inspect ¶ added in v0.18.0
func (n *BehaviourTypeDecl) Inspect(f func(Node) bool)
func (*BehaviourTypeDecl) LastTok ¶ added in v0.18.0
func (n *BehaviourTypeDecl) LastTok() Token
func (*BehaviourTypeDecl) Pos ¶ added in v0.18.0
func (n *BehaviourTypeDecl) Pos() int
type BinaryExpr ¶
type BinaryExpr struct { X Expr // First operand Op Token // Operator token Y Expr // Second operand }
A BinaryExpr represents a binary expression. Possible operands are all tokens with a precedence value, TO and FROM.
func (*BinaryExpr) Children ¶ added in v0.18.0
func (n *BinaryExpr) Children() []Node
func (*BinaryExpr) End ¶ added in v0.18.0
func (n *BinaryExpr) End() int
func (*BinaryExpr) FirstTok ¶ added in v0.18.0
func (n *BinaryExpr) FirstTok() Token
func (*BinaryExpr) Inspect ¶ added in v0.18.0
func (n *BinaryExpr) Inspect(f func(Node) bool)
func (*BinaryExpr) LastTok ¶ added in v0.18.0
func (n *BinaryExpr) LastTok() Token
func (*BinaryExpr) Pos ¶ added in v0.18.0
func (n *BinaryExpr) Pos() int
type BlockStmt ¶ added in v0.18.0
type BlockStmt struct { LBrace Token // Position of "{" Stmts []Stmt // List of statements RBrace Token // Position of "}" }
A BlockStmt represents a curly braces enclosed list of statements.
type BranchStmt ¶ added in v0.18.0
type BranchStmt struct { Tok Token // REPEAT, BREAK, CONTINUE, LABEL, GOTO Label *Ident // Label literal or nil }
A BranchStmt represents a branch statement.
func (*BranchStmt) Children ¶ added in v0.18.0
func (n *BranchStmt) Children() []Node
func (*BranchStmt) End ¶ added in v0.18.0
func (n *BranchStmt) End() int
func (*BranchStmt) FirstTok ¶ added in v0.18.0
func (n *BranchStmt) FirstTok() Token
func (*BranchStmt) Inspect ¶ added in v0.18.0
func (n *BranchStmt) Inspect(f func(Node) bool)
func (*BranchStmt) LastTok ¶ added in v0.18.0
func (n *BranchStmt) LastTok() Token
func (*BranchStmt) Pos ¶ added in v0.18.0
func (n *BranchStmt) Pos() int
type CallStmt ¶ added in v0.18.0
type CallStmt struct { Stmt Stmt // "call" statement Body *BlockStmt // Block statement with alternations }
A CallStmt represents a "call" statement with communication-block.
type CaseClause ¶ added in v0.18.0
type CaseClause struct { Tok Token // Position of "case" Case *ParenExpr // nil means else-case Body *BlockStmt // Case body }
A CaseClause represents a case clause.
func (*CaseClause) Children ¶ added in v0.18.0
func (n *CaseClause) Children() []Node
func (*CaseClause) End ¶ added in v0.18.0
func (n *CaseClause) End() int
func (*CaseClause) FirstTok ¶ added in v0.18.0
func (n *CaseClause) FirstTok() Token
func (*CaseClause) Inspect ¶ added in v0.18.0
func (n *CaseClause) Inspect(f func(Node) bool)
func (*CaseClause) LastTok ¶ added in v0.18.0
func (n *CaseClause) LastTok() Token
func (*CaseClause) Pos ¶ added in v0.18.0
func (n *CaseClause) Pos() int
type ClassTypeDecl ¶ added in v0.19.0
type ClassTypeDecl struct { TypeTok Token // Position of "type" Kind Token // CLASS Modif Token // "@abstract" or nil Name *Ident // Name ExtendsTok Token Extends []Expr RunsOn *RunsOnSpec // Optional runs-on-spec Mtc *MtcSpec // Optional mtc-spec System *SystemSpec // Optional system-spec LBrace Token // Position of "{" Defs []*ModuleDef RBrace Token // Position of }" With *WithSpec }
A StructTypeDecl represents a name struct type.
func (*ClassTypeDecl) Children ¶ added in v0.19.0
func (n *ClassTypeDecl) Children() []Node
func (*ClassTypeDecl) End ¶ added in v0.19.0
func (n *ClassTypeDecl) End() int
func (*ClassTypeDecl) FirstTok ¶ added in v0.19.0
func (n *ClassTypeDecl) FirstTok() Token
func (*ClassTypeDecl) Inspect ¶ added in v0.19.0
func (n *ClassTypeDecl) Inspect(f func(Node) bool)
func (*ClassTypeDecl) LastTok ¶ added in v0.19.0
func (n *ClassTypeDecl) LastTok() Token
func (*ClassTypeDecl) Pos ¶ added in v0.19.0
func (n *ClassTypeDecl) Pos() int
type CommClause ¶ added in v0.18.0
type CommClause struct { LBrack Token // Position of '[' X Expr // Conditional guard expression or nil Else Token // Else-clause of nil RBrack Token // Position of ']' Comm Stmt // Communication statement Body *BlockStmt // Body of nil }
A CommClause represents communication clauses used by alt, interleave or check.
func (*CommClause) Children ¶ added in v0.18.0
func (n *CommClause) Children() []Node
func (*CommClause) End ¶ added in v0.18.0
func (n *CommClause) End() int
func (*CommClause) FirstTok ¶ added in v0.18.0
func (n *CommClause) FirstTok() Token
func (*CommClause) Inspect ¶ added in v0.18.0
func (n *CommClause) Inspect(f func(Node) bool)
func (*CommClause) LastTok ¶ added in v0.18.0
func (n *CommClause) LastTok() Token
func (*CommClause) Pos ¶ added in v0.18.0
func (n *CommClause) Pos() int
type ComponentTypeDecl ¶ added in v0.18.0
type ComponentTypeDecl struct { TypeTok Token CompTok Token Name *Ident TypePars *FormalPars ExtendsTok Token Extends []Expr Body *BlockStmt With *WithSpec }
func (*ComponentTypeDecl) Children ¶ added in v0.18.0
func (n *ComponentTypeDecl) Children() []Node
func (*ComponentTypeDecl) End ¶ added in v0.18.0
func (n *ComponentTypeDecl) End() int
func (*ComponentTypeDecl) FirstTok ¶ added in v0.18.0
func (n *ComponentTypeDecl) FirstTok() Token
func (*ComponentTypeDecl) Inspect ¶ added in v0.18.0
func (n *ComponentTypeDecl) Inspect(f func(Node) bool)
func (*ComponentTypeDecl) LastTok ¶ added in v0.18.0
func (n *ComponentTypeDecl) LastTok() Token
func (*ComponentTypeDecl) Pos ¶ added in v0.18.0
func (n *ComponentTypeDecl) Pos() int
type CompositeLiteral ¶ added in v0.18.0
type CompositeLiteral struct { LBrace Token // Position of "{" List []Expr // Expression list RBrace Token // Position of "{" }
A CompositeLiteral represents composite literals, e.g. "{x:=23, y:=5}".
func (*CompositeLiteral) Children ¶ added in v0.18.0
func (n *CompositeLiteral) Children() []Node
func (*CompositeLiteral) End ¶ added in v0.18.0
func (n *CompositeLiteral) End() int
func (*CompositeLiteral) FirstTok ¶ added in v0.18.0
func (n *CompositeLiteral) FirstTok() Token
func (*CompositeLiteral) Inspect ¶ added in v0.18.0
func (n *CompositeLiteral) Inspect(f func(Node) bool)
func (*CompositeLiteral) LastTok ¶ added in v0.18.0
func (n *CompositeLiteral) LastTok() Token
func (*CompositeLiteral) Pos ¶ added in v0.18.0
func (n *CompositeLiteral) Pos() int
type ConstructorDecl ¶ added in v0.19.0
type ConstructorDecl struct { CreateTok Token // CREATE Params *FormalPars // Formal parameter list Body *BlockStmt // Body }
A ConstructorDecl represents a class constructor definition.
func (*ConstructorDecl) Children ¶ added in v0.19.0
func (n *ConstructorDecl) Children() []Node
func (*ConstructorDecl) End ¶ added in v0.19.0
func (n *ConstructorDecl) End() int
func (*ConstructorDecl) FirstTok ¶ added in v0.19.0
func (n *ConstructorDecl) FirstTok() Token
func (*ConstructorDecl) Inspect ¶ added in v0.19.0
func (n *ConstructorDecl) Inspect(f func(Node) bool)
func (*ConstructorDecl) LastTok ¶ added in v0.19.0
func (n *ConstructorDecl) LastTok() Token
func (*ConstructorDecl) Pos ¶ added in v0.19.0
func (n *ConstructorDecl) Pos() int
type ControlPart ¶ added in v0.18.0
func (*ControlPart) Children ¶ added in v0.18.0
func (n *ControlPart) Children() []Node
func (*ControlPart) End ¶ added in v0.18.0
func (n *ControlPart) End() int
func (*ControlPart) FirstTok ¶ added in v0.18.0
func (n *ControlPart) FirstTok() Token
func (*ControlPart) Inspect ¶ added in v0.18.0
func (n *ControlPart) Inspect(f func(Node) bool)
func (*ControlPart) LastTok ¶ added in v0.18.0
func (n *ControlPart) LastTok() Token
func (*ControlPart) Pos ¶ added in v0.18.0
func (n *ControlPart) Pos() int
type Decl ¶
type Decl interface { Node // contains filtered or unexported methods }
All declaration nodes implement the Decl interface.
type DeclStmt ¶ added in v0.18.0
type DeclStmt struct {
Decl Decl
}
A DeclStmt represents a value declaration used as statement, lika a local variable declaration.
type Declarator ¶
A Declarator represents a single varable declaration
func (*Declarator) Children ¶ added in v0.18.0
func (n *Declarator) Children() []Node
func (*Declarator) End ¶ added in v0.18.0
func (n *Declarator) End() int
func (*Declarator) FirstTok ¶ added in v0.18.0
func (n *Declarator) FirstTok() Token
func (*Declarator) Inspect ¶ added in v0.18.0
func (n *Declarator) Inspect(f func(Node) bool)
func (*Declarator) LastTok ¶ added in v0.18.0
func (n *Declarator) LastTok() Token
func (*Declarator) Pos ¶ added in v0.18.0
func (n *Declarator) Pos() int
type DecmatchExpr ¶ added in v0.18.0
type DecmatchExpr struct { Tok Token // Position of "decmatch" Params Expr // Parameter list or nil X Expr // Template expression }
A DecmatchExpr represents a "decmatch" expression.
func (*DecmatchExpr) Children ¶ added in v0.18.0
func (n *DecmatchExpr) Children() []Node
func (*DecmatchExpr) End ¶ added in v0.18.0
func (n *DecmatchExpr) End() int
func (*DecmatchExpr) FirstTok ¶ added in v0.18.0
func (n *DecmatchExpr) FirstTok() Token
func (*DecmatchExpr) Inspect ¶ added in v0.18.0
func (n *DecmatchExpr) Inspect(f func(Node) bool)
func (*DecmatchExpr) LastTok ¶ added in v0.18.0
func (n *DecmatchExpr) LastTok() Token
func (*DecmatchExpr) Pos ¶ added in v0.18.0
func (n *DecmatchExpr) Pos() int
type DecodedExpr ¶ added in v0.18.0
type DecodedExpr struct { Tok Token // Position of "decoded" Params Expr // Parameter list or nil X Expr // Template expression }
A DecodedExpr represents a "@decoded" expression.
func (*DecodedExpr) Children ¶ added in v0.18.0
func (n *DecodedExpr) Children() []Node
func (*DecodedExpr) End ¶ added in v0.18.0
func (n *DecodedExpr) End() int
func (*DecodedExpr) FirstTok ¶ added in v0.18.0
func (n *DecodedExpr) FirstTok() Token
func (*DecodedExpr) Inspect ¶ added in v0.18.0
func (n *DecodedExpr) Inspect(f func(Node) bool)
func (*DecodedExpr) LastTok ¶ added in v0.18.0
func (n *DecodedExpr) LastTok() Token
func (*DecodedExpr) Pos ¶ added in v0.18.0
func (n *DecodedExpr) Pos() int
type DefKindExpr ¶ added in v0.18.0
type DefKindExpr struct { Kind Token // Definition kind, "type", "group", ... List []Expr // List of identifiers or except-expressions }
A DefKindExpr represents a definition kind expression, used by imports and with-attributes.
func (*DefKindExpr) Children ¶ added in v0.18.0
func (n *DefKindExpr) Children() []Node
func (*DefKindExpr) End ¶ added in v0.18.0
func (n *DefKindExpr) End() int
func (*DefKindExpr) FirstTok ¶ added in v0.18.0
func (n *DefKindExpr) FirstTok() Token
func (*DefKindExpr) Inspect ¶ added in v0.18.0
func (n *DefKindExpr) Inspect(f func(Node) bool)
func (*DefKindExpr) LastTok ¶ added in v0.18.0
func (n *DefKindExpr) LastTok() Token
func (*DefKindExpr) Pos ¶ added in v0.18.0
func (n *DefKindExpr) Pos() int
type DoWhileStmt ¶ added in v0.18.0
type DoWhileStmt struct { DoTok Token // Position of "do" Body *BlockStmt // Loop-Body WhileTok Token // Position of "while" LParen Token // Position of "(" Cond Expr // Conditional expression RParen Token // Position of ")" }
A DoWhileStmt represents a do-while statement.
func (*DoWhileStmt) Children ¶ added in v0.18.0
func (n *DoWhileStmt) Children() []Node
func (*DoWhileStmt) End ¶ added in v0.18.0
func (n *DoWhileStmt) End() int
func (*DoWhileStmt) FirstTok ¶ added in v0.18.0
func (n *DoWhileStmt) FirstTok() Token
func (*DoWhileStmt) Inspect ¶ added in v0.18.0
func (n *DoWhileStmt) Inspect(f func(Node) bool)
func (*DoWhileStmt) LastTok ¶ added in v0.18.0
func (n *DoWhileStmt) LastTok() Token
func (*DoWhileStmt) Pos ¶ added in v0.18.0
func (n *DoWhileStmt) Pos() int
type EnumSpec ¶ added in v0.18.0
type EnumSpec struct { Tok Token // Position of "enumerated" LBrace Token // Position of "{" Enums []Expr // Enum list RBrace Token // Position of "}" }
A EnumSpec represents a enumeration type specification.
type EnumTypeDecl ¶ added in v0.18.0
type EnumTypeDecl struct { TypeTok Token // Position of "type" EnumTok Token // Position of "ENUMERATED" Name *Ident TypePars *FormalPars LBrace Token // Position of "{" Enums []Expr // Enum list RBrace Token // Position of "}" With *WithSpec }
A EnumTypeDecl represents a named enum type.
func (*EnumTypeDecl) Children ¶ added in v0.18.0
func (n *EnumTypeDecl) Children() []Node
func (*EnumTypeDecl) End ¶ added in v0.18.0
func (n *EnumTypeDecl) End() int
func (*EnumTypeDecl) FirstTok ¶ added in v0.18.0
func (n *EnumTypeDecl) FirstTok() Token
func (*EnumTypeDecl) Inspect ¶ added in v0.18.0
func (n *EnumTypeDecl) Inspect(f func(Node) bool)
func (*EnumTypeDecl) LastTok ¶ added in v0.18.0
func (n *EnumTypeDecl) LastTok() Token
func (*EnumTypeDecl) Pos ¶ added in v0.18.0
func (n *EnumTypeDecl) Pos() int
type ExceptExpr ¶ added in v0.18.0
type ExceptExpr struct { X Expr // (Qualified) identifier or "all" ExceptTok Token // Position of "except" LBrace Token // Position of "{" or nil List []Expr // List of identifiers or DefKindExprs to exclude RBrace Token // Position of "}" or nil }
A ExceptExpr is used by DefKindExpr to express exlusion of specific defintions.
func (*ExceptExpr) Children ¶ added in v0.18.0
func (n *ExceptExpr) Children() []Node
func (*ExceptExpr) End ¶ added in v0.18.0
func (n *ExceptExpr) End() int
func (*ExceptExpr) FirstTok ¶ added in v0.18.0
func (n *ExceptExpr) FirstTok() Token
func (*ExceptExpr) Inspect ¶ added in v0.18.0
func (n *ExceptExpr) Inspect(f func(Node) bool)
func (*ExceptExpr) LastTok ¶ added in v0.18.0
func (n *ExceptExpr) LastTok() Token
func (*ExceptExpr) Pos ¶ added in v0.18.0
func (n *ExceptExpr) Pos() int
type Expr ¶
type Expr interface { Node // contains filtered or unexported methods }
All expression nodes implement the Expr interface.
type ExprStmt ¶ added in v0.18.0
type ExprStmt struct {
Expr Expr
}
An ExprStmt represents a expression used as statement, like an assignment or function call.
type Field ¶ added in v0.18.0
type Field struct { DefaultTok Token // Position of "@default" or nil Type TypeSpec // Type Name *Ident // Name ArrayDef []*ParenExpr // Array definitions TypePars *FormalPars ValueConstraint *ParenExpr // Value constraint or nil LengthConstraint *LengthExpr // Length constraint or nil Optional Token // Position of "optional" or nil }
A Field represents a named struct member or sub type definition
type ForRangeStmt ¶ added in v0.19.0
type ForRangeStmt struct { Tok Token LParen Token Init Stmt InTok Token Range Expr RParen Token Body *BlockStmt }
func (*ForRangeStmt) Children ¶ added in v0.19.0
func (n *ForRangeStmt) Children() []Node
func (*ForRangeStmt) End ¶ added in v0.19.0
func (n *ForRangeStmt) End() int
func (*ForRangeStmt) FirstTok ¶ added in v0.19.0
func (n *ForRangeStmt) FirstTok() Token
func (*ForRangeStmt) Inspect ¶ added in v0.19.0
func (n *ForRangeStmt) Inspect(f func(Node) bool)
func (*ForRangeStmt) LastTok ¶ added in v0.19.0
func (n *ForRangeStmt) LastTok() Token
func (*ForRangeStmt) Pos ¶ added in v0.19.0
func (n *ForRangeStmt) Pos() int
type ForStmt ¶
type ForStmt struct { Tok Token // Position of "for" LParen Token // Position of "(" Init Stmt // Initialization statement InitSemi Token // Position of ";" Cond Expr // Conditional expression CondSemi Token // Position of ";" Post Stmt // Post iteration statement RParen Token // Position of ")" Body *BlockStmt // Loop-Body }
A ForStmt represents a "for" statement.
type FormalPar ¶
type FormalPars ¶
func (*FormalPars) Children ¶ added in v0.18.0
func (n *FormalPars) Children() []Node
func (*FormalPars) End ¶ added in v0.18.0
func (n *FormalPars) End() int
func (*FormalPars) FirstTok ¶ added in v0.18.0
func (n *FormalPars) FirstTok() Token
func (*FormalPars) Inspect ¶ added in v0.18.0
func (n *FormalPars) Inspect(f func(Node) bool)
func (*FormalPars) LastTok ¶ added in v0.18.0
func (n *FormalPars) LastTok() Token
func (*FormalPars) Pos ¶ added in v0.18.0
func (n *FormalPars) Pos() int
type FriendDecl ¶ added in v0.18.0
func (*FriendDecl) Children ¶ added in v0.18.0
func (n *FriendDecl) Children() []Node
func (*FriendDecl) End ¶ added in v0.18.0
func (n *FriendDecl) End() int
func (*FriendDecl) FirstTok ¶ added in v0.18.0
func (n *FriendDecl) FirstTok() Token
func (*FriendDecl) Inspect ¶ added in v0.18.0
func (n *FriendDecl) Inspect(f func(Node) bool)
func (*FriendDecl) LastTok ¶ added in v0.18.0
func (n *FriendDecl) LastTok() Token
func (*FriendDecl) Pos ¶ added in v0.18.0
func (n *FriendDecl) Pos() int
type FromExpr ¶ added in v0.18.0
type FromExpr struct { Kind Token // ANY or ALL FromTok Token // Position of "from" X Expr // Expression }
A FromExpr represents a "from" expression, like "any from a".
type FuncDecl ¶ added in v0.18.0
type FuncDecl struct { External Token // Position of "external" or nil Kind Token // TESTCASE, ALTSTEP, FUNCTION Name *Ident Modif Token // Position of "@deterministic" or nil TypePars *FormalPars Params *FormalPars // Formal parameter list or nil RunsOn *RunsOnSpec // Optional runs-on-spec Mtc *MtcSpec // Optional mtc-spec System *SystemSpec // Optional system-spec Return *ReturnSpec // Optional return-spec Body *BlockStmt // Body or nil With *WithSpec }
A FuncDecl represents a behaviour definition.
type GroupDecl ¶ added in v0.18.0
type Ident ¶ added in v0.18.0
type Ident struct { IsName bool // true if this is a name, false if it is a reference Tok Token // first identifier token Tok2 Token `json:",omitempty"` // optional second identifier token, e.g. for "any port" }
Ident represents an identifier.
type IfStmt ¶
type IfStmt struct { Tok Token // Position of "if" LParen Token Cond Expr // Conditional expression RParen Token Then *BlockStmt // True branch ElseTok Token // Position of "else" or nil Else Stmt // Else branch }
A IfStmt represents a conditional statement.
type ImportDecl ¶ added in v0.18.0
type ImportDecl struct { ImportTok Token FromTok Token Module *Ident Language *LanguageSpec LBrace Token List []*DefKindExpr RBrace Token With *WithSpec }
func (*ImportDecl) Children ¶ added in v0.18.0
func (n *ImportDecl) Children() []Node
func (*ImportDecl) End ¶ added in v0.18.0
func (n *ImportDecl) End() int
func (*ImportDecl) FirstTok ¶ added in v0.18.0
func (n *ImportDecl) FirstTok() Token
func (*ImportDecl) Inspect ¶ added in v0.18.0
func (n *ImportDecl) Inspect(f func(Node) bool)
func (*ImportDecl) LastTok ¶ added in v0.18.0
func (n *ImportDecl) LastTok() Token
func (*ImportDecl) Pos ¶ added in v0.18.0
func (n *ImportDecl) Pos() int
type IndexExpr ¶ added in v0.18.0
type IndexExpr struct { X Expr // Preceding expression (might be nil) LBrack Token // Position of "[" Index Expr // Actuall index expression (might be "-") RBrack Token // Position of "]" }
A IndexExpr represents an expression followed by an index.
type Kind ¶
type Kind int
Kind is the set of lexical tokens of the Go programming language.
const ( // Special tokens ILLEGAL Kind = iota EOF UNTERMINATED MALFORMED COMMENT PREPROC // Identifiers and basic type literals // (these tokens stand for classes of literals) IDENT // main INT // 12345 FLOAT // 123.45 STRING // "abc" BSTRING // '101?F'H MODIF // @fuzzy // Operators and delimiters INC // ++ ADD // + SUB // - DEC // -- MUL // * DIV // / SHL // << ROL // <@ SHR // >> ROR // @> CONCAT // & REDIR // -> DECODE // => ANY // ? EXCL // ! RANGE // .. ELIPSIS // ... ASSIGN // := COLONCOLON // :: EQ // == NE // != LT // < LE // <= GT // > GE // >= LPAREN // ( LBRACK // [ LBRACE // { COMMA // , DOT // . RPAREN // ) RBRACK // ] RBRACE // } SEMICOLON // ; COLON // : // Keywords MOD // mod REM // rem AND // and OR // or XOR // xor NOT // not AND4B // and4b OR4B // or4b XOR4B // xor4b NOT4B // not4b ADDRESS ALIVE ALL ALT ALTSTEP ANYKW BREAK CASE CHARSTRING CLASS COMPONENT CONST CONTINUE CONTROL CREATE DECMATCH DISPLAY DO ELSE ENCODE ENUMERATED ERROR EXCEPT EXCEPTION EXTENDS EXTENSION EXTERNAL FAIL FALSE FOR FRIEND FROM FUNCTION GOTO GROUP IF IFPRESENT IMPORT IN INCONC INOUT INTERLEAVE LABEL LANGUAGE LENGTH MAP MESSAGE MIXED MODIFIES MODULE MODULEPAR MTC NAN NOBLOCK NONE NULL OF OMIT ON OPTIONAL OUT OVERRIDE PARAM PASS PATTERN PORT PRESENT PRIVATE PROCEDURE PUBLIC REALTIME RECORD REGEXP REPEAT RETURN RUNS SELECT SENDER SET SIGNATURE STEPSIZE SYSTEM TEMPLATE TESTCASE TIMER TIMESTAMP TO TRUE TYPE UNION UNIVERSAL UNMAP VALUE VAR VARIANT WHILE WITH )
The list of tokens.
func Lookup ¶ added in v0.18.0
Lookup maps an identifier to its keyword token or IDENT (if not a keyword).
func (Kind) IsKeyword ¶
IsKeyword returns true for tokens corresponding to keywords; it returns false otherwise.
func (Kind) IsLiteral ¶
IsLiteral returns true for tokens corresponding to identifiers and basic type literals; it returns false otherwise.
func (Kind) IsOperator ¶ added in v0.18.0
IsOperator returns true for tokens corresponding to operators and delimiters; it returns false otherwise.
func (Kind) Precedence ¶ added in v0.18.0
Precedence returns the operator precedence of the binary operator op. If op is not a binary operator, the result is LowestPrecedence.
func (Kind) String ¶
String returns the string corresponding to the token tok. For operators, delimiters, and keywords the string is the actual token character sequence (e.g., for the token ADD, the string is "+"). For all other tokens the string corresponds to the token constant name (e.g. for the token IDENT, the string is "IDENT").
type LanguageSpec ¶ added in v0.18.0
func (*LanguageSpec) Children ¶ added in v0.18.0
func (n *LanguageSpec) Children() []Node
func (*LanguageSpec) End ¶ added in v0.18.0
func (n *LanguageSpec) End() int
func (*LanguageSpec) FirstTok ¶ added in v0.18.0
func (n *LanguageSpec) FirstTok() Token
func (*LanguageSpec) Inspect ¶ added in v0.18.0
func (n *LanguageSpec) Inspect(f func(Node) bool)
func (*LanguageSpec) LastTok ¶ added in v0.18.0
func (n *LanguageSpec) LastTok() Token
func (*LanguageSpec) Pos ¶ added in v0.18.0
func (n *LanguageSpec) Pos() int
type LengthExpr ¶ added in v0.18.0
type LengthExpr struct { X Expr // Preceding expression Len Token // Position of "length" keyword Size *ParenExpr // Size expression }
A LengthExpr represents a length expression.
func (*LengthExpr) Children ¶ added in v0.18.0
func (n *LengthExpr) Children() []Node
func (*LengthExpr) End ¶ added in v0.18.0
func (n *LengthExpr) End() int
func (*LengthExpr) FirstTok ¶ added in v0.18.0
func (n *LengthExpr) FirstTok() Token
func (*LengthExpr) Inspect ¶ added in v0.18.0
func (n *LengthExpr) Inspect(f func(Node) bool)
func (*LengthExpr) LastTok ¶ added in v0.18.0
func (n *LengthExpr) LastTok() Token
func (*LengthExpr) Pos ¶ added in v0.18.0
func (n *LengthExpr) Pos() int
type ListSpec ¶ added in v0.18.0
type ListSpec struct { Kind Token // RECORD, SET Length *LengthExpr // Length constraint or nil OfTok Token // Position of "of" ElemType TypeSpec // Element type specification }
A ListSpec represents a list type specification.
type MapTypeDecl ¶ added in v0.19.0
type MapTypeDecl struct { TypeTok Token Spec *MapSpec Name *Ident TypePars *FormalPars With *WithSpec }
func (*MapTypeDecl) Children ¶ added in v0.19.0
func (n *MapTypeDecl) Children() []Node
func (*MapTypeDecl) End ¶ added in v0.19.0
func (n *MapTypeDecl) End() int
func (*MapTypeDecl) FirstTok ¶ added in v0.19.0
func (n *MapTypeDecl) FirstTok() Token
func (*MapTypeDecl) Inspect ¶ added in v0.19.0
func (n *MapTypeDecl) Inspect(f func(Node) bool)
func (*MapTypeDecl) LastTok ¶ added in v0.19.0
func (n *MapTypeDecl) LastTok() Token
func (*MapTypeDecl) Pos ¶ added in v0.19.0
func (n *MapTypeDecl) Pos() int
type Mode ¶ added in v0.18.0
type Mode uint
A Mode value is a set of flags (or 0). They control the amount of source code parsed and other optional parser functionality.
type ModifiesExpr ¶ added in v0.18.0
type ModifiesExpr struct { Tok Token // Position of "modifies" X Expr // Base template expression Assign Token // Position of ":=" Y Expr // Modifying expression }
A ModifiesExpr represents a "modifies" expression.
func (*ModifiesExpr) Children ¶ added in v0.18.0
func (n *ModifiesExpr) Children() []Node
func (*ModifiesExpr) End ¶ added in v0.18.0
func (n *ModifiesExpr) End() int
func (*ModifiesExpr) FirstTok ¶ added in v0.18.0
func (n *ModifiesExpr) FirstTok() Token
func (*ModifiesExpr) Inspect ¶ added in v0.18.0
func (n *ModifiesExpr) Inspect(f func(Node) bool)
func (*ModifiesExpr) LastTok ¶ added in v0.18.0
func (n *ModifiesExpr) LastTok() Token
func (*ModifiesExpr) Pos ¶ added in v0.18.0
func (n *ModifiesExpr) Pos() int
type Module ¶
type ModuleParameterGroup ¶ added in v0.18.0
type ModuleParameterGroup struct { Tok Token // Position of "modulepar" LBrace Token // Position of "{" Decls []*ValueDecl // Module parameter list RBrace Token // Position of "}" With *WithSpec }
A ModuleParameterGroup represents a deprecated module parameter list
func (*ModuleParameterGroup) Children ¶ added in v0.18.0
func (n *ModuleParameterGroup) Children() []Node
func (*ModuleParameterGroup) End ¶ added in v0.18.0
func (n *ModuleParameterGroup) End() int
func (*ModuleParameterGroup) FirstTok ¶ added in v0.18.0
func (n *ModuleParameterGroup) FirstTok() Token
func (*ModuleParameterGroup) Inspect ¶ added in v0.18.0
func (n *ModuleParameterGroup) Inspect(f func(Node) bool)
func (*ModuleParameterGroup) LastTok ¶ added in v0.18.0
func (n *ModuleParameterGroup) LastTok() Token
func (*ModuleParameterGroup) Pos ¶ added in v0.18.0
func (n *ModuleParameterGroup) Pos() int
type Node ¶
type Node interface { Pos() int End() int FirstTok() Token LastTok() Token Children() []Node Inspect(func(Node) bool) }
All node types implement the Node interface.
func FindChildOf ¶ added in v0.18.0
FindChildOfType returns the first direct child of the give node, enclosing given position.
type ParamExpr ¶ added in v0.18.0
type ParamExpr struct { X Expr // map or unmap statement Tok Token // Position "param" Y Expr // Additional arguments for map/unmap }
A ParamExpr represents parametrized map and unmap statements.
type ParametrizedIdent ¶ added in v0.18.0
ParametrizedIdent represents a paremetrized identifier, e.g. "f<charstring>".
func (*ParametrizedIdent) Children ¶ added in v0.18.0
func (n *ParametrizedIdent) Children() []Node
func (*ParametrizedIdent) End ¶ added in v0.18.0
func (n *ParametrizedIdent) End() int
func (*ParametrizedIdent) FirstTok ¶ added in v0.18.0
func (n *ParametrizedIdent) FirstTok() Token
func (*ParametrizedIdent) Inspect ¶ added in v0.18.0
func (n *ParametrizedIdent) Inspect(f func(Node) bool)
func (*ParametrizedIdent) LastTok ¶ added in v0.18.0
func (n *ParametrizedIdent) LastTok() Token
func (*ParametrizedIdent) Pos ¶ added in v0.18.0
func (n *ParametrizedIdent) Pos() int
type ParenExpr ¶ added in v0.18.0
type ParenExpr struct { LParen Token // Position of "(", "<", "[" List []Expr // Expression list RParen Token // Position of ")", ">", "]" }
A ParenExpr represents parenthized expression lists.
type ParserOption ¶ added in v0.18.0
type ParserOption func(*parser) error
func WithFilename ¶ added in v0.18.0
func WithFilename(filename string) ParserOption
type PatternExpr ¶ added in v0.18.0
type PatternExpr struct { Tok Token // Position of "pattern" NoCase Token // Position of "@nocase" of nil X Expr // Pattern expression }
A PatternExpr represents a "pattern" expression.
func (*PatternExpr) Children ¶ added in v0.18.0
func (n *PatternExpr) Children() []Node
func (*PatternExpr) End ¶ added in v0.18.0
func (n *PatternExpr) End() int
func (*PatternExpr) FirstTok ¶ added in v0.18.0
func (n *PatternExpr) FirstTok() Token
func (*PatternExpr) Inspect ¶ added in v0.18.0
func (n *PatternExpr) Inspect(f func(Node) bool)
func (*PatternExpr) LastTok ¶ added in v0.18.0
func (n *PatternExpr) LastTok() Token
func (*PatternExpr) Pos ¶ added in v0.18.0
func (n *PatternExpr) Pos() int
type PortAttribute ¶
func (*PortAttribute) Children ¶ added in v0.18.0
func (n *PortAttribute) Children() []Node
func (*PortAttribute) End ¶ added in v0.18.0
func (n *PortAttribute) End() int
func (*PortAttribute) FirstTok ¶ added in v0.18.0
func (n *PortAttribute) FirstTok() Token
func (*PortAttribute) Inspect ¶ added in v0.18.0
func (n *PortAttribute) Inspect(f func(Node) bool)
func (*PortAttribute) LastTok ¶ added in v0.18.0
func (n *PortAttribute) LastTok() Token
func (*PortAttribute) Pos ¶ added in v0.18.0
func (n *PortAttribute) Pos() int
type PortMapAttribute ¶ added in v0.18.0
type PortMapAttribute struct { MapTok Token // MAP, UNMAP ParamTok Token Params *FormalPars }
func (*PortMapAttribute) Children ¶ added in v0.18.0
func (n *PortMapAttribute) Children() []Node
func (*PortMapAttribute) End ¶ added in v0.18.0
func (n *PortMapAttribute) End() int
func (*PortMapAttribute) FirstTok ¶ added in v0.18.0
func (n *PortMapAttribute) FirstTok() Token
func (*PortMapAttribute) Inspect ¶ added in v0.18.0
func (n *PortMapAttribute) Inspect(f func(Node) bool)
func (*PortMapAttribute) LastTok ¶ added in v0.18.0
func (n *PortMapAttribute) LastTok() Token
func (*PortMapAttribute) Pos ¶ added in v0.18.0
func (n *PortMapAttribute) Pos() int
type PortTypeDecl ¶ added in v0.18.0
type PortTypeDecl struct { TypeTok Token PortTok Token Name *Ident TypePars *FormalPars Kind Token // MIXED, MESSAGE, PROCEDURE Realtime Token LBrace Token Attrs []Node RBrace Token With *WithSpec }
func (*PortTypeDecl) Children ¶ added in v0.18.0
func (n *PortTypeDecl) Children() []Node
func (*PortTypeDecl) End ¶ added in v0.18.0
func (n *PortTypeDecl) End() int
func (*PortTypeDecl) FirstTok ¶ added in v0.18.0
func (n *PortTypeDecl) FirstTok() Token
func (*PortTypeDecl) Inspect ¶ added in v0.18.0
func (n *PortTypeDecl) Inspect(f func(Node) bool)
func (*PortTypeDecl) LastTok ¶ added in v0.18.0
func (n *PortTypeDecl) LastTok() Token
func (*PortTypeDecl) Pos ¶ added in v0.18.0
func (n *PortTypeDecl) Pos() int
type Position ¶ added in v0.18.0
type Position struct {
Line, Column int
}
Position is a cursor position in a source file. Lines and columns are 1-based.
func (*Position) After ¶ added in v0.18.0
After returns true if the position is after other given position.
func (*Position) Before ¶ added in v0.18.0
Before returns true if the position is before the other given position.
type RedirectExpr ¶ added in v0.18.0
type RedirectExpr struct { X Expr // Preceding redirected expression Tok Token // Position of "->" ValueTok Token // Position of "value" or nil Value []Expr // Value expression ParamTok Token // Position of "param" or nil Param []Expr // Param expression SenderTok Token // Position of "sender" or nil Sender Expr // Sender expression IndexTok Token // Position of "@index" or nil IndexValueTok Token // Position of "value" or nil Index Expr // Index expression TimestampTok Token // Position of "timestamp" or nil Timestamp Expr // Timestamp expression }
A RedirectExpr represents various redirect expressions
func (*RedirectExpr) Children ¶ added in v0.18.0
func (n *RedirectExpr) Children() []Node
func (*RedirectExpr) End ¶ added in v0.18.0
func (n *RedirectExpr) End() int
func (*RedirectExpr) FirstTok ¶ added in v0.18.0
func (n *RedirectExpr) FirstTok() Token
func (*RedirectExpr) Inspect ¶ added in v0.18.0
func (n *RedirectExpr) Inspect(f func(Node) bool)
func (*RedirectExpr) LastTok ¶ added in v0.18.0
func (n *RedirectExpr) LastTok() Token
func (*RedirectExpr) Pos ¶ added in v0.18.0
func (n *RedirectExpr) Pos() int
type RefSpec ¶ added in v0.18.0
type RefSpec struct {
X Expr
}
A RefSpec represents a type reference.
type RegexpExpr ¶ added in v0.18.0
type RegexpExpr struct { Tok Token // Position of "regexp" NoCase Token // Position of "@nocase" or nil X Expr // Regex expression }
A RegexExpr represents a "regexp" expression.
func (*RegexpExpr) Children ¶ added in v0.18.0
func (n *RegexpExpr) Children() []Node
func (*RegexpExpr) End ¶ added in v0.18.0
func (n *RegexpExpr) End() int
func (*RegexpExpr) FirstTok ¶ added in v0.18.0
func (n *RegexpExpr) FirstTok() Token
func (*RegexpExpr) Inspect ¶ added in v0.18.0
func (n *RegexpExpr) Inspect(f func(Node) bool)
func (*RegexpExpr) LastTok ¶ added in v0.18.0
func (n *RegexpExpr) LastTok() Token
func (*RegexpExpr) Pos ¶ added in v0.18.0
func (n *RegexpExpr) Pos() int
type RestrictionSpec ¶ added in v0.18.0
func (*RestrictionSpec) Children ¶ added in v0.18.0
func (n *RestrictionSpec) Children() []Node
func (*RestrictionSpec) End ¶ added in v0.18.0
func (n *RestrictionSpec) End() int
func (*RestrictionSpec) FirstTok ¶ added in v0.18.0
func (n *RestrictionSpec) FirstTok() Token
func (*RestrictionSpec) Inspect ¶ added in v0.18.0
func (n *RestrictionSpec) Inspect(f func(Node) bool)
func (*RestrictionSpec) LastTok ¶ added in v0.18.0
func (n *RestrictionSpec) LastTok() Token
func (*RestrictionSpec) Pos ¶ added in v0.18.0
func (n *RestrictionSpec) Pos() int
type ReturnSpec ¶ added in v0.18.0
type ReturnSpec struct { Tok Token Restriction *RestrictionSpec Modif Token Type Expr }
func (*ReturnSpec) Children ¶ added in v0.18.0
func (n *ReturnSpec) Children() []Node
func (*ReturnSpec) End ¶ added in v0.18.0
func (n *ReturnSpec) End() int
func (*ReturnSpec) FirstTok ¶ added in v0.18.0
func (n *ReturnSpec) FirstTok() Token
func (*ReturnSpec) Inspect ¶ added in v0.18.0
func (n *ReturnSpec) Inspect(f func(Node) bool)
func (*ReturnSpec) LastTok ¶ added in v0.18.0
func (n *ReturnSpec) LastTok() Token
func (*ReturnSpec) Pos ¶ added in v0.18.0
func (n *ReturnSpec) Pos() int
type ReturnStmt ¶
type ReturnStmt struct { Tok Token // Position of "return" Result Expr // Resulting expression of nil }
A ReturnStmt represents a return statement.
func (*ReturnStmt) Children ¶ added in v0.18.0
func (n *ReturnStmt) Children() []Node
func (*ReturnStmt) End ¶ added in v0.18.0
func (n *ReturnStmt) End() int
func (*ReturnStmt) FirstTok ¶ added in v0.18.0
func (n *ReturnStmt) FirstTok() Token
func (*ReturnStmt) Inspect ¶ added in v0.18.0
func (n *ReturnStmt) Inspect(f func(Node) bool)
func (*ReturnStmt) LastTok ¶ added in v0.18.0
func (n *ReturnStmt) LastTok() Token
func (*ReturnStmt) Pos ¶ added in v0.18.0
func (n *ReturnStmt) Pos() int
type Root ¶
func Parse ¶
func Parse(src []byte, opts ...ParserOption) (root *Root, names map[string]bool, uses map[string]bool)
Parse the source code of a single file and return the corresponding syntax tree. The source code may be provided via the filename of the source file, or via the src parameter.
If src != nil, Parse parses the source from src and the filename is only used when recording position information. The type of the argument for the src parameter must be string, []byte, or io.Reader. If src == nil, Parse parses the file specified by filename.
The mode parameter controls the amount of source text parsed and other optional parser functionality.
If the source couldn't be read, the returned AST is nil and the error indicates the specific failure. If the source was read but syntax errors were found, the result is a partial AST (with Bad* nodes representing the fragments of erroneous source code). Multiple errors are returned via a ErrorList which is sorted by file position.
type RunsOnSpec ¶ added in v0.18.0
func (*RunsOnSpec) Children ¶ added in v0.18.0
func (n *RunsOnSpec) Children() []Node
func (*RunsOnSpec) End ¶ added in v0.18.0
func (n *RunsOnSpec) End() int
func (*RunsOnSpec) FirstTok ¶ added in v0.18.0
func (n *RunsOnSpec) FirstTok() Token
func (*RunsOnSpec) Inspect ¶ added in v0.18.0
func (n *RunsOnSpec) Inspect(f func(Node) bool)
func (*RunsOnSpec) LastTok ¶ added in v0.18.0
func (n *RunsOnSpec) LastTok() Token
func (*RunsOnSpec) Pos ¶ added in v0.18.0
func (n *RunsOnSpec) Pos() int
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner scans a TTCN-3 source.
func NewScanner ¶
NewScanner returns a new TTCN-3 scanner for src.
type SelectStmt ¶
type SelectStmt struct { Tok Token // Position of "select" Union Token // Position of "union" or nil Tag *ParenExpr // Tag expression LBrace Token // Position of "{" Body []*CaseClause // List of case clauses RBrace Token // Position of "}" }
A SelectStmt represents a select statements.
func (*SelectStmt) Children ¶ added in v0.18.0
func (n *SelectStmt) Children() []Node
func (*SelectStmt) End ¶ added in v0.18.0
func (n *SelectStmt) End() int
func (*SelectStmt) FirstTok ¶ added in v0.18.0
func (n *SelectStmt) FirstTok() Token
func (*SelectStmt) Inspect ¶ added in v0.18.0
func (n *SelectStmt) Inspect(f func(Node) bool)
func (*SelectStmt) LastTok ¶ added in v0.18.0
func (n *SelectStmt) LastTok() Token
func (*SelectStmt) Pos ¶ added in v0.18.0
func (n *SelectStmt) Pos() int
type SelectorExpr ¶ added in v0.18.0
type SelectorExpr struct { X Expr // Preceding expression (might be nil) Dot Token // Position of "." Sel Expr // Literal, identifier or reference. }
A SelectorExpr represents an expression followed by a selector.
func (*SelectorExpr) Children ¶ added in v0.18.0
func (n *SelectorExpr) Children() []Node
func (*SelectorExpr) End ¶ added in v0.18.0
func (n *SelectorExpr) End() int
func (*SelectorExpr) FirstTok ¶ added in v0.18.0
func (n *SelectorExpr) FirstTok() Token
func (*SelectorExpr) Inspect ¶ added in v0.18.0
func (n *SelectorExpr) Inspect(f func(Node) bool)
func (*SelectorExpr) LastTok ¶ added in v0.18.0
func (n *SelectorExpr) LastTok() Token
func (*SelectorExpr) Pos ¶ added in v0.18.0
func (n *SelectorExpr) Pos() int
type SignatureDecl ¶ added in v0.18.0
type SignatureDecl struct { Tok Token // Position of "signature" Name *Ident TypePars *FormalPars Params *FormalPars NoBlock Token // Optional "noblock" Return *ReturnSpec // Optional return-spec ExceptionTok Token // Position of "exeception" or nil Exception *ParenExpr // Exception list With *WithSpec }
A SignatureDecl represents a signature type for procedure based communication.
func (*SignatureDecl) Children ¶ added in v0.18.0
func (n *SignatureDecl) Children() []Node
func (*SignatureDecl) End ¶ added in v0.18.0
func (n *SignatureDecl) End() int
func (*SignatureDecl) FirstTok ¶ added in v0.18.0
func (n *SignatureDecl) FirstTok() Token
func (*SignatureDecl) Inspect ¶ added in v0.18.0
func (n *SignatureDecl) Inspect(f func(Node) bool)
func (*SignatureDecl) LastTok ¶ added in v0.18.0
func (n *SignatureDecl) LastTok() Token
func (*SignatureDecl) Pos ¶ added in v0.18.0
func (n *SignatureDecl) Pos() int
type Stmt ¶
type Stmt interface { Node // contains filtered or unexported methods }
All statement nodes implement the Stmt interface.
type StructSpec ¶ added in v0.18.0
type StructSpec struct { Kind Token // RECORD, SET, UNION LBrace Token // Position of "{" Fields []*Field // Member list RBrace Token // Position of "}" }
A StructSpec represents a struct type specification.
func (*StructSpec) Children ¶ added in v0.18.0
func (n *StructSpec) Children() []Node
func (*StructSpec) End ¶ added in v0.18.0
func (n *StructSpec) End() int
func (*StructSpec) FirstTok ¶ added in v0.18.0
func (n *StructSpec) FirstTok() Token
func (*StructSpec) Inspect ¶ added in v0.18.0
func (n *StructSpec) Inspect(f func(Node) bool)
func (*StructSpec) LastTok ¶ added in v0.18.0
func (n *StructSpec) LastTok() Token
func (*StructSpec) Pos ¶ added in v0.18.0
func (n *StructSpec) Pos() int
type StructTypeDecl ¶ added in v0.18.0
type StructTypeDecl struct { TypeTok Token // Position of "type" Kind Token // RECORD, SET, UNION Name *Ident // Name TypePars *FormalPars LBrace Token // Position of "{" Fields []*Field // Member list RBrace Token // Position of }" With *WithSpec }
A StructTypeDecl represents a name struct type.
func (*StructTypeDecl) Children ¶ added in v0.18.0
func (n *StructTypeDecl) Children() []Node
func (*StructTypeDecl) End ¶ added in v0.18.0
func (n *StructTypeDecl) End() int
func (*StructTypeDecl) FirstTok ¶ added in v0.18.0
func (n *StructTypeDecl) FirstTok() Token
func (*StructTypeDecl) Inspect ¶ added in v0.18.0
func (n *StructTypeDecl) Inspect(f func(Node) bool)
func (*StructTypeDecl) LastTok ¶ added in v0.18.0
func (n *StructTypeDecl) LastTok() Token
func (*StructTypeDecl) Pos ¶ added in v0.18.0
func (n *StructTypeDecl) Pos() int
type SubTypeDecl ¶ added in v0.18.0
type SubTypeDecl struct { TypeTok Token // Position of "type" Field *Field // Field spec With *WithSpec }
A SubTypeDecl represents a named sub type declaration
func (*SubTypeDecl) Children ¶ added in v0.18.0
func (n *SubTypeDecl) Children() []Node
func (*SubTypeDecl) End ¶ added in v0.18.0
func (n *SubTypeDecl) End() int
func (*SubTypeDecl) FirstTok ¶ added in v0.18.0
func (n *SubTypeDecl) FirstTok() Token
func (*SubTypeDecl) Inspect ¶ added in v0.18.0
func (n *SubTypeDecl) Inspect(f func(Node) bool)
func (*SubTypeDecl) LastTok ¶ added in v0.18.0
func (n *SubTypeDecl) LastTok() Token
func (*SubTypeDecl) Pos ¶ added in v0.18.0
func (n *SubTypeDecl) Pos() int
type SystemSpec ¶ added in v0.18.0
func (*SystemSpec) Children ¶ added in v0.18.0
func (n *SystemSpec) Children() []Node
func (*SystemSpec) End ¶ added in v0.18.0
func (n *SystemSpec) End() int
func (*SystemSpec) FirstTok ¶ added in v0.18.0
func (n *SystemSpec) FirstTok() Token
func (*SystemSpec) Inspect ¶ added in v0.18.0
func (n *SystemSpec) Inspect(f func(Node) bool)
func (*SystemSpec) LastTok ¶ added in v0.18.0
func (n *SystemSpec) LastTok() Token
func (*SystemSpec) Pos ¶ added in v0.18.0
func (n *SystemSpec) Pos() int
type TemplateDecl ¶ added in v0.18.0
type TemplateDecl struct { *RestrictionSpec Modif Token // "@lazy", "@fuzzy" or nil Type Expr Name *Ident TypePars *FormalPars Params *FormalPars ModifiesTok Token Base Expr AssignTok Token Value Expr With *WithSpec }
func (*TemplateDecl) Children ¶ added in v0.18.0
func (n *TemplateDecl) Children() []Node
func (*TemplateDecl) End ¶ added in v0.18.0
func (n *TemplateDecl) End() int
func (*TemplateDecl) FirstTok ¶ added in v0.18.0
func (n *TemplateDecl) FirstTok() Token
func (*TemplateDecl) Inspect ¶ added in v0.18.0
func (n *TemplateDecl) Inspect(f func(Node) bool)
func (*TemplateDecl) LastTok ¶ added in v0.18.0
func (n *TemplateDecl) LastTok() Token
func (*TemplateDecl) Pos ¶ added in v0.18.0
func (n *TemplateDecl) Pos() int
type TypeSpec ¶ added in v0.18.0
type TypeSpec interface { Node // contains filtered or unexported methods }
All nested types implement TypeSpec interface.
type ValueDecl ¶ added in v0.18.0
type ValueDecl struct { Kind Token // VAR, CONST, TIMER, PORT, TEMPLATE, MODULEPAR TemplateRestriction *RestrictionSpec Modif Token // "@lazy", "@fuzzy" or nil Type Expr Decls []*Declarator With *WithSpec }
A ValueDecl represents a value declaration.
type ValueExpr ¶ added in v0.18.0
type ValueExpr struct { X Expr // Preceding template expression Tok Token // Position of "value" Y Expr // Value expression }
A ValueExpr represents the return value used by signature based communication.
type ValueLiteral ¶ added in v0.18.0
type ValueLiteral struct {
Tok Token
}
A ValueLiteral represents simple literals, like integers, charstrings, ...
func (*ValueLiteral) Children ¶ added in v0.18.0
func (n *ValueLiteral) Children() []Node
func (*ValueLiteral) End ¶ added in v0.18.0
func (n *ValueLiteral) End() int
func (*ValueLiteral) FirstTok ¶ added in v0.18.0
func (n *ValueLiteral) FirstTok() Token
func (*ValueLiteral) Inspect ¶ added in v0.18.0
func (n *ValueLiteral) Inspect(f func(Node) bool)
func (*ValueLiteral) LastTok ¶ added in v0.18.0
func (n *ValueLiteral) LastTok() Token
func (*ValueLiteral) Pos ¶ added in v0.18.0
func (n *ValueLiteral) Pos() int
type WhileStmt ¶
type WhileStmt struct { Tok Token // Position of "while" LParen Token // Position of "(" Cond Expr // Conditional expression RParen Token // Position of ")" Body *BlockStmt // Loop-body }
A WhilStmt represents a "while" statement.