Parrot Compiler Tools Parrot Compiler Tools #13

Install parse grammar in HLLCompiler object

# file 'abc.pir'
.namespace [ 'ABC' ]

.sub '__onload' :load :init
    load_bytecode 'PGE.pbc'
    load_bytecode 'Parrot/HLLCompiler.pbc'

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