Beispiel #1
0
    def __init__(self, line, source):
        """
        Argument: re match object
        """

        Definition.__init__(
            self, line,
            '\\[([A-Z][a-zA-Z0-9]+)(>[A-Z][a-zA-Z0-9]+|)(\\:SINGLE|)\\] *$')
        PhysicsObject._known_objects.append(self)

        # is this a singlet?
        if self.matches.group(3) == ':SINGLE':
            self.parent = 'Singlet'
            self._singlet = True
        else:
            self.parent = 'Element'
            self._singlet = False

        # if >parent is present, update the parent class name
        if self.matches.group(2):
            self.parent = self.matches.group(2)[1:]
            self._singlet = None

        Object.__init__(self, self.matches.group(1), source)

        if len([f for f in self.functions if f.is_pure_virtual]) == 0:
            self.instantiable = True
        else:
            self.instantiable = False
Beispiel #2
0
    def __init__(self, line, source):
        """
        Argument: re match object
        """

        Definition.__init__(self, line, '<([A-Z][a-zA-Z0-9]+)>$')
        Object.__init__(self, self.matches.group(1), source)
Beispiel #3
0
    def __init__(self, line, source):
        Definition.__init__(self, line,
                            '\\{([A-Z][a-zA-Z0-9]+)(>[A-Z][a-zA-Z0-9]+|)\\}$')
        Object.__init__(self, self.matches.group(1), source)

        if self.matches.group(2):
            self.parent = self.matches.group(2)[1:]
        else:
            self.parent = 'TreeEntry'
Beispiel #4
0
    def __init__(self, line, source):
        Definition.__init__(self, line, '\\{([A-Z][a-zA-Z0-9]+)(>[A-Z][a-zA-Z0-9]+|)\\}$')
        Object.__init__(self, self.matches.group(1), source)
        Inheritable.__init__(self)

        Tree._known_objects.append(self)

        if self.matches.group(2):
            self.parent = self.matches.group(2)[1:]
        else:
            self.parent = 'TreeEntry'