/
kea.pir
68 lines (44 loc) · 1.18 KB
/
kea.pir
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
=head1 TITLE
kea.pir - A kea compiler.
=head2 Description
This is the base file for the kea compiler.
This file includes the parsing and grammar rules from
the src/ directory, loads the relevant PGE libraries,
and registers the compiler under the name 'kea'.
=head2 Functions
=over 4
=item onload()
Creates the kea compiler using a C<PCT::HLLCompiler>
object.
=cut
.namespace [ 'kea::Compiler' ]
#.loadlib 'kea_group'
.sub 'onload' :anon :load :init
load_bytecode 'PCT.pbc'
$P0 = get_hll_global ['PCT'], 'HLLCompiler'
$P1 = $P0.'new'()
$P1.'language'('kea')
$P1.'parsegrammar'('kea::Grammar')
$P1.'parseactions'('kea::Grammar::Actions')
$P1.'commandline_banner'("Kea - Factor on Parrot Virtual Machine\n")
$P1.'commandline_prompt'('> ')
.end
=item main(args :slurpy) :main
Start compilation by passing any command line C<args>
to the kea compiler.
=cut
.sub 'main' :main
.param pmc args
$P0 = compreg 'kea'
$P1 = $P0.'command_line'(args)
.end
.include 'src/builtins.pir'
.include 'src/gen_grammar.pir'
.include 'src/gen_actions.pir'
=back
=cut
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: