|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.io.PushbackInputStream
org.extex.ocpware.compiler.parser.ParserStream
public class ParserStream
This class provides a push-back input stream which can parse certain basic entities.
| Field Summary |
|---|
| Fields inherited from class java.io.PushbackInputStream |
|---|
buf, pos |
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
ParserStream(java.io.InputStream in)
Creates a new object. |
|
| Method Summary | |
|---|---|
SyntaxException |
error(int c)
Create an exception containing the context. |
void |
expect(char ex)
Skip to the next non-white-space character and compare it to a given one. |
void |
expect(java.lang.String ex)
Parse an id. |
java.lang.CharSequence |
getLine()
Getter for line. |
int |
getLineno()
Getter for lineno. |
java.lang.String |
parseId()
Parse an id. |
int |
parseNumber(int cc)
Parse a number. |
java.lang.String |
parseString()
Parse a string specification. |
int |
read()
|
int |
skipSpace()
Skip whitespace and comments and advance to the next real character. |
java.lang.String |
toString()
|
void |
unread(int b)
|
| Methods inherited from class java.io.PushbackInputStream |
|---|
available, close, mark, markSupported, read, reset, skip, unread, unread |
| Methods inherited from class java.io.FilterInputStream |
|---|
read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ParserStream(java.io.InputStream in)
in - the stream to acquire characters from| Method Detail |
|---|
public SyntaxException error(int c)
c - the character read
public void expect(char ex)
throws java.io.IOException,
SyntaxException
ex - the expected character
java.io.IOException - in case of an I/O error
SyntaxException - in case of a syntax error
public void expect(java.lang.String ex)
throws java.io.IOException,
SyntaxException
ex - the expected characters
java.io.IOException - in case of an I/O error
SyntaxException - in case of a syntax errorpublic java.lang.CharSequence getLine()
public int getLineno()
public java.lang.String parseId()
throws java.io.IOException,
SyntaxException
java.io.IOException - in case of an I/O error
SyntaxException - in case of a syntax error
public int parseNumber(int cc)
throws java.io.IOException,
SyntaxException
cc - the character already scanned
java.io.IOException - in case of an I/O error
SyntaxException - in case of an parser error
public java.lang.String parseString()
throws java.io.IOException
If two double quotes occur in sequence then this is interpreted as one double quote character embedded in the string.
java.io.IOException - in case of an I/O error
public int read()
throws java.io.IOException
read in class java.io.PushbackInputStreamjava.io.IOExceptionPushbackInputStream.read()
public int skipSpace()
throws java.io.IOException
java.io.IOException - in case of an I/O errorpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
public void unread(int b)
throws java.io.IOException
unread in class java.io.PushbackInputStreamjava.io.IOExceptionPushbackInputStream.unread(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||