Triangle tools from the text book Programming Processors in Java.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Triangle-Tools/programs/nesting.tri

32 lines
404 B

let
var g: Integer;
proc P() ~
let
var p: Integer;
proc Q() ~
let
var q: Integer;
proc R() ~
let
var r: Integer
in
r := (g+p+q) * 1000 ! should cause overflow
in
begin q := g+p; R() end;
proc S() ~
let
var s: Integer
in
begin s := g+p+1; Q() end
in
begin p := g+1; S() end
in
begin g := 1000; P() end