Class Source
java.lang.Object
io.github.ocelot.glslprocessor.lib.anarres.cpp.Source
- Direct Known Subclasses:
LexerSource
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintReturns the current column number within this Source.intgetLine()Returns the current line number within this Source.@Nullable StringgetName()Returns the human-readable name of the current Source.skipline(boolean white) Skips tokens until the end of line.abstract Tokentoken()Returns the next Token parsed from this input stream.protected void
-
Constructor Details
-
Source
public Source()
-
-
Method Details
-
getName
Returns the human-readable name of the current Source. -
getLine
public int getLine()Returns the current line number within this Source. -
getColumn
public int getColumn()Returns the current column number within this Source. -
token
Returns the next Token parsed from this input stream.- Throws:
LexerException- See Also:
-
skipline
Skips tokens until the end of line.- Parameters:
white- true if only whitespace is permitted on the remainder of the line.- Returns:
- the NL token.
- Throws:
LexerException
-
error
- Throws:
LexerException
-
warning
- Throws:
LexerException
-