Top Inners Fields Constructors Methods
org.jruby.parser

public abstract Class RubyParserBase

extends Object
Class Inheritance
Known Direct Subclasses
org.jruby.parser.RubyParser
Imports
java.io.IOException, java.math.BigInteger, java.util.ArrayList, .Arrays, .HashMap, .HashSet, .List, .Map, .Set, org.jcodings.Encoding, org.jcodings.specific.USASCIIEncoding, org.jruby.Ruby, .RubyBignum, .RubyRegexp, .RubyString, .RubySymbol, org.jruby.ast.*, org.jruby.ast.types.INameNode, org.jruby.ast.visitor.OperatorCallNode, org.jruby.common.IRubyWarnings, .IRubyWarnings.ID, .RubyWarnings, org.jruby.ext.coverage.CoverageData, org.jruby.ir.IRScopeType, org.jruby.ir.builder.StringStyle, org.jruby.lexer.LexerSource, org.jruby.lexer.yacc.LexContext, .RubyLexer, .StackState, .StrTerm, org.jruby.runtime.DynamicScope, .Signature, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList, .CommonByteLists, .KeyValuePair, .RegexpOptions, .StringSupport, org.jruby.util.cli.Options

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
public static enum

Field Summary

Modifier and TypeField and Description
public IRubyObject
private int[]
protected StaticScope
private static final int[]
private DynamicScope
public static final ByteList
public boolean
private Node
private Set<ByteList>
protected RubyLexer
private int
public static ByteList
public static final ByteList
private Node
private Node
private Node
protected static final int
private RubyParserResult
private Ruby
protected ScopedParserState
private StringStyle
private TokenInfo
protected ParserType
private Set<ByteList>
private boolean

Constructor Summary

AccessConstructor and Description
public
RubyParserBase(Ruby runtime, LexerSource source, DynamicScope scope, ParserType type)

Method Summary

Modifier and TypeMethod and Description
public void
private void
addOrMarkVariable(RubySymbol name, int slot)

public Node
addRootNode(Node topOfAST)

private List<Integer>
protected NodeExits
public Node
appendToBlock(Node head, Node tail)

private static Node
arg_add(int line, Node node1, Node node2)

public Node
arg_append(Node node1, Node node2)

public static Node
arg_blk_pass(Node firstNode, BlockPassNode secondNode)

public static Node
arg_concat(Node node1, Node node2)

public ArgumentNode
public ArgumentNode
arg_var(ByteList byteName)

public ArgsNode
args_with_numbered(ArgsNode args, int paramCount, Node itNode)

public Node

Returns:

an AttrAssignNode
aryset
(Node
array being set
receiver
,
Node
node which should evalute to index of array set
index
)

Define an array set condition so we can return lhs

private void
public AssignableNode
assignableInCurr(ByteList nameBytes, Node value)

public AssignableNode
public AssignableNode
public static int
associateEncoding(ByteList buffer, Encoding newEncoding, int codeRange)

public Node
asSymbol(int line, ByteList value)

public Node
asSymbol(int line, Node value)

public Node

Returns:

an AttrAssignNode
attrset
(Node
object which contains attribute
receiver
,
ByteList
of the attribute being set
name
)

Define an attribute set condition so we can return lhs

public Node
attrset(Node receiver, ByteList callType, ByteList name)

public void
protected void
public Node
call_bin_op(Node firstNode, ByteList operator, Node secondNode)

public Node
call_bin_op(Node firstNode, ByteList operator, Node secondNode, int defaultPosition)

public Node
call_uni_op(Node firstNode, ByteList operator)

public boolean
public void
private boolean
checkAssignmentInCondition(Node node)

assign_in_cond

private Node
checkForNilNode(Node node, int defaultPosition)

protected void
clear_block_exit(boolean value)

public void
public Node
cond(Node node)

private Node
protected ConstDeclNode
cont_decl(int position, INameNode constNode)

public void
coverLine(int i)

Zero out coverable lines as they're encountered

public DStrNode
createDStrNode(int line)

public KeyValuePair<Node, Node>
createKeyValue(Node key, Node value)

private ByteList
protected StrNode
createStr(ByteList buffer, int flags)

public Node
protected boolean
public void
public void
public void
protected ByteList
public void
public DynamicScope
public CoverageData
finishCoverage(String file, int lines)

At end of a parse if coverage is enabled we will do final processing of the primitive coverage array and make sure runtimes coverage data has been updated with this new data.

public void
fixpos(Node node, Node orig)

public ByteList
formal_argument(ByteList identifier, Object _unused)

protected void
public void
public RubySymbol
protected int
protected StackState
protected StackState
protected ByteList
public StaticScope
protected Encoding
protected String
protected int
protected int
protected LexContext
private Node
getOperatorCallNodeInner(Node firstNode, ByteList operator, Node secondNode)

protected int
public int
public RubyParserResult

Returns:

Returns a RubyParserResult
getResult
()

Gets the result.

public Ruby
protected int
public StringStyle
protected StrTerm
public Node
public Node

Returns:

an AST node representing this new variable
gettable2
(Node
to check its variable type
node
)

We know for callers of this that it cannot be any of the specials checked in gettable.

protected void
protected TokenInfo
public StaticScope

Returns:

a static scope
getTopStaticScope
(String
to name top scope if we have a new scope
file
)

Returns the static scope which represents the top of the parse.

public IRubyWarnings
public void
growCoverageLines(int i)

Called by coverLine to grow it large enough to add new covered line.

private void
handleUselessWarn(Node node, String useless)

private boolean
public boolean
protected void
public static RubyParserBase.IDType
id_type(ByteList identifier)

protected NodeExits
public void
initTopLocalVariables()

Description of the RubyMethod

public String
internalId()
Deprecated

private boolean
public static boolean
public boolean
is_local_id(String name)
Deprecated

public static boolean
public boolean
private static boolean
public boolean
public boolean
protected boolean
private boolean
private boolean
public boolean
isLazy(String callType)

public boolean
isLazy(ByteList callType)

private boolean
private boolean
private static boolean
protected Node
public Node
last_arg_append(Node args, Node lastArg)

public ListNode
list_append(Node list, Node item)

public ListNode
list_concat(Node first, Node second)

public Node
literal_concat(Node head, Node tail)

public boolean
public Node
logop(Node left, ByteList op, Node right)

protected Node
private ListNode
makePreNumArgs(int paramCount)

public Node
match_op(Node firstNode, Node secondNode)

public Node
public void
nd_set_first_loc(Node node, int line)

public ComplexNode
public FloatNode
public NumericNode
public NumericNode
public RationalNode
public ArgsNode
new_args(int line, ListNode pre, ListNode optional, RestArgNode rest, ListNode post, ArgsTailHolder tail)

public Node
new_args_forward_call(int line, Node leadingArgs)

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 ArrayPatternNode
new_array_pattern(int line, Node constant, Node preArg, ArrayPatternNode arrayPattern)

public ArrayPatternNode
new_array_pattern_tail(int line, ListNode preArgs, boolean hasRest, ByteList restArg, ListNode postArgs)

public Node
new_ary_op_assign(Node receiverNode, Node argsNode, ByteList operatorName, Node valueNode)

public Node
new_attr_op_assign(Node receiverNode, ByteList callType, ByteList variableName, ByteList operatorName, Node valueNode)

public Node
new_attrassign(int line, Node receiver, ByteList name, Node argsNode, boolean isLazy)

public Node
new_bodystmt(Node head, RescueBodyNode rescue, Node rescueElse, Node ensure)

public Node
new_bv(ByteList identifier)

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 Node
new_call(Node receiver, ByteList name, Node argsNode, Node iter)

public Colon2Node
new_colon2(int line, Node leftNode, ByteList name)

public Colon3Node
new_colon3(int line, ByteList name)

public Node
new_const_op_assign(int line, Node lhs, ByteList operatorName, Node rhs, LexContext _lexContext)

public Node
new_defined(long line, Node node)

protected Node
public Node
new_fcall(ByteList operation)

public Node
new_find_pattern(Node constant, FindPatternNode findPattern)

public Node
new_find_pattern_tail(int line, ByteList preRestArg, ListNode postArgs, ByteList postRestArg)

public HashPatternNode
new_hash_pattern(Node constant, HashPatternNode hashPatternNode)

public HashPatternNode
new_hash_pattern_tail(int line, HashNode keywordArgs, ByteList keywordRestArg)

public Node
new_if(int line, Node condition, Node thenNode, Node elseNode)

public Node
new_op_assign(AssignableNode receiverNode, ByteList operatorName, Node valueNode, LexContext _lexContext)

public Node
new_regexp(int line, Node contents, RegexpNode end)

public Node
new_super(int line, Node args)

public Node
new_yield(int line, Node node)

public static Node
newAlias(int line, Node newNode, Node oldNode)

public ArrayNode
newArrayNode(int line, Node node)

public static CaseNode

Returns:

a new case node
newCaseNode
(int line, Node
of the case node (e.g. case foo)
expression
,
Node
first when (which could also be the else)
firstWhenNode
)

We post-process a chain of when nodes and analyze them to re-insert them back into our new CaseNode as a list.

public Node
newEvStrNode(int line, Node node)

public Node
newIn(int line, Node expression, Node body, Node nextCase)

public Node
newline_node(Node node, int line)

Wraps node with NEWLINE node.

public static PatternCaseNode
newPatternCaseNode(int line, Node expression, Node firstWhenNode)

public Node
newRescueModNode(Node body, Node rescueBody)

public SplatNode
public SValueNode
newSValueNode(int line, Node node)

public static Node
newUndef(int line, Node nameNode)

public WhenNode
newWhenNode(int line, Node expressionNodes, Node bodyNode, Node nextCase)

protected void
public Node
nil()

public static Node
node_assign(Node lhs, Node rhs, LexContext _lexContext)

public HashNode
none()

private boolean
public void
public void
public void
numparam_pop(Node previousInner)

public Node
public void
public RubyParserResult
public void
public void
public void
public int
position(Node one, Node two)

protected void
public Set<ByteList>
public Set<ByteList>
public void
public void
private Node
range_op(Node node)

public Node
public Node
public Node
public Node
rescued_expr(int line, Node arg, Node rescue)

public void
public int
public Node
rest_arg_append(Node args, Node restArg)

protected void
public void
public int
restoreMaxNumParam(int maxNum)

public Node
ret_args(Node node, int line)

protected void
protected void
setBraceNest(int value)

protected void
setCommandStart(boolean value)

protected void
protected void
setHeredocIndent(int value)

protected void
protected void
setLeftParenBegin(int value)

protected void
protected void
setState(int value)

public void
protected void
public ByteList
private static void
public Node
splat_array(Node node)

If node is a splat and it is splatting a literal array then return the literal array.

protected int
private void
private void
public RubySymbol
symbolID(ByteList identifierValue)

protected void
protected void
protected void
protected void
protected void
token_info_warn(String name, int same, ProductionState loc)

public boolean
pack-priv boolean
public void
void_expr(Node
to be checked.
node
)

Check to see if current node is an useless statement.

public Node
void_stmts(Node
to be checked.
node
)

Check all nodes but the last one in a BlockNode for useless (void context) statements.

public void
warn(String message)

public void
warn(int line, String message)

protected void
public void
warning(int line, String message)

public void
warning(IRubyWarnings.ID id, String file, int line, String message)

public void
public void
yyerror(String message)

generate parsing error

public void
yyerror(String message, ProductionState state)

public void
yyerror(String
text to be displayed.
message
,
String[]
list of acceptable tokens, if available.
expected
,
String found)

generate parsing error

protected abstract Object
yyparse(RubyLexer lexer, Object yyDebug)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait