Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions simple_test/fixtures/ast/binary.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
instructions =>
Write:
expression =>
Binary (DIV):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
5 changes: 5 additions & 0 deletions simple_test/fixtures/ast/binary.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROGRAM x;
VAR a,b: INTEGER;
BEGIN
WRITE a DIV b
END x.
26 changes: 26 additions & 0 deletions simple_test/fixtures/ast/binary1.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
instructions =>
Assign:
location =>
Variable:
variable =>
VAR BEGIN
type:
ARRAY BEGIN
type:
INTEGER
length:
5
END ARRAY
END VAR
expression =>
Variable:
variable =>
VAR BEGIN
type:
ARRAY BEGIN
type:
INTEGER
length:
5
END ARRAY
END VAR
5 changes: 5 additions & 0 deletions simple_test/fixtures/ast/binary1.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROGRAM x;
VAR a,b: ARRAY 5 OF INTEGER;
BEGIN
a := b
END x.
6 changes: 6 additions & 0 deletions simple_test/fixtures/ast/binary2.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PROGRAM x;
VAR a: ARRAY 5 OF INTEGER;
VAR b: ARRAY 5 OF INTEGER;
BEGIN
a := b
END x.
18 changes: 18 additions & 0 deletions simple_test/fixtures/ast/div.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
instructions =>
Write:
expression =>
Binary (DIV):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
5 changes: 5 additions & 0 deletions simple_test/fixtures/ast/div.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROGRAM x;
VAR a,b: INTEGER;
BEGIN
WRITE a DIV b
END x.
Empty file.
1 change: 1 addition & 0 deletions simple_test/fixtures/ast/empty.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROGRAM a; END a.
38 changes: 38 additions & 0 deletions simple_test/fixtures/ast/if1.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
instructions =>
If:
condition =>
Condition (=):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
true =>
Write:
expression =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
false =>
Write:
expression =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
42
END CONST
9 changes: 9 additions & 0 deletions simple_test/fixtures/ast/if1.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PROGRAM x;
VAR a,b: INTEGER;
BEGIN
IF a = b THEN
WRITE a
ELSE
WRITE 42
END
END x.
33 changes: 33 additions & 0 deletions simple_test/fixtures/ast/if2.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
instructions =>
If:
condition =>
Condition (=):
left =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
true =>
Write:
expression =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
10
END CONST
6 changes: 6 additions & 0 deletions simple_test/fixtures/ast/if2.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PROGRAM x;
BEGIN
IF 0 = 0 THEN
WRITE 10
END
END x.
3 changes: 3 additions & 0 deletions simple_test/fixtures/ast/modErr.sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PROGRAM peter;
VAR a : ARRAY 10 DIV (1 - 1) OF INTEGER;
END peter.
200 changes: 200 additions & 0 deletions simple_test/fixtures/ast/random.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
instructions =>
Assign:
location =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
expression =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
1
END CONST
If:
condition =>
Condition (=):
left =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
true =>
Repeat:
condition =>
Condition (#):
left =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
instructions =>
Assign:
location =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
expression =>
Binary (-):
left =>
Binary (*):
left =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
16807
END CONST
right =>
Binary (MOD):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
127773
END CONST
right =>
Binary (*):
left =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
2836
END CONST
right =>
Binary (DIV):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
127773
END CONST
If:
condition =>
Condition (>):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
0
END CONST
true =>
Assign:
location =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
expression =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
false =>
Assign:
location =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
expression =>
Binary (+):
left =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
right =>
Number:
value =>
CONST BEGIN
type:
INTEGER
value:
2147483647
END CONST
Write:
expression =>
Variable:
variable =>
VAR BEGIN
type:
INTEGER
END VAR
Loading