org.anarres.cpp
Class CppReader
java.lang.Object
java.io.Reader
org.anarres.cpp.CppReader
- All Implemented Interfaces:
- Closeable, Readable
public class CppReader
- extends Reader
A Reader wrapper around the Preprocessor.
This is a utility class to provide a transparent Reader
which preprocesses the input text.
- See Also:
Preprocessor
,
Reader
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CppReader
public CppReader(Reader r)
CppReader
public CppReader(Preprocessor p)
getPreprocessor
public Preprocessor getPreprocessor()
- Returns the Preprocessor used by this CppReader.
addMacro
public void addMacro(String name)
throws LexerException
- Defines the given name as a macro.
This is a convnience method.
- Throws:
LexerException
addMacro
public void addMacro(String name,
String value)
throws LexerException
- Defines the given name as a macro.
This is a convnience method.
- Throws:
LexerException
read
public int read()
throws IOException
- Overrides:
read
in class Reader
- Throws:
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
read
in class Reader
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Specified by:
close
in class Reader
- Throws:
IOException
Copyright © 2007 Shevek, Anarres. All Rights Reserved.