public abstract class LexingCommon
extends java.lang.Object
Constructor and Description |
---|
LexingCommon(LexerSource src) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
ambiguousOperator(java.lang.String op,
java.lang.String syn) |
void |
checkRegexpFragment(Ruby runtime,
ByteList value,
RegexpOptions options) |
void |
checkRegexpSyntax(Ruby runtime,
ByteList value,
RegexpOptions options) |
int |
column() |
protected boolean |
comment_at_top() |
abstract void |
compile_error(java.lang.String message) |
java.lang.String |
createAsEncodedString(byte[] bytes,
int start,
int length,
org.jcodings.Encoding encoding) |
ByteList |
createTokenByteList() |
ByteList |
createTokenByteList(int start) |
java.lang.String |
createTokenString() |
java.lang.String |
createTokenString(int start) |
static int |
dedent_string(ByteList string,
int width) |
protected void |
flush() |
int |
getBraceNest() |
StackState |
getCmdArgumentState() |
StackState |
getConditionState() |
ByteList |
getCurrentArg() |
java.lang.String |
getCurrentLine() |
org.jcodings.Encoding |
getEncoding() |
java.lang.String |
getFile() |
int |
getHeredocIndent() |
int |
getHeredocLineIndent() |
int |
getLeftParenBegin() |
int |
getLineOffset() |
ISourcePosition |
getPosition() |
int |
getRubySourceline() |
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) |
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) |
static boolean |
isSpace(int c) |
protected boolean |
isSpaceArg(int c,
boolean spaceSeen) |
void |
lex_goto_eol() |
int |
lineno() |
protected void |
magicCommentEncoding(ByteList encoding) |
static int |
magicCommentMarker(ByteList str,
int begin) |
protected abstract void |
mismatchedRegexpEncodingError(org.jcodings.Encoding optionEncoding,
org.jcodings.Encoding encoding) |
void |
newtok(boolean unreadOnce) |
abstract int |
nextc() |
protected int |
numberLiteralSuffix(int mask) |
protected boolean |
onMagicComment(java.lang.String name,
ByteList value) |
protected char |
optionsEncodingChar(org.jcodings.Encoding optionEncoding) |
int |
p(int offset) |
boolean |
parser_magic_comment(ByteList magicLine) |
void |
parser_prepare() |
protected abstract RegexpOptions |
parseRegexpFlags() |
protected RegexpOptions |
parseRegexpFlags(java.lang.StringBuilder unknownFlags) |
boolean |
peek(int c) |
protected boolean |
peek(int c,
int n) |
int |
peekVariableName(int tSTRING_DVAR,
int tSTRING_DBEG) |
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(java.lang.String name,
ByteList value) |
void |
setCurrentArg(ByteList current_arg) |
void |
setCurrentEncoding(org.jcodings.Encoding encoding) |
protected abstract void |
setEncoding(ByteList name) |
void |
setEncoding(org.jcodings.Encoding encoding) |
void |
setHeredocIndent(int heredoc_indent) |
void |
setHeredocLineIndent(int heredoc_line_indent) |
void |
setLeftParenBegin(int value) |
void |
setRegexpEncoding(Ruby runtime,
ByteList value,
RegexpOptions options) |
void |
setRubySourceline(int line) |
void |
setSource(LexerSource source)
Allow the parser to set the source for its lexer.
|
void |
setState(int state) |
protected abstract void |
setTokenInfo(java.lang.String name,
ByteList value) |
void |
setValue(java.lang.Object yaccValue) |
protected boolean |
strncmp(ByteList one,
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,
ByteList buffer) |
void |
tokAdd(int first_byte,
ByteList buffer) |
void |
tokaddmbc(int codepoint,
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,
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(ByteList identifier) |
void |
validateFormalIdentifier(java.lang.String identifier)
Deprecated.
|
java.lang.Object |
value()
Value of last token (if it is a token which has a value).
|
protected void |
warn_balanced(int c,
boolean spaceSeen,
java.lang.String op,
java.lang.String syn) |
boolean |
was_bol() |
boolean |
whole_match_p(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_FITEM
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 ByteList lexb
public ByteList lex_lastline
protected 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 java.lang.Object yaccValue
public final ByteList BACKTICK
public final ByteList EQ_EQ_EQ
public final ByteList EQ_EQ
protected ByteList EQ_TILDE
protected ByteList EQ_GT
protected ByteList EQ
public static final ByteList AMPERSAND_AMPERSAND
protected ByteList AMPERSAND
public ByteList AMPERSAND_DOT
public final ByteList BANG
protected ByteList BANG_EQ
protected ByteList BANG_TILDE
protected ByteList CARET
protected ByteList COLON_COLON
protected ByteList COLON
protected ByteList COMMA
protected ByteList DOT_DOT_DOT
protected ByteList DOT_DOT
public ByteList DOT
protected ByteList GT_EQ
protected ByteList GT_GT
protected ByteList GT
protected ByteList LBRACKET_RBRACKET_EQ
public static ByteList LBRACKET_RBRACKET
protected ByteList LBRACKET
protected ByteList LCURLY
protected ByteList LT_EQ_RT
protected ByteList LT_EQ
protected ByteList LT_LT
protected ByteList LT
protected ByteList MINUS_AT
protected ByteList MINUS
protected ByteList MINUS_GT
protected ByteList PERCENT
public static final ByteList OR_OR
protected ByteList OR
protected ByteList PLUS_AT
protected ByteList PLUS
protected ByteList QUESTION
protected ByteList RBRACKET
protected ByteList RCURLY
protected ByteList RPAREN
protected ByteList Q
protected ByteList SLASH
protected ByteList STAR
protected ByteList STAR_STAR
protected ByteList TILDE
protected ByteList QQ
protected ByteList SEMICOLON
protected ByteList BACKSLASH
public static final ByteList CALL
public static final ByteList DOLLAR_BANG
public static final ByteList DOLLAR_UNDERSCORE
public static final ByteList DOLLAR_DOT
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_FUNC_LIST
public static final int STR_FUNC_TERM
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_sword
public static final int str_dword
public static final int str_ssym
public static final int str_dsym
public static final int EOF
public static ByteList END_MARKER
public static ByteList BEGIN_DOC_MARKER
public static ByteList END_DOC_MARKER
public static 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 LexingCommon(LexerSource src)
public int column()
protected boolean comment_at_top()
public int getRubySourceline()
public void setRubySourceline(int line)
public ByteList createTokenByteList()
public ByteList createTokenByteList(int start)
public java.lang.String createTokenString(int start)
public java.lang.String createAsEncodedString(byte[] bytes, int start, int length, org.jcodings.Encoding encoding)
public java.lang.String createTokenString()
public static int dedent_string(ByteList string, int width)
protected void flush()
public int getBraceNest()
public StackState getCmdArgumentState()
public StackState getConditionState()
public ByteList getCurrentArg()
public java.lang.String getCurrentLine()
public org.jcodings.Encoding getEncoding()
public java.lang.String getFile()
public int getHeredocIndent()
public int getHeredocLineIndent()
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 int peekVariableName(int tSTRING_DVAR, int tSTRING_DBEG) throws java.io.IOException
java.io.IOException
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(ByteList encoding)
public void newtok(boolean unreadOnce)
protected int numberLiteralSuffix(int mask) throws java.io.IOException
java.io.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 java.io.IOException
java.io.IOException
public void setCurrentArg(ByteList 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(java.lang.Object yaccValue)
public void tokAdd(int first_byte, ByteList buffer)
public void tokCopy(int length, ByteList buffer)
public boolean tokadd_ident(int c)
public boolean tokadd_mbchar(int first_byte)
public boolean tokadd_mbchar(int first_byte, ByteList buffer)
public void tokaddmbc(int codepoint, ByteList buffer)
public int token()
public boolean update_heredoc_indent(int c)
public void validateFormalIdentifier(ByteList identifier)
@Deprecated public void validateFormalIdentifier(java.lang.String identifier)
public java.lang.Object value()
protected void warn_balanced(int c, boolean spaceSeen, java.lang.String op, java.lang.String syn)
public boolean was_bol()
public boolean whole_match_p(ByteList eos, boolean indent)
protected abstract void ambiguousOperator(java.lang.String op, java.lang.String syn)
public abstract void compile_error(java.lang.String message)
public abstract int nextc()
protected abstract void setCompileOptionFlag(java.lang.String name, ByteList value)
protected abstract void setEncoding(ByteList name)
protected abstract void setTokenInfo(java.lang.String name, 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)
public boolean isLabelSuffix()
protected boolean isAfterOperator()
protected boolean isNext_identchar() throws java.io.IOException
java.io.IOException
public static boolean isOctChar(int c)
c
- the character to testpublic static boolean isSpace(int c)
protected boolean isSpaceArg(int c, boolean spaceSeen)
public static int magicCommentMarker(ByteList str, int begin)
public boolean parser_magic_comment(ByteList magicLine)
protected boolean onMagicComment(java.lang.String name, ByteList value)
protected abstract RegexpOptions parseRegexpFlags() throws java.io.IOException
java.io.IOException
protected RegexpOptions parseRegexpFlags(java.lang.StringBuilder unknownFlags) throws java.io.IOException
java.io.IOException
public void checkRegexpFragment(Ruby runtime, ByteList value, RegexpOptions options)
public void checkRegexpSyntax(Ruby runtime, ByteList value, RegexpOptions options)
protected abstract void mismatchedRegexpEncodingError(org.jcodings.Encoding optionEncoding, org.jcodings.Encoding encoding)
public void setRegexpEncoding(Ruby runtime, ByteList value, RegexpOptions options)
protected char optionsEncodingChar(org.jcodings.Encoding optionEncoding)
Copyright © 2001-2018 JRuby. All Rights Reserved.