public class RubyYaccLexer
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RubyYaccLexer.Keyword |
static class |
RubyYaccLexer.LexState |
| Modifier and Type | Field and Description |
|---|---|
static org.jcodings.Encoding |
ASCII8BIT_ENCODING |
private static org.jruby.util.ByteList |
BEGIN_DOC_MARKER |
private StackState |
cmdArgumentState |
boolean |
commandStart |
private StackState |
conditionState |
private org.jcodings.Encoding |
encoding |
private static org.joni.Regex |
encodingRegexp |
private static java.lang.String |
encodingString |
private static org.jruby.util.ByteList |
END_DOC_MARKER |
private static org.jruby.util.ByteList |
END_MARKER |
(package private) static int |
EOF |
private boolean |
isOneEight |
private boolean |
isTwoZero |
private RubyYaccLexer.LexState |
last_state |
private int |
leftParenBegin |
private RubyYaccLexer.LexState |
lex_state |
private StrTerm |
lex_strterm |
private static org.joni.Regex |
magicRegexp |
private static java.lang.String |
magicString |
private static java.util.HashMap<java.lang.String,RubyYaccLexer.Keyword> |
map |
private byte[] |
mbcBuf |
private int |
parenNest |
private ParserSupport |
parserSupport |
private LexerSource |
src |
private static int |
str_dquote |
private static int |
str_dsym |
(package private) static int |
STR_FUNC_ESCAPE |
(package private) static int |
STR_FUNC_EXPAND |
(package private) static int |
STR_FUNC_INDENT |
(package private) static int |
STR_FUNC_QWORDS |
(package private) static int |
STR_FUNC_REGEXP |
(package private) static int |
STR_FUNC_SYMBOL |
private static int |
str_regexp |
private static int |
str_squote |
private static int |
str_ssym |
private static int |
str_xquote |
private int |
token |
private java.lang.StringBuilder |
tokenBuffer |
static org.jcodings.Encoding |
USASCII_ENCODING |
static org.jcodings.Encoding |
UTF8_ENCODING |
private IRubyWarnings |
warnings |
(package private) java.lang.Object |
yaccValue |
| Constructor and Description |
|---|
RubyYaccLexer() |
RubyYaccLexer(boolean isOneEight) |
| Modifier and Type | Method and Description |
|---|---|
private void |
ambiguousOperator(java.lang.String op,
java.lang.String syn) |
private int |
ampersand(boolean spaceSeen) |
private void |
arg_ambiguous() |
private int |
at() |
private int |
backtick(boolean commandState) |
private int |
bang() |
private int |
caret() |
private int |
colon(boolean spaceSeen) |
private int |
comma(int c) |
StrNode |
createStrNode(ISourcePosition position,
org.jruby.util.ByteList buffer,
int flags) |
private void |
detectUTF8BOM() |
private void |
determineExpressionState() |
private int |
doKeyword(RubyYaccLexer.LexState state) |
private int |
dollar() |
private int |
dot() |
private int |
doubleQuote() |
StackState |
getCmdArgumentState() |
StackState |
getConditionState() |
java.lang.String |
getCurrentLine() |
org.jcodings.Encoding |
getEncoding() |
private int |
getFloatToken(java.lang.String number) |
private int |
getIdentifier(int first) |
private java.lang.Object |
getInteger(java.lang.String value,
int radix) |
static RubyYaccLexer.Keyword |
getKeyword(java.lang.String str) |
int |
getLeftParenBegin() |
private int |
getNumberToken(java.lang.String number,
boolean isFloat,
int nondigit) |
ISourcePosition |
getPosition() |
ISourcePosition |
getPosition(ISourcePosition startPosition)
Get position information for Token/Node that follows node represented by startPosition
and current lexer location.
|
StrTerm |
getStrTerm() |
java.lang.StringBuilder |
getTokenBuffer() |
private int |
greaterThan() |
protected void |
handleFileEncodingComment(org.jruby.util.ByteList encodingLine) |
private int |
hereDocumentIdentifier() |
private int |
identifier(int c,
boolean commandState) |
private int |
identifierToken(int result,
java.lang.String value) |
int |
incrementParenNest() |
private boolean |
isARG() |
private boolean |
isBEG() |
private boolean |
isEND() |
boolean |
isGlobalCharPunct(int c) |
(package private) static boolean |
isHexChar(int c) |
boolean |
isIdentifierChar(int c)
This is a valid character for an identifier?
|
private boolean |
isLabelPossible(boolean commandState) |
protected boolean |
isMultiByteChar(int c)
Is this a multibyte character from a multibyte encoding?
|
private boolean |
isNext_identchar() |
(package private) static boolean |
isOctChar(int c) |
boolean |
isOneEight() |
private boolean |
isSpaceArg(int c,
boolean spaceSeen) |
private int |
leftBracket(boolean spaceSeen) |
private int |
leftCurly() |
private int |
leftParen(boolean spaceSeen) |
private int |
lessThan(boolean spaceSeen) |
private int |
magicCommentMarker(org.jruby.util.ByteList str,
int begin) |
private boolean |
magicCommentSpecialChar(char c) |
private int |
minus(boolean spaceSeen) |
private java.lang.Object |
newBignumNode(java.lang.String value,
int radix) |
private java.lang.Object |
newFixnumNode(java.lang.String value,
int radix) |
int |
nextToken() |
protected boolean |
parseMagicComment(org.jruby.util.ByteList magicLine) |
private int |
parseNumber(int c)
Parse a number from the input stream.
|
private int |
parseQuote(int c)
What type/kind of quote are we dealing with?
|
private int |
percent(boolean spaceSeen) |
private int |
pipe() |
private int |
plus(boolean spaceSeen) |
private void |
printState() |
private void |
printToken(int token) |
private int |
questionMark() |
protected int |
readComment()
Read a comment up to end of line.
|
int |
readEscape() |
private void |
readUTF8EscapeIntoBuffer(int codepoint,
org.jruby.util.ByteList buffer,
boolean stringLiteral) |
int |
readUTFEscape(org.jruby.util.ByteList buffer,
boolean stringLiteral,
boolean symbolLiteral) |
void |
readUTFEscapeRegexpLiteral(org.jruby.util.ByteList buffer) |
void |
reset() |
void |
resetStacks() |
private int |
rightBracket() |
private int |
rightCurly() |
private int |
rightParen() |
private int |
scanHex(int count,
boolean strict,
java.lang.String errorMessage)
Read up to count hexadecimal digits.
|
private char |
scanHexLiteral(org.jruby.util.ByteList buffer,
int count,
boolean strict,
java.lang.String errorMessage)
Read up to count hexadecimal digits and store those digits in a token buffer.
|
private char |
scanOct(int count) |
private void |
setEncoding(org.jruby.util.ByteList name) |
void |
setEncoding(org.jcodings.Encoding encoding) |
void |
setLeftParenBegin(int value) |
void |
setParserSupport(ParserSupport parserSupport)
Parse must pass its support object for some check at bottom of
yylex().
|
void |
setSource(LexerSource source)
Allow the parser to set the source for its lexer.
|
void |
setState(RubyYaccLexer.LexState state) |
void |
setStrTerm(StrTerm strterm) |
void |
setValue(java.lang.Object yaccValue) |
void |
setWarnings(IRubyWarnings warnings) |
private int |
singleQuote() |
private int |
slash(boolean spaceSeen) |
private int |
star(boolean spaceSeen) |
private int |
tilde() |
int |
token()
Last token read from the lexer at the end of a call to yylex()
|
int |
tokenAddMBC(int codepoint,
org.jruby.util.ByteList buffer) |
void |
tokenAddMBCFromSrc(int c,
org.jruby.util.ByteList buffer) |
java.lang.Object |
value()
Value of last token (if it is a token which has a value).
|
private void |
warn_balanced(int c,
boolean spaceSeen,
java.lang.String op,
java.lang.String syn) |
private int |
yylex()
Returns the next token.
|
private int |
yylex2() |
public static final org.jcodings.Encoding UTF8_ENCODING
public static final org.jcodings.Encoding USASCII_ENCODING
public static final org.jcodings.Encoding ASCII8BIT_ENCODING
private static org.jruby.util.ByteList END_MARKER
private static org.jruby.util.ByteList BEGIN_DOC_MARKER
private static org.jruby.util.ByteList END_DOC_MARKER
private static final java.util.HashMap<java.lang.String,RubyYaccLexer.Keyword> map
private org.jcodings.Encoding encoding
private int token
java.lang.Object yaccValue
private LexerSource src
private ParserSupport parserSupport
private IRubyWarnings warnings
private RubyYaccLexer.LexState lex_state
private RubyYaccLexer.LexState last_state
private java.lang.StringBuilder tokenBuffer
private StackState conditionState
private StackState cmdArgumentState
private StrTerm lex_strterm
public boolean commandStart
static final int EOF
static final int STR_FUNC_ESCAPE
static final int STR_FUNC_EXPAND
static final int STR_FUNC_REGEXP
static final int STR_FUNC_QWORDS
static final int STR_FUNC_SYMBOL
static final int STR_FUNC_INDENT
private static final int str_squote
private static final int str_dquote
private static final int str_xquote
private static final int str_regexp
private static final int str_ssym
private static final int str_dsym
private boolean isOneEight
private boolean isTwoZero
private int parenNest
private int leftParenBegin
private static final java.lang.String magicString
private static final org.joni.Regex magicRegexp
private static final java.lang.String encodingString
private static final org.joni.Regex encodingRegexp
private byte[] mbcBuf
public RubyYaccLexer()
public RubyYaccLexer(boolean isOneEight)
public org.jcodings.Encoding getEncoding()
private int getFloatToken(java.lang.String number)
private java.lang.Object newBignumNode(java.lang.String value,
int radix)
private java.lang.Object newFixnumNode(java.lang.String value,
int radix)
throws java.lang.NumberFormatException
java.lang.NumberFormatExceptionprivate void ambiguousOperator(java.lang.String op,
java.lang.String syn)
private void warn_balanced(int c,
boolean spaceSeen,
java.lang.String op,
java.lang.String syn)
private void detectUTF8BOM()
throws java.io.IOException
java.io.IOExceptionpublic static RubyYaccLexer.Keyword getKeyword(java.lang.String str)
public int incrementParenNest()
public int getLeftParenBegin()
public void setLeftParenBegin(int value)
public final void reset()
public int nextToken()
throws java.io.IOException
java.io.IOExceptionpublic int token()
public java.lang.StringBuilder getTokenBuffer()
public java.lang.Object value()
public ISourcePosition getPosition(ISourcePosition startPosition)
startPosition - previous node/tokeninclusive - include previous node into position information of current nodepublic ISourcePosition getPosition()
public java.lang.String getCurrentLine()
public void setParserSupport(ParserSupport parserSupport)
parserSupport - private void setEncoding(org.jruby.util.ByteList name)
public void setEncoding(org.jcodings.Encoding encoding)
public void setSource(LexerSource source)
source - where the lexer gets raw datapublic StrTerm getStrTerm()
public void setStrTerm(StrTerm strterm)
public void resetStacks()
public void setWarnings(IRubyWarnings warnings)
private void printState()
public void setState(RubyYaccLexer.LexState state)
public StackState getCmdArgumentState()
public boolean isOneEight()
public StackState getConditionState()
public void setValue(java.lang.Object yaccValue)
private boolean isNext_identchar()
throws java.io.IOException
java.io.IOExceptionprivate boolean isBEG()
private boolean isEND()
private boolean isARG()
private boolean isLabelPossible(boolean commandState)
private boolean isSpaceArg(int c,
boolean spaceSeen)
private void determineExpressionState()
private java.lang.Object getInteger(java.lang.String value,
int radix)
static boolean isHexChar(int c)
c - the character to teststatic boolean isOctChar(int c)
c - the character to testpublic boolean isIdentifierChar(int c)
c - is character to be comparedprotected boolean isMultiByteChar(int c)
c - public StrNode createStrNode(ISourcePosition position, org.jruby.util.ByteList buffer, int flags)
private int parseQuote(int c)
throws java.io.IOException
c - first character the the quote constructjava.io.IOExceptionprivate int hereDocumentIdentifier()
throws java.io.IOException
java.io.IOExceptionprivate void arg_ambiguous()
private int magicCommentMarker(org.jruby.util.ByteList str,
int begin)
private boolean magicCommentSpecialChar(char c)
protected boolean parseMagicComment(org.jruby.util.ByteList magicLine)
throws java.io.IOException
java.io.IOExceptionprotected void handleFileEncodingComment(org.jruby.util.ByteList encodingLine)
throws java.io.IOException
java.io.IOExceptionprotected int readComment()
throws java.io.IOException
java.io.IOExceptionprivate void printToken(int token)
private int yylex2()
throws java.io.IOException
java.io.IOExceptionprivate int yylex()
throws java.io.IOException
java.io.IOExceptionprivate int identifierToken(int result,
java.lang.String value)
private int getIdentifier(int first)
throws java.io.IOException
java.io.IOExceptionprivate int ampersand(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int at()
throws java.io.IOException
java.io.IOExceptionprivate int backtick(boolean commandState)
throws java.io.IOException
java.io.IOExceptionprivate int bang()
throws java.io.IOException
java.io.IOExceptionprivate int caret()
throws java.io.IOException
java.io.IOExceptionprivate int colon(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int comma(int c)
throws java.io.IOException
java.io.IOExceptionprivate int doKeyword(RubyYaccLexer.LexState state)
private int dollar()
throws java.io.IOException
java.io.IOExceptionpublic boolean isGlobalCharPunct(int c)
private int dot()
throws java.io.IOException
java.io.IOExceptionprivate int doubleQuote()
throws java.io.IOException
java.io.IOExceptionprivate int greaterThan()
throws java.io.IOException
java.io.IOExceptionprivate int identifier(int c,
boolean commandState)
throws java.io.IOException
java.io.IOExceptionprivate int leftBracket(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int leftCurly()
private int leftParen(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int lessThan(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int minus(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int percent(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int pipe()
throws java.io.IOException
java.io.IOExceptionprivate int plus(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int questionMark()
throws java.io.IOException
java.io.IOExceptionprivate int rightBracket()
private int rightCurly()
private int rightParen()
private int singleQuote()
throws java.io.IOException
java.io.IOExceptionprivate int slash(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int star(boolean spaceSeen)
throws java.io.IOException
java.io.IOExceptionprivate int tilde()
throws java.io.IOException
java.io.IOExceptionprivate int parseNumber(int c)
throws java.io.IOException
c - The first character of the number.java.io.IOExceptionprivate int getNumberToken(java.lang.String number,
boolean isFloat,
int nondigit)
public void readUTFEscapeRegexpLiteral(org.jruby.util.ByteList buffer)
throws java.io.IOException
java.io.IOExceptionpublic int tokenAddMBC(int codepoint,
org.jruby.util.ByteList buffer)
public void tokenAddMBCFromSrc(int c,
org.jruby.util.ByteList buffer)
throws java.io.IOException
java.io.IOExceptionpublic int readUTFEscape(org.jruby.util.ByteList buffer,
boolean stringLiteral,
boolean symbolLiteral)
throws java.io.IOException
java.io.IOExceptionprivate void readUTF8EscapeIntoBuffer(int codepoint,
org.jruby.util.ByteList buffer,
boolean stringLiteral)
public int readEscape()
throws java.io.IOException
java.io.IOExceptionprivate char scanHexLiteral(org.jruby.util.ByteList buffer,
int count,
boolean strict,
java.lang.String errorMessage)
throws java.io.IOException
java.io.IOExceptionprivate int scanHex(int count,
boolean strict,
java.lang.String errorMessage)
throws java.io.IOException
java.io.IOExceptionprivate char scanOct(int count)
throws java.io.IOException
java.io.IOException