Example #1
0
 def __init__(self):
     StateDescription.__init__(
         self, ArgumentStartState(), _ArgumentStartDefaultTransition(), [
             TransitionWithAction(Configuration(ArgumentStartState(), ')'),
                                  Configuration(AcceptState(), ''),
                                  AcceptState.add_function_to_stack),
             TransitionWithAction(Configuration(ArgumentStartState(), '*'),
                                  Configuration(FreeArgumentState(), ''),
                                  lambda stack: stack.add_level())
         ])
Example #2
0
 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)
         ])
Example #3
0
 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)
     ])
Example #4
0
 def __init__(self):
     StateDescription.__init__(
         self, RequiredArgumentState(), _RequiredArgumentDefaultTransition(), [
             TransitionWithAction(Configuration(RequiredArgumentState(), '*'),
                                  Configuration(FreeArgumentState(), ''),
                                  lambda stack: stack.add_level())
         ])
Example #5
0
 def __init__(self):
     StateDescription.__init__(
         self, OperatorEndState(), _InvalidValueTransition(), [
             TransitionWithAction(Configuration(OperatorEndState(), '"'),
                                  Configuration(ValueState(), ''),
                                  lambda stack: stack.add_level())
         ])
Example #6
0
 def __init__(self):
     StateDescription.__init__(
         self, StartState(), _InvalidStartTransition(), [
             TransitionWithAction(Configuration(StartState(), '"'),
                                  Configuration(MessageState(), ''),
                                  lambda stack: stack.add_level())
         ])
Example #7
0
 def __init__(self):
     StateDescription.__init__(
         self, ConstraintEndState(), _InvalidConstraintTransition(), [
             TransitionWithAction(Configuration(ConstraintEndState(), '&'),
                                  Configuration(ConstraintStartState(), ''),
                                  lambda stack: stack.add_level()),
             TransitionWithoutAction(
                 Configuration(ConstraintEndState(), ' '),
                 Configuration(ConstraintEndState(), ''))
         ])
Example #8
0
 def __init__(self):
     StateDescription.__init__(self, VariableEndState(), _InvalidOperatorTransition(), [
         TransitionWithAction(Configuration(VariableEndState(), '='),
                              Configuration(OperatorState(), ''),
                              lambda stack: stack.add_level())
     ])