|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.parser.ParserSupport
public class ParserSupport
Field Summary | |
---|---|
protected ParserConfiguration |
configuration
|
protected StaticScope |
currentScope
|
protected RubyYaccLexer |
lexer
|
protected IRubyWarnings |
warnings
|
Constructor Summary | |
---|---|
ParserSupport()
|
Method Summary | |
---|---|
Node |
addRootNode(Node topOfAST,
ISourcePosition position)
|
void |
allowDubyExtension(ISourcePosition position)
|
Node |
appendToBlock(Node head,
Node tail)
|
Node |
arg_add(ISourcePosition position,
Node node1,
Node node2)
|
Node |
arg_append(Node node1,
Node node2)
|
Node |
arg_blk_pass(Node firstNode,
BlockPassNode secondNode)
|
Node |
arg_concat(ISourcePosition position,
Node node1,
Node node2)
|
ArgumentNode |
arg_var(Token identifier)
|
Node |
aryset(Node receiver,
Node index)
Define an array set condition so we can return lhs |
AssignableNode |
assignable(Token lhs,
Node value)
|
Node |
attrset(Node receiver,
java.lang.String name)
Define an attribute set condition so we can return lhs |
void |
backrefAssignError(Node node)
|
boolean |
checkExpression(Node node)
|
protected void |
checkRegexpSyntax(org.jruby.util.ByteList value,
RegexpOptions options)
|
void |
checkUselessStatement(Node node)
Check to see if current node is an useless statement. |
void |
checkUselessStatements(BlockNode blockNode)
Check all nodes but the last one in a BlockNode for useless (void context) statements. |
DStrNode |
createDStrNode(ISourcePosition position)
|
ISourcePosition |
createEmptyArgsNodePosition(ISourcePosition pos)
|
Token |
formal_argument(Token identifier)
|
Node |
getConditionNode(Node node)
|
ParserConfiguration |
getConfiguration()
|
StaticScope |
getCurrentScope()
|
int |
getInSingle()
Getter for property inSingle. |
Node |
getMatchNode(Node firstNode,
Node secondNode)
|
Node |
getOperatorCallNode(Node firstNode,
java.lang.String operator)
|
Node |
getOperatorCallNode(Node firstNode,
java.lang.String operator,
Node secondNode)
|
Node |
getOperatorCallNode(Node firstNode,
java.lang.String operator,
Node secondNode,
ISourcePosition defaultPosition)
|
ISourcePosition |
getPosition(ISourcePositionHolder start)
|
RubyParserResult |
getResult()
Gets the result. |
Node |
getReturnArgsNode(Node node)
|
Node |
gettable(Token token)
Create AST node representing variable type it represents. |
Node |
gettable2(Node node)
We know for callers of this that it cannot be any of the specials checked in gettable. |
protected void |
getterIdentifierError(ISourcePosition position,
java.lang.String identifier)
|
void |
initTopLocalVariables()
Description of the RubyMethod |
boolean |
is_local_id(Token identifier)
|
boolean |
isBreakStatement(Node node)
Is the supplied node a break/control statement? |
boolean |
isInDef()
|
boolean |
isInSingle()
Getter for property inSingle. |
boolean |
isLiteral(Node node)
Is this a literal in the sense that MRI has a NODE_LIT for. |
ListNode |
list_append(Node list,
Node item)
|
ListNode |
list_concat(Node first,
Node second)
|
Node |
literal_concat(ISourcePosition position,
Node head,
Node tail)
|
protected Node |
makeNullNil(Node node)
|
FloatNode |
negateFloat(FloatNode floatNode)
|
Node |
negateInteger(Node integerNode)
|
Node |
new_aref(Node receiver,
Token name,
Node argsNode)
|
Node |
new_args(ISourcePosition position,
ListNode pre,
ListNode optional,
RestArgNode rest,
ListNode post,
BlockArgNode block)
|
Node |
new_attrassign(ISourcePosition position,
Node receiver,
java.lang.String name,
Node args)
|
Node |
new_bv(Token identifier)
|
Node |
new_call(Node receiver,
Token name,
Node argsNode,
Node iter)
|
Colon2Node |
new_colon2(ISourcePosition position,
Node leftNode,
java.lang.String name)
|
Colon3Node |
new_colon3(ISourcePosition position,
java.lang.String name)
|
Node |
new_fcall(Token operation,
Node args,
Node iter)
|
IterNode |
new_iter(ISourcePosition position,
Node vars,
StaticScope scope,
Node body)
|
Node |
new_opElementAsgnNode(ISourcePosition position,
Node receiverNode,
java.lang.String operatorName,
Node argsNode,
Node valueNode)
|
Node |
new_super(Node args,
Token operation)
|
Node |
new_yield(ISourcePosition position,
Node node)
|
Node |
newAlias(ISourcePosition position,
Node newNode,
Node oldNode)
|
AndNode |
newAndNode(ISourcePosition position,
Node left,
Node right)
|
ArrayNode |
newArrayNode(ISourcePosition position,
Node firstNode)
|
BlockArgNode |
newBlockArg(ISourcePosition position,
Token nameToken)
|
BlockArg18Node |
newBlockArg18(ISourcePosition position,
Node blockValue,
Node args)
|
CaseNode |
newCaseNode(ISourcePosition position,
Node expression,
Node firstWhenNode)
Ok I admit that this is somewhat ugly. |
Node |
newEvStrNode(ISourcePosition position,
Node node)
|
Node |
newline_node(Node node,
ISourcePosition position)
Wraps node with NEWLINE node. |
OrNode |
newOrNode(ISourcePosition position,
Node left,
Node right)
|
Node |
newRegexpNode(ISourcePosition position,
Node contents,
RegexpNode end)
|
SplatNode |
newSplatNode(ISourcePosition position,
Node node)
|
SValueNode |
newSValueNode(ISourcePosition position,
Node node)
|
Node |
newUndef(ISourcePosition position,
Node nameNode)
|
WhenNode |
newWhenNode(ISourcePosition position,
Node expressionNodes,
Node bodyNode,
Node nextCase)
|
Node |
node_assign(Node lhs,
Node rhs)
|
void |
popCurrentScope()
|
ISourcePosition |
position(ISourcePositionHolder one,
ISourcePositionHolder two)
|
void |
pushBlockScope()
|
void |
pushLocalScope()
|
void |
regexpFragmentCheck(RegexpNode end,
org.jruby.util.ByteList value)
|
void |
reset()
|
Node |
ret_args(Node node,
ISourcePosition position)
|
void |
setConfiguration(ParserConfiguration configuration)
Sets the configuration. |
void |
setInDef(boolean inDef)
|
void |
setInSingle(int inSingle)
Setter for property inSingle. |
void |
setLexer(RubyYaccLexer lexer)
|
void |
setResult(RubyParserResult result)
Sets the result. |
void |
setWarnings(IRubyWarnings warnings)
|
Token |
shadowing_lvar(Token identifier)
|
Node |
splat_array(Node node)
If node is a splat and it is splatting a literal array then return the literal array. |
Node |
unwrapNewlineNode(Node node)
|
void |
warn(IRubyWarnings.ID id,
ISourcePosition position,
java.lang.String message,
java.lang.Object... data)
|
void |
warning(IRubyWarnings.ID id,
ISourcePosition position,
java.lang.String message,
java.lang.Object... data)
|
void |
warningUnlessEOption(IRubyWarnings.ID id,
Node node,
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,
java.lang.String[] expected,
java.lang.String found)
generate parsing error |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StaticScope currentScope
protected RubyYaccLexer lexer
protected IRubyWarnings warnings
protected ParserConfiguration configuration
Constructor Detail |
---|
public ParserSupport()
Method Detail |
---|
public void reset()
public void allowDubyExtension(ISourcePosition position)
public StaticScope getCurrentScope()
public ParserConfiguration getConfiguration()
public void popCurrentScope()
public void pushBlockScope()
public void pushLocalScope()
public Node arg_concat(ISourcePosition position, Node node1, Node node2)
public Node arg_blk_pass(Node firstNode, BlockPassNode secondNode)
public Node gettable2(Node node)
node
- to check its variable type
public Node gettable(Token token)
token
- to check its variable type
protected void getterIdentifierError(ISourcePosition position, java.lang.String identifier)
public AssignableNode assignable(Token lhs, Node value)
public Node newline_node(Node node, ISourcePosition position)
node
-
public Node addRootNode(Node topOfAST, ISourcePosition position)
public Node appendToBlock(Node head, Node tail)
public Node getOperatorCallNode(Node firstNode, java.lang.String operator)
public Node getOperatorCallNode(Node firstNode, java.lang.String operator, Node secondNode)
public Node getOperatorCallNode(Node firstNode, java.lang.String operator, Node secondNode, ISourcePosition defaultPosition)
public Node getMatchNode(Node firstNode, Node secondNode)
public Node aryset(Node receiver, Node index)
receiver
- array being setindex
- node which should evalute to index of array set
public Node attrset(Node receiver, java.lang.String name)
receiver
- object which contains attributename
- of the attribute being set
public void backrefAssignError(Node node)
public Node arg_add(ISourcePosition position, Node node1, Node node2)
public Node node_assign(Node lhs, Node rhs)
public Node ret_args(Node node, ISourcePosition position)
public boolean isBreakStatement(Node node)
node
- to be checked
public void warnUnlessEOption(IRubyWarnings.ID id, Node node, java.lang.String message)
public void warningUnlessEOption(IRubyWarnings.ID id, Node node, java.lang.String message)
public boolean checkExpression(Node node)
public boolean isLiteral(Node node)
node
- to be tested
public void checkUselessStatement(Node node)
node
- to be checked.public void checkUselessStatements(BlockNode blockNode)
blockNode
- to be checked.protected Node makeNullNil(Node node)
public Node getConditionNode(Node node)
public SValueNode newSValueNode(ISourcePosition position, Node node)
public SplatNode newSplatNode(ISourcePosition position, Node node)
public ArrayNode newArrayNode(ISourcePosition position, Node firstNode)
public ISourcePosition position(ISourcePositionHolder one, ISourcePositionHolder two)
public AndNode newAndNode(ISourcePosition position, Node left, Node right)
public OrNode newOrNode(ISourcePosition position, Node left, Node right)
public CaseNode newCaseNode(ISourcePosition position, 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(ISourcePosition position, Node expressionNodes, Node bodyNode, Node nextCase)
public Node getReturnArgsNode(Node node)
public Node new_opElementAsgnNode(ISourcePosition position, Node receiverNode, java.lang.String operatorName, Node argsNode, Node valueNode)
public Node new_attrassign(ISourcePosition position, Node receiver, java.lang.String name, Node args)
public Node new_call(Node receiver, Token name, Node argsNode, Node iter)
public Node new_aref(Node receiver, Token name, Node argsNode)
public Colon2Node new_colon2(ISourcePosition position, Node leftNode, java.lang.String name)
public Colon3Node new_colon3(ISourcePosition position, java.lang.String name)
public Node new_fcall(Token operation, Node args, Node iter)
public Node new_super(Node args, Token operation)
public void initTopLocalVariables()
public boolean isInSingle()
public void setInSingle(int inSingle)
inSingle
- New value of property inSingle.public boolean isInDef()
public void setInDef(boolean inDef)
public int getInSingle()
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(RubyYaccLexer lexer)
public DStrNode createDStrNode(ISourcePosition position)
public Node literal_concat(ISourcePosition position, Node head, Node tail)
public Node newEvStrNode(ISourcePosition position, Node node)
public IterNode new_iter(ISourcePosition position, Node vars, StaticScope scope, Node body)
public Node new_yield(ISourcePosition position, Node node)
public Node negateInteger(Node integerNode)
public FloatNode negateFloat(FloatNode floatNode)
public ISourcePosition createEmptyArgsNodePosition(ISourcePosition pos)
public Node unwrapNewlineNode(Node node)
public Node new_args(ISourcePosition position, ListNode pre, ListNode optional, RestArgNode rest, ListNode post, BlockArgNode block)
public Node newAlias(ISourcePosition position, Node newNode, Node oldNode)
public Node newUndef(ISourcePosition position, Node nameNode)
public BlockArg18Node newBlockArg18(ISourcePosition position, Node blockValue, Node args)
public BlockArgNode newBlockArg(ISourcePosition position, Token nameToken)
public void yyerror(java.lang.String message)
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 ISourcePosition getPosition(ISourcePositionHolder start)
public void warn(IRubyWarnings.ID id, ISourcePosition position, java.lang.String message, java.lang.Object... data)
public void warning(IRubyWarnings.ID id, ISourcePosition position, java.lang.String message, java.lang.Object... data)
public boolean is_local_id(Token identifier)
public ListNode list_append(Node list, Node item)
public Node new_bv(Token identifier)
public ArgumentNode arg_var(Token identifier)
public Token formal_argument(Token identifier)
public Token shadowing_lvar(Token identifier)
public ListNode list_concat(Node first, Node second)
public Node splat_array(Node node)
public Node arg_append(Node node1, Node node2)
public void regexpFragmentCheck(RegexpNode end, org.jruby.util.ByteList value)
protected void checkRegexpSyntax(org.jruby.util.ByteList value, RegexpOptions options)
public Node newRegexpNode(ISourcePosition position, Node contents, RegexpNode end)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |