Debian Codegraph @

gcc/testsuite/gm2/pim/pass/foo.mod

raw
1 (* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. *)
2 (* This file is part of GNU Modula-2.
3
4 GNU Modula-2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with gm2; see the file COPYING. If not, write to the Free Software
16 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *)
17 MODULE foo ;
18
19
20 TYPE
21 proc = PROCEDURE (CHAR) ;
22
23 rec = RECORD
24 a, b: CARDINAL ;
25 END ;
26
27 colours = (red, blue, yellow) ;
28
29 varrec= RECORD
30 CASE type:colours OF
31
32 red : x: CARDINAL |
33 blue: y: CHAR
34
35 ELSE
36 END
37 END ;
38
39 VAR
40 myp : POINTER TO rec ;
41 this: rec ;
42 that: RECORD
43 c, d: CARDINAL ;
44 e : rec ;
45 END ;
46
47 other: varrec ;
48
49 inline: RECORD
50 CASE type:colours OF
51
52 red : x: CARDINAL |
53 blue: y: CHAR
54
55 ELSE
56 END
57 END ;
58 array: ARRAY [1..10] OF CHAR ;
59 large: ARRAY [1..100], [1..200] OF rec ;
60 it : proc ;
61 another,
62 card : CARDINAL ;
63
64 (*
65 TYPE
66
67 sub = [1..10] ;
68 bar = CARDINAL ;
69 VAR
70 z : bar ;
71 *)
72 i, j, k: INTEGER ;
73 (*
74 c : colours ;
75 b : BOOLEAN ;
76 *)
77
78 (* *)
79 PROCEDURE dummy (q: CARDINAL) ;
80 VAR
81 t: CARDINAL ;
82 a: CHAR ;
83 BEGIN
84 t := 123 ;
85 (* another := *) dummy(t) ;
86 (* RETURN( t ) *)
87 END dummy ;
88
89
90 BEGIN
91 card := 12 ;
92 (* myproc('a', card) ; *)
93 (* *)
94 (* another := *) dummy(card);
95 i := 100
96 (* i := j+k *)
97 END foo.