LabComm.ast 563 Bytes
Newer Older
Anders Nilsson's avatar
Anders Nilsson committed
1
2
3
4
5
6
7
8
9
10
Program ::= Decl*;

abstract Decl ::= Type <Name:String>;
TypeDecl : Decl;
SampleDecl : Decl;

Field ::= Type <Name:String>;

abstract Type;
VoidType          : Type;
11
SampleRefType     : Type;
Anders Nilsson's avatar
Anders Nilsson committed
12
13
14
15
PrimType          : Type ::= <Name:String> <Token:int>;
UserType          : Type ::= <Name:String>;
StructType        : Type ::= Field*;
ParseArrayType    : Type ::= Type Dim*;
16
abstract ArrayType :Type ::= Type Exp*;
Anders Nilsson's avatar
Anders Nilsson committed
17
18
19
20
21
22
23
24
VariableArrayType : ArrayType;
FixedArrayType    : ArrayType;

Dim ::= Exp*;

abstract Exp;
IntegerLiteral : Exp ::= <Value:String>;
VariableSize : Exp;