m2data.in 755 Bytes
Newer Older
dcw's avatar
dcw committed
1
2
3
EXPORT {
TYPE
	string	= ARRAY [ 0..200 ] OF CHAR;
4
5
6
7
8
@@
PROCEDURE AppendIntList( a, b : IntList ) : IntList;
}

GLOBAL {
dcw's avatar
dcw committed
9
FROM BIO IMPORT PutLn;
10
11
12
13
14
15

@@
PROCEDURE AppendIntList( a, b : IntList ) : IntList;

BEGIN
END AppendIntList;
dcw's avatar
dcw committed
16
17
}

dcw's avatar
dcw committed
18
19
20
21
BEGIN {
	PutLn( "initialization of m2data complete!" );
}

dcw's avatar
dcw committed
22
TYPE {
dcw's avatar
dcw committed
23
24
25
26
27
28
First = A | B | C | D | E;
Second = A( int aa );
Third = A | B;
Fourth = A | B | C( int cc ) | D | E;
Fifth = A | B | C( int cc ) | D( string dd ) | E;
Sixth = A( int aa ) | B | C | D | E;
dcw's avatar
dcw committed
29

dcw's avatar
dcw committed
30
31
IntList = Nil "nil" | Cons( int first, IntList next ) 1 " , " 2;
ILList  = Nil "nil" | Cons( IntList first, ILList next ) "[ " 1 " ] , " 2;
dcw's avatar
dcw committed
32
33
IdTree  = Leaf( string id, IntList l ) "leaf( '" 1 "', [ " 2 " ] )"
	| Node( IdTree left, IdTree right ) "node( " 1 " , " 2 " )";
dcw's avatar
dcw committed
34
}