Skip to content

Commit

Permalink
changed parser diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbaracwx committed Nov 14, 2023
1 parent e5bdfe1 commit feb2bf5
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions docs/UML Diagrams/ParserDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,24 @@ hide footbox
actor User
participant "User Input" as UserInput
participant ": Parser" as Parser
participant ": Command" as Command
participant ": CommandResult" as CommandResult


participant ": IncorrectCommand" as IncorrectCommand
User -> UserInput: Enter command
UserInput -> Parser: parseCommand(userInput)
activate Parser

Parser -> Parser: Split the input into command and arguments
activate Parser
deactivate Parser
alt Command found
Parser -> Parser: commandWord = Extract command word
activate Parser
deactivate Parser
Parser -> Parser: arguments = Extract arguments
activate Parser
deactivate Parser
else Command not found
Parser -> IncorrectCommand: Create IncorrectCommand
activate IncorrectCommand
Parser --> Parser: return IncorrectCommand
activate Parser
Parser -> Command: execute(model)
deactivate Parser
end
Parser -> IncorrectCommand: Create IncorrectCommand
deactivate IncorrectCommand
activate Command
Create CommandResult
Command -> CommandResult
activate CommandResult
CommandResult --> Command
deactivate CommandResult
Command --> User

Parser --> Parser: return IncorrectCommand
activate Parser
deactivate Parser

deactivate Parser


@enduml

0 comments on commit feb2bf5

Please sign in to comment.