first usable version
This commit is contained in:
50
IBAF-Tests/IBAF-1/test.aterm
Normal file
50
IBAF-Tests/IBAF-1/test.aterm
Normal file
@@ -0,0 +1,50 @@
|
||||
L-start--L-pgm(
|
||||
L-pgm--R-int-L-idlist-SEMI-L-stmt(
|
||||
L-idlist--L-id-C-COMMA-L-idlist-D-Q(
|
||||
LEX-id("x")
|
||||
, Some(L-COMMA-L-idlist--COMMA-L-idlist(L-idlist--L-id-C-COMMA-L-idlist-D-Q(LEX-id("y"), None())))
|
||||
)
|
||||
, L-stmt--L-stmt-L-stmt(
|
||||
L-stmt--L-id-EQUALS-L-exp-SEMI(
|
||||
LEX-id("x")
|
||||
, L-exp--L-aexp(
|
||||
L-aexp--L-aexp-PERCENT-L-aexp(
|
||||
L-aexp--L-int(L-int--C-DASH-Q-L-decimal-D(L-DASH-Q-L-decimal--DASH-Q-L-decimal(None(), LEX-decimal("10"))))
|
||||
, L-aexp--L-int(L-int--C-DASH-Q-L-decimal-D(L-DASH-Q-L-decimal--DASH-Q-L-decimal(None(), LEX-decimal("3"))))
|
||||
)
|
||||
)
|
||||
)
|
||||
, L-stmt--L-stmt-L-stmt(
|
||||
L-stmt--L-id-EQUALS-L-exp-SEMI(
|
||||
LEX-id("y")
|
||||
, L-exp--L-aexp(
|
||||
L-aexp--L-aexp-PLUS-L-aexp(
|
||||
L-aexp--L-id(LEX-id("x"))
|
||||
, L-aexp--L-int(L-int--C-DASH-Q-L-decimal-D(L-DASH-Q-L-decimal--DASH-Q-L-decimal(None(), LEX-decimal("10"))))
|
||||
)
|
||||
)
|
||||
)
|
||||
, L-stmt--L-stmt-L-stmt(
|
||||
L-stmt--R-print-LPAREN-L-exp-RPAREN-SEMI(
|
||||
amb(
|
||||
[ amb(
|
||||
[L-exp--L-id(LEX-id("x")), L-exp--L-bexp(L-bexp--L-id(LEX-id("x")))]
|
||||
)
|
||||
, L-exp--L-aexp(L-aexp--L-id(LEX-id("x")))
|
||||
]
|
||||
)
|
||||
)
|
||||
, L-stmt--R-print-LPAREN-L-exp-RPAREN-SEMI(
|
||||
amb(
|
||||
[ amb(
|
||||
[L-exp--L-id(LEX-id("y")), L-exp--L-bexp(L-bexp--L-id(LEX-id("y")))]
|
||||
)
|
||||
, L-exp--L-aexp(L-aexp--L-id(LEX-id("y")))
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
64
IBAF-Tests/IBAF-1/test.fct
Normal file
64
IBAF-Tests/IBAF-1/test.fct
Normal file
@@ -0,0 +1,64 @@
|
||||
initialise-binding finalise-failing scope
|
||||
(collateral
|
||||
(bind
|
||||
("x",
|
||||
allocate-initialised-variable
|
||||
(integers,
|
||||
0)),
|
||||
bind
|
||||
("y",
|
||||
allocate-initialised-variable
|
||||
(integers,
|
||||
0))),
|
||||
sequential
|
||||
(assign
|
||||
(bound
|
||||
("x"),
|
||||
decimal-natural
|
||||
("10")),
|
||||
assign
|
||||
(bound
|
||||
("y"),
|
||||
checked int-mod
|
||||
(assigned
|
||||
(bound
|
||||
("x")),
|
||||
int-val [: 0 :])),
|
||||
print
|
||||
(assigned
|
||||
(bound
|
||||
("x"))),
|
||||
print
|
||||
(assigned
|
||||
(bound
|
||||
("y"))),
|
||||
print
|
||||
(is-equal
|
||||
(assigned
|
||||
(bound
|
||||
("x")),
|
||||
decimal-natural
|
||||
("1"))),
|
||||
print
|
||||
(is-equal
|
||||
(assigned
|
||||
(bound
|
||||
("x")),
|
||||
assigned
|
||||
(bound
|
||||
("y")))),
|
||||
print
|
||||
(is-less
|
||||
(assigned
|
||||
(bound
|
||||
("x")),
|
||||
assigned
|
||||
(bound
|
||||
("y")))),
|
||||
print
|
||||
(int-add
|
||||
(assigned
|
||||
(bound
|
||||
("x")),
|
||||
decimal-natural
|
||||
("2")))))
|
||||
13
IBAF-Tests/IBAF-1/test.ibaf
Normal file
13
IBAF-Tests/IBAF-1/test.ibaf
Normal file
@@ -0,0 +1,13 @@
|
||||
int x, y;
|
||||
|
||||
int x = 10;
|
||||
int y = x % 3;
|
||||
|
||||
print(x);
|
||||
print(y);
|
||||
|
||||
print(x == 1);
|
||||
print(x == y);
|
||||
print(x < y);
|
||||
|
||||
print(x + 2);
|
||||
1
IBAF-Tests/IBAF-1/test.pp.ibaf
Normal file
1
IBAF-Tests/IBAF-1/test.pp.ibaf
Normal file
@@ -0,0 +1 @@
|
||||
int x , y ; x = 10 % 3 ; y = x + 10 ; print ( x ) ; print ( y ) ;
|
||||
Reference in New Issue
Block a user