Changeset 756


Ignore:
Timestamp:
Dec 1, 2010, 6:00:48 PM (8 years ago)
Author:
cameron
Message:

Pablo compiler fixes

Location:
proto/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/Cgen.py

    r753 r756  
    276276        self.fill("while (")
    277277        self.dispatch(t.test)
    278         self.write(") do ")
     278        self.write(") ")
    279279        self.do_block(t.body)
    280280        if t.orelse:
  • proto/Compiler/compiler2.py

    r753 r756  
    4545
    4646        # BACK END
    47         declarations = pablo.gen_declarations(self.mainfn)
     47        declarations = pablo.gen_declarations(s, self.mainfn)
    4848        templ = self.read_template(file_path)
    4949
  • proto/Compiler/pablo.py

    r753 r756  
    116116      linelgth += len(pending + v) + 1
    117117    else:
    118       decls += pending + "\n  BitBlock " + v
     118      decls += ";\n  BitBlock " + v
    119119      linelgth = 11 + len(v)
    120120    pending = ","
     
    281281    return self.Ccode
    282282  def visit_ClassDef(self, node):
    283     self.Ccode += "typedef struct {\n"
     283#    self.Ccode += "typedef struct {\n"
     284    self.Ccode += "struct {\n"
    284285    for stmt in node.body:
    285286      if isinstance(stmt, ast.Assign):
     
    333334#  Quick and dirty hacks for now - Dec. 2010.
    334335#
    335 def gen_declarations(main_fn):
    336   return BitBlock_decls_of_fn(main_fn)
     336def gen_declarations(main_module, main_fn):
     337  Cdecls = StreamStructGen().gen(main_module)
     338  Cdecls +=  BitBlock_decls_of_fn(main_fn)
     339  return Cdecls
    337340
    338341def stream_stmts(main_fn):
Note: See TracChangeset for help on using the changeset viewer.