Exemple #1
0
 def perform_stack_action(self, stack: AutomatonStack,
                          configuration: Configuration):
     MemberState.check_stack(stack)
     stack.add_data(stack.get_current_content())
     MemberState.add_member_to_stack(stack)
     stack.remove_level()
     ExpressionEndState.add_function_to_stack(stack)
 def __init__(self):
     StateDescription.__init__(
         self, OptionalExpressionState(), _ExpressionDefaultTransition(), [
             TransitionWithoutAction(Configuration(OptionalExpressionState(), ' '),
                                     Configuration(OptionalExpressionState(), '')),
             TransitionWithAction(Configuration(OptionalExpressionState(), '"'),
                                  Configuration(StringState(), ''),
                                  lambda stack: stack.add_level()),
             TransitionWithAction(Configuration(OptionalExpressionState(), ')'),
                                  Configuration(ExpressionEndState(), ''),
                                  ExpressionEndState.add_function_to_stack)
         ])
 def __init__(self):
     StateDescription.__init__(self, ExpressionEndState(), _ExpressionEndDefaultTransition(), [
         TransitionWithoutAction(Configuration(ExpressionEndState(), ' '),
                                 Configuration(ExpressionEndState(), '')),
         TransitionWithAction(Configuration(ExpressionEndState(), '$'),
                              Configuration(AcceptState(), ''),
                              AcceptState.check_stack),
         TransitionWithoutAction(Configuration(ExpressionEndState(), ','),
                                 Configuration(ExpressionState(), '')),
         _ConversionFromVariableToFunctionName(),
         TransitionWithAction(Configuration(ExpressionEndState(), ')'),
                              Configuration(ExpressionEndState(), ''),
                              ExpressionEndState.add_function_to_stack)
     ])
Exemple #4
0
 def __init__(self):
     TransitionWithoutAction.__init__(
         self, Configuration(StringState(), '"'),
         Configuration(ExpressionEndState(), ''))
Exemple #5
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(MemberState(), ')'),
                                      Configuration(ExpressionEndState(), ''))
Exemple #6
0
 def __init__(self):
     TransitionWithoutAction.__init__(self, Configuration(VariableState(), ' '),
                                      Configuration(ExpressionEndState(), ''))
Exemple #7
0
 def perform_stack_action(self, stack: AutomatonStack, configuration: Configuration):
     stack.add_data(VariableExpression(stack.get_current_content()))
     stack.remove_level()
     ExpressionEndState.add_function_to_stack(stack)
Exemple #8
0
 def __init__(self):
     DefaultTransition.__init__(self, ExpressionEndState())