Parrot Compiler Tools Running Your Programming Language on Parrot #27

Install the astgrammar into HLLCompiler object

Add the astgrammar to the HLLCompiler object:

.sub '__onload' :load :init
    load_bytecode 'PGE.pbc'
    load_bytecode 'Parrot/HLLCompiler.pbc'
    load_bytecode 'PAST-pm.pbc'             # added

    ##  create a new HLLCompiler
    $P0 = new [ 'HLLCompiler' ]
    ##  register it as 'ABC'
    $P0.'language'('ABC')
    ##  set the parsegrammar
    $P0.'parsegrammar'('ABC::Grammar')
    $P0.'astgrammar'('ABC::ASTGrammar')     # added
.end
Copyright © 2007 chromatic and Patrick Michaud