home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / modula2 / alexcoco / cocosemf < prev    next >
Text File  |  1987-07-16  |  1KB  |  45 lines

  1. (*          generated semantic analyzer
  2.             ===========================
  3. This module is produced by COCO from the semantic actions of the
  4. attribute grammar.
  5. ---------------------------------------------------------------------*)
  6. IMPLEMENTATION MODULE -->modulename;
  7. FROM FileIO IMPORT con, WriteCard, WriteString;
  8. FROM SYSTEM IMPORT WORD;
  9. FROM -->parsername IMPORT at;
  10.  
  11. -->declarations
  12.  
  13. PROCEDURE ASSIGN(VAR x:WORD; y:WORD);
  14. BEGIN
  15.   x:=y;
  16.   END ASSIGN;
  17.  
  18. PROCEDURE Semant(sem:CARDINAL);
  19.  
  20. CONST NrSemacts=-->NrSemacts; (*max. number of sem. actions*) (*3.12.,I,Dob*)
  21.    (*This partitioning has to be done, because some compilers
  22.       cannot handle many CASE parts, e.g. Logitech's *)
  23.  
  24. PROCEDURE Part1;
  25. BEGIN
  26.   CASE sem OF
  27.      11: ;
  28. -->actions
  29.  
  30. BEGIN
  31.   IF printactions THEN
  32.     WriteString(con,"$   [");
  33.     WriteCard(con,sem,3);
  34.     WriteString(con,"] ");
  35.     END;
  36.  
  37.   CASE (((sem-10) DIV NrSemacts)+1)  OF
  38.     1: Part1;
  39. -->partlist
  40.     END; (*CASE*)
  41.   END Semant;
  42. BEGIN
  43.   printactions:=FALSE;
  44.   END -->modulename.
  45.