Debian Codegraph @

gcc/testsuite/gm2/pim/pass/smallset4.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
18 MODULE smallset4 ;
19
20
21 FROM libc IMPORT exit ;
22
23 TYPE
24 tokens = (eoftok, plustok, minustok, timestok, dividetok, becomestok, ambersandtok, periodtok, commatok, semicolontok, lparatok, rparatok, lsbratok, rsbratok, lcbratok, rcbratok, uparrowtok, singlequotetok, equaltok, hashtok, lesstok, greatertok, lessgreatertok, lessequaltok, greaterequaltok, periodperiodtok, colontok, doublequotestok, bartok, andtok, arraytok, begintok, bytok, casetok, consttok, definitiontok, divtok, dotok, elsetok, elsiftok, endtok, exittok, exporttok, fortok, fromtok, iftok, implementationtok, importtok, intok, looptok, modtok, moduletok, nottok, oftok, ortok, pointertok, proceduretok, qualifiedtok, unqualifiedtok, recordtok, repeattok, returntok, settok, thentok, totok, typetok, untiltok, vartok, whiletok, withtok, asmtok, volatiletok, periodperiodperiodtok, datetok, linetok, filetok, integertok, identtok, realtok, stringtok) ;
25
26 SetOfStop0 = SET OF [eoftok..begintok] ;
27 SetOfStop1 = SET OF [bytok..thentok] ;
28 SetOfStop2 = SET OF [totok..stringtok] ;
29
30 VAR
31 s0: SetOfStop0 ;
32 s1: SetOfStop1 ;
33 s2: SetOfStop2 ;
34 i : tokens ;
35 BEGIN
36 s0 := SetOfStop0{} ;
37 s1 := SetOfStop1{} ;
38 s2 := SetOfStop2{} ;
39 INCL(s0, plustok) ;
40 IF NOT (plustok IN s0)
41 THEN
42 exit(1)
43 END ;
44 INCL(s1, casetok) ;
45 IF NOT (casetok IN s1)
46 THEN
47 exit(1)
48 END ;
49 INCL(s2, realtok) ;
50 IF NOT (realtok IN s2)
51 THEN
52 exit(1)
53 END ;
54 EXCL(s0, plustok) ;
55 IF s0#SetOfStop0{}
56 THEN
57 exit(2)
58 END ;
59 EXCL(s1, casetok) ;
60 IF s1#SetOfStop1{}
61 THEN
62 exit(2)
63 END ;
64 EXCL(s2, realtok) ;
65 IF s2#SetOfStop2{}
66 THEN
67 exit(2)
68 END ;
69 FOR i := MIN(SetOfStop0) TO MAX(SetOfStop0) DO
70 INCL(s0, i) ;
71 IF i IN s0
72 THEN
73 EXCL(s0, i) ;
74 IF i IN s0
75 THEN
76 exit(3)
77 END
78 END
79 END ;
80 FOR i := MIN(SetOfStop1) TO MAX(SetOfStop1) DO
81 INCL(s1, i) ;
82 IF i IN s1
83 THEN
84 EXCL(s1, i) ;
85 IF i IN s1
86 THEN
87 exit(3)
88 END
89 END
90 END ;
91 FOR i := MIN(SetOfStop2) TO MAX(SetOfStop2) DO
92 INCL(s2, i) ;
93 IF i IN s2
94 THEN
95 EXCL(s2, i) ;
96 IF i IN s2
97 THEN
98 exit(3)
99 END
100 END
101 END
102 END smallset4.