Skip to content

Commit 0e25209

Browse files
authored
Updated MathOCL for dates
1 parent 04c8864 commit 0e25209

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

MathApp.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,12 @@ public void actionPerformed(ActionEvent e)
12281228
String arg1 = CGRule.correctNewlines(entcode);
12291229
System.out.println(arg1);
12301230

1231+
File datelib = new File("libraries/ocldate.km3");
1232+
if (datelib.exists())
1233+
{ loadKM3FromFile(datelib); }
1234+
else
1235+
{ System.err.println("! Warning: no file libraries/ocldate.km3"); }
1236+
12311237
File mathlib = new File("libraries/mathlib.km3");
12321238
if (mathlib.exists())
12331239
{ loadKM3FromFile(mathlib); }

MathOCL.g4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ formula
3232
: 'Define' basicExpression '=' (instruction | expression)
3333
| 'Define' basicExpression '~' expression
3434
| 'Define' basicExpression
35+
| 'Define' basicExpression ':' type
36+
| 'Define' basicExpression ':' type '=' expression
3537
;
3638

3739
instruction
@@ -110,7 +112,7 @@ type
110112
| 'Bag' '(' type ')'
111113
| 'OrderedSet' '(' type ')'
112114
| 'Map' '(' type ',' type ')'
113-
| 'Function' '(' type ',' type ')'
115+
| 'Function' '(' type ',' type ')'
114116
| NATURAL
115117
| INTEGER
116118
| REAL

0 commit comments

Comments
 (0)