public class RipperLexer
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RipperLexer.Keyword |
static class |
RipperLexer.LexState |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
__end__seen |
static org.jcodings.Encoding |
ASCII8BIT_ENCODING |
private static org.jruby.util.ByteList |
BEGIN_DOC_MARKER |
private StackState |
cmdArgumentState |
private static org.jruby.util.ByteList |
CODING |
boolean |
commandStart |
private StackState |
conditionState |
private org.jcodings.Encoding |
current_enc |
protected org.jruby.util.ByteList |
delayed |
private int |
delayed_col |
private int |
delayed_line |
private static org.jruby.util.ByteList |
END_DOC_MARKER |
private static org.jruby.util.ByteList |
END_MARKER |
(package private) static int |
EOF |
protected boolean |
eofp |
private boolean |
has_shebang |
private int |
heredoc_end |
(package private) java.lang.String |
identValue |
boolean |
ignoreNextScanEvent |
private int |
leftParenBegin |
protected org.jruby.util.ByteList |
lex_lastline |
private org.jruby.util.ByteList |
lex_nextline |
protected int |
lex_p |
protected int |
lex_pbeg |
protected int |
lex_pend |
private RipperLexer.LexState |
lex_state |
private StrTerm |
lex_strterm |
protected org.jruby.util.ByteList |
lexb |
private int |
line_count |
private static org.joni.Regex |
magicRegexp |
private static java.lang.String |
magicString |
private static java.util.HashMap<java.lang.String,RipperLexer.Keyword> |
map |
private byte[] |
mbcBuf |
private int |
parenNest |
private RipperParser |
parser |
private int |
ruby_sourceline |
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 |
protected int |
tokp |
static org.jcodings.Encoding |
USASCII_ENCODING |
static org.jcodings.Encoding |
UTF8_ENCODING |
(package private) java.lang.Object |
yaccValue |
| Constructor and Description |
|---|
RipperLexer(RipperParser parser,
LexerSource src) |
| Modifier and Type | Method and Description |
|---|---|
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) |
int |
column() |
private int |
comma(int c) |
private boolean |
comment_at_top() |
void |
compile_error(java.lang.String message) |
IRubyObject |
createStr(org.jruby.util.ByteList buffer,
int flags) |
private void |
determineExpressionState() |
void |
dispatchDelayedToken(int token) |
void |
dispatchHeredocEnd() |
void |
dispatchIgnoredScanEvent(int token) |
void |
dispatchScanEvent(int token) |
private int |
doKeyword(RipperLexer.LexState state) |
private int |
dollar() |
private int |
dot() |
private int |
doubleQuote() |
protected void |
flush_string_content(org.jcodings.Encoding encoding) |
private void |
flush() |
StackState |
getCmdArgumentState() |
StackState |
getConditionState() |
org.jcodings.Encoding |
getEncoding() |
private int |
getFloatToken(java.lang.String number) |
java.lang.String |
getIdent() |
private int |
getIdentifier(int first) |
private java.lang.Object |
getInteger(java.lang.String value,
int radix) |
static RipperLexer.Keyword |
getKeyword(java.lang.String str) |
int |
getLeftParenBegin() |
private int |
getNumberToken(java.lang.String number,
boolean isFloat,
int nondigit) |
Ruby |
getRuntime() |
StrTerm |
getStrTerm() |
java.lang.StringBuilder |
getTokenBuffer() |
private int |
greaterThan() |
boolean |
hasScanEvent() |
boolean |
hasStarted()
Has lexing started yet?
|
void |
heredoc_restore(HeredocTerm here) |
private int |
hereDocumentIdentifier() |
private int |
identifier(int c,
boolean commandState) |
private int |
identifierToken(RipperLexer.LexState last_state,
int result,
java.lang.String value) |
int |
incrementParenNest() |
private boolean |
isARG() |
private boolean |
isBEG() |
private boolean |
isEND() |
boolean |
isEndSeen() |
(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) |
private boolean |
isSpaceArg(int c,
boolean spaceSeen) |
boolean |
isVerbose() |
private int |
leftBracket(boolean spaceSeen) |
private int |
leftCurly() |
private int |
leftParen(boolean spaceSeen) |
private int |
lessThan(boolean spaceSeen) |
protected void |
lex_goto_eol() |
int |
lineno() |
private int |
magicCommentMarker(org.jruby.util.ByteList str,
int begin) |
private int |
minus(boolean spaceSeen) |
int |
nextc() |
int |
nextToken() |
int |
p(int offset) |
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?
|
void |
parser_prepare() |
boolean |
peek(int c) |
private boolean |
peek(int c,
int n) |
private int |
percent(boolean spaceSeen) |
private int |
pipe() |
private int |
plus(boolean spaceSeen) |
private void |
printState() |
private java.lang.String |
printToken(int token) |
void |
pushback(int c) |
private int |
questionMark() |
int |
readCodepoint(int first,
org.jcodings.Encoding encoding) |
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 |
resetStacks() |
private int |
rightBracket() |
private int |
rightCurly() |
private int |
rightParen() |
private IRubyObject |
scanEventValue(int token) |
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) |
protected void |
set_file_encoding(int str,
int send) |
private void |
setEncoding(org.jruby.util.ByteList name) |
void |
setEncoding(org.jcodings.Encoding encoding) |
void |
setLeftParenBegin(int value) |
void |
setParser(RipperParser parserSupport)
Parse must pass its support object for some check at bottom of
yylex().
|
void |
setState(RipperLexer.LexState state) |
void |
setStrTerm(StrTerm strterm) |
void |
setValue(java.lang.Object yaccValue) |
private int |
singleQuote() |
private int |
slash(boolean spaceSeen) |
private int |
star(boolean spaceSeen) |
private boolean |
strncmp(org.jruby.util.ByteList one,
org.jruby.util.ByteList two,
int length) |
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) |
private java.lang.String |
tokenToEventId(int token) |
java.lang.Object |
value()
Value of last token (if it is a token which has a value).
|
void |
warn(java.lang.String message) |
void |
warning(java.lang.String message) |
boolean |
was_bol() |
boolean |
whole_match_p(org.jruby.util.ByteList eos,
boolean indent) |
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 org.jruby.util.ByteList CODING
private static final java.util.HashMap<java.lang.String,RipperLexer.Keyword> map
private org.jcodings.Encoding current_enc
public boolean ignoreNextScanEvent
private int token
java.lang.Object yaccValue
java.lang.String identValue
private LexerSource src
private RipperParser parser
private RipperLexer.LexState lex_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 int parenNest
private int leftParenBegin
protected int tokp
protected org.jruby.util.ByteList lexb
protected int lex_p
protected int lex_pbeg
protected int lex_pend
protected org.jruby.util.ByteList lex_lastline
private org.jruby.util.ByteList lex_nextline
private boolean __end__seen
protected boolean eofp
private boolean has_shebang
protected org.jruby.util.ByteList delayed
private int delayed_line
private int delayed_col
private int ruby_sourceline
private int heredoc_end
private int line_count
private static final java.lang.String magicString
private static final org.joni.Regex magicRegexp
private byte[] mbcBuf
public RipperLexer(RipperParser parser, LexerSource src)
public org.jcodings.Encoding getEncoding()
private int getFloatToken(java.lang.String number)
public boolean isVerbose()
public void warn(java.lang.String message)
public void warning(java.lang.String message)
public static RipperLexer.Keyword getKeyword(java.lang.String str)
public int incrementParenNest()
public int getLeftParenBegin()
public void setLeftParenBegin(int value)
public boolean hasStarted()
public boolean isEndSeen()
protected void flush_string_content(org.jcodings.Encoding encoding)
public int p(int offset)
public int nextc()
public boolean peek(int c)
private boolean peek(int c,
int n)
protected void lex_goto_eol()
public int column()
public int lineno()
public void dispatchHeredocEnd()
public boolean was_bol()
private boolean strncmp(org.jruby.util.ByteList one,
org.jruby.util.ByteList two,
int length)
public void pushback(int c)
private void flush()
public void compile_error(java.lang.String message)
public int readCodepoint(int first,
org.jcodings.Encoding encoding)
throws java.io.IOException
java.io.IOExceptionpublic void heredoc_restore(HeredocTerm here)
public void parser_prepare()
public int nextToken()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getIdent()
public int token()
public java.lang.StringBuilder getTokenBuffer()
public java.lang.Object value()
public boolean whole_match_p(org.jruby.util.ByteList eos,
boolean indent)
public Ruby getRuntime()
public void setParser(RipperParser parserSupport)
parserSupport - private void setEncoding(org.jruby.util.ByteList name)
public void setEncoding(org.jcodings.Encoding encoding)
public StrTerm getStrTerm()
public void setStrTerm(StrTerm strterm)
public void resetStacks()
private void printState()
public void setState(RipperLexer.LexState state)
public StackState getCmdArgumentState()
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 IRubyObject createStr(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 comment_at_top()
protected boolean parseMagicComment(org.jruby.util.ByteList magicLine)
throws java.io.IOException
java.io.IOExceptionprotected void set_file_encoding(int str,
int send)
private java.lang.String printToken(int token)
public boolean hasScanEvent()
public void dispatchDelayedToken(int token)
public void dispatchIgnoredScanEvent(int token)
public void dispatchScanEvent(int token)
private IRubyObject scanEventValue(int token)
private java.lang.String tokenToEventId(int token)
private int yylex2()
throws java.io.IOException
java.io.IOExceptionprivate int yylex()
throws java.io.IOException
java.io.IOExceptionprivate int identifierToken(RipperLexer.LexState last_state, 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(RipperLexer.LexState state)
private int dollar()
throws java.io.IOException
java.io.IOExceptionprivate 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