org.codehaus.groovy.syntax.parser
Class ExpressionSupport

java.lang.Object
  extended byorg.codehaus.groovy.syntax.parser.ExpressionSupport

public class ExpressionSupport
extends java.lang.Object

A helper for the expression parsing system that provides in-depth analysis of CSTNodes.

Author:
Chris Poirier

Constructor Summary
ExpressionSupport()
           
 
Method Summary
static boolean isAModifiableExpression(CSTNode node)
          A synonym for isAModifiableExpression( node, false ).
static boolean isAModifiableExpression(CSTNode node, boolean unknownReturns)
          Returns true if the node is a modifiable expression (ie.
static boolean isAnExpression(CSTNode node)
          A synonym for isAnExpression( node, false ).
static boolean isAnExpression(CSTNode node, boolean unknownReturns)
          Returns true if the node is a complete expression (something that has a value).
static boolean isAnOperator(CSTNode node)
          A synonym for isAnOperator(node, false).
static boolean isAnOperator(CSTNode node, boolean unknownReturns)
          Returns true if the node is an operator and not an expression (see above).
static boolean isAPotentialTypeName(CSTNode node, boolean allowVoid)
          Returns true if the node is potentially a type name.
static boolean isAVariable(CSTNode node)
          Returns true if the node might be a variable.
static boolean isInvokable(CSTNode node)
          Returns true if the node might be a method.
static boolean isPotentialCastOperator(CSTNode node)
          Returns true if the node is potentially a cast operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionSupport

public ExpressionSupport()
Method Detail

isAnExpression

public static boolean isAnExpression(CSTNode node,
                                     boolean unknownReturns)
Returns true if the node is a complete expression (something that has a value).


isAnExpression

public static boolean isAnExpression(CSTNode node)
A synonym for isAnExpression( node, false ).


isAnOperator

public static boolean isAnOperator(CSTNode node,
                                   boolean unknownReturns)
Returns true if the node is an operator and not an expression (see above).


isAnOperator

public static boolean isAnOperator(CSTNode node)
A synonym for isAnOperator(node, false).


isAVariable

public static boolean isAVariable(CSTNode node)
Returns true if the node might be a variable.


isInvokable

public static boolean isInvokable(CSTNode node)
Returns true if the node might be a method.


isAModifiableExpression

public static boolean isAModifiableExpression(CSTNode node,
                                              boolean unknownReturns)
Returns true if the node is a modifiable expression (ie. something that can be the target of an assignment). Note that this determination is approximate: false negatives won't happen, but false positives are distinctly possible, and must be resolved in later phases.


isAModifiableExpression

public static boolean isAModifiableExpression(CSTNode node)
A synonym for isAModifiableExpression( node, false ).


isPotentialCastOperator

public static boolean isPotentialCastOperator(CSTNode node)
Returns true if the node is potentially a cast operator.


isAPotentialTypeName

public static boolean isAPotentialTypeName(CSTNode node,
                                           boolean allowVoid)
Returns true if the node is potentially a type name.



Copyright © 2003-2005 The Codehaus. All Rights Reserved.