Ignore:
Timestamp:
Apr 29, 2011, 5:27:18 PM (8 years ago)
Author:
cameron
Message:

Add -l option: -l @pfx_ uses template variables @pfx_block_stmts ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/compiler2.py

    r937 r1178  
    1717        self.output_file = output_file
    1818
    19     def output(self, globaldecl, localdecl, stream_stmts, block_stmts, final_block_stmts, any_carry_expr, template_string):
    20         template_string = string.replace(template_string, '@global', globaldecl)
    21         template_string = string.replace(template_string, '@decl', localdecl)
    22         template_string = string.replace(template_string, '@stream_stmts', stream_stmts)
    23         template_string = string.replace(template_string, '@block_stmts', block_stmts)
    24         template_string = string.replace(template_string, '@final_block_stmts', final_block_stmts)
    25         template_string = string.replace(template_string, '@any_carry', any_carry_expr)
     19    def output(self, tag, globaldecl, localdecl, stream_stmts, block_stmts, final_block_stmts, any_carry_expr, template_string):
     20       
     21        template_string = string.replace(template_string, tag + 'global', globaldecl)
     22        template_string = string.replace(template_string, tag + 'decl', localdecl)
     23        template_string = string.replace(template_string, tag + 'stream_stmts', stream_stmts)
     24        template_string = string.replace(template_string, tag + 'block_stmts', block_stmts)
     25        template_string = string.replace(template_string, tag + 'final_block_stmts', final_block_stmts)
     26        template_string = string.replace(template_string, tag + 'any_carry', any_carry_expr)
    2627        return template_string
    2728
     
    5253        template_contents = self.read_template()
    5354               
    54         template_contents = self.output(xfrmr.Cglobals,
     55        template_contents = self.output(
     56                            options.template_label,
     57                            xfrmr.Cglobals,
    5558                            xfrmr.Cdecls,
    5659                            xfrmr.Cinits,
Note: See TracChangeset for help on using the changeset viewer.