public abstract class LexingCommon extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
__end__seen |
static org.jcodings.Encoding |
ASCII8BIT_ENCODING |
static org.jruby.util.ByteList |
BEGIN_DOC_MARKER |
protected int |
braceNest |
protected StackState |
cmdArgumentState |
static org.jruby.util.ByteList |
CODING |
boolean |
commandStart |
protected StackState |
conditionState |
static org.jruby.util.ByteList |
END_DOC_MARKER |
static org.jruby.util.ByteList |
END_MARKER |
static int |
EOF |
boolean |
eofp |
static int |
EXPR_ARG |
static int |
EXPR_ARG_ANY |
static int |
EXPR_BEG |
static int |
EXPR_BEG_ANY |
static int |
EXPR_CLASS |
static int |
EXPR_CMDARG |
static int |
EXPR_DOT |
static int |
EXPR_END |
static int |
EXPR_END_ANY |
static int |
EXPR_ENDARG |
static int |
EXPR_ENDFN |
static int |
EXPR_FNAME |
static int |
EXPR_LABEL |
static int |
EXPR_LABELED |
static int |
EXPR_MID |
static int |
EXPR_VALUE |
protected boolean |
has_shebang |
protected int |
heredoc_end |
protected int |
heredoc_indent |
protected int |
heredoc_line_indent |
boolean |
inKwarg |
protected int |
last_cr_line |
protected int |
last_state |
org.jruby.util.ByteList |
lex_lastline |
protected org.jruby.util.ByteList |
lex_nextline |
int |
lex_p |
protected int |
lex_pbeg |
int |
lex_pend |
protected int |
lex_state |
org.jruby.util.ByteList |
lexb |
protected int |
line_count |
protected int |
line_offset |
static org.joni.Regex |
magicRegexp |
static String |
magicString |
protected int |
parenNest |
protected int |
ruby_sourceline |
protected LexerSource |
src |
static int |
str_dquote |
static int |
str_dsym |
static int |
STR_FUNC_ESCAPE |
static int |
STR_FUNC_EXPAND |
static int |
STR_FUNC_INDENT |
static int |
STR_FUNC_LABEL |
static int |
STR_FUNC_QWORDS |
static int |
STR_FUNC_REGEXP |
static int |
STR_FUNC_SYMBOL |
static int |
str_label |
static int |
str_regexp |
static int |
str_squote |
static int |
str_ssym |
static int |
str_xquote |
static int |
SUFFIX_ALL |
static int |
SUFFIX_I |
static int |
SUFFIX_R |
static int |
TAB_WIDTH |
protected int |
token |
protected boolean |
tokenSeen |
ISourcePosition |
tokline |
int |
tokp |
static org.jcodings.Encoding |
USASCII_ENCODING |
static org.jcodings.Encoding |
UTF8_ENCODING |
protected Object |
yaccValue |
Constructor and Description |
---|
LexingCommon(LexerSource src) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
ambiguousOperator(String op,
String syn) |
int |
column() |
protected boolean |
comment_at_top() |
abstract void |
compile_error(String message) |
String |
createAsEncodedString(byte[] bytes,
int start,
int length,
org.jcodings.Encoding encoding) |
org.jruby.util.ByteList |
createTokenByteList() |
String |
createTokenString() |
String |
createTokenString(int start) |
protected int |
dedent_string(org.jruby.util.ByteList string,
int width) |
protected void |
flush() |
int |
getBraceNest() |
StackState |
getCmdArgumentState() |
StackState |
getConditionState() |
String |
getCurrentArg() |
String |
getCurrentLine() |
org.jcodings.Encoding |
getEncoding() |
String |
getFile() |
int |
getHeredocIndent() |
int |
getLeftParenBegin() |
int |
getLineOffset() |
ISourcePosition |
getPosition() |
int |
getState() |
int |
getTokenCR() |
int |
incrementParenNest() |
protected boolean |
isAfterOperator() |
protected boolean |
isARG() |
boolean |
isASCII() |
boolean |
isASCII(int c) |
protected boolean |
isBEG() |
protected boolean |
isEND() |
boolean |
isEndSeen() |
boolean |
isGlobalCharPunct(int c) |
static boolean |
isHexChar(int c) |
boolean |
isIdentifierChar(int c)
This is a valid character for an identifier?
|
protected boolean |
isLabelPossible(boolean commandState) |
protected boolean |
isLabelSuffix() |
static boolean |
isLexState(int state,
int mask) |
protected boolean |
isLexStateAll(int state,
int mask) |
protected boolean |
isNext_identchar() |
static boolean |
isOctChar(int c) |
protected boolean |
isSpaceArg(int c,
boolean spaceSeen) |
void |
lex_goto_eol() |
int |
lineno() |
protected void |
magicCommentEncoding(org.jruby.util.ByteList encoding) |
static int |
magicCommentMarker(org.jruby.util.ByteList str,
int begin) |
void |
newtok(boolean unreadOnce) |
abstract int |
nextc() |
protected int |
numberLiteralSuffix(int mask) |
int |
p(int offset) |
boolean |
parseMagicComment(Ruby runtime,
org.jruby.util.ByteList magicLine) |
void |
parser_prepare() |
boolean |
peek(int c) |
protected boolean |
peek(int c,
int n) |
int |
precise_mbclen() |
void |
printState() |
void |
pushback(int c) |
void |
reset() |
void |
resetStacks() |
protected char |
scanOct(int count) |
protected void |
set_file_encoding(int str,
int send) |
void |
setBraceNest(int nest) |
protected abstract void |
setCompileOptionFlag(String name,
org.jruby.util.ByteList value) |
void |
setCurrentArg(String current_arg) |
void |
setCurrentEncoding(org.jcodings.Encoding encoding) |
protected abstract void |
setEncoding(org.jruby.util.ByteList name) |
void |
setEncoding(org.jcodings.Encoding encoding) |
void |
setHeredocIndent(int heredoc_indent) |
void |
setHeredocLineIndent(int heredoc_line_indent) |
void |
setLeftParenBegin(int value) |
void |
setSource(LexerSource source)
Allow the parser to set the source for its lexer.
|
void |
setState(int state) |
protected abstract void |
setTokenInfo(String name,
org.jruby.util.ByteList value) |
void |
setValue(Object yaccValue) |
protected boolean |
strncmp(org.jruby.util.ByteList one,
org.jruby.util.ByteList two,
int length) |
boolean |
tokadd_ident(int c) |
boolean |
tokadd_mbchar(int first_byte)
This differs from MRI in a few ways.
|
boolean |
tokadd_mbchar(int first_byte,
org.jruby.util.ByteList buffer) |
void |
tokAdd(int first_byte,
org.jruby.util.ByteList buffer) |
void |
tokaddmbc(int codepoint,
org.jruby.util.ByteList buffer)
This looks deceptively like tokadd_mbchar(int, ByteList) but it differs in that it uses
the bytelists encoding and the first parameter is a full codepoint and not the first byte
of a mbc sequence.
|
void |
tokCopy(int length,
org.jruby.util.ByteList buffer) |
int |
token()
Last token read from the lexer at the end of a call to yylex()
|
abstract int |
tokenize_ident(int result) |
boolean |
update_heredoc_indent(int c) |
void |
validateFormalIdentifier(String identifier) |
Object |
value()
Value of last token (if it is a token which has a value).
|
protected void |
warn_balanced(int c,
boolean spaceSeen,
String op,
String syn) |
boolean |
was_bol() |
boolean |
whole_match_p(org.jruby.util.ByteList eos,
boolean indent) |
public static final int EXPR_BEG
public static final int EXPR_END
public static final int EXPR_ENDARG
public static final int EXPR_ENDFN
public static final int EXPR_ARG
public static final int EXPR_CMDARG
public static final int EXPR_MID
public static final int EXPR_FNAME
public static final int EXPR_DOT
public static final int EXPR_CLASS
public static final int EXPR_LABEL
public static final int EXPR_LABELED
public static final int EXPR_VALUE
public static final int EXPR_BEG_ANY
public static final int EXPR_ARG_ANY
public static final int EXPR_END_ANY
protected int braceNest
public boolean commandStart
protected StackState conditionState
protected StackState cmdArgumentState
protected boolean __end__seen
public boolean eofp
protected boolean has_shebang
protected int heredoc_end
protected int heredoc_indent
protected int heredoc_line_indent
public boolean inKwarg
protected int last_cr_line
protected int last_state
public org.jruby.util.ByteList lexb
public org.jruby.util.ByteList lex_lastline
protected org.jruby.util.ByteList lex_nextline
public int lex_p
protected int lex_pbeg
public int lex_pend
protected int lex_state
protected int line_count
protected int line_offset
protected int parenNest
protected int ruby_sourceline
protected LexerSource src
protected int token
protected boolean tokenSeen
public ISourcePosition tokline
public int tokp
protected Object yaccValue
public static final int TAB_WIDTH
public static final int STR_FUNC_ESCAPE
public static final int STR_FUNC_EXPAND
public static final int STR_FUNC_REGEXP
public static final int STR_FUNC_QWORDS
public static final int STR_FUNC_SYMBOL
public static final int STR_FUNC_INDENT
public static final int STR_FUNC_LABEL
public static final int str_label
public static final int str_squote
public static final int str_dquote
public static final int str_xquote
public static final int str_regexp
public static final int str_ssym
public static final int str_dsym
public static final int EOF
public static org.jruby.util.ByteList END_MARKER
public static org.jruby.util.ByteList BEGIN_DOC_MARKER
public static org.jruby.util.ByteList END_DOC_MARKER
public static org.jruby.util.ByteList CODING
public static final org.jcodings.Encoding UTF8_ENCODING
public static final org.jcodings.Encoding USASCII_ENCODING
public static final org.jcodings.Encoding ASCII8BIT_ENCODING
public static final int SUFFIX_R
public static final int SUFFIX_I
public static final int SUFFIX_ALL
public static final String magicString
public static final org.joni.Regex magicRegexp
public LexingCommon(LexerSource src)
public int column()
protected boolean comment_at_top()
public org.jruby.util.ByteList createTokenByteList()
public String createTokenString(int start)
public String createAsEncodedString(byte[] bytes, int start, int length, org.jcodings.Encoding encoding)
public String createTokenString()
protected int dedent_string(org.jruby.util.ByteList string, int width)
protected void flush()
public int getBraceNest()
public StackState getCmdArgumentState()
public StackState getConditionState()
public String getCurrentArg()
public String getCurrentLine()
public org.jcodings.Encoding getEncoding()
public String getFile()
public int getHeredocIndent()
public int getLeftParenBegin()
public ISourcePosition getPosition()
public int getLineOffset()
public int getState()
public int getTokenCR()
public int incrementParenNest()
public boolean isEndSeen()
public boolean isASCII()
public boolean isASCII(int c)
public boolean isGlobalCharPunct(int c)
public boolean isIdentifierChar(int c)
c
- is character to be comparedpublic void lex_goto_eol()
public int lineno()
protected void magicCommentEncoding(org.jruby.util.ByteList encoding)
public void newtok(boolean unreadOnce)
protected int numberLiteralSuffix(int mask) throws IOException
IOException
public void parser_prepare()
public int p(int offset)
public boolean peek(int c)
protected boolean peek(int c, int n)
public int precise_mbclen()
public void printState()
public void pushback(int c)
public void reset()
public void resetStacks()
protected char scanOct(int count) throws IOException
IOException
public void setCurrentArg(String current_arg)
public void setCurrentEncoding(org.jcodings.Encoding encoding)
public void setEncoding(org.jcodings.Encoding encoding)
protected void set_file_encoding(int str, int send)
public void setHeredocLineIndent(int heredoc_line_indent)
public void setHeredocIndent(int heredoc_indent)
public void setBraceNest(int nest)
public void setLeftParenBegin(int value)
public void setSource(LexerSource source)
source
- where the lexer gets raw datapublic void setState(int state)
public void setValue(Object yaccValue)
protected boolean strncmp(org.jruby.util.ByteList one, org.jruby.util.ByteList two, int length)
public void tokAdd(int first_byte, org.jruby.util.ByteList buffer)
public void tokCopy(int length, org.jruby.util.ByteList buffer)
public boolean tokadd_ident(int c)
public boolean tokadd_mbchar(int first_byte)
public boolean tokadd_mbchar(int first_byte, org.jruby.util.ByteList buffer)
public void tokaddmbc(int codepoint, org.jruby.util.ByteList buffer)
public int token()
public boolean update_heredoc_indent(int c)
public void validateFormalIdentifier(String identifier)
public Object value()
public boolean was_bol()
public boolean whole_match_p(org.jruby.util.ByteList eos, boolean indent)
public abstract void compile_error(String message)
public abstract int nextc()
protected abstract void setCompileOptionFlag(String name, org.jruby.util.ByteList value)
protected abstract void setEncoding(org.jruby.util.ByteList name)
protected abstract void setTokenInfo(String name, org.jruby.util.ByteList value)
public abstract int tokenize_ident(int result)
public static boolean isHexChar(int c)
c
- the character to testpublic static boolean isLexState(int state, int mask)
protected boolean isLexStateAll(int state, int mask)
protected boolean isARG()
protected boolean isBEG()
protected boolean isEND()
protected boolean isLabelPossible(boolean commandState)
protected boolean isLabelSuffix()
protected boolean isAfterOperator()
protected boolean isNext_identchar() throws IOException
IOException
public static boolean isOctChar(int c)
c
- the character to testprotected boolean isSpaceArg(int c, boolean spaceSeen)
public static int magicCommentMarker(org.jruby.util.ByteList str, int begin)
public boolean parseMagicComment(Ruby runtime, org.jruby.util.ByteList magicLine) throws IOException
IOException
Copyright © 2001-2016 JRuby. All Rights Reserved.