public class RubyLexer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RubyLexer.Keyword |
static class |
RubyLexer.LexState |
Modifier and Type | Field and Description |
---|---|
boolean |
commandStart |
protected org.jruby.util.ByteList |
delayed |
protected boolean |
eofp |
boolean |
inKwarg |
protected org.jruby.util.ByteList |
lex_lastline |
protected int |
lex_p |
protected int |
lex_pbeg |
protected int |
lex_pend |
protected org.jruby.util.ByteList |
lexb |
ISourcePosition |
tokline |
protected int |
tokp |
Constructor and Description |
---|
RubyLexer(ParserSupport support,
LexerSource source) |
Modifier and Type | Method and Description |
---|---|
int |
column() |
void |
compile_error(String message) |
void |
compile_error(SyntaxException.PID pid,
String message) |
StrNode |
createStr(org.jruby.util.ByteList buffer,
int flags) |
org.jruby.util.ByteList |
createTokenByteList() |
String |
createTokenString() |
int |
getBraceNest() |
StackState |
getCmdArgumentState() |
StackState |
getConditionState() |
String |
getCurrentLine() |
org.jcodings.Encoding |
getEncoding() |
String |
getFile() |
static RubyLexer.Keyword |
getKeyword(String str) |
int |
getLeftParenBegin() |
ISourcePosition |
getPosition() |
ISourcePosition |
getPosition(ISourcePosition startPosition) |
RubyLexer.LexState |
getState() |
StrTerm |
getStrTerm() |
protected void |
handleFileEncodingComment(org.jruby.util.ByteList encodingLine) |
boolean |
hasStarted()
Has lexing started yet?
|
void |
heredoc_restore(HeredocTerm here) |
int |
incrementParenNest() |
boolean |
isASCII(int c) |
boolean |
isEndSeen() |
boolean |
isGlobalCharPunct(int c) |
boolean |
isIdentifierChar(int c)
This is a valid character for an identifier?
|
protected boolean |
isMultiByteChar(int c)
Is this a multibyte character from a multibyte encoding?
|
protected void |
lex_goto_eol() |
void |
newtok(boolean unreadOnce) |
int |
nextc() |
int |
nextToken() |
int |
p(int offset) |
void |
parser_prepare() |
boolean |
peek(int c) |
int |
precise_mbclen() |
void |
pushback(int c) |
int |
readCodepoint(int first,
org.jcodings.Encoding encoding) |
int |
readEscape() |
int |
readUTFEscape(org.jruby.util.ByteList buffer,
boolean stringLiteral,
boolean symbolLiteral) |
void |
readUTFEscapeRegexpLiteral(org.jruby.util.ByteList buffer) |
void |
reset() |
void |
resetStacks() |
protected void |
set_file_encoding(int str,
int send) |
void |
setBraceNest(int nest) |
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(RubyLexer.LexState state) |
void |
setStrTerm(StrTerm strterm) |
void |
setValue(Object yaccValue) |
void |
setWarnings(IRubyWarnings warnings) |
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()
|
void |
tokenAddMBCFromSrc(int c,
org.jruby.util.ByteList buffer) |
int |
tokenize_ident(int result) |
Object |
value()
Value of last token (if it is a token which has a value).
|
boolean |
was_bol() |
boolean |
whole_match_p(org.jruby.util.ByteList eos,
boolean indent) |
public ISourcePosition tokline
public boolean commandStart
public boolean inKwarg
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
protected boolean eofp
protected org.jruby.util.ByteList delayed
public RubyLexer(ParserSupport support, LexerSource source)
public org.jcodings.Encoding getEncoding()
public static RubyLexer.Keyword getKeyword(String str)
public void newtok(boolean unreadOnce)
public boolean tokadd_ident(int c)
public org.jruby.util.ByteList createTokenByteList()
public String createTokenString()
public int tokenize_ident(int result)
public int incrementParenNest()
public int getBraceNest()
public void setBraceNest(int nest)
public int getLeftParenBegin()
public void setLeftParenBegin(int value)
public final void reset()
public boolean hasStarted()
public boolean isEndSeen()
public int p(int offset)
public int nextc()
public boolean peek(int c)
protected void lex_goto_eol()
public int column()
public boolean was_bol()
public void pushback(int c)
public void compile_error(String message)
public void compile_error(SyntaxException.PID pid, String message)
public int readCodepoint(int first, org.jcodings.Encoding encoding) throws IOException
IOException
public void heredoc_restore(HeredocTerm here)
public void parser_prepare()
public int nextToken() throws IOException
IOException
public int token()
public Object value()
public ISourcePosition getPosition()
public ISourcePosition getPosition(ISourcePosition startPosition)
public String getFile()
public String getCurrentLine()
public boolean whole_match_p(org.jruby.util.ByteList eos, boolean indent)
public void setParserSupport(ParserSupport parserSupport)
parserSupport
- 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)
public RubyLexer.LexState getState()
public void setState(RubyLexer.LexState state)
public StackState getCmdArgumentState()
public StackState getConditionState()
public void setValue(Object yaccValue)
public boolean isIdentifierChar(int c)
c
- is character to be comparedpublic boolean isASCII(int c)
protected boolean isMultiByteChar(int c)
c
- public StrNode createStr(org.jruby.util.ByteList buffer, int flags)
protected void handleFileEncodingComment(org.jruby.util.ByteList encodingLine) throws IOException
IOException
protected void set_file_encoding(int str, int send)
public boolean isGlobalCharPunct(int c)
public void readUTFEscapeRegexpLiteral(org.jruby.util.ByteList buffer) throws IOException
IOException
public boolean tokadd_mbchar(int first_byte)
public boolean tokadd_mbchar(int first_byte, org.jruby.util.ByteList buffer)
RubyLexer::tokadd_mbchar(int)
public void tokaddmbc(int codepoint, org.jruby.util.ByteList buffer)
public void tokAdd(int first_byte, org.jruby.util.ByteList buffer)
public void tokCopy(int length, org.jruby.util.ByteList buffer)
public int precise_mbclen()
public void tokenAddMBCFromSrc(int c, org.jruby.util.ByteList buffer) throws IOException
IOException
public int readUTFEscape(org.jruby.util.ByteList buffer, boolean stringLiteral, boolean symbolLiteral) throws IOException
IOException
public int readEscape() throws IOException
IOException
Copyright © 2001-2015 JRuby. All Rights Reserved.