def perform_stack_action(self, stack: AutomatonStack, configuration: Configuration): current_content = stack.get_current_content() if not current_content: raise ParsingError('A variable name was expected!') stack.add_data(Argument(current_content)) stack.remove_level() AcceptState.add_function_to_stack(stack)
def __init__(self): ModifiedPushdownAutomaton.__init__( self, FunctionNameState(), [AcceptState()], [ FunctionNameStateDescription(), ArgumentStartStateDescription(), ArgumentStateDescription(), FreeArgumentStateDescription(), RequiredArgumentStateDescription(), AcceptStateDescription() ])
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()) ])
def __init__(self): TransitionWithoutAction.__init__( self, Configuration(FreeArgumentState(), ')'), Configuration(AcceptState(), ''))
def __init__(self): StateDescription.__init__(self, AcceptState(), _InvalidAcceptTransition(), [])
def __init__(self): DefaultTransition.__init__(self, AcceptState())