changeset 7322d2b2ec76 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=7322d2b2ec76
description:
        ruby: slicc: slight code refactoring

diffstat:

 src/mem/slicc/ast/MethodCallExprAST.py |  26 ++++++++++++--------------
 src/mem/slicc/ast/ObjDeclAST.py        |   6 ------
 2 files changed, 12 insertions(+), 20 deletions(-)

diffs (59 lines):

diff -r 0e013fa647ac -r 7322d2b2ec76 src/mem/slicc/ast/MethodCallExprAST.py
--- a/src/mem/slicc/ast/MethodCallExprAST.py    Thu Feb 20 17:26:41 2014 -0600
+++ b/src/mem/slicc/ast/MethodCallExprAST.py    Thu Feb 20 17:26:49 2014 -0600
@@ -140,23 +140,21 @@
 
                       implemented_paramTypes.append(implemented_paramType)
 
+                  implementedMethodId = ""
                   if implements_interface:
-                      implementedMethodId = 
obj_type.methodIdAbstract(self.proc_name,
-                                                                      
implemented_paramTypes)
-                  else:
-                      implementedMethodId = ""
+                      implementedMethodId = obj_type.methodIdAbstract(
+                              self.proc_name, implemented_paramTypes)
 
                   if implementedMethodId not in obj_type.methods:
-                      self.error("Invalid method call: " \
-                                 "Type '%s' does not have a method %s, '%s' 
nor '%s'",
-                                 obj_type, self.proc_name, methodId, 
implementedMethodId)
-                  else:
-                      #
-                      # Replace the methodId with the implementedMethodId 
found in
-                      # the method list.
-                      #
-                      methodId = implementedMethodId
-                      return_type = obj_type.methods[methodId].return_type
+                      self.error("Invalid method call: Type '%s' " \
+                                 "does not have a method %s, '%s' nor '%s'",
+                                 obj_type, self.proc_name, methodId,
+                                 implementedMethodId)
+
+                  # Replace the methodId with the implementedMethodId
+                  # found in the method list.
+                  methodId = implementedMethodId
+                  return_type = obj_type.methods[methodId].return_type
 
         if return_type.isInterface:
             prefix = "static_cast<%s &>" % return_type.c_ident
diff -r 0e013fa647ac -r 7322d2b2ec76 src/mem/slicc/ast/ObjDeclAST.py
--- a/src/mem/slicc/ast/ObjDeclAST.py   Thu Feb 20 17:26:41 2014 -0600
+++ b/src/mem/slicc/ast/ObjDeclAST.py   Thu Feb 20 17:26:49 2014 -0600
@@ -39,8 +39,6 @@
         return "[ObjDecl: %r]" % self.ident
 
     def generate(self):
-        machineComponentSym = False
-
         if "network" in self and not ("virtual_network" in self or
                                       "physical_network" in self) :
             self.error("Network queues require a 'virtual_network' attribute")
@@ -84,7 +82,3 @@
             machine.addObject(v)
 
         self.symtab.newSymbol(v)
-
-        # used to cheat-- that is, access components in other machines
-        if machineComponentSym:
-            self.symtab.newMachComponentSym(v)
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to