|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader scale.frontend.c.CReader
public class CReader
This class reads a C file and transforms it by translating special character sequences and catenating "continued" lines.
$Id: CReader.java,v 1.10 2006-05-15 19:37:06 burrill Exp $
Copyright 2005 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary | |
---|---|
static boolean |
classTrace
True if traces are to be performed. |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
CReader(java.lang.String filename)
|
Method Summary | |
---|---|
void |
close()
|
boolean |
fillLine()
Fill the line buffer. |
java.lang.String |
getFilename()
Return the file name associated with this reader. |
boolean |
getLineArray(char[] text,
int position)
|
int |
getLineLength()
Return the length of the current line. |
int |
getLineNumber()
Return the line number of the next line to be read. |
int |
getLinePosition()
Return the current position in the current line. |
void |
mark(int readAheadLimit)
Mark the present position in the stream. |
boolean |
markSupported()
Marking is not supported by this Reader. |
int |
read()
Read a single character. |
int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array. |
java.lang.String |
readLine()
Read a line of text. |
void |
reset()
Reset the stream to the most recent mark. |
void |
setFilename(java.lang.String filename)
Set the file name associated with this reader. |
void |
setLineNumber(int lineNumber)
Set the line number of the next line to be read. |
long |
skip(long n)
Skip characters. |
Methods inherited from class java.io.Reader |
---|
read, read, ready |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean classTrace
Constructor Detail |
---|
public CReader(java.lang.String filename) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.Reader
cbuf
- - destination bufferoff
- - offset at which to start storing characterslen
- - maximum number of characters to read
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
public final boolean getLineArray(char[] text, int position)
public final int getLinePosition()
public final int getLineLength()
public boolean fillLine() throws java.io.IOException
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public void setLineNumber(int lineNumber)
public int getLineNumber()
public void setFilename(java.lang.String filename)
public java.lang.String getFilename()
public long skip(long n) throws java.io.IOException
skip
in class java.io.Reader
n
- - the number of characters to skip
java.io.IOException
public void mark(int readAheadLimit) throws java.io.IOException
mark
in class java.io.Reader
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.Reader
public void reset() throws java.io.IOException
reset
in class java.io.Reader
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |