tagged release 0.6.4
[parrot.git] / languages / lolcode / lolcode.pir
blobc168867629ace238d674fc4f049b6f1725ffc7e2
1 =head1 TITLE
3 lolcode.pir - A lolcode compiler.
5 =head2 Description
7 This is the base file for the lolcode compiler.
9 This file includes the parsing and grammar rules from
10 the src/ directory, loads the relevant PGE libraries,
11 and registers the compiler under the name 'lolcode'.
13 =head2 Functions
15 =over 4
17 =item onload()
19 Creates the lolcode compiler using a C<PCT::HLLCompiler>
20 object.
22 =cut
24 .namespace [ 'lolcode::Compiler' ]
26 .loadlib 'lolcode_group'
28 .sub 'onload' :anon :load :init
29     load_bytecode 'PCT.pbc'
31     $P0 = new 'ResizablePMCArray'
32     set_hll_global ['lolcode';'Grammar';'Actions'], '@?BLOCK', $P0
34     $P0 = new 'PAST::Stmts'
35     set_hll_global ['lolcode';'Grammar';'Actions'], '$?BLOCK_SIGNATURE', $P0
37     $P0 = get_hll_global ['PCT'], 'HLLCompiler'
38     $P1 = $P0.'new'()
39     $P1.'language'('lolcode')
40     $P1.'parsegrammar'('lolcode::Grammar')
41     $P1.'parseactions'('lolcode::Grammar::Actions')
42 .end
44 =item main(args :slurpy)  :main
46 Start compilation by passing any command line C<args>
47 to the lolcode compiler.
49 =cut
51 .sub 'main' :main
52     .param pmc args
54     $P0 = compreg 'lolcode'
55     $P1 = $P0.'command_line'(args)
56 .end
59 .include 'src/gen_builtins.pir'
60 .include 'src/gen_grammar.pir'
61 .include 'src/parser/yarn_literal.pir'
62 .include 'src/gen_actions.pir'
64 =back
66 =cut
68 # Local Variables:
69 #   mode: pir
70 #   fill-column: 100
71 # End:
72 # vim: expandtab shiftwidth=4 ft=pir: