home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1987-07-16 | 1.0 KB | 45 lines |
- (* generated semantic analyzer
- ===========================
- This module is produced by COCO from the semantic actions of the
- attribute grammar.
- ---------------------------------------------------------------------*)
- IMPLEMENTATION MODULE -->modulename;
- FROM FileIO IMPORT con, WriteCard, WriteString;
- FROM SYSTEM IMPORT WORD;
- FROM -->parsername IMPORT at;
-
- -->declarations
-
- PROCEDURE ASSIGN(VAR x:WORD; y:WORD);
- BEGIN
- x:=y;
- END ASSIGN;
-
- PROCEDURE Semant(sem:CARDINAL);
-
- CONST NrSemacts=-->NrSemacts; (*max. number of sem. actions*) (*3.12.,I,Dob*)
- (*This partitioning has to be done, because some compilers
- cannot handle many CASE parts, e.g. Logitech's *)
-
- PROCEDURE Part1;
- BEGIN
- CASE sem OF
- 11: ;
- -->actions
-
- BEGIN
- IF printactions THEN
- WriteString(con,"$ [");
- WriteCard(con,sem,3);
- WriteString(con,"] ");
- END;
-
- CASE (((sem-10) DIV NrSemacts)+1) OF
- 1: Part1;
- -->partlist
- END; (*CASE*)
- END Semant;
- BEGIN
- printactions:=FALSE;
- END -->modulename.