Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 67 lines (42 sloc) 1.16 kB
5bb360e @tewk Cardinal restart
tewk authored
1 =head1 TITLE
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
2
5bb360e @tewk Cardinal restart
tewk authored
3 cardinal.pir - A cardinal compiler.
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
4
5bb360e @tewk Cardinal restart
tewk authored
5 =head2 Description
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
6
5bb360e @tewk Cardinal restart
tewk authored
7 This is the base file for the cardinal compiler.
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
8
5bb360e @tewk Cardinal restart
tewk authored
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 'cardinal'.
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
12
5bb360e @tewk Cardinal restart
tewk authored
13 =head2 Functions
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
14
5bb360e @tewk Cardinal restart
tewk authored
15 =over 4
06b8a84 @tewk [Cardinal] refactor to follow Perl6 AST/OST example
tewk authored
16
5bb360e @tewk Cardinal restart
tewk authored
17 =item onload()
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
18
5bb360e @tewk Cardinal restart
tewk authored
19 Creates the cardinal compiler using a C<PCT::HLLCompiler>
20 object.
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
21
5bb360e @tewk Cardinal restart
tewk authored
22 =cut
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
23
5bb360e @tewk Cardinal restart
tewk authored
24 .namespace [ 'cardinal::Compiler' ]
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
25
5bb360e @tewk Cardinal restart
tewk authored
26 .loadlib 'cardinal_group'
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
27
5bb360e @tewk Cardinal restart
tewk authored
28 .sub 'onload' :anon :load :init
29 load_bytecode 'PCT.pbc'
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
30
5bb360e @tewk Cardinal restart
tewk authored
31 $P0 = get_hll_global ['PCT'], 'HLLCompiler'
32 $P1 = $P0.'new'()
33 $P1.'language'('cardinal')
34 $P1.'parsegrammar'('cardinal::Grammar')
35 $P1.'parseactions'('cardinal::Grammar::Actions')
362250e @tewk [Cardinal] Closer to support for classes, blocking on .HLL bug
tewk authored
36 .end
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
37
5bb360e @tewk Cardinal restart
tewk authored
38 =item main(args :slurpy) :main
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
39
5bb360e @tewk Cardinal restart
tewk authored
40 Start compilation by passing any command line C<args>
41 to the cardinal compiler.
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
42
5bb360e @tewk Cardinal restart
tewk authored
43 =cut
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
44
5bb360e @tewk Cardinal restart
tewk authored
45 .sub 'main' :main
46 .param pmc args
4cfaaf2 @tewk Cleanup and refactor for class support
tewk authored
47
5bb360e @tewk Cardinal restart
tewk authored
48 $P0 = compreg 'cardinal'
49 $P1 = $P0.'command_line'(args)
4cfaaf2 @tewk Cleanup and refactor for class support
tewk authored
50 .end
51
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
52
5bb360e @tewk Cardinal restart
tewk authored
53 .include 'src/gen_builtins.pir'
54 .include 'src/gen_grammar.pir'
55 .include 'src/gen_actions.pir'
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
56
5bb360e @tewk Cardinal restart
tewk authored
57 =back
272b0b9 @tewk languages/cardinal Initial checkin
tewk authored
58
59 =cut
9af6817 @paultcochrane [cardinal] Added emacs/vim coda as per coding standards
paultcochrane authored
60
61 # Local Variables:
62 # mode: pir
63 # fill-column: 100
64 # End:
65 # vim: expandtab shiftwidth=4:
5bb360e @tewk Cardinal restart
tewk authored
66
Something went wrong with that request. Please try again.