public abstract class RubyParserBase
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RubyParserBase.IDType |
| Modifier and Type | Field and Description |
|---|---|
IRubyObject |
case_labels |
protected ParserConfiguration |
configuration |
protected StaticScope |
currentScope |
static ByteList |
INTERNAL_ID |
boolean |
isNextBreak |
protected RubyLexer |
lexer |
static ByteList |
NIL |
static ByteList |
NOT |
protected ScopedParserState |
scopedParserState |
protected IRubyWarnings |
warnings |
| Constructor and Description |
|---|
RubyParserBase(IRubyWarnings warnings) |
| Modifier and Type | Method and Description |
|---|---|
void |
add_forwarding_args() |
Node |
addRootNode(Node topOfAST) |
Node |
appendToBlock(Node head,
Node tail) |
Node |
arg_append(Node node1,
Node node2) |
static Node |
arg_blk_pass(Node firstNode,
BlockPassNode secondNode) |
static Node |
arg_concat(Node node1,
Node node2) |
ArgumentNode |
arg_var(ByteList byteName) |
ArgumentNode |
arg_var(RubySymbol name) |
ArgsNode |
args_with_numbered(ArgsNode args,
int paramCount) |
Node |
aryset(Node receiver,
Node index)
Define an array set condition so we can return lhs
|
AssignableNode |
assignableInCurr(ByteList nameBytes,
Node value) |
AssignableNode |
assignableKeyword(ByteList name,
Node value) |
AssignableNode |
assignableLabelOrIdentifier(ByteList byteName,
Node value) |
static int |
associateEncoding(ByteList buffer,
org.jcodings.Encoding newEncoding,
int codeRange) |
Node |
asSymbol(int line,
ByteList value) |
Node |
asSymbol(int line,
Node value) |
Node |
attrset(Node receiver,
ByteList name)
Define an attribute set condition so we can return lhs
|
Node |
attrset(Node receiver,
ByteList callType,
ByteList name) |
void |
backrefAssignError(Node node) |
Node |
call_bin_op(Node firstNode,
ByteList operator,
Node secondNode) |
Node |
call_bin_op(Node firstNode,
ByteList operator,
Node secondNode,
int defaultPosition) |
Node |
call_uni_op(Node firstNode,
ByteList operator) |
boolean |
check_forwarding_args() |
void |
check_literal_when(Node one) |
void |
compile_error(java.lang.String message) |
Node |
cond(Node node) |
DStrNode |
createDStrNode(int line) |
KeyValuePair<Node,Node> |
createKeyValue(Node key,
Node value) |
protected StrNode |
createStr(ByteList buffer,
int flags) |
Node |
declareIdentifier(ByteList byteName) |
void |
endless_method_name(DefHolder name) |
void |
error_duplicate_pattern_key(ByteList key) |
void |
error_duplicate_pattern_variable(ByteList variable) |
protected ByteList |
extractByteList(java.lang.Object value) |
void |
fixpos(Node node,
Node orig) |
ByteList |
formal_argument(ByteList identifier,
java.lang.Object _unused) |
void |
frobnicate_fcall_args(FCallNode fcall,
Node args,
Node iter) |
RubySymbol |
get_id(ByteList id) |
protected int |
getBraceNest() |
protected StackState |
getCmdArgumentState() |
protected StackState |
getConditionState() |
ParserConfiguration |
getConfiguration() |
protected ByteList |
getCurrentArg() |
StaticScope |
getCurrentScope() |
protected org.jcodings.Encoding |
getEncoding() |
protected java.lang.String |
getFile() |
protected int |
getHeredocIndent() |
protected int |
getLeftParenBegin() |
protected LexContext |
getLexContext() |
protected int |
getParenNest() |
int |
getPosition(Node start) |
RubyParserResult |
getResult()
Gets the result.
|
Ruby |
getRuntime() |
protected int |
getState() |
protected StrTerm |
getStrTerm() |
Node |
gettable(ByteList id) |
Node |
gettable2(Node node)
We know for callers of this that it cannot be any of the specials checked in gettable.
|
protected void |
getterIdentifierError(RubySymbol identifier) |
protected void |
heredoc_dedent(Node node) |
static RubyParserBase.IDType |
id_type(ByteList identifier) |
void |
initTopLocalVariables()
Description of the RubyMethod
|
java.lang.String |
internalId()
Deprecated.
|
static boolean |
is_local_id(ByteList name) |
boolean |
is_local_id(java.lang.String name)
Deprecated.
|
static boolean |
is_private_local_id(ByteList name) |
boolean |
isArgsInfoEmpty(ArgsNode argsNode) |
boolean |
isLazy(ByteList callType) |
boolean |
isLazy(java.lang.String callType) |
Node |
last_arg_append(Node args,
Node lastArg) |
ListNode |
list_append(Node list,
Node item) |
ListNode |
list_concat(Node first,
Node second) |
Node |
literal_concat(Node head,
Node tail) |
boolean |
local_id(ByteList value) |
Node |
logop(Node left,
ByteList op,
Node right) |
protected Node |
makeNullNil(Node node) |
Node |
match_op(Node firstNode,
Node secondNode) |
Node |
method_cond(Node node) |
void |
nd_set_first_loc(Node node,
int line) |
ComplexNode |
negateComplexNode(ComplexNode complexNode) |
FloatNode |
negateFloat(FloatNode floatNode) |
NumericNode |
negateInteger(NumericNode integerNode) |
NumericNode |
negateNumeric(NumericNode node) |
RationalNode |
negateRational(RationalNode rationalNode) |
Node |
new_args_forward_call(int line,
Node leadingArgs) |
ArgsTailHolder |
new_args_tail(int line,
ListNode keywordArg,
ByteList keywordRestArgName,
BlockArgNode blockArg) |
protected ArgsTailHolder |
new_args_tail(int line,
ListNode keywordArg,
ByteList keywordRestArgName,
ByteList block) |
ArgsNode |
new_args(int line,
ListNode pre,
ListNode optional,
RestArgNode rest,
ListNode post,
ArgsTailHolder tail) |
ArrayPatternNode |
new_array_pattern_tail(int line,
ListNode preArgs,
boolean hasRest,
ByteList restArg,
ListNode postArgs) |
ArrayPatternNode |
new_array_pattern(int line,
Node constant,
Node preArg,
ArrayPatternNode arrayPattern) |
Node |
new_ary_op_assign(Node receiverNode,
ByteList operatorName,
Node argsNode,
Node valueNode) |
Node |
new_attr_op_assign(Node receiverNode,
ByteList callType,
Node valueNode,
ByteList variableName,
ByteList operatorName) |
Node |
new_attrassign(int line,
Node receiver,
ByteList name,
Node argsNode,
boolean isLazy) |
Node |
new_bodystmt(Node head,
RescueBodyNode rescue,
Node rescueElse,
Node ensure) |
Node |
new_bv(ByteList identifier) |
Node |
new_call(Node receiver,
ByteList callType,
ByteList name,
Node argsNode,
Node iter) |
Node |
new_call(Node receiver,
ByteList callType,
ByteList name,
Node argsNode,
Node iter,
int line) |
Node |
new_call(Node receiver,
ByteList name,
Node argsNode,
Node iter) |
Colon2Node |
new_colon2(int line,
Node leftNode,
ByteList name) |
Colon3Node |
new_colon3(int line,
ByteList name) |
Node |
new_const_op_assign(int line,
Node lhs,
ByteList operatorName,
Node rhs) |
Node |
new_defined(long line,
Node node) |
Node |
new_fcall(ByteList operation) |
Node |
new_find_pattern_tail(int line,
ByteList preRestArg,
ListNode postArgs,
ByteList postRestArg) |
Node |
new_find_pattern(Node constant,
FindPatternNode findPattern) |
HashPatternNode |
new_hash_pattern_tail(int line,
HashNode keywordArgs,
ByteList keywordRestArg) |
HashPatternNode |
new_hash_pattern(Node constant,
HashPatternNode hashPatternNode) |
Node |
new_if(int line,
Node condition,
Node thenNode,
Node elseNode) |
Node |
new_op_assign(AssignableNode receiverNode,
ByteList operatorName,
Node valueNode) |
Node |
new_regexp(int line,
Node contents,
RegexpNode end) |
Node |
new_super(int line,
Node args) |
Node |
new_yield(int line,
Node node) |
static Node |
newAlias(int line,
Node newNode,
Node oldNode) |
ArrayNode |
newArrayNode(int line,
Node node) |
static CaseNode |
newCaseNode(int line,
Node expression,
Node firstWhenNode)
We post-process a chain of when nodes and analyze them to re-insert them back into our new CaseNode
as a list.
|
Node |
newEvStrNode(int line,
Node node) |
Node |
newIn(int line,
Node expression,
Node body,
Node nextCase) |
Node |
newline_node(Node node,
int line)
Wraps node with NEWLINE node.
|
static PatternCaseNode |
newPatternCaseNode(int line,
Node expression,
Node firstWhenNode) |
Node |
newRescueModNode(Node body,
Node rescueBody) |
SplatNode |
newSplatNode(Node node) |
SValueNode |
newSValueNode(int line,
Node node) |
static Node |
newUndef(int line,
Node nameNode) |
WhenNode |
newWhenNode(int line,
Node expressionNodes,
Node bodyNode,
Node nextCase) |
Node |
nil() |
static Node |
node_assign(Node lhs,
Node rhs) |
HashNode |
none() |
void |
numparam_name(ByteList name) |
void |
numparam_name(RubySymbol name) |
void |
numparam_pop(Node previousInner) |
Node |
numparam_push() |
void |
ordinalMaxNumParam() |
RubyParserResult |
parse(ParserConfiguration configuration)
The parse method use an lexer stream and parse it to an AST node
structure
|
void |
pop_pktbl(java.util.Set<ByteList> table) |
void |
pop_pvtbl(java.util.Set<ByteList> table) |
void |
popCurrentScope() |
int |
position(Node one,
Node two) |
java.util.Set<ByteList> |
push_pktbl() |
java.util.Set<ByteList> |
push_pvtbl() |
void |
pushBlockScope() |
void |
pushLocalScope() |
Node |
reduce_nodes(Node body) |
Node |
remove_begin(Node node) |
Node |
remove_duplicate_keys(HashNode hash) |
Node |
rescued_expr(int line,
Node arg,
Node rescue) |
void |
reset() |
int |
resetMaxNumParam() |
Node |
rest_arg_append(Node args,
Node restArg) |
void |
restore_defun(DefHolder holder) |
int |
restoreMaxNumParam(int maxNum) |
Node |
ret_args(Node node,
int line) |
protected void |
setBraceNest(int value) |
protected void |
setCommandStart(boolean value) |
void |
setConfiguration(ParserConfiguration configuration)
Sets the configuration.
|
protected void |
setCurrentArg(RubySymbol value) |
protected void |
setHeredocIndent(int value) |
protected void |
setHeredocLineIndent(int indent) |
protected void |
setLeftParenBegin(int value) |
void |
setLexer(RubyLexer lexer) |
void |
setResult(RubyParserResult result)
Sets the result.
|
protected void |
setState(int value) |
protected void |
setStrTerm(StrTerm value) |
ByteList |
shadowing_lvar(ByteList nameBytes) |
Node |
splat_array(Node node)
If node is a splat and it is splatting a literal array then return the literal array.
|
protected int |
src_line() |
RubySymbol |
symbolID(ByteList identifierValue) |
boolean |
value_expr(Node node) |
void |
void_expr(Node node)
Check to see if current node is an useless statement.
|
Node |
void_stmts(Node node)
Check all nodes but the last one in a BlockNode for useless (void context) statements.
|
void |
warn_experimental(int line,
java.lang.String message) |
void |
warn(int line,
java.lang.String message) |
void |
warn(java.lang.String message) |
void |
warning(int line,
java.lang.String message) |
void |
warnUnlessEOption(IRubyWarnings.ID id,
Node node,
java.lang.String message) |
void |
yyerror(java.lang.String message)
generate parsing error
|
void |
yyerror(java.lang.String message,
ProductionState state) |
void |
yyerror(java.lang.String message,
java.lang.String[] expected,
java.lang.String found)
generate parsing error
|
protected abstract java.lang.Object |
yyparse(RubyLexer lexer,
java.lang.Object yyDebug) |
protected StaticScope currentScope
protected ScopedParserState scopedParserState
protected RubyLexer lexer
protected IRubyWarnings warnings
protected ParserConfiguration configuration
public boolean isNextBreak
public IRubyObject case_labels
public static final ByteList INTERNAL_ID
public static ByteList NIL
public static final ByteList NOT
public RubyParserBase(IRubyWarnings warnings)
public void reset()
public StaticScope getCurrentScope()
public ParserConfiguration getConfiguration()
public void popCurrentScope()
public void pushBlockScope()
public void pushLocalScope()
public Node numparam_push()
public void numparam_pop(Node previousInner)
public int resetMaxNumParam()
public int restoreMaxNumParam(int maxNum)
public void ordinalMaxNumParam()
public static Node arg_blk_pass(Node firstNode, BlockPassNode secondNode)
public Node gettable2(Node node)
node - to check its variable typepublic void numparam_name(RubySymbol name)
public void numparam_name(ByteList name)
public boolean isArgsInfoEmpty(ArgsNode argsNode)
public AssignableNode assignableLabelOrIdentifier(ByteList byteName, Node value)
public AssignableNode assignableKeyword(ByteList name, Node value)
protected void getterIdentifierError(RubySymbol identifier)
public AssignableNode assignableInCurr(ByteList nameBytes, Node value)
public Node call_bin_op(Node firstNode, ByteList operator, Node secondNode, int defaultPosition)
public Node aryset(Node receiver, Node index)
receiver - array being setindex - node which should evalute to index of array setpublic Node attrset(Node receiver, ByteList name)
receiver - object which contains attributename - of the attribute being setpublic void backrefAssignError(Node node)
public void warnUnlessEOption(IRubyWarnings.ID id, Node node, java.lang.String message)
public boolean value_expr(Node node)
public void void_expr(Node node)
node - to be checked.public Node void_stmts(Node node)
node - to be checked.public SValueNode newSValueNode(int line, Node node)
public static CaseNode newCaseNode(int line, Node expression, Node firstWhenNode)
expression - of the case node (e.g. case foo)firstWhenNode - first when (which could also be the else)public static PatternCaseNode newPatternCaseNode(int line, Node expression, Node firstWhenNode)
public WhenNode newWhenNode(int line, Node expressionNodes, Node bodyNode, Node nextCase)
public Node new_op_assign(AssignableNode receiverNode, ByteList operatorName, Node valueNode)
public Node new_ary_op_assign(Node receiverNode, ByteList operatorName, Node argsNode, Node valueNode)
public Node new_attr_op_assign(Node receiverNode, ByteList callType, Node valueNode, ByteList variableName, ByteList operatorName)
public Node new_const_op_assign(int line, Node lhs, ByteList operatorName, Node rhs)
public Node new_bodystmt(Node head, RescueBodyNode rescue, Node rescueElse, Node ensure)
public RubySymbol symbolID(ByteList identifierValue)
public boolean isLazy(java.lang.String callType)
public boolean isLazy(ByteList callType)
public Node new_attrassign(int line, Node receiver, ByteList name, Node argsNode, boolean isLazy)
public Node new_call(Node receiver, ByteList callType, ByteList name, Node argsNode, Node iter)
public Node new_call(Node receiver, ByteList callType, ByteList name, Node argsNode, Node iter, int line)
public Colon2Node new_colon2(int line, Node leftNode, ByteList name)
public Colon3Node new_colon3(int line, ByteList name)
public void initTopLocalVariables()
public RubyParserResult getResult()
public void setResult(RubyParserResult result)
result - The result to setpublic void setConfiguration(ParserConfiguration configuration)
configuration - The configuration to setpublic void setLexer(RubyLexer lexer)
public DStrNode createDStrNode(int line)
public KeyValuePair<Node,Node> createKeyValue(Node key, Node value)
public NumericNode negateInteger(NumericNode integerNode)
public ComplexNode negateComplexNode(ComplexNode complexNode)
public RationalNode negateRational(RationalNode rationalNode)
public ArgsNode new_args(int line, ListNode pre, ListNode optional, RestArgNode rest, ListNode post, ArgsTailHolder tail)
public ArgsTailHolder new_args_tail(int line, ListNode keywordArg, ByteList keywordRestArgName, BlockArgNode blockArg)
protected ArgsTailHolder new_args_tail(int line, ListNode keywordArg, ByteList keywordRestArgName, ByteList block)
public void yyerror(java.lang.String message)
public void yyerror(java.lang.String message,
ProductionState state)
public void yyerror(java.lang.String message,
java.lang.String[] expected,
java.lang.String found)
message - text to be displayed.expected - list of acceptable tokens, if available.public int getPosition(Node start)
public void warn(java.lang.String message)
public void warn(int line,
java.lang.String message)
public void warning(int line,
java.lang.String message)
public static boolean is_local_id(ByteList name)
@Deprecated public boolean is_local_id(java.lang.String name)
public ArgumentNode arg_var(RubySymbol name)
public ArgumentNode arg_var(ByteList byteName)
public static RubyParserBase.IDType id_type(ByteList identifier)
public static boolean is_private_local_id(ByteList name)
public Node splat_array(Node node)
public void compile_error(java.lang.String message)
public Node new_regexp(int line, Node contents, RegexpNode end)
public static int associateEncoding(ByteList buffer, org.jcodings.Encoding newEncoding, int codeRange)
public NumericNode negateNumeric(NumericNode node)
@Deprecated public java.lang.String internalId()
public java.util.Set<ByteList> push_pvtbl()
public void pop_pvtbl(java.util.Set<ByteList> table)
public java.util.Set<ByteList> push_pktbl()
public void pop_pktbl(java.util.Set<ByteList> table)
public void endless_method_name(DefHolder name)
public void restore_defun(DefHolder holder)
public ArrayPatternNode new_array_pattern(int line, Node constant, Node preArg, ArrayPatternNode arrayPattern)
public HashPatternNode new_hash_pattern(Node constant, HashPatternNode hashPatternNode)
public HashNode none()
public HashPatternNode new_hash_pattern_tail(int line, HashNode keywordArgs, ByteList keywordRestArg)
public void warn_experimental(int line,
java.lang.String message)
public ArrayPatternNode new_array_pattern_tail(int line, ListNode preArgs, boolean hasRest, ByteList restArg, ListNode postArgs)
public void error_duplicate_pattern_key(ByteList key)
public void error_duplicate_pattern_variable(ByteList variable)
public Node new_find_pattern(Node constant, FindPatternNode findPattern)
public Node new_find_pattern_tail(int line, ByteList preRestArg, ListNode postArgs, ByteList postRestArg)
public boolean local_id(ByteList value)
public boolean check_forwarding_args()
public void add_forwarding_args()
public void check_literal_when(Node one)
public void nd_set_first_loc(Node node, int line)
public RubyParserResult parse(ParserConfiguration configuration) throws java.io.IOException
java.io.IOExceptionprotected abstract java.lang.Object yyparse(RubyLexer lexer, java.lang.Object yyDebug) throws java.io.IOException
java.io.IOExceptionprotected LexContext getLexContext()
protected int src_line()
protected int getHeredocIndent()
protected void setHeredocIndent(int value)
protected int getBraceNest()
protected void setBraceNest(int value)
protected int getState()
protected void setState(int value)
protected org.jcodings.Encoding getEncoding()
protected void setCommandStart(boolean value)
protected ByteList getCurrentArg()
protected void setCurrentArg(RubySymbol value)
protected StackState getCmdArgumentState()
protected StackState getConditionState()
protected int getLeftParenBegin()
protected int getParenNest()
protected ByteList extractByteList(java.lang.Object value)
protected void setLeftParenBegin(int value)
protected java.lang.String getFile()
protected void heredoc_dedent(Node node)
protected StrTerm getStrTerm()
protected void setStrTerm(StrTerm value)
protected void setHeredocLineIndent(int indent)
public Ruby getRuntime()
public Node nil()
public RubySymbol get_id(ByteList id)
Copyright © 2001-2023 JRuby. All Rights Reserved.