Package org.yecht
Class TokenScanner
- java.lang.Object
-
- org.yecht.TokenScanner
-
- All Implemented Interfaces:
DefaultYAMLParser.yyInput
public class TokenScanner extends java.lang.Object implements DefaultYAMLParser.yyInput
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTokenScanner.QuotedString
-
Field Summary
Fields Modifier and Type Field Description private intcurrentTokenprivate static boolean[]DIGIT_OR_SIGNprivate java.lang.Objectlvalprivate Parserparserstatic intQUOTELENstatic java.lang.String[]tnamesprivate static boolean[]YWORDC
-
Constructor Summary
Constructors Constructor Description TokenScanner(Parser parser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadvance()move on to next token.private voidcountAndAddNewlines(TokenScanner.QuotedString q)static DefaultYAMLParser.yyInputcreateScanner(Parser parser)private intdirective()private intdocument(int doc_level)private intdoubleQuote()private voideatComments()private booleanendspc()static voiderror(java.lang.String msg, Parser parser)private byteescapeSeq(byte ch)private intGET_TRUE_YAML_INDENT()private intgetAndCheckIndentLength()private intheader()private intisNewline(byte[] buff, int ptr)private intisNewline(int ptr)private voidNEWLINE(int ptr)private intnewlineLen(byte[] buff, int ptr)private intnewlineLen(int ptr)private intplain()private intreal_yylex()voidRETURN_IMPLICIT(TokenScanner.QuotedString q)private voidRETURN_YAML_BLOCK(TokenScanner.QuotedString q, int blockType, int nlDoWhat)private intscalarBlock()private intsingleQuote()private voidspcOrLfStar()inttoken()classifies current token.private inttransferMethod()java.lang.Objectvalue()associated with current token.private booleanyblock()private booleanywordc()private voidYYPOS(int n)
-
-
-
Field Detail
-
QUOTELEN
public static final int QUOTELEN
- See Also:
- Constant Field Values
-
parser
private Parser parser
-
lval
private java.lang.Object lval
-
currentToken
private int currentToken
-
tnames
public static final java.lang.String[] tnames
-
YWORDC
private static final boolean[] YWORDC
-
DIGIT_OR_SIGN
private static final boolean[] DIGIT_OR_SIGN
-
-
Constructor Detail
-
TokenScanner
public TokenScanner(Parser parser)
-
-
Method Detail
-
error
public static void error(java.lang.String msg, Parser parser)
-
createScanner
public static DefaultYAMLParser.yyInput createScanner(Parser parser)
-
value
public java.lang.Object value()
Description copied from interface:DefaultYAMLParser.yyInputassociated with current token. Should not be called ifDefaultYAMLParser.yyInput.advance()returned false.- Specified by:
valuein interfaceDefaultYAMLParser.yyInput- Returns:
- value for
DefaultYAMLParser.yyInput.token().
-
token
public int token()
Description copied from interface:DefaultYAMLParser.yyInputclassifies current token. Should not be called ifDefaultYAMLParser.yyInput.advance()returned false.- Specified by:
tokenin interfaceDefaultYAMLParser.yyInput- Returns:
- current %token or single character.
-
advance
public boolean advance() throws java.io.IOExceptionDescription copied from interface:DefaultYAMLParser.yyInputmove on to next token.- Specified by:
advancein interfaceDefaultYAMLParser.yyInput- Returns:
- false if positioned beyond tokens.
- Throws:
java.io.IOException
-
isNewline
private int isNewline(int ptr)
-
newlineLen
private int newlineLen(int ptr)
-
isNewline
private int isNewline(byte[] buff, int ptr)
-
newlineLen
private int newlineLen(byte[] buff, int ptr)
-
NEWLINE
private void NEWLINE(int ptr)
-
RETURN_YAML_BLOCK
private void RETURN_YAML_BLOCK(TokenScanner.QuotedString q, int blockType, int nlDoWhat)
-
GET_TRUE_YAML_INDENT
private int GET_TRUE_YAML_INDENT()
-
YYPOS
private void YYPOS(int n)
-
RETURN_IMPLICIT
public void RETURN_IMPLICIT(TokenScanner.QuotedString q)
-
real_yylex
private int real_yylex() throws java.io.IOException- Throws:
java.io.IOException
-
header
private int header() throws java.io.IOException- Throws:
java.io.IOException
-
spcOrLfStar
private void spcOrLfStar() throws java.io.IOException- Throws:
java.io.IOException
-
ywordc
private boolean ywordc() throws java.io.IOException- Throws:
java.io.IOException
-
endspc
private boolean endspc() throws java.io.IOException- Throws:
java.io.IOException
-
yblock
private boolean yblock() throws java.io.IOException- Throws:
java.io.IOException
-
document
private int document(int doc_level) throws java.io.IOException- Throws:
java.io.IOException
-
directive
private int directive() throws java.io.IOException- Throws:
java.io.IOException
-
getAndCheckIndentLength
private int getAndCheckIndentLength()
-
countAndAddNewlines
private void countAndAddNewlines(TokenScanner.QuotedString q)
-
plain
private int plain() throws java.io.IOException- Throws:
java.io.IOException
-
doubleQuote
private int doubleQuote() throws java.io.IOException- Throws:
java.io.IOException
-
singleQuote
private int singleQuote() throws java.io.IOException- Throws:
java.io.IOException
-
transferMethod
private int transferMethod() throws java.io.IOException- Throws:
java.io.IOException
-
scalarBlock
private int scalarBlock() throws java.io.IOException- Throws:
java.io.IOException
-
escapeSeq
private byte escapeSeq(byte ch)
-
eatComments
private void eatComments() throws java.io.IOException- Throws:
java.io.IOException
-
-