|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.anarres.cpp.Source
public abstract class Source
An input to the Preprocessor. Inputs may come from Files, Strings or other sources. The preprocessor maintains a stack of Sources. Operations such as file inclusion or token pasting will push a new source onto the Preprocessor stack. Sources pop from the stack when they are exhausted; this may be transparent or explicit. BUG: Error messages are not handled properly.
Constructor Summary | |
---|---|
Source()
|
Method Summary | |
---|---|
void |
close()
|
protected void |
error(int line,
int column,
String msg)
|
int |
getColumn()
Returns the current column number within this Source. |
int |
getLine()
Returns the current line number within this Source. |
Iterator<Token> |
iterator()
Returns a token iterator for this Source. |
void |
setListener(PreprocessorListener pl)
Sets the listener for this Source. |
Token |
skipline(boolean white)
Skips tokens until the end of line. |
abstract Token |
token()
Returns the next Token parsed from this input stream. |
protected void |
warning(int line,
int column,
String msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Source()
Method Detail |
---|
public void setListener(PreprocessorListener pl)
public int getLine()
public int getColumn()
public abstract Token token() throws IOException, LexerException
IOException
LexerException
Token
public Iterator<Token> iterator()
iterator
in interface Iterable<Token>
public Token skipline(boolean white) throws IOException, LexerException
white
- true if only whitespace is permitted on the
remainder of the line.
IOException
LexerException
protected void error(int line, int column, String msg) throws LexerException
LexerException
protected void warning(int line, int column, String msg) throws LexerException
LexerException
public void close() throws IOException
close
in interface Closeable
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |