gate.wiki.antlr
Class YAMLexer

java.lang.Object
  extended by antlr.CharScanner
      extended by gate.wiki.antlr.YAMLexer
All Implemented Interfaces:
antlr.TokenStream, YAMLexerTokenTypes
Direct Known Subclasses:
DefaultYAMEngine

public abstract class YAMLexer
extends antlr.CharScanner
implements YAMLexerTokenTypes, antlr.TokenStream

Parse and translate YAM input. All lexers for an input and included text share the same context but each lexer can have their own translator target. Most functionality is in the DefaultYAMEngine.


Field Summary
static antlr.collections.impl.BitSet _tokenSet_0
           
static antlr.collections.impl.BitSet _tokenSet_1
           
static antlr.collections.impl.BitSet _tokenSet_10
           
static antlr.collections.impl.BitSet _tokenSet_11
           
static antlr.collections.impl.BitSet _tokenSet_12
           
static antlr.collections.impl.BitSet _tokenSet_13
           
static antlr.collections.impl.BitSet _tokenSet_14
           
static antlr.collections.impl.BitSet _tokenSet_15
           
static antlr.collections.impl.BitSet _tokenSet_16
           
static antlr.collections.impl.BitSet _tokenSet_17
           
static antlr.collections.impl.BitSet _tokenSet_18
           
static antlr.collections.impl.BitSet _tokenSet_19
           
static antlr.collections.impl.BitSet _tokenSet_2
           
static antlr.collections.impl.BitSet _tokenSet_3
           
static antlr.collections.impl.BitSet _tokenSet_4
           
static antlr.collections.impl.BitSet _tokenSet_5
           
static antlr.collections.impl.BitSet _tokenSet_6
           
static antlr.collections.impl.BitSet _tokenSet_7
           
static antlr.collections.impl.BitSet _tokenSet_8
           
static antlr.collections.impl.BitSet _tokenSet_9
           
protected  YAMContext context
          Tracks variables and such; later track line number etc...
protected  boolean inTable
          Can't do some things in tables like bullet lists
protected  boolean inTitle
           
 YAMTarget target
          Each lexer/translator can have it's own target language
 
Fields inherited from class antlr.CharScanner
_returnToken, caseSensitive, caseSensitiveLiterals, commitToPath, EOF_CHAR, hashString, inputState, literals, saveConsumedInput, tabsize, text, tokenObjectClass, traceDepth
 
Fields inherited from interface gate.wiki.antlr.YAMLexerTokenTypes
ANCHOR, ARG, ARGLIST, BLANK, BLANK_LINE_THEN_MARKUP, BLOCKQUOTE, BOLD, BR, CODE, COL_SEP, END_TABLE, EOF, ESC, ESC2, ID, INQUOTE, ITALIC, LEFT_EDGE_MARKUP, LEVEL, LINE_START_THEN_MARKUP, LINK, LONGDASH, NESTED_PAREN, NOT_SPECIAL_CHAR, NULL_TREE_LOOKAHEAD, PLUGIN, ROW_SEP, SECTION, STRING, TABLE, TEXT, TEXT_TIL_END_ARG, TITLE, TOP_PAREN, TT, WS, WS2
 
Constructor Summary
YAMLexer(antlr.InputBuffer ib)
           
YAMLexer(InputStream in)
           
YAMLexer(antlr.LexerSharedInputState state)
           
YAMLexer(Reader in)
           
YAMLexer(Reader in, YAMContext context)
          Used by sublexers that handle plugin data; shares context with original
 
Method Summary
protected abstract  void captureText()
           
protected abstract  void closeAllLists()
           
protected abstract  void closeAllLists(int level)
           
protected abstract  void closeList()
           
protected abstract  void closeSectionsToLevel(int level)
           
protected abstract  void define(String id, String value)
           
 YAMContext getContext()
           
 YAMTarget getTarget()
           
 void mANCHOR(boolean _createToken)
          An anchor is a # followed by an ID
protected  void mARG(boolean _createToken)
           
protected  Vector mARGLIST(boolean _createToken)
           
 void mBLANK_LINE_THEN_MARKUP(boolean _createToken)
           
 void mBLANK(boolean _createToken)
           
protected  void mBLOCKQUOTE(boolean _createToken)
           
 void mBOLD(boolean _createToken)
           
 void mBR(boolean _createToken)
           
protected  void mCODE(boolean _createToken)
           
 void mCOL_SEP(boolean _createToken)
           
protected  void mEND_TABLE(boolean _createToken)
           
 void mESC(boolean _createToken)
           
protected  void mESC2(boolean _createToken)
           
protected  void mID(boolean _createToken)
           
protected  void mINQUOTE(boolean _createToken)
           
 void mITALIC(boolean _createToken)
           
protected  void mLEFT_EDGE_MARKUP(boolean _createToken)
           
protected  void mLEVEL(boolean _createToken)
           
 void mLINE_START_THEN_MARKUP(boolean _createToken)
           
 void mLINK(boolean _createToken)
          A link looks like %(url,title) or %(url), which is same as http://foo.com.
 void mLONGDASH(boolean _createToken)
           
protected  void mNESTED_PAREN(boolean _createToken)
           
protected  void mNOT_SPECIAL_CHAR(boolean _createToken)
           
 void mPLUGIN(boolean _createToken)
           
 void mROW_SEP(boolean _createToken)
           
protected  void mSECTION(boolean _createToken)
           
protected  void mSTRING(boolean _createToken)
           
protected  void mTABLE(boolean _createToken)
           
protected  void mTEXT_TIL_END_ARG(boolean _createToken)
           
protected  void mTEXT(boolean _createToken)
          The catch-all "else" rule.
 void mTITLE(boolean _createToken)
          First line of outermost file (stdin usually) is title
protected  void mTOP_PAREN(boolean _createToken)
           
 void mTT(boolean _createToken)
           
protected  void mWS(boolean _createToken)
           
protected  void mWS2(boolean _createToken)
           
 antlr.Token nextToken()
           
protected abstract  void ol(int level)
           
protected abstract  void plugin(String id, Vector args)
           
protected abstract  void section(String text, int level)
           
 void setContext(YAMContext context)
           
protected abstract  void title(String title)
           
abstract  void translate(YAMTarget target)
          Begin on-the-fly syntax-directed translation
protected abstract  void ul(int level)
           
protected abstract  void variable(String id)
           
 
Methods inherited from class antlr.CharScanner
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getTabSize, getText, getTokenObject, LA, makeToken, mark, match, match, match, matchNot, matchRange, newline, panic, panic, reportError, reportError, reportWarning, resetText, rewind, setCaseSensitive, setColumn, setCommitToPath, setFilename, setInputState, setLine, setTabSize, setText, setTokenObjectClass, 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
 

Field Detail

context

protected YAMContext context
Tracks variables and such; later track line number etc...


target

public YAMTarget target
Each lexer/translator can have it's own target language


inTable

protected boolean inTable
Can't do some things in tables like bullet lists


inTitle

protected boolean inTitle

_tokenSet_0

public static final antlr.collections.impl.BitSet _tokenSet_0

_tokenSet_1

public static final antlr.collections.impl.BitSet _tokenSet_1

_tokenSet_2

public static final antlr.collections.impl.BitSet _tokenSet_2

_tokenSet_3

public static final antlr.collections.impl.BitSet _tokenSet_3

_tokenSet_4

public static final antlr.collections.impl.BitSet _tokenSet_4

_tokenSet_5

public static final antlr.collections.impl.BitSet _tokenSet_5

_tokenSet_6

public static final antlr.collections.impl.BitSet _tokenSet_6

_tokenSet_7

public static final antlr.collections.impl.BitSet _tokenSet_7

_tokenSet_8

public static final antlr.collections.impl.BitSet _tokenSet_8

_tokenSet_9

public static final antlr.collections.impl.BitSet _tokenSet_9

_tokenSet_10

public static final antlr.collections.impl.BitSet _tokenSet_10

_tokenSet_11

public static final antlr.collections.impl.BitSet _tokenSet_11

_tokenSet_12

public static final antlr.collections.impl.BitSet _tokenSet_12

_tokenSet_13

public static final antlr.collections.impl.BitSet _tokenSet_13

_tokenSet_14

public static final antlr.collections.impl.BitSet _tokenSet_14

_tokenSet_15

public static final antlr.collections.impl.BitSet _tokenSet_15

_tokenSet_16

public static final antlr.collections.impl.BitSet _tokenSet_16

_tokenSet_17

public static final antlr.collections.impl.BitSet _tokenSet_17

_tokenSet_18

public static final antlr.collections.impl.BitSet _tokenSet_18

_tokenSet_19

public static final antlr.collections.impl.BitSet _tokenSet_19
Constructor Detail

YAMLexer

public YAMLexer(Reader in,
                YAMContext context)
Used by sublexers that handle plugin data; shares context with original


YAMLexer

public YAMLexer(InputStream in)

YAMLexer

public YAMLexer(Reader in)

YAMLexer

public YAMLexer(antlr.InputBuffer ib)

YAMLexer

public YAMLexer(antlr.LexerSharedInputState state)
Method Detail

getTarget

public YAMTarget getTarget()

getContext

public YAMContext getContext()

setContext

public void setContext(YAMContext context)

translate

public abstract void translate(YAMTarget target)
                        throws antlr.TokenStreamException
Begin on-the-fly syntax-directed translation

Throws:
antlr.TokenStreamException

closeAllLists

protected abstract void closeAllLists()

closeAllLists

protected abstract void closeAllLists(int level)

closeList

protected abstract void closeList()

captureText

protected abstract void captureText()

ul

protected abstract void ul(int level)

ol

protected abstract void ol(int level)

closeSectionsToLevel

protected abstract void closeSectionsToLevel(int level)

section

protected abstract void section(String text,
                                int level)

title

protected abstract void title(String title)

define

protected abstract void define(String id,
                               String value)

plugin

protected abstract void plugin(String id,
                               Vector args)

variable

protected abstract void variable(String id)

nextToken

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

mBOLD

public final void mBOLD(boolean _createToken)
                 throws antlr.RecognitionException,
                        antlr.CharStreamException,
                        antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mITALIC

public final void mITALIC(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mTT

public final void mTT(boolean _createToken)
               throws antlr.RecognitionException,
                      antlr.CharStreamException,
                      antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLINK

public final void mLINK(boolean _createToken)
                 throws antlr.RecognitionException,
                        antlr.CharStreamException,
                        antlr.TokenStreamException
A link looks like %(url,title) or %(url), which is same as http://foo.com. An anchor ref to an image, table or section will be %table(name). A wikilink looks like %(WikiLink) i.e. CamelCase within the %() link indicators.

Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mANCHOR

public final void mANCHOR(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
An anchor is a # followed by an ID

Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mTITLE

public final void mTITLE(boolean _createToken)
                  throws antlr.RecognitionException,
                         antlr.CharStreamException,
                         antlr.TokenStreamException
First line of outermost file (stdin usually) is title

Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mNOT_SPECIAL_CHAR

protected final void mNOT_SPECIAL_CHAR(boolean _createToken)
                                throws antlr.RecognitionException,
                                       antlr.CharStreamException,
                                       antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mBR

public final void mBR(boolean _createToken)
               throws antlr.RecognitionException,
                      antlr.CharStreamException,
                      antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mBLANK

public final void mBLANK(boolean _createToken)
                  throws antlr.RecognitionException,
                         antlr.CharStreamException,
                         antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLONGDASH

public final void mLONGDASH(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mTOP_PAREN

protected final void mTOP_PAREN(boolean _createToken)
                         throws antlr.RecognitionException,
                                antlr.CharStreamException,
                                antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mNESTED_PAREN

protected final void mNESTED_PAREN(boolean _createToken)
                            throws antlr.RecognitionException,
                                   antlr.CharStreamException,
                                   antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mPLUGIN

public final void mPLUGIN(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mID

protected final void mID(boolean _createToken)
                  throws antlr.RecognitionException,
                         antlr.CharStreamException,
                         antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mWS

protected final void mWS(boolean _createToken)
                  throws antlr.RecognitionException,
                         antlr.CharStreamException,
                         antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mARG

protected final void mARG(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mARGLIST

protected final Vector mARGLIST(boolean _createToken)
                         throws antlr.RecognitionException,
                                antlr.CharStreamException,
                                antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCODE

protected final void mCODE(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mSTRING

protected final void mSTRING(boolean _createToken)
                      throws antlr.RecognitionException,
                             antlr.CharStreamException,
                             antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mTEXT_TIL_END_ARG

protected final void mTEXT_TIL_END_ARG(boolean _createToken)
                                throws antlr.RecognitionException,
                                       antlr.CharStreamException,
                                       antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mESC

public final void mESC(boolean _createToken)
                throws antlr.RecognitionException,
                       antlr.CharStreamException,
                       antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mESC2

protected final void mESC2(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLINE_START_THEN_MARKUP

public final void mLINE_START_THEN_MARKUP(boolean _createToken)
                                   throws antlr.RecognitionException,
                                          antlr.CharStreamException,
                                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLEFT_EDGE_MARKUP

protected final void mLEFT_EDGE_MARKUP(boolean _createToken)
                                throws antlr.RecognitionException,
                                       antlr.CharStreamException,
                                       antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mBLANK_LINE_THEN_MARKUP

public final void mBLANK_LINE_THEN_MARKUP(boolean _createToken)
                                   throws antlr.RecognitionException,
                                          antlr.CharStreamException,
                                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mBLOCKQUOTE

protected final void mBLOCKQUOTE(boolean _createToken)
                          throws antlr.RecognitionException,
                                 antlr.CharStreamException,
                                 antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mSECTION

protected final void mSECTION(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mTABLE

protected final void mTABLE(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mEND_TABLE

protected final void mEND_TABLE(boolean _createToken)
                         throws antlr.RecognitionException,
                                antlr.CharStreamException,
                                antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mINQUOTE

protected final void mINQUOTE(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLEVEL

protected final void mLEVEL(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCOL_SEP

public final void mCOL_SEP(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mROW_SEP

public final void mROW_SEP(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mTEXT

protected final void mTEXT(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
The catch-all "else" rule. Anything not matched as a tag, gets matched here. The chars are buffered up until the next tag is recognized at which point the target.text() method gets the text.

Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mWS2

protected final void mWS2(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException