com.ricebridge.csvman
Class CsvLexer

java.lang.Object
  extended bycom.ricebridge.csvman.imp.antlr.CharScanner
      extended bycom.ricebridge.csvman.CsvLexer
All Implemented Interfaces:
CsvParserTokenTypes, com.ricebridge.csvman.imp.antlr.TokenStream

public class CsvLexer
extends com.ricebridge.csvman.imp.antlr.CharScanner
implements CsvParserTokenTypes, com.ricebridge.csvman.imp.antlr.TokenStream

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.


Field Summary
 
Fields inherited from class com.ricebridge.csvman.imp.antlr.CharScanner
_returnToken, caseSensitive, caseSensitiveLiterals, commitToPath, EOF_CHAR, hashString, inputState, literals, saveConsumedInput, tabsize, text, 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
CsvLexer(com.ricebridge.csvman.imp.antlr.InputBuffer ib)
           
CsvLexer(InputStream in)
           
CsvLexer(com.ricebridge.csvman.imp.antlr.LexerSharedInputState state)
           
CsvLexer(Reader in)
           
 
Method Summary
protected  void mCOMMENT(boolean _createToken)
           
protected  void mDQ(boolean _createToken)
           
protected  void mEC(boolean _createToken)
           
protected  void mENDOFLINE(boolean _createToken)
           
protected  void mFIELD(boolean _createToken)
           
protected  void mMERGE_SEP(boolean _createToken)
           
protected  void mQUOTED_FIELD(boolean _createToken)
           
 void mROOT(boolean _createToken)
           
protected  void mSEP(boolean _createToken)
           
protected  void mSINGLE_SEP(boolean _createToken)
           
protected  void mUNQUOTED_FIELD(boolean _createToken)
           
 com.ricebridge.csvman.imp.antlr.Token nextToken()
           
 void panic()
           
 void panic(String pText)
           
 void reportError(com.ricebridge.csvman.imp.antlr.RecognitionException pRE)
           
 void reportError(String pText)
           
 void reportWarning(String pText)
           
 void setAllowQuotedLineEnds(boolean pAllowQuotedLineEnds)
           
 void setComment(char pComment)
           
 void setCommentWithinLine(boolean pCommentWithinLine)
           
 void setDoubleQuote(boolean pDoubleQuote)
           
 void setEndOfLine(String pEndOfLine)
           
 void setEscape(char pEscape)
           
 void setEscapeMap(HashMap pEscapeMap)
           
 void setMergeSeparators(boolean pMergeSeparators)
           
 void setQuote(char pQuote)
           
 void setSeparator(String pSeparator)
           
 void setTrim(String pTrim)
           
 void setTrimType(TrimType pTrimType)
           
 void setUseComment(boolean pUseComment)
           
 void setUseEscape(boolean pUseEscape)
           
 void setUseEscapeMap(boolean pUseEscapeMap)
           
 void setUseQuote(boolean pUseQuote)
           
 
Methods inherited from class com.ricebridge.csvman.imp.antlr.CharScanner
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getTabSize, getText, getTokenObject, initStringBuffer, LA, makeToken, mark, match, match, match, matchNot, matchRange, newline, resetText, rewind, setCaseSensitive, setColumn, setCommitToPath, setFilename, setInputState, setLine, setTabSize, setText, tab, testLiteralsTable, testLiteralsTable, toLower, traceIn, traceIndent, traceOut, uponEOF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvLexer

public CsvLexer(InputStream in)

CsvLexer

public CsvLexer(Reader in)

CsvLexer

public CsvLexer(com.ricebridge.csvman.imp.antlr.InputBuffer ib)

CsvLexer

public CsvLexer(com.ricebridge.csvman.imp.antlr.LexerSharedInputState state)
Method Detail

panic

public void panic()

panic

public void panic(String pText)

reportError

public void reportError(com.ricebridge.csvman.imp.antlr.RecognitionException pRE)

reportError

public void reportError(String pText)

reportWarning

public void reportWarning(String pText)

setSeparator

public void setSeparator(String pSeparator)

setQuote

public void setQuote(char pQuote)

setEscape

public void setEscape(char pEscape)

setEndOfLine

public void setEndOfLine(String pEndOfLine)

setMergeSeparators

public void setMergeSeparators(boolean pMergeSeparators)

setUseQuote

public void setUseQuote(boolean pUseQuote)

setDoubleQuote

public void setDoubleQuote(boolean pDoubleQuote)

setUseEscape

public void setUseEscape(boolean pUseEscape)

setTrim

public void setTrim(String pTrim)

setTrimType

public void setTrimType(TrimType pTrimType)

setUseEscapeMap

public void setUseEscapeMap(boolean pUseEscapeMap)

setEscapeMap

public void setEscapeMap(HashMap pEscapeMap)

setAllowQuotedLineEnds

public void setAllowQuotedLineEnds(boolean pAllowQuotedLineEnds)

setComment

public void setComment(char pComment)

setUseComment

public void setUseComment(boolean pUseComment)

setCommentWithinLine

public void setCommentWithinLine(boolean pCommentWithinLine)

nextToken

public com.ricebridge.csvman.imp.antlr.Token nextToken()
                                                throws com.ricebridge.csvman.imp.antlr.TokenStreamException
Specified by:
nextToken in interface com.ricebridge.csvman.imp.antlr.TokenStream
Throws:
com.ricebridge.csvman.imp.antlr.TokenStreamException

mROOT

public final void mROOT(boolean _createToken)
                 throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                        com.ricebridge.csvman.imp.antlr.CharStreamException,
                        com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mSEP

protected final void mSEP(boolean _createToken)
                   throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                          com.ricebridge.csvman.imp.antlr.CharStreamException,
                          com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mENDOFLINE

protected final void mENDOFLINE(boolean _createToken)
                         throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                                com.ricebridge.csvman.imp.antlr.CharStreamException,
                                com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mCOMMENT

protected final void mCOMMENT(boolean _createToken)
                       throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                              com.ricebridge.csvman.imp.antlr.CharStreamException,
                              com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mFIELD

protected final void mFIELD(boolean _createToken)
                     throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                            com.ricebridge.csvman.imp.antlr.CharStreamException,
                            com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mSINGLE_SEP

protected final void mSINGLE_SEP(boolean _createToken)
                          throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                                 com.ricebridge.csvman.imp.antlr.CharStreamException,
                                 com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mMERGE_SEP

protected final void mMERGE_SEP(boolean _createToken)
                         throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                                com.ricebridge.csvman.imp.antlr.CharStreamException,
                                com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mUNQUOTED_FIELD

protected final void mUNQUOTED_FIELD(boolean _createToken)
                              throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                                     com.ricebridge.csvman.imp.antlr.CharStreamException,
                                     com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mQUOTED_FIELD

protected final void mQUOTED_FIELD(boolean _createToken)
                            throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                                   com.ricebridge.csvman.imp.antlr.CharStreamException,
                                   com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mEC

protected final void mEC(boolean _createToken)
                  throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                         com.ricebridge.csvman.imp.antlr.CharStreamException,
                         com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException

mDQ

protected final void mDQ(boolean _createToken)
                  throws com.ricebridge.csvman.imp.antlr.RecognitionException,
                         com.ricebridge.csvman.imp.antlr.CharStreamException,
                         com.ricebridge.csvman.imp.antlr.TokenStreamException
Throws:
com.ricebridge.csvman.imp.antlr.RecognitionException
com.ricebridge.csvman.imp.antlr.CharStreamException
com.ricebridge.csvman.imp.antlr.TokenStreamException


Copyright © 2003-2006 Ricebridge