org.anarres.cpp
Class StringLexerSource

java.lang.Object
  extended by org.anarres.cpp.Source
      extended by org.anarres.cpp.LexerSource
          extended by org.anarres.cpp.StringLexerSource
All Implemented Interfaces:
Closeable, Iterable<Token>

public class StringLexerSource
extends LexerSource

A Source for lexing a String. This class is used by token pasting, but can be used by user code.


Constructor Summary
StringLexerSource(String string)
          Creates a new Source for lexing the given String.
StringLexerSource(String string, boolean ppvalid)
          Creates a new Source for lexing the given String.
 
Method Summary
 String toString()
           
 
Methods inherited from class org.anarres.cpp.LexerSource
close, getColumn, getLine, token
 
Methods inherited from class org.anarres.cpp.Source
error, iterator, setListener, skipline, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringLexerSource

public StringLexerSource(String string,
                         boolean ppvalid)
                  throws IOException
Creates a new Source for lexing the given String.

Parameters:
ppvalid - true if preprocessor directives are to be honoured within the string.
Throws:
IOException

StringLexerSource

public StringLexerSource(String string)
                  throws IOException
Creates a new Source for lexing the given String. By default, preprocessor directives are not honoured within the string.

Throws:
IOException
Method Detail

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007 Shevek, Anarres. All Rights Reserved.