Ejemplo n.º 1
0
 def clearParseActions(self):
     HEXNUM.setParseAction(lambda x: x)
     REGISTER.setParseAction(lambda x: x)
     CONNECTIVE.setParseAction(lambda x: x)
     EQ_SYMBOL.setParseAction(lambda x: x)
     MEMREF.setParseAction(lambda x: x)
     RELATION.setParseAction(lambda x: x)
     FORMULA.setParseAction(lambda x: x)
Ejemplo n.º 2
0
 def setupParseActions(self):
     HEXNUM.setParseAction(self.createConstExpr)
     REGISTER.setParseAction(self.getRegisterExpr)
     CONNECTIVE.setParseAction(self.createNewLogicExpr)
     EQ_SYMBOL.setParseAction(self.createEqSymbol)
     MEMREF.setParseAction(self.createNewMemref)
     RELATION.setParseAction(self.createNewRelation)
     FORMULA.setParseAction(self.createNewFormula)
Ejemplo n.º 3
0
 def setupParseActions(self):
     HEXNUM.setParseAction(self.createConstExpr)
     REGISTER.setParseAction(self.getRegisterExpr)
     CONNECTIVE.setParseAction(self.createNewLogicExpr)
     EQ_SYMBOL.setParseAction(self.createEqSymbol)
     MEMREF.setParseAction(self.createNewMemref)
     RELATION.setParseAction(self.createNewRelation)
     FORMULA.setParseAction(self.createNewFormula)
Ejemplo n.º 4
0
 def clearParseActions(self):
     HEXNUM.setParseAction(lambda x:x)
     REGISTER.setParseAction(lambda x:x)
     CONNECTIVE.setParseAction(lambda x:x)
     EQ_SYMBOL.setParseAction(lambda x:x)
     MEMREF.setParseAction(lambda x:x)
     RELATION.setParseAction(lambda x:x)
     FORMULA.setParseAction(lambda x:x)
Ejemplo n.º 5
0
 def add_debug_actions(self):
     HEXNUM.addParseAction(lambda x: self.debugLog("Hexnum %s" % str(x)))
     REGISTER.addParseAction(
         lambda x: self.debugLog("Register %s" % str(x)))
     CONNECTIVE.addParseAction(
         lambda x: self.debugLog("Connective %s" % str(x)))
     EQ_SYMBOL.addParseAction(
         lambda x: self.debugLog("Eqsymbol %s" % str(x)))
     MEMREF.addParseAction(lambda x: self.debugLog("Memref %s" % str(x)))
     RELATION.addParseAction(
         lambda x: self.debugLog("Relation %s" % str(x)))
     FORMULA.addParseAction(lambda x: self.debugLog("Formula %s" % str(x)))
Ejemplo n.º 6
0
    def enableDebug(self, verbose=False):
        self.debug_mode = True

        if verbose:
            HEXNUM.setDebug()
            REGISTER.setDebug()
            CONNECTIVE.setDebug()
            EQ_SYMBOL.setDebug()
            MEMREF.setDebug()
            RELATION.setDebug()
            FORMULA.setDebug()

        self.add_debug_actions()
Ejemplo n.º 7
0
    def enableDebug(self, verbose=False):
        self.debug_mode = True

        if verbose:
            HEXNUM.setDebug()
            REGISTER.setDebug()
            CONNECTIVE.setDebug()
            EQ_SYMBOL.setDebug()
            MEMREF.setDebug()
            RELATION.setDebug()
            FORMULA.setDebug()

        self.add_debug_actions()
Ejemplo n.º 8
0
 def add_debug_actions(self):
     HEXNUM.addParseAction(lambda x:self.debugLog(
                 "Hexnum %s" % str(x)))
     REGISTER.addParseAction(lambda x:self.debugLog(
                 "Register %s" % str(x)))
     CONNECTIVE.addParseAction(lambda x:self.debugLog(
                 "Connective %s" % str(x)))
     EQ_SYMBOL.addParseAction(lambda x:self.debugLog(
                 "Eqsymbol %s" % str(x)))
     MEMREF.addParseAction(lambda x:self.debugLog(
                 "Memref %s" % str(x)))
     RELATION.addParseAction(lambda x:self.debugLog(
                 "Relation %s" % str(x)))
     FORMULA.addParseAction(lambda x:self.debugLog(
                 "Formula %s" % str(x)))
Ejemplo n.º 9
0
 def testRELATION(self):
     RELATION.parseString('EAX <= EBX')
     RELATION.parseString('EAX = 0x50')
     #RELATION.parseString('(EAX = 0x50)')
     self.assertRaises(ParseException, 
             RELATION.parseString, '50 <= EAX')