| 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 testcse45 ; |
| 18 |
|
| 19 |
|
| 20 |
TYPE |
| 21 |
|
| 22 |
Where = RECORD |
| 23 |
Declared, |
| 24 |
FirstUsed: CARDINAL ; |
| 25 |
END ; |
| 26 |
|
| 27 |
SymUndefined = RECORD |
| 28 |
Name : CARDINAL ; (* Index into name array, name *) |
| 29 |
(* of record. *) |
| 30 |
At : Where ; (* Where was sym declared/used *) |
| 31 |
END ; |
| 32 |
|
| 33 |
|
| 34 |
VAR |
| 35 |
myvar: SymUndefined ; |
| 36 |
|
| 37 |
|
| 38 |
PROCEDURE InitWhereDeclared (VAR at: Where) ; |
| 39 |
BEGIN |
| 40 |
WITH at DO |
| 41 |
Declared := 1 ; |
| 42 |
FirstUsed := 2 |
| 43 |
END |
| 44 |
END InitWhereDeclared ; |
| 45 |
|
| 46 |
|
| 47 |
(* |
| 48 |
MakeUnbounded - makes an unbounded array Symbol. |
| 49 |
No name is required. |
| 50 |
*) |
| 51 |
|
| 52 |
PROCEDURE MakeUnbounded ; |
| 53 |
BEGIN |
| 54 |
WITH myvar DO |
| 55 |
InitWhereDeclared(At) (* Declared here *) |
| 56 |
END |
| 57 |
END MakeUnbounded ; |
| 58 |
|
| 59 |
|
| 60 |
BEGIN |
| 61 |
MakeUnbounded |
| 62 |
END testcse45. |