cppcheckdata.py: Added Token.getValue()

This commit is contained in:
Daniel Marjamäki 2014-07-18 18:10:52 +02:00
parent 4a784ce2e9
commit 54dbb5f832
1 changed files with 16 additions and 6 deletions

View File

@ -63,6 +63,16 @@ class Token:
self.astOperand1 = IdMap[self.astOperand1Id]
self.astOperand2 = IdMap[self.astOperand2Id]
# Get value if it exists
# Returns None if it doesn't exist
def getValue(self,v):
if not self.values:
return None
for value in self.values:
if value.intvalue == v:
return value
return None
class Scope:
Id = None
classStartId = None