org.jruby.parser
Class ParserSupport

java.lang.Object
  extended byorg.jruby.parser.ParserSupport

public class ParserSupport
extends java.lang.Object

Ruby 1.6.7 compatible.

Version:
$Revision: 1.10 $
Author:
jpetersen

Constructor Summary
ParserSupport()
           
 
Method Summary
 INode appendPrintToBlock(INode block)
           
 INode appendToBlock(INode head, INode tail)
           
 INode appendWhileLoopToBlock(INode block, boolean chop, boolean split)
           
 INode arg_blk_pass(IListNode firstNode, BlockPassNode secondNode)
           
 void backrefAssignError(INode node)
           
 void checkExpression(INode node)
           
 void checkUselessStatement(INode node)
           
 void checkUselessStatements(BlockNode blockNode)
           
 INode getAccessNode(java.lang.String id, ISourcePosition iPosition)
          Returns a Node representing the access of the variable or constant named id.
 INode getAssignmentNode(java.lang.String name, INode valueNode, ISourcePosition position)
          Returns a Node representing the assignment of value to the variable or constant named id.
 INode getAttributeAssignmentNode(INode recv, java.lang.String name)
           
 BlockNamesStack getBlockNames()
          Gets the blockNames.
 int getClassNest()
          Getter for property classNest.
 INode getConditionNode(INode node)
           
 IRubyParserConfiguration getConfiguration()
          Gets the configuration.
 INode getElementAssignmentNode(INode recv, IListNode idx)
           
 int getInSingle()
          Getter for property inSingle.
 LocalNamesStack getLocalNames()
          Gets the localNames.
 INode getMatchNode(INode firstNode, INode secondNode)
           
 INode getOperatorCallNode(INode firstNode, java.lang.String operator)
           
 INode getOperatorCallNode(INode firstNode, java.lang.String operator, INode secondNode)
           
 java.lang.String getOperatorName(int operatorName)
           
 RubyParserResult getResult()
          Gets the result.
 INode getReturnArgsNode(INode node)
           
 void initTopLocalVariables()
          Description of the Method
 boolean isCompileForEval()
           
 boolean isInDef()
           
 boolean isInDefined()
          Getter for property inDefined.
 boolean isInSingle()
          Getter for property inSingle.
 INode new_call(INode receiverNode, java.lang.String name, INode args)
           
 INode new_fcall(java.lang.String name, INode args, ISourcePosition iPosition)
           
 INode new_super(INode args, ISourcePosition iPosition)
           
 AndNode newAndNode(INode left, INode right)
           
 INode newline_node(INode node, ISourcePosition iPosition)
          Wraps node with NEWLINE node.
 OrNode newOrNode(INode left, INode right)
           
 INode node_assign(INode lhs, INode rhs)
           
 void reset()
           
 void setClassNest(int classNest)
          Setter for property classNest.
 void setConfiguration(IRubyParserConfiguration configuration)
          Sets the configuration.
 void setErrorHandler(IErrorHandler errorHandler)
          Sets the errorHandler.
 void setInDef(boolean inDef)
           
 void setInDefined(boolean inDefined)
          Setter for property inDefined.
 void setInSingle(int inSingle)
          Setter for property inSingle.
 void setResult(RubyParserResult result)
          Sets the result.
 void updateTopLocalVariables()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserSupport

public ParserSupport()
Method Detail

reset

public void reset()

getOperatorName

public java.lang.String getOperatorName(int operatorName)

arg_blk_pass

public INode arg_blk_pass(IListNode firstNode,
                          BlockPassNode secondNode)

appendPrintToBlock

public INode appendPrintToBlock(INode block)

appendWhileLoopToBlock

public INode appendWhileLoopToBlock(INode block,
                                    boolean chop,
                                    boolean split)

getAccessNode

public INode getAccessNode(java.lang.String id,
                           ISourcePosition iPosition)
Returns a Node representing the access of the variable or constant named id. see gettable() in MRI

Parameters:
id - The name of the variable or constant.
Returns:
A node representing the access.

getAssignmentNode

public INode getAssignmentNode(java.lang.String name,
                               INode valueNode,
                               ISourcePosition position)
Returns a Node representing the assignment of value to the variable or constant named id. cf assignable in MRI

Parameters:
name - The name of the variable or constant.
valueNode - A Node representing the value which should be assigned.
Returns:
A Node representing the assignment.

newline_node

public INode newline_node(INode node,
                          ISourcePosition iPosition)
Wraps node with NEWLINE node.

Parameters:
node -
Returns:
a NewlineNode or null if node is null.

appendToBlock

public INode appendToBlock(INode head,
                           INode tail)

getOperatorCallNode

public INode getOperatorCallNode(INode firstNode,
                                 java.lang.String operator)

getOperatorCallNode

public INode getOperatorCallNode(INode firstNode,
                                 java.lang.String operator,
                                 INode secondNode)

getMatchNode

public INode getMatchNode(INode firstNode,
                          INode secondNode)

getElementAssignmentNode

public INode getElementAssignmentNode(INode recv,
                                      IListNode idx)

getAttributeAssignmentNode

public INode getAttributeAssignmentNode(INode recv,
                                        java.lang.String name)

backrefAssignError

public void backrefAssignError(INode node)

node_assign

public INode node_assign(INode lhs,
                         INode rhs)

checkExpression

public void checkExpression(INode node)

checkUselessStatement

public void checkUselessStatement(INode node)

checkUselessStatements

public void checkUselessStatements(BlockNode blockNode)

getConditionNode

public INode getConditionNode(INode node)

newAndNode

public AndNode newAndNode(INode left,
                          INode right)

newOrNode

public OrNode newOrNode(INode left,
                        INode right)

getReturnArgsNode

public INode getReturnArgsNode(INode node)

new_call

public INode new_call(INode receiverNode,
                      java.lang.String name,
                      INode args)

new_fcall

public INode new_fcall(java.lang.String name,
                       INode args,
                       ISourcePosition iPosition)

new_super

public INode new_super(INode args,
                       ISourcePosition iPosition)

initTopLocalVariables

public void initTopLocalVariables()
Description of the Method


updateTopLocalVariables

public void updateTopLocalVariables()
Description of the Method


isInSingle

public boolean isInSingle()
Getter for property inSingle.

Returns:
Value of property inSingle.

setInSingle

public void setInSingle(int inSingle)
Setter for property inSingle.

Parameters:
inSingle - New value of property inSingle.

isInDef

public boolean isInDef()

setInDef

public void setInDef(boolean inDef)

getInSingle

public int getInSingle()
Getter for property inSingle.

Returns:
Value of property inSingle.

isInDefined

public boolean isInDefined()
Getter for property inDefined.

Returns:
Value of property inDefined.

setInDefined

public void setInDefined(boolean inDefined)
Setter for property inDefined.

Parameters:
inDefined - New value of property inDefined.

isCompileForEval

public boolean isCompileForEval()

getClassNest

public int getClassNest()
Getter for property classNest.

Returns:
Value of property classNest.

setClassNest

public void setClassNest(int classNest)
Setter for property classNest.

Parameters:
classNest - New value of property classNest.

getBlockNames

public BlockNamesStack getBlockNames()
Gets the blockNames.

Returns:
Returns a BlockNamesStack

getLocalNames

public LocalNamesStack getLocalNames()
Gets the localNames.

Returns:
Returns a LocalNamesStack

getResult

public RubyParserResult getResult()
Gets the result.

Returns:
Returns a RubyParserResult

setResult

public void setResult(RubyParserResult result)
Sets the result.

Parameters:
result - The result to set

getConfiguration

public IRubyParserConfiguration getConfiguration()
Gets the configuration.

Returns:
Returns a IRubyParserConfiguration

setConfiguration

public void setConfiguration(IRubyParserConfiguration configuration)
Sets the configuration.

Parameters:
configuration - The configuration to set

setErrorHandler

public void setErrorHandler(IErrorHandler errorHandler)
Sets the errorHandler.

Parameters:
errorHandler - The errorHandler to set


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.