|
Language.VDM_SL.Syntax | Portability | portable
| Stability | experimental | Maintainer | joost.visser@di.uminho.pt |
|
|
|
|
|
Description |
This module defines the Abstract Syntax Tree (AST) for the
VDM-SL language, accondingly with the ISO standard. Since the ISO standard
differs in some points from the IFAD implementation of VDM, some of the
features supported by the VDM-Tools might not have been implemented.
This AST was manually derived from the concrete BNF grammar. The concrete
grammar is based on the work of Richard Atterer (atterer@in.tum.de,
http://www.in.tum.de/~atterer/) in a dissertation submitted at
The Queen's University of Belfast: Automatic Test Data Generation From
VDM-SL Specifications. This can be found in the author's web site.
|
|
Synopsis |
|
|
|
|
Primitive Datatypes
|
|
type Type_variable_identifier = String |
|
type Lit_char = String |
|
type Lit_string = String |
|
type Lit_quote = String |
|
type Lit_num = Double |
|
type Numeral = Int |
|
Document Datatype
|
|
data Document |
A VDM-SL Document is a list of Definitions Blocks.
| Constructors | | Instances | |
|
|
Definition Blocks
|
|
data Definition_block |
These are the main blocks in a VDM-SL document:
| Constructors | | Instances | |
|
|
Datatype Definition
|
|
data Type_definition_list |
In VDM-SL the types are declared in type sections. Thus, there can be
a list of type defintions.
| Constructors | | Instances | |
|
|
data Type_definition |
There are four ways of defining a type:
| Constructors | | Instances | |
|
|
data Type_list |
|
|
data Type |
The types that VDM-SL allows are:
| Constructors | BRACK_TYPE Type | The enclosed (...) datatype.
| BOOL | Booleans
| NAT | Natural numbers with 0
| NAT1 | Natural numbers without 0
| INT | Integer numbers
| RAT | Rational numbers
| REAL | Real numbers
| CHAR | Characters
| TOKEN | Tokens
| QUOTE_TYPE Lit_quote | Quote type (corresponds to enumerated types)
| COMPOSE Name Field_list | Compostie types (records)
| UNION_TYPE Type Type | Unions of types
| PROD_TYPE Type Type | Products of types (tuples)
| OPT_TYPE Type | Optional type ([A] means 1 + A)
| SET_OF Type | Sets of elements of a type
| SEQ0_OF Type | Sequences of elements of a type
| SEQ1_OF Type | Non-empty sequences of elements of a type
| MAP_TYPE Type Type | Maps (finite functions) from a type to another
| INMAP_TYPE Type Type | Injective maps from a type to another
| FUNC_TYPE Function_type | Functions
| TYPE_VAR Type_variable_identifier | A type variable
| NAME_TYPE Name | An user defined type
| NIL_TYPE | |
| Instances | |
|
|
data Function_type |
|
|
data Discretionary_type |
|
|
data Field_list |
|
|
data Field |
|
|
data State_definition |
|
|
data Invariant |
|
|
data Initialization |
|
|
Values Definition
|
|
data Value_definition_list |
|
|
data Value_definition |
|
|
Function Definition
|
|
data Function_definition_list |
|
|
data Function_definition |
|
|
data Explicit_function_definition |
|
|
data Implicit_function_definition |
|
|
data Type_variable_list |
|
|
data Parameter_type_list |
|
|
data Pattern_type_pair_list |
|
|
data Parameters_list |
|
|
data Brack_maybe_pattern_list |
|
|
data Maybe_precondition |
|
|
Operation Definition
|
|
data Operation_definition_list |
|
|
data Operation_definition |
|
|
data Explicit_operation_definition |
|
|
data Implicit_operation_definition |
|
|
data Maybe_externals |
|
|
data External_list |
|
|
data Var_information |
|
|
data Exception_list |
|
|
Expressions
|
|
data Expression_list |
|
|
data Expression |
|
|
data Symbolic_literal |
|
|
data Patternbind_expr_list |
|
|
data Local_definition_list |
|
|
data If_expression |
|
|
data Elseif_expression |
|
|
data Cases_alternative_list |
|
|
data Name_list |
|
|
data Name |
Constructors | IDENTIFIER String | | MK_ID String | | IS_ID String | |
| Instances | |
|
|
data Map_enumeration_list |
|
|
data Record_modification_list |
|
|
data State_designator |
|
|
Statements
|
|
data Statement_list |
|
|
data Statement |
|
|
data Call_statement |
|
|
data Equals_definition_list |
|
|
data Maybe_dcl_statement_list |
|
|
Patterns
|
|
data Pattern_list |
|
|
data Pattern |
|
|
data Pattern2 |
|
|
data Pattern_bind |
|
|
data Bind |
|
|
data Bind_list |
|
|
data Multiple_set_bind |
|
|
data Multiple_type_bind |
|
|
data Type_bind_list |
|
|
data Local_definition |
|
|
Produced by Haddock version 0.6 |