import java.util.*; import java.io.*; BrokerSim = MarketList AccountList OperationList . MarketList = List(Investment) . OperationList = List(Operation) . Operation : Quit | Report | Buy | Sell | Invalid *common* OpCode Description. OpCode = String . Report : MarketReport | AccountReport . MarketReport = "DisplayMarketReport". AccountReport = "DisplayAccountReport". Buy = "PurchaseInvestment". Sell = "SellInvestment". Quit = "Quit". Invalid = "Invalid". AccountList = List(Account) . Account = "Username:" Username "Password:" Password "$" Cash ["[" Portfolio "]"] . Username = String . Password = String . Cash = float . Portfolio = List(Investment) . Investment = "*" TickerSymbol "$" UnitValue "#" Shares [ Description] . TickerSymbol = String . UnitValue = float . Shares = int . Description = String . List(S) ~ "(" { S } ")". noparse CheckUsernameVisitor = Username Account Account . DisplayOpVisitor = . FindOpVisitor = OpCode Operation . FileVisitor = PrintWriter . parse Main = .