Commit ec2c95c6 authored by Matthias Simon's avatar Matthias Simon
Browse files

Add with and visibility

parent 780ac59f
Loading
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ A variable is a named memory location to store the value of a given type.
**Syntactical Structure**

```ebnf
VarDecl ::= "var" [TypeExpr] Declarator { "," Declarator} [With].
VarDecl ::= [visibility] "var" [TypeExpr] Declarator { "," Declarator} [With].
Declarator ::= name {"[" integer "]"} [":=" Expr].
```

@@ -95,6 +95,14 @@ used in an [expression].
> expression during compile time or even replace the variable with a macro,
> when possible.

A variable declaration may also specify a visibility, if its enclosing scope
permits that. 

> NOTE: Local variables always have [local visibility], while variables in
> class declarations can specify private or protected visibility.

A variable declaration may also specify attributes using a `with`-clause.

**Examples**

 ```ttcn3 example = "static type during lifetime"