source: liacs/coco/tests/declarations/redeclaration2.p1@ 394

Last change on this file since 394 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 394 bytes
RevLine 
[2]1{ This program is correct wrt the CF grammar. }
2
3program example;
4
5var x, y, x: integer; { x is redeclared within one var statement }
6function gcd(a,b: integer): integer;
7var c: integer;
8var d,e,f: integer;
9var c: integer; { c is redeclared }
10begin
11 if b = 0 then gcd := a
12 else gcd := gcd(b, a mod b)
13end;
14
15begin
16 x := readinteger; y := readinteger;
17 writeinteger(gcd(x, y))
18end.
Note: See TracBrowser for help on using the repository browser.