コード例 #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)
コード例 #2
0
 def perform_stack_action(self, stack: AutomatonStack,
                          configuration: Configuration):
     current_string = stack.get_current_content()
     stack.add_data(
         MessageComponent(MessageComponentType.PYTHON_CODE, current_string))
     stack.remove_level()
     stack.add_level()
コード例 #3
0
ファイル: argument.py プロジェクト: zhiyin121/adviser
 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)
コード例 #4
0
 def perform_stack_action(self, stack: AutomatonStack,
                          configuration: Configuration):
     current_content = stack.get_current_content()
     if not current_content:
         raise ParsingError('Empty function name is not allowed!')
     stack.add_data(FunctionDeclaration(current_content))
     stack.remove_level()
     stack.add_level()
コード例 #5
0
 def perform_stack_action(self, stack: AutomatonStack,
                          configuration: Configuration):
     current_content = stack.get_current_content()
     stack.add_data(VariableExpression(current_content))
     stack.remove_level()
     stack.add_level()
コード例 #6
0
ファイル: string.py プロジェクト: wendywtchang/adviser
 def perform_stack_action(self, stack: AutomatonStack,
                          configuration: Configuration):
     current_string = stack.get_current_content()
     stack.add_data(ConstantExpression(current_string))
     stack.remove_level()
     stack.add_level()
コード例 #7
0
ファイル: variable.py プロジェクト: zhiyin121/adviser
 def perform_stack_action(self, stack: AutomatonStack, configuration: Configuration):
     stack.add_data(FunctionDeclaration(stack.get_current_content()))
     stack.remove_level()
     stack.add_level()
コード例 #8
0
ファイル: variable.py プロジェクト: zhiyin121/adviser
 def perform_stack_action(self, stack: AutomatonStack, configuration: Configuration):
     stack.add_data(VariableExpression(stack.get_current_content()))
     stack.remove_level()
     AcceptState.check_stack(stack)
コード例 #9
0
 def check_stack(stack: AutomatonStack):
     if stack.get_current_content() == '':
         ParsingError('Empty member variable detected')