コード例 #1
0
ファイル: indentation_setup.py プロジェクト: jirkamarsik/quex
 def indentation_count_character_set(self):
     """Returns the superset of all characters that are involved in
        indentation counting. That is the set of character that can
        appear between newline and the first non whitespace character.
     """
     result = NumberSet()
     for character_set in self.space_db.values():
         result.unite_with(character_set.get())
     for character_set in self.grid_db.values():
         result.unite_with(character_set.get())
     return result
コード例 #2
0
ファイル: ucs_db_parser.py プロジェクト: yura9889/grit-engine
    def __wildcard_value_match(self, WildCardValue):
        result = NumberSet()

        value_list = self.get_wildcard_value_matches(WildCardValue)
        if value_list == []: 
            return None

        for value in value_list:
            result.unite_with(NumberSet(self.code_point_db[value]))

        return result
コード例 #3
0
ファイル: indentation_setup.py プロジェクト: jirkamarsik/quex
 def indentation_count_character_set(self):
     """Returns the superset of all characters that are involved in
        indentation counting. That is the set of character that can
        appear between newline and the first non whitespace character.
     """
     result = NumberSet()
     for character_set in self.space_db.values():
         result.unite_with(character_set.get())
     for character_set in self.grid_db.values():
         result.unite_with(character_set.get())
     return result
コード例 #4
0
    def __wildcard_value_match(self, WildCardValue):
        result = NumberSet()

        value_list = self.get_wildcard_value_matches(WildCardValue)
        if value_list == []: 
            return None

        for value in value_list:
            result.unite_with(NumberSet(self.code_point_db[value]))

        # No decoupling, since result is computed each fresh and new
        return result
コード例 #5
0
ファイル: transition_map.py プロジェクト: jirkamarsik/quex
    def is_DFA_compliant(self):
        """Checks if the current state transitions are DFA compliant, i.e. it
           investigates if trigger sets pointing to different targets intersect.
           RETURN:  True  => OK
                    False => Same triggers point to different target. This cannot
                             be part of a deterministic finite automaton (DFA).
        """
        # DFA's do not have epsilon transitions
        if len(self.__epsilon_target_index_list) != 0: return False

        # check wether trigger sets intersect
        all_trigger_sets = NumberSet()
        for trigger_set in self.__db.values():
            if all_trigger_sets.has_intersection(trigger_set): 
                return False
            else:
                all_trigger_sets.unite_with(trigger_set)

        return True
コード例 #6
0
ファイル: transition_map.py プロジェクト: jirkamarsik/quex
    def is_DFA_compliant(self):
        """Checks if the current state transitions are DFA compliant, i.e. it
           investigates if trigger sets pointing to different targets intersect.
           RETURN:  True  => OK
                    False => Same triggers point to different target. This cannot
                             be part of a deterministic finite automaton (DFA).
        """
        # DFA's do not have epsilon transitions
        if len(self.__epsilon_target_index_list) != 0: return False

        # check wether trigger sets intersect
        all_trigger_sets = NumberSet()
        for trigger_set in self.__db.values():
            if all_trigger_sets.has_intersection(trigger_set):
                return False
            else:
                all_trigger_sets.unite_with(trigger_set)

        return True
コード例 #7
0
ファイル: transition_map.py プロジェクト: jirkamarsik/quex
    def get_trigger_set_union(self):
        result = NumberSet()
        for trigger_set in self.__db.values():
            result.unite_with(trigger_set)

        return result
コード例 #8
0
ファイル: transition_map.py プロジェクト: jirkamarsik/quex
    def get_trigger_set_union(self):
        result = NumberSet()
        for trigger_set in self.__db.values():
            result.unite_with(trigger_set)

        return result