SYSC 2004 Lecture Notes - Lecture 4: Interactive Fiction, Terminal Emulator, Lexical Analysis
Document Summary
* this class is part of the "world of zuul" application. * "world of zuul" is a very simple, text based adventure game. * this parser reads user input and tries to interpret it as an "adventure" Every time it is called it reads a line from the terminal and. * tries to interpret the line as a two word command. * the parser has a set of known command words. * the known commands, and if the input is not one of the known commands, it. * returns a command object that is marked as an unknown command. * @author michael kolling and david j. barnes. * @version october 21, 2012 public class parser private commandwords commands; // holds all valid command words private scanner reader; // source of command input. * create a parser to read from the terminal window. public parser() commands = new commandwords(); reader = new scanner(system. in);