1 (* ==================================================================== *)
2 (* *)
3 (* Main Module for the Gardens Point Component Pascal Compiler. *)
4 (* Copyright (c) John Gough 1999, 2000. *)
5 (* This module was extensively modified from the driver *)
6 (* automatically produced by the M2 version of COCO/R, using *)
7 (* the CPascal.atg grammar used for the JVM version of GPCP. *)
8 (* *)
9 (* ==================================================================== *)
12 (* This is an example of a rudimentary main module for use with COCO/R.
13 The auxiliary modules <Grammar>S (scanner) and <Grammar>P (parser)
14 are assumed to have been constructed with COCO/R compiler generator. *)
16 IMPORT
17 GPCPcopyright,
18 Symbols,
19 RTS,
20 FileNames,
21 IdDesc,
22 Error,
23 Console,
24 ProgArgs,
26 CPascalP,
28 CPascalErrors,
31 NameHash,
32 Visitor,
33 Builtin,
34 GPText,
35 Target,
39 (* ==================================================================== *)
40 (* Option Setting *)
41 (* ==================================================================== *)
44 BEGIN
48 (* -------------------------- *)
51 BEGIN
55 (* -------------------------- *)
58 BEGIN
62 (* -------------------------- *)
65 BEGIN
69 (* ==================================================================== *)
70 (* Calling the Compiler *)
71 (* ==================================================================== *)
76 BEGIN
84 ELSE
97 (* ==================================================================== *)
102 BEGIN
113 ELSE
121 (* ==================================================================== *)
124 BEGIN
131 ELSE
157 ELSE
164 ELSE
177 FixListing;
178 Finalize;
185 (*
186 * If an exception is raised during listing, FixListing will
187 * be called twice. Avoid an attempted sharing violation...
188 *)
193 ELSE
194 FixListing;
196 Finalize;
199 (* ==================================================================== *)
200 (* Main Argument Loop *)
201 (* ==================================================================== *)
203 BEGIN
209 (* ==================================================================== *)