public class ParserSupport
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected ParserConfiguration |
configuration |
protected StaticScope |
currentScope |
static ByteList |
INTERNAL_ID |
boolean |
isNextBreak |
protected RubyLexer |
lexer |
protected ScopedParserState |
scopedParserState |
protected IRubyWarnings |
warnings |
| Constructor and Description |
|---|
ParserSupport() |
| Modifier and Type | Method and Description |
|---|---|
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) |
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) |
void |
compile_error(java.lang.String message) |
Node |
cond(Node node) |
DStrNode |
createDStrNode(int line) |
KeyValuePair<Node,Node> |
createKeyValue(Node key,
Node value) |
Node |
declareIdentifier(ByteList byteName) |
void |
fixpos(Node node,
Node orig) |
ByteList |
formal_argument(ByteList identifier) |
void |
frobnicate_fcall_args(FCallNode fcall,
Node args,
Node iter) |
ParserConfiguration |
getConfiguration() |
StaticScope |
getCurrentScope() |
Node |
getMatchNode(Node firstNode,
Node secondNode) |
Node |
getOperatorCallNode(Node firstNode,
ByteList operator) |
Node |
getOperatorCallNode(Node firstNode,
ByteList operator,
Node secondNode) |
Node |
getOperatorCallNode(Node firstNode,
ByteList operator,
Node secondNode,
int defaultPosition) |
int |
getPosition(Node start) |
RubyParserResult |
getResult()
Gets the result.
|
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) |
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 |
isInClass() |
boolean |
isInDef() |
boolean |
isLazy(ByteList callType) |
boolean |
isLazy(java.lang.String callType) |
ListNode |
list_append(Node list,
Node item) |
ListNode |
list_concat(Node first,
Node second) |
Node |
literal_concat(Node head,
Node tail) |
protected Node |
makeNullNil(Node node) |
Node |
method_cond(Node node) |
ComplexNode |
negateComplexNode(ComplexNode complexNode) |
FloatNode |
negateFloat(FloatNode floatNode) |
NumericNode |
negateInteger(NumericNode integerNode) |
NumericNode |
negateNumeric(NumericNode node) |
RationalNode |
negateRational(RationalNode rationalNode) |
ArgsTailHolder |
new_args_tail(int line,
ListNode keywordArg,
ByteList keywordRestArgName,
BlockArgNode blockArg) |
Node |
new_args(int line,
ListNode pre,
ListNode optional,
RestArgNode rest,
ListNode post,
ArgsTailHolder tail) |
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_fcall(ByteList operation) |
Node |
new_if(int line,
Node condition,
Node thenNode,
Node elseNode) |
Node |
new_op_assign(AssignableNode receiverNode,
ByteList operatorName,
Node valueNode) |
Node |
new_super(int line,
Node args) |
Node |
new_yield(int line,
Node node) |
static Node |
newAlias(int line,
Node newNode,
Node oldNode) |
AndNode |
newAndNode(Node left,
Node right) |
ArrayNode |
newArrayNode(int line,
Node node) |
static CaseNode |
newCaseNode(int line,
Node expression,
Node firstWhenNode)
Ok I admit that this is somewhat ugly.
|
Node |
newEvStrNode(int line,
Node node) |
Node |
newline_node(Node node,
int line)
Wraps node with NEWLINE node.
|
OrNode |
newOrNode(Node left,
Node right) |
Node |
newRegexpNode(int line,
Node contents,
RegexpNode end) |
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) |
static Node |
node_assign(Node lhs,
Node rhs) |
void |
popCurrentScope() |
int |
position(Node one,
Node two) |
void |
pushBlockScope() |
void |
pushLocalScope() |
Node |
remove_duplicate_keys(HashNode hash) |
void |
reset() |
Node |
ret_args(Node node,
int line) |
void |
setConfiguration(ParserConfiguration configuration)
Sets the configuration.
|
void |
setInDef(boolean inDef) |
void |
setIsInClass(boolean inClass) |
void |
setLexer(RubyLexer lexer) |
void |
setResult(RubyParserResult result)
Sets the result.
|
void |
setWarnings(IRubyWarnings warnings) |
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.
|
RubySymbol |
symbolID(ByteList identifierValue) |
boolean |
value_expr(RubyLexer lexer,
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(IRubyWarnings.ID id,
int line,
java.lang.String message,
java.lang.Object... data) |
void |
warning(IRubyWarnings.ID id,
int line,
java.lang.String message,
java.lang.Object... data) |
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 StaticScope currentScope
protected ScopedParserState scopedParserState
protected RubyLexer lexer
protected IRubyWarnings warnings
protected ParserConfiguration configuration
public boolean isNextBreak
public static final ByteList INTERNAL_ID
public void reset()
public StaticScope getCurrentScope()
public ParserConfiguration getConfiguration()
public void popCurrentScope()
public void pushBlockScope()
public void pushLocalScope()
public static Node arg_blk_pass(Node firstNode, BlockPassNode secondNode)
public Node gettable2(Node node)
node - to check its variable typepublic 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 getOperatorCallNode(Node firstNode, ByteList operator, Node secondNode)
public Node getOperatorCallNode(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 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 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 boolean isInDef()
public void setInDef(boolean inDef)
public boolean isInClass()
public void setIsInClass(boolean inClass)
public RubyParserResult getResult()
public void setResult(RubyParserResult result)
result - The result to setpublic void setConfiguration(ParserConfiguration configuration)
configuration - The configuration to setpublic void setWarnings(IRubyWarnings warnings)
public 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 Node 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)
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(IRubyWarnings.ID id, int line, java.lang.String message, java.lang.Object... data)
public void warning(IRubyWarnings.ID id, int line, java.lang.String message, java.lang.Object... data)
public static boolean is_local_id(ByteList name)
@Deprecated public boolean is_local_id(java.lang.String name)
public ArgumentNode arg_var(ByteList byteName)
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 newRegexpNode(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()
Copyright © 2001-2022 JRuby. All Rights Reserved.