org.codehaus.groovy.syntax.lexer
Class GStringLexer

java.lang.Object
  extended byorg.codehaus.groovy.syntax.lexer.LexerBase
      extended byorg.codehaus.groovy.syntax.lexer.GStringLexer
All Implemented Interfaces:
Lexer

public class GStringLexer
extends LexerBase

A lexer for GStrings, usually run on a LexerFilter base.

Author:
Chris Poirier

Field Summary
protected  GroovyExpressionLexer child
           
protected  StringBuffer fullText
           
protected  int fullTextStartColumn
           
protected  int fullTextStartLine
           
protected  boolean inExpression
           
protected  boolean sentEndToken
           
protected  boolean sentStartToken
           
 
Fields inherited from class org.codehaus.groovy.syntax.lexer.LexerBase
delegate, source, startColumn, startLine
 
Constructor Summary
GStringLexer()
           
 
Method Summary
 char consume()
          Eats a character from the input stream.
 void delegate(Lexer to)
          Delegates our duties to another Lexer.
 void setSource(Lexer source)
          Sets the source lexer.
protected  void sourceDelimiting(boolean delimit)
          Coordinates with our source about delimiting.
 void undelegate()
          Retakes responsibility for our duties.
protected  Token undelegatedNextToken()
          Finds and returns (consuming) the next token from the underlying stream.
 void unsetSource()
          Unsets the source lexer.
 
Methods inherited from class org.codehaus.groovy.syntax.lexer.LexerBase
getColumn, getDelegate, getLine, getSource, getStartColumn, getStartLine, isDelegated, isExternallySourced, la, la, mark, nextToken, readEOL, readEOL, reset, symbol, symbol, tokenizeEOL, unexpected, unexpected, unexpected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sentStartToken

protected boolean sentStartToken

sentEndToken

protected boolean sentEndToken

fullText

protected StringBuffer fullText

fullTextStartLine

protected int fullTextStartLine

fullTextStartColumn

protected int fullTextStartColumn

child

protected GroovyExpressionLexer child

inExpression

protected boolean inExpression
Constructor Detail

GStringLexer

public GStringLexer()
Method Detail

undelegatedNextToken

protected Token undelegatedNextToken()
                              throws ReadException,
                                     LexerException
Finds and returns (consuming) the next token from the underlying stream. Returns null when out of tokens.

Overrides:
undelegatedNextToken in class LexerBase
Throws:
ReadException
LexerException

sourceDelimiting

protected void sourceDelimiting(boolean delimit)
Coordinates with our source about delimiting. When entering or processing sub-expressions, source delimiting should be off.


delegate

public void delegate(Lexer to)
Delegates our duties to another Lexer.

Specified by:
delegate in interface Lexer
Overrides:
delegate in class LexerBase

undelegate

public void undelegate()
Retakes responsibility for our duties.

Specified by:
undelegate in interface Lexer
Overrides:
undelegate in class LexerBase

setSource

public void setSource(Lexer source)
Sets the source lexer.

Specified by:
setSource in interface Lexer
Overrides:
setSource in class LexerBase

unsetSource

public void unsetSource()
Unsets the source lexer.

Specified by:
unsetSource in interface Lexer
Overrides:
unsetSource in class LexerBase

consume

public char consume()
             throws LexerException,
                    ReadException
Eats a character from the input stream.

Specified by:
consume in interface Lexer
Overrides:
consume in class LexerBase
Throws:
LexerException
ReadException


Copyright © 2003-2004 The Codehaus. All Rights Reserved.