-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.js
33 lines (27 loc) · 864 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var assert = require("assert");
var util = require("util");
var cr = require("./cr.js");
var cg = require("./codegen.js");
function dump(xx) {
console.log(util.inspect(xx,{colors:true,depth:10000}));
}
function example() {
let output = cr(`
var i = {0,+,10}
output [ i*i*7 + i + 17771 ]
`);
console.log("-----------Chain of Recurrences---------------");
for(const x of output) {
console.log(x.toString());
}
console.log("----------------------------------------------");
console.log("-----------Code Generation -------------------");
let cgo = cg(output);
for(const x of cgo) {
console.log("----------------------------------------------");
console.log(x);
console.log("----------------------------------------------");
}
console.log("----------------------------------------------");
}
example();