예제 #1
0
파일: Expression.py 프로젝트: qram9/c_ast
    def setChild(self, which, t):
        """Overrides Traversable's setChild to 
enforce the rule that a child of an Expression must be 
type Expression"""
        if isinstance(t, Expression):
            Traversable.setChild(self, which, t)
        else:
            raise ChildNotAnExpressionError(str(type(t)))
        return self
예제 #2
0
파일: Declaration.py 프로젝트: qram9/c_ast
    def setChild(self, which, t):
        """Overrides the Traversable setChild to catch
unsupported child nodes"""
        self._catchChildNotCorrectType(t)
        Traversable.setChild(self, which, t)