com.tirix.util
Class SimpleTokenizer
java.lang.Object
java.io.StreamTokenizer
com.tirix.util.SimpleTokenizer
public class SimpleTokenizer
- extends StreamTokenizer
The class to parse a data file.
This is basically a StreamTokenizer extended with some useful methods.
- Version:
- $Id: SimpleTokenizer.java,v 1.2 2004/07/15 16:28:11 tirix Exp $
Change Log:
$Log: SimpleTokenizer.java,v $
Revision 1.2 2004/07/15 16:28:11 tirix
New handling of parsing exceptions.
Revision 1.1 2004/06/09 20:49:12 tirix
First version.
Revision 1.4 2002/03/05 21:57:24 Clara
Adapted 'parseOneOf'.
Revision 1.3 2001/11/24 01:22:10 Clara
New utility call "parseKeywordValue".
Revision 1.2 2001/11/19 22:21:36 Clara
Changed the Initialisation, added the 'close' capacity.
Revision 1.1.1.1 2001/09/30 13:14:01 Clara
Initial CVS check in.
Copyright (C) 2001 Thierry Arnoux.
- Author:
- Thierry Arnoux
| Methods inherited from class java.io.StreamTokenizer |
commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars |
SimpleTokenizer
public SimpleTokenizer(Reader r,
String fileName,
Class parsingExceptionClass)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseKeyword
public String parseKeyword(String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseString
public String parseString(String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseOrdinaryChar
public void parseOrdinaryChar(int oChar)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseOrdinaryChar
public void parseOrdinaryChar(int oChar,
String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
nextWordIs
public boolean nextWordIs(String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
nextCharIs
public boolean nextCharIs(int aChar)
nextCharIs
public boolean nextCharIs(char aChar)
parseFixedWord
public void parseFixedWord(String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseOneOf
public int parseOneOf(String[] choices,
String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseOneOf
public int parseOneOf(String[] choices)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseInteger
public int parseInteger()
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseFloat
public float parseFloat()
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
getNextToken
public int getNextToken()
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
eof
public boolean eof()
parseKeywordValue
public String parseKeywordValue(String awaited)
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseStringValue
public String parseStringValue()
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
parseIntegerValue
public int parseIntegerValue()
throws SimpleTokenizer.ParsingException
- Throws:
SimpleTokenizer.ParsingException
getParsingException
public SimpleTokenizer.ParsingException getParsingException(String awaited)
getParsingException
public SimpleTokenizer.ParsingException getParsingException(String awaited,
String got)
makeParsingException
public SimpleTokenizer.ParsingException makeParsingException(String text)