-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathml2-grammar.txt
48 lines (36 loc) · 2.08 KB
/
ml2-grammar.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/********* ML2 Simplified Grammar ************/
This file contains the simplified version of ML2's grammar.
The syntax of this file is not formal but intends to resemble BNF like rules.
The list of symbols and their semantics is the following:
Pipe Option selection rules
Asterisk Repetition rule
Question Mark Optional rule
Capital Letters Terminal (omitted) rule
/********************************************/
Entity := Class | Individual ;
Class := (FirstOrderClass | HighOrderClass | OrderlessClass | DataType) ({ (Feature | FeatureAssignment)* })?
FirstOrderClass := class NAME MLTRelations*
HighOrderClass := order NUMBER class NAME MLTRelations* ;
OrderlessClass := orderless class NAME MLTRelations* ;
Individual := individual NAME Instantiation ({ (Feature | FeatureAssignment)* })?
DataType := datatype NAME MLTRelations* ({ (Feature | FeatureAssignment)* })? ;
MLTRelations := Instantiation | Specialization | Subordination | Categorization | Powertyping
Instantiation := : Class (, Class)*
Specialization := specializes Class (, Class)*
Subordination := subordinatedTo Class (, Class)*
Categorization := CategorizationType Class
Powertyping := isPowertypeOf Class
CategorizationType := categorizes | completeCategorizes | disjointCategorizes | partitions
Feature := Reference | Attribute | RegularityReference | RegularityAttribute
Reference := ref NAME : Multiplicity? Class Subsets? IsOpposite?
Multiplicity := [ CARDINALITY .. CARDINALITY ]
Subsets := subsets Feature (, Feature)*
IsOpposite := isOppositeTo Feature
Attribute := att NAME : Multiplicity? Datatype Subsets?
FeatureAssignment := ReferenceAssignment | AttributeAssignment
ReferenceAssignment := ref Feature = Entity | { Entity (, Entity)* }
AttributeAssignment := att Feature = Value | { Value (,Value)* }
Value := STRING | NUMBER | BOOLEAN | Entity
RegularityReference := regularity Reference RegularityType? Feature
RegularityAttribute := regularity Attribute RegularityType? Feature
RegularityType := determinesValue | determinesMinValue | determinesMaxValue | determinesAllowedValues | determinesType | determinesAllowedTypes