-
Notifications
You must be signed in to change notification settings - Fork 0
/
SchemeFile.g4
33 lines (27 loc) · 984 Bytes
/
SchemeFile.g4
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
grammar SchemeFile;
@header {
import java.util.List;
import java.util.LinkedList;
import java.util.Deque;
import rmk35.partIIProject.SyntaxErrorException;
import rmk35.partIIProject.runtime.RuntimeValue;
import rmk35.partIIProject.runtime.PrimitiveValue;
import rmk35.partIIProject.runtime.BooleanValue;
import rmk35.partIIProject.runtime.numbers.NumberValue;
import rmk35.partIIProject.runtime.CharacterValue;
import rmk35.partIIProject.runtime.StringValue;
import rmk35.partIIProject.runtime.IdentifierValue;
import rmk35.partIIProject.runtime.BytevectorValue;
import rmk35.partIIProject.runtime.ConsValue;
import rmk35.partIIProject.runtime.NullValue;
import rmk35.partIIProject.runtime.VectorValue;
import rmk35.partIIProject.frontend.SourceInfo;
}
import SchemeExternalRepresentation;
file[String filename] returns [List<RuntimeValue> data]
@init {
$data = new LinkedList<>();
}
:
(datum[$filename] { if ($datum.expr != null) $data.add($datum.expr); })* EOF
;