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 class
TokenScanner.QuotedString
-
Field Summary
Fields Modifier and Type Field Description private int
currentToken
private static boolean[]
DIGIT_OR_SIGN
private java.lang.Object
lval
private Parser
parser
static int
QUOTELEN
static java.lang.String[]
tnames
private 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 boolean
advance()
move on to next token.private void
countAndAddNewlines(TokenScanner.QuotedString q)
static DefaultYAMLParser.yyInput
createScanner(Parser parser)
private int
directive()
private int
document(int doc_level)
private int
doubleQuote()
private void
eatComments()
private boolean
endspc()
static void
error(java.lang.String msg, Parser parser)
private byte
escapeSeq(byte ch)
private int
GET_TRUE_YAML_INDENT()
private int
getAndCheckIndentLength()
private int
header()
private int
isNewline(byte[] buff, int ptr)
private int
isNewline(int ptr)
private void
NEWLINE(int ptr)
private int
newlineLen(byte[] buff, int ptr)
private int
newlineLen(int ptr)
private int
plain()
private int
real_yylex()
void
RETURN_IMPLICIT(TokenScanner.QuotedString q)
private void
RETURN_YAML_BLOCK(TokenScanner.QuotedString q, int blockType, int nlDoWhat)
private int
scalarBlock()
private int
singleQuote()
private void
spcOrLfStar()
int
token()
classifies current token.private int
transferMethod()
java.lang.Object
value()
associated with current token.private boolean
yblock()
private boolean
ywordc()
private void
YYPOS(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.yyInput
associated with current token. Should not be called ifDefaultYAMLParser.yyInput.advance()
returned false.- Specified by:
value
in interfaceDefaultYAMLParser.yyInput
- Returns:
- value for
DefaultYAMLParser.yyInput.token()
.
-
token
public int token()
Description copied from interface:DefaultYAMLParser.yyInput
classifies current token. Should not be called ifDefaultYAMLParser.yyInput.advance()
returned false.- Specified by:
token
in interfaceDefaultYAMLParser.yyInput
- Returns:
- current %token or single character.
-
advance
public boolean advance() throws java.io.IOException
Description copied from interface:DefaultYAMLParser.yyInput
move on to next token.- Specified by:
advance
in 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
-
-