mem-ruby: enable DPRINTFN calls in slicc for temporary debug printing
[gem5.git] / src / mem / slicc / ast / TypeDeclAST.py
index ecdb5949b5256045e86fa9c4904b93eb2a6edf6d..8a58853ac66bc8f5b8cfad78774a49e43b593fba 100644 (file)
@@ -50,12 +50,20 @@ class TypeDeclAST(DeclAST):
 
     def generate(self):
         ident = str(self.type_ast)
+        machine = self.symtab.state_machine
 
         # Make the new type
         new_type = Type(self.symtab, ident, self.location, self.pairs,
                         self.state_machine)
+
+        if machine:
+            machine.addType(new_type)
+
         self.symtab.newSymbol(new_type)
+        self.symtab.pushFrame()
 
         # Add all of the fields of the type to it
         for field in self.field_asts:
             field.generate(new_type)
+
+        self.symtab.popFrame()