|
||||||||||
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 StaticScope |
currentScope
|
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_blk_pass(Node firstNode,
BlockPassNode secondNode)
|
Node |
arg_concat(ISourcePosition position,
Node node1,
Node node2)
|
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)
|
void |
checkExpression(Node node)
Does this node represent an expression? |
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. |
ISourcePosition |
createEmptyArgsNodePosition(ISourcePosition pos)
|
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)
|
ArgumentNode |
getRestArgNode(Token token)
|
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 |
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. |
Node |
literal_concat(ISourcePosition position,
Node head,
Node tail)
|
protected Node |
makeNullNil(Node node)
|
FloatNode |
negateFloat(FloatNode floatNode)
|
Node |
negateInteger(Node integerNode)
|
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_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)
|
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)
|
AndNode |
newAndNode(ISourcePosition position,
Node left,
Node right)
|
ArrayNode |
newArrayNode(ISourcePosition position,
Node firstNode)
|
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)
|
SplatNode |
newSplatNode(ISourcePosition position,
Node node)
|
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 |
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 |
setResult(RubyParserResult result)
Sets the result. |
void |
setWarnings(IRubyWarnings warnings)
|
Node |
unwrapNewlineNode(Node node)
|
void |
warningUnlessEOption(IRubyWarnings.ID id,
Node node,
java.lang.String message)
|
void |
warnUnlessEOption(IRubyWarnings.ID id,
Node node,
java.lang.String message)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StaticScope currentScope
protected IRubyWarnings warnings
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 void checkExpression(Node node)
node
- to be checkedpublic 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 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 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 Node literal_concat(ISourcePosition position, Node head, Node tail)
public Node newEvStrNode(ISourcePosition position, Node node)
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 ArgumentNode getRestArgNode(Token token)
public Node new_args(ISourcePosition position, ListNode pre, ListNode optional, RestArgNode rest, ListNode post, BlockArgNode block)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |