org.prorefactor.refactor
Class ScanIncludeRef

java.lang.Object
  extended by org.prorefactor.refactor.ScanIncludeRef

public class ScanIncludeRef
extends java.lang.Object

Scan an include reference gathering attributes like the entire reference, the string used for the include name, and a string containing all arguments. This does change the scanner's token list. It compacts the file reference string into a single token. This is for working with the include reference's text, not for macro level analysis. For that, see org.prorefactor.refactor.macrolevel.*.


Field Summary
 java.lang.String argString
          The reference arguments, including leading and trailing whitespace Might contain embedded macro references.
 java.lang.String entireReference
          The entire reference "{...}" Might contain embedded macro references.
 int filenameHandle
          Handle to the (new) FILENAME token
 int leftCurly
          Handle to the LEFTCURLY
 int rightCurly
          Handle to the RIGHTCURLY
 
Constructor Summary
ScanIncludeRef(int h)
          Create a ScanIncludeRef object with the LEFTCURLY token.
ScanIncludeRef(int[] pos, int scanNum)
          Construct given an int[3] file/line/col position and a scan number
 
Method Summary
protected  void compactRefname(int leftcurly)
          Compact an include reference filename into one token, set a handle to point at that token.
 void markToBeCut()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filenameHandle

public int filenameHandle
Handle to the (new) FILENAME token


leftCurly

public int leftCurly
Handle to the LEFTCURLY


rightCurly

public int rightCurly
Handle to the RIGHTCURLY


argString

public java.lang.String argString
The reference arguments, including leading and trailing whitespace Might contain embedded macro references.


entireReference

public java.lang.String entireReference
The entire reference "{...}" Might contain embedded macro references.

Constructor Detail

ScanIncludeRef

public ScanIncludeRef(int h)
               throws RefactorException
Create a ScanIncludeRef object with the LEFTCURLY token.

Parameters:
h - a handle to the LEFTCURLY.
Throws:
RefactorException - if RIGHTCURLY not found.

ScanIncludeRef

public ScanIncludeRef(int[] pos,
                      int scanNum)
               throws RefactorException
Construct given an int[3] file/line/col position and a scan number

Throws:
RefactorException
Method Detail

compactRefname

protected void compactRefname(int leftcurly)
                       throws RefactorException
Compact an include reference filename into one token, set a handle to point at that token. A doublequote will start a string - all this means is that we'll collect whitespace. A singlequote does not have this effect.

Throws:
RefactorException

markToBeCut

public void markToBeCut()
                 throws RefactorException
Throws:
RefactorException


Copyright © 2008 Joanju Software. All Rights Reserved.