puzzled.processor
Class Parser

java.lang.Object
  |
  +--puzzled.processor.Parser
All Implemented Interfaces:
Constants

public class Parser
extends java.lang.Object
implements Constants

This class is the part of the application that understand the hints entered by the user. Its role is to interpret the given hint and derive what relationships can be deduced out of the statement. It understand multiple subjects and objects, and the following relationships: is, is not, left of, right of.

Version:
1.0 10 Sep 2001
Author:
Frédéric Demers

Field Summary
static boolean STATUS_NOK
          Value used by the parser to signify that the string sent can no longer be understood.
static boolean STATUS_OK
          Value used by the parser to signify that the string sent is being decoded properly.
 
Fields inherited from interface puzzled.Constants
ACTION_TOKEN, AND_TOKEN, AND_TOKENS, IS_ACTION, IS_TOKEN, IS_TOKENS, ISNOT_ACTION, JUNCTION_TOKEN, LESS_ACTION, LESS_TOKEN, LESS_TOKENS, MORE_ACTION, MORE_TOKEN, MORE_TOKENS, NEXT_ACTION, NEXT_TOKEN, NEXT_TOKENS, NO_ACTION, NOR_TOKEN, NOT_TOKEN, NOT_TOKENS, NOT_VALID, NOTNEXT_ACTION, NOTNEXT_TOKEN, NUMBER_TOKEN, NUMBER_TOKENS, OR_ACTION, OR_TOKEN, OR_TOKENS, PREVIOUS_CLUE_TOKEN, RESET_TOKEN, THAN_TOKEN, TO_TOKEN, VALUE_NO, VALUE_UNKNOWN, VALUE_YES
 
Constructor Summary
Parser(ProblemSolver parent_arg)
          Constructor.
 
Method Summary
 boolean parse(Clue currentClue_arg)
          This method will actually do the job of understanding user clues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_OK

public static final boolean STATUS_OK
Value used by the parser to signify that the string sent is being decoded properly.

STATUS_NOK

public static final boolean STATUS_NOK
Value used by the parser to signify that the string sent can no longer be understood.
Constructor Detail

Parser

public Parser(ProblemSolver parent_arg)
Constructor. Accepts a reference to the data structure (Grid object), in order to be able to add relationships, or retreive relationship information.
Parameters:
myGrid_arg - the reference to the data structure grid
Method Detail

parse

public boolean parse(Clue currentClue_arg)
This method will actually do the job of understanding user clues.
Parameters:
currentClue_arg - the reference to the Clue object being studied