Ejemplo n.º 1
0
def PPT_character_set_skipper(MHI, character_set, incidence_id, CounterDb, goto_terminal_str, Sr):
    """Generate a PPT for a character set skipper. That is, 
        -- A PatternPriority based on a given MHI and the specified incidence id.
        -- A Pattern to be webbed into the lexical analyzer state machine.
        -- A Terminal implementing the character set skipper.
    """
    priority = PatternPriority(MHI, incidence_id)
    pattern  = Pattern.from_character_set(character_set)
    pattern.set_pattern_string("<skip>")
    pattern.set_source_reference(Sr)

    code = CodeTerminal([ goto_terminal_str ], Sr)
    return PPT(priority, pattern, code)
Ejemplo n.º 2
0
def PPT_character_set_skipper(MHI, character_set, incidence_id, CounterDb, goto_terminal_str, Sr):
    """Generate a PPT for a character set skipper. That is, 
        -- A PatternPriority based on a given MHI and the specified incidence id.
        -- A Pattern to be webbed into the lexical analyzer state machine.
        -- A Terminal implementing the character set skipper.
    """
    priority = PatternPriority(MHI, incidence_id)
    pattern  = Pattern.from_character_set(character_set)
    pattern.set_pattern_string("<skip>")
    pattern.set_source_reference(Sr)

    code = CodeTerminal([ goto_terminal_str ], Sr)
    return PPT(priority, pattern, code)
Ejemplo n.º 3
0
def get_Pattern(ValueList):
    return Pattern.from_character_set(
        NumberSet([Interval(ord(x)) for x in ValueList]))
Ejemplo n.º 4
0
def get_Pattern(ValueList):
    return Pattern.from_character_set(NumberSet([ Interval(ord(x)) for x in ValueList ]))