Esempio 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)
Esempio n. 2
0
 def __init__(self):
     StateDescription.__init__(self, VariableState(), _VariableDefaultTransition(), [
         _TransitionFromVariableToAccept(),
         _VariableCommaTransition(),
         _TransitionFromVariableToMember(),
         _TransitionFromVariableToOpenFunction(),
         _VariableWhitespaceTransition(),
         _TransitionFromVariableToCloseFunction()
     ])
Esempio n. 3
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), ')'),
                                      Configuration(ExpressionEndState(), ''))
Esempio n. 4
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), '('),
                                      Configuration(OptionalExpressionState(), ''))
Esempio n. 5
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), '.'),
                                      Configuration(MemberState(), ''))
Esempio n. 6
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), '$'),
                                      Configuration(AcceptState(), ''))
Esempio n. 7
0
 def __init__(self):
     DefaultTransition.__init__(self, VariableState())