lgen.lua

changeset 2
3975fa5ed630
child 3
b2df1b3f2c83
equal deleted inserted replaced
1:e2face1be50e 2:3975fa5ed630
1
2 module('lgen', package.seeall)
3 -- export src dst hierarchy
4
5 require('scan')
6 require('handlers')
7
8 --
9 -- Main
10 --
11
12 if #arg < 2 then
13 error("Usage: lgen src dst")
14 end
15
16 src = arg[1]
17 dst = arg[2]
18
19 print('Scan...')
20 hierarchy = scan.scan(src)
21
22 -- Pitäisi env konstruoida. polun perusteella.
23 scan.map(hierarchy, function(f) handlers.choose(f, env) end)
24
25 print('Phase 1...')
26 scan.map(hierarchy, function(f) handlers.phase1(f, env) end)
27 print('Phase 2...')
28 scan.map(hierarchy, function(f) handlers.phase2(f, env) end)
29 print('Phase 3...')
30 scan.map(hierarchy, function(f) handlers.phase3(f, env) end)

mercurial