edu.rice.cs.drjava.model.definitions.reducedmodel
Class ReducedModelState

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelState
All Implemented Interfaces:
ReducedModelStates
Direct Known Subclasses:
Free, InsideBlockComment, InsideDoubleQuote, InsideLineComment, InsideSingleQuote, Stutter

public abstract class ReducedModelState
extends Object
implements ReducedModelStates

The abstract notion of a shadowing state. We use shadowing to mean the state of text as it is interpreted during compile. Commented text is ignored, and quoted text does not factor into the ASTs generated by the compiler except as a text constant. This buys us a lot in terms of correctness when highlighting, indenting, and performing other editor functions.

Version:
$Id: ReducedModelState.java,v 1.7 2002/02/08 14:22:21 brianstoler Exp $

Fields inherited from interface edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelStates
FREE, INSIDE_BLOCK_COMMENT, INSIDE_DOUBLE_QUOTE, INSIDE_LINE_COMMENT, INSIDE_SINGLE_QUOTE, STUTTER
 
Constructor Summary
ReducedModelState()
           
 
Method Summary
(package private)  boolean _combineCurrentAndNextIfEscape(TokenList.Iterator copyCursor)
           
(package private)  boolean _combineCurrentAndNextIfFind(String first, String second, TokenList.Iterator copyCursor)
          Combines the current and next braces if they match the given types.
(package private) abstract  ReducedModelState update(TokenList.Iterator copyCursor)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

ReducedModelState

public ReducedModelState()
Method Detail

update

abstract ReducedModelState update(TokenList.Iterator copyCursor)

_combineCurrentAndNextIfFind

boolean _combineCurrentAndNextIfFind(String first,
                                     String second,
                                     TokenList.Iterator copyCursor)
Combines the current and next braces if they match the given types. If we have braces of first and second in immediate succession, and if second's gap is 0, combine them into first+second. The cursor remains on the same block after this method is called.
Parameters:
first - the first half of a multiple char brace
second - the second half of a multiple char brace
Returns:
true if we combined two braces or false if not

_combineCurrentAndNextIfEscape

boolean _combineCurrentAndNextIfEscape(TokenList.Iterator copyCursor)