Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
struct f1 end; /* Felddefinition */ | ||
|
||
method foo ( p1 p2 ) /* Methodendefinition, Parameterdefinition */ | ||
|
||
p1 := 1; /* Zuweisung */ | ||
|
||
var v1 := 1; /* Variablendefinition */ | ||
|
||
1; /* Ausdrucksanweisung */ | ||
not 1; /* Dito */ | ||
|
||
if p1 < p2 then /* If-Anweisung ohne Else-Zweig */ | ||
v1 := 2; | ||
end; | ||
|
||
if p1 < p2 then /* If-Anweisung mit Else-Zweig */ | ||
var v2 := 2; | ||
else | ||
v1 := p1; | ||
end; | ||
|
||
while (((((1 or 1 or 1 or 1 or 1 or 1))))) do (((((1))))).f1; end; /* While-Anweisung, lesender Feldzugriff */ | ||
|
||
var v2 := 5; /* Hier wieder erlaubt, war nur in if reserviert */ | ||
v2 := v1; /* lesender/schreibender Variablen/Feldzugriff */ | ||
f1 := f1; /* Dito */ | ||
|
||
v2(-500, 500, ); /* What a call */ | ||
v2(-500, 500, ).f1(-500,500); /* What another call */ | ||
|
||
return p1; /* Parameter sind in der ganzen Methode sichtbar */ | ||
end; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
method foo ( ) | ||
if 1 then | ||
var v1 := 1; | ||
else | ||
v1 := 2; | ||
end; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
method foo ( p1 ) | ||
var p1 := 1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
method foo ( ) | ||
if 1 then | ||
var v1 := 1; | ||
end; | ||
|
||
return v1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
method foo ( ) | ||
v1 := 1; | ||
var v1 := 1; | ||
return v1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
struct f1 end; | ||
|
||
method foo () | ||
var f1 := 1; | ||
end; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
struct f1 end; | ||
|
||
method foo ( ) | ||
|
||
var v1 := 1; | ||
|
||
/* Bei einem Variablen/Feldzugriff muss eine Variable oder ein Feld mit dem Namen sichtbar sein */ | ||
f1 := f1; | ||
v1 := v1; | ||
|
||
/* Bei einem Feldzugriff muss ein Feld mit dem Namen sichtbar sein */ | ||
this.f1 := this.f1; | ||
this.v1 := this.v1; | ||
|
||
return v1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
struct f1 end; /* Felddefinition */ | ||
|
||
method foo ( p1 p2 ) /* Methodendefinition, Parameterdefinition */ | ||
|
||
p1 := 1; /* Zuweisung */ | ||
|
||
var v1 := 1; /* Variablendefinition */ | ||
|
||
1; /* Ausdrucksanweisung */ | ||
not 1; /* Dito */ | ||
|
||
if p1 < p2 then /* If-Anweisung ohne Else-Zweig */ | ||
v1 := 2; | ||
end; | ||
|
||
if p1 < p2 then /* If-Anweisung mit Else-Zweig */ | ||
var v2 := 2; | ||
else | ||
v1 := p1; | ||
end; | ||
|
||
while (((((1 or 1 or 1 or 1 or 1 or 1))))) do (((((1))))).f1; end; /* While-Anweisung, lesender Feldzugriff */ | ||
|
||
var v2 := 5; /* Hier wieder erlaubt, war nur in if reserviert */ | ||
v2 := v1; /* lesender/schreibender Variablen/Feldzugriff */ | ||
f1 := f1; /* Dito */ | ||
|
||
v2(-500, 500, ); /* What a call */ | ||
v2(-500, 500, ).f1(-500,500); /* What another call */ | ||
|
||
return p1; /* Parameter sind in der ganzen Methode sichtbar */ | ||
end; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
method foo ( ) | ||
if 1 then | ||
var v1 := 1; | ||
else | ||
v1 := 2; | ||
end; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
method foo ( p1 ) | ||
var p1 := 1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
method foo ( ) | ||
if 1 then | ||
var v1 := 1; | ||
end; | ||
|
||
return v1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
method foo ( ) | ||
v1 := 1; | ||
var v1 := 1; | ||
return v1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
struct f1 end; | ||
|
||
method foo () | ||
var f1 := 1; | ||
end; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
struct f1 end; | ||
|
||
method foo ( ) | ||
|
||
var v1 := 1; | ||
|
||
/* Bei einem Variablen/Feldzugriff muss eine Variable oder ein Feld mit dem Namen sichtbar sein */ | ||
f1 := f1; | ||
v1 := v1; | ||
|
||
/* Bei einem Feldzugriff muss ein Feld mit dem Namen sichtbar sein */ | ||
this.f1 := this.f1; | ||
this.v1 := this.v1; | ||
|
||
return v1; | ||
end; |