Ejemplo n.º 1
0
 def get_output_configuration(
         self, input_configuration: Configuration) -> Configuration:
     if not input_configuration.character.isalpha(
     ) and input_configuration.character != '_':
         raise ParsingError(
             f'Non-alpha character "{input_configuration.character}" detected.'
         )
     return Configuration(VariableState(), input_configuration.character)
Ejemplo n.º 2
0
 def __init__(self):
     StateDescription.__init__(self, VariableState(), _VariableDefaultTransition(), [
         _TransitionFromVariableToAccept(),
         _VariableCommaTransition(),
         _TransitionFromVariableToMember(),
         _TransitionFromVariableToOpenFunction(),
         _VariableWhitespaceTransition(),
         _TransitionFromVariableToCloseFunction()
     ])
Ejemplo n.º 3
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), ')'),
                                      Configuration(ExpressionEndState(), ''))
Ejemplo n.º 4
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), '('),
                                      Configuration(OptionalExpressionState(), ''))
Ejemplo n.º 5
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), '.'),
                                      Configuration(MemberState(), ''))
Ejemplo n.º 6
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), '$'),
                                      Configuration(AcceptState(), ''))
Ejemplo n.º 7
0
 def __init__(self):
     DefaultTransition.__init__(self, VariableState())