com.ricebridge.csvman
Class CsvParser
java.lang.Object
com.ricebridge.csvman.imp.antlr.Parser
com.ricebridge.csvman.imp.antlr.LLkParser
com.ricebridge.csvman.CsvParser
- All Implemented Interfaces:
- CsvParserTokenTypes
- public class CsvParser
- extends com.ricebridge.csvman.imp.antlr.LLkParser
- implements CsvParserTokenTypes
Internal Class; handles parsing of CSV text using the ANTLR parser generator.
ANTLR is used by Ricebridge CSV Manager under the terms of the ANTLR license,
which allows for commercial redistribution.
| Fields inherited from class com.ricebridge.csvman.imp.antlr.Parser |
inputState, tokenNames, traceDepth |
| Fields inherited from interface com.ricebridge.csvman.CsvParserTokenTypes |
COMMENT, DQ, EC, ENDOFLINE, EOF, FIELD, MERGE_SEP, NULL_TREE_LOOKAHEAD, QUOTED_FIELD, ROOT, SEP, SINGLE_SEP, UNQUOTED_FIELD |
|
Constructor Summary |
|
CsvParser(com.ricebridge.csvman.imp.antlr.ParserSharedInputState state)
|
|
CsvParser(com.ricebridge.csvman.imp.antlr.TokenBuffer tokenBuf)
|
protected |
CsvParser(com.ricebridge.csvman.imp.antlr.TokenBuffer tokenBuf,
int k)
|
|
CsvParser(com.ricebridge.csvman.imp.antlr.TokenStream lexer)
|
protected |
CsvParser(com.ricebridge.csvman.imp.antlr.TokenStream lexer,
int k)
|
| Methods inherited from class com.ricebridge.csvman.imp.antlr.LLkParser |
consume, LA, LT, traceIn, traceOut |
| Methods inherited from class com.ricebridge.csvman.imp.antlr.Parser |
consumeUntil, consumeUntil, defaultDebuggingSetup, getFilename, getInputState, getTokenName, getTokenNames, isDebugMode, mark, match, match, matchNot, rewind, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOTBAD
public static int NOTBAD
JUSTBAD
public static int JUSTBAD
LASTBAD
public static int LASTBAD
REALLYBAD
public static int REALLYBAD
iBadLineState
public int iBadLineState
_tokenNames
public static final String[] _tokenNames
_tokenSet_0
public static final com.ricebridge.csvman.imp.antlr.collections.impl.BitSet _tokenSet_0
_tokenSet_1
public static final com.ricebridge.csvman.imp.antlr.collections.impl.BitSet _tokenSet_1
CsvParser
protected CsvParser(com.ricebridge.csvman.imp.antlr.TokenBuffer tokenBuf,
int k)
CsvParser
public CsvParser(com.ricebridge.csvman.imp.antlr.TokenBuffer tokenBuf)
CsvParser
protected CsvParser(com.ricebridge.csvman.imp.antlr.TokenStream lexer,
int k)
CsvParser
public CsvParser(com.ricebridge.csvman.imp.antlr.TokenStream lexer)
CsvParser
public CsvParser(com.ricebridge.csvman.imp.antlr.ParserSharedInputState state)
reportError
public void reportError(com.ricebridge.csvman.imp.antlr.RecognitionException pRE)
reportError
public void reportError(String pText)
reportWarning
public void reportWarning(String pText)
setNumFields
public void setNumFields(int pSize)
setLineListener
public void setLineListener(LineListener pLineListener)
setFieldListener
public void setFieldListener(FieldListener pFieldListener)
setEndOfLine
public void setEndOfLine(String pEndOfLine)
setCsvBuffer
public void setCsvBuffer(CsvBuffer pCsvBuffer)
setIgnoreBadLines
public void setIgnoreBadLines(boolean pIgnoreBadLines)
setCollectBadLines
public void setCollectBadLines(boolean pCollectBadLines)
setIgnoreEmptyLines
public void setIgnoreEmptyLines(boolean pIgnoreEmptyLines)
setStartLine
public void setStartLine(long pStartLine)
setEndLine
public void setEndLine(long pEndLine)
addField
public void addField(String pValue)
getLineCount
public long getLineCount()
getBadLineCount
public long getBadLineCount()
getBadLines
public List getBadLines()
emptyLine
public boolean emptyLine()
checkLineWithinBounds
public boolean checkLineWithinBounds()
lineWithinBounds
public boolean lineWithinBounds()
badLine
public void badLine(Exception e)
- keeps parsing as if at line end, so badline must be built from multiple line matches
closeBadLine
public void closeBadLine(boolean pCallBadLine,
boolean pOnward,
String entry)
handleLine
public boolean handleLine()
table
public final void table()
throws com.ricebridge.csvman.imp.antlr.RecognitionException,
com.ricebridge.csvman.imp.antlr.TokenStreamException,
Exception
- Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.TokenStreamException
Exception
line
public final boolean line()
throws com.ricebridge.csvman.imp.antlr.RecognitionException,
com.ricebridge.csvman.imp.antlr.TokenStreamException,
Exception
- Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.TokenStreamException
Exception
sep_first
public final void sep_first()
throws com.ricebridge.csvman.imp.antlr.RecognitionException,
com.ricebridge.csvman.imp.antlr.TokenStreamException
- Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.TokenStreamException
field
public final void field()
throws com.ricebridge.csvman.imp.antlr.RecognitionException,
com.ricebridge.csvman.imp.antlr.TokenStreamException
- Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.TokenStreamException
sep
public final void sep()
throws com.ricebridge.csvman.imp.antlr.RecognitionException,
com.ricebridge.csvman.imp.antlr.TokenStreamException
- Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.TokenStreamException
endline
public final void endline()
throws com.ricebridge.csvman.imp.antlr.RecognitionException,
com.ricebridge.csvman.imp.antlr.TokenStreamException
- Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.TokenStreamException
Copyright © 2003-2006 Ricebridge