sjm.examples.robot
Class RobotParser
java.lang.Object
|
+--sjm.examples.robot.RobotParser
- public class RobotParser
- extends java.lang.Object
This class's start() method provides a parser that
will recognize a command for a track robot and build a
corresponding command object.
The grammar for the language that this class recognizes
is:
command = pickCommand | placeCommand |
scanCommand;
pickCommand = "pick" "carrier" "from" location;
placeCommand = "place" "carrier" "at" location;
scanCommand = "scan" location;
location = Word;
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
RobotParser
public RobotParser()
command
public Parser command()
- Returns a parser that will recognize a command for a
track robot and build a corresponding command object.
(This method returns the same value as
start()).
- Returns:
- a parser that will recognize a track robot
command
location
protected Parser location()
pickCommand
protected Parser pickCommand()
placeCommand
protected Parser placeCommand()
scanCommand
protected Parser scanCommand()
start
public static Parser start()
- Returns a parser that will recognize a command for a
track robot and build a corresponding command object.
- Returns:
- a parser that will recognize a track robot
command