org.ocltf.concretesyntax.impl
Class ConcreteSyntaxUtils

java.lang.Object
  extended byorg.ocltf.concretesyntax.impl.ConcreteSyntaxUtils

public class ConcreteSyntaxUtils
extends java.lang.Object

Contains some utilities for concrete syntax value retrieval.

Author:
Chad Brandon

Constructor Summary
ConcreteSyntaxUtils()
           
 
Method Summary
static java.lang.StringBuffer concatContents(java.util.List list)
          Iterates through the passed in list and concates all the values of objects toString value to a StringBuffer and returns the StringBuffer.
static java.util.List getArgumentNames(VariableDeclarationCS[] variableDeclarations)
          Loads a List of variable declaration names from the variableDeclarations
static java.util.List getFeatureCalls(org.ocltf.parser.node.APropertyCallExpression expression)
          Gets all feature calls from the passed in APropertyCallExpression instance.
static java.lang.String[] getLeftAndRightExpressions(org.ocltf.parser.node.PRelationalExpression relationalExpression)
          Gets the left and right expressions of a PRelationalExpression and puts then into a List.
static OperationCS getOperationDeclaration(org.ocltf.parser.node.POperation operation)
          Retrieves all the variable declarations for the passed in operation.
static java.util.List getParameters(org.ocltf.parser.node.AFeatureCall featureCall)
          Gets all the parameters from a AFeatureCall instance.
static java.lang.String getParametersAsString(org.ocltf.parser.node.AFeatureCall featureCall)
          Gets all the parameters from a AFeatureCall instance as a comma seperated String.
static java.lang.String getPrimaryExpression(org.ocltf.parser.node.APropertyCallExpression expression)
          Gets the "real" primary expression, as opposed to the primary expression retrieved from the parser syntax (since it leaves off any navigational relationships).
static java.lang.String getType(org.ocltf.parser.node.TName name, java.util.List pathNameTail)
          Concatinates the type from the passed in name and pathNameTail.
static VariableDeclarationCS[] getVariableDeclarations(org.ocltf.parser.node.AStandardDeclarator standardDeclarator)
          Retrieves all the variable declarations for the passed in standardDeclarator.
static VariableDeclarationCS[] getVariableDeclarations(org.ocltf.parser.node.POperation operation)
          Retrieves all the variable declarations for the passed in operation.
static VariableDeclarationCS[] getVariableDeclarations(org.ocltf.parser.node.PVariableDeclarationList variableDeclarationList)
          Creates an array of VariableDeclarationCS[] from the passed in PVariableDeclarationList.
protected static VariableDeclarationCS newVariableDeclaration(org.ocltf.parser.node.PVariableDeclaration variableDeclaration, org.ocltf.parser.node.PEqualExpression initialValue)
          Creates a new VariableDeclarationCS from the passed in PVariableDeclaration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcreteSyntaxUtils

public ConcreteSyntaxUtils()
Method Detail

concatContents

public static java.lang.StringBuffer concatContents(java.util.List list)
Iterates through the passed in list and concates all the values of objects toString value to a StringBuffer and returns the StringBuffer.

Parameters:
list - the List of objects to concatinate.
Returns:
StringBuffer the concatinated contents of the list.

getOperationDeclaration

public static OperationCS getOperationDeclaration(org.ocltf.parser.node.POperation operation)
Retrieves all the variable declarations for the passed in operation.

Parameters:
operation -
Returns:
VariableDeclarations

getVariableDeclarations

public static VariableDeclarationCS[] getVariableDeclarations(org.ocltf.parser.node.POperation operation)
Retrieves all the variable declarations for the passed in operation.

Parameters:
operation - the operation for which to retrieve the variable declarations.
Returns:
VariableDeclaration[]

getVariableDeclarations

public static VariableDeclarationCS[] getVariableDeclarations(org.ocltf.parser.node.AStandardDeclarator standardDeclarator)
Retrieves all the variable declarations for the passed in standardDeclarator.

Parameters:
standardDeclarator - the standard declartor for which to retrieve the VariableDeclarationCS instances.
Returns:
VariableDeclarationCS[]

newVariableDeclaration

protected static VariableDeclarationCS newVariableDeclaration(org.ocltf.parser.node.PVariableDeclaration variableDeclaration,
                                                              org.ocltf.parser.node.PEqualExpression initialValue)
Creates a new VariableDeclarationCS from the passed in PVariableDeclaration.

Parameters:
variableDeclaration - the PVariableDeclaration that the new VariableDeclarationCS will be created from.
initialValue - the initial value of the variable declaration.
Returns:
VariableDeclarationCS the new VariableDeclarationCS

getVariableDeclarations

public static VariableDeclarationCS[] getVariableDeclarations(org.ocltf.parser.node.PVariableDeclarationList variableDeclarationList)
Creates an array of VariableDeclarationCS[] from the passed in PVariableDeclarationList.

Parameters:
variableDeclarationList - the PVariableDeclarationList that the new VariableDeclarationCS will be created from.
Returns:
VariableDeclarationCS[] the new VariableDeclarationCS array

getParameters

public static java.util.List getParameters(org.ocltf.parser.node.AFeatureCall featureCall)
Gets all the parameters from a AFeatureCall instance.

Parameters:
featureCall - the featureCall for which to retrieve the parameters
Returns:
List the list containing any parameters retrieved, or an empty array if none could be retrieved

getParametersAsString

public static java.lang.String getParametersAsString(org.ocltf.parser.node.AFeatureCall featureCall)
Gets all the parameters from a AFeatureCall instance as a comma seperated String.

Parameters:
featureCall - the featureCall for which to retrieve the parameters
Returns:
String the comma seperated String

getLeftAndRightExpressions

public static java.lang.String[] getLeftAndRightExpressions(org.ocltf.parser.node.PRelationalExpression relationalExpression)
Gets the left and right expressions of a PRelationalExpression and puts then into a List. The left expression will be the first expression in the list.

Parameters:
relationalExpression -
Returns:
the left and right paranthesis in [0] and [1] of the String[]/

getType

public static java.lang.String getType(org.ocltf.parser.node.TName name,
                                       java.util.List pathNameTail)
Concatinates the type from the passed in name and pathNameTail.

Parameters:
name - the starting name of the type
pathNameTail - the tail pieces of the name
Returns:
String the concatinated name.

getPrimaryExpression

public static java.lang.String getPrimaryExpression(org.ocltf.parser.node.APropertyCallExpression expression)
Gets the "real" primary expression, as opposed to the primary expression retrieved from the parser syntax (since it leaves off any navigational relationships).

Parameters:
expression - the APosfixExpression instance for which to retrieve the primary expression
Returns:
String the "real" primary expression or the passed in expression.

getFeatureCalls

public static java.util.List getFeatureCalls(org.ocltf.parser.node.APropertyCallExpression expression)
Gets all feature calls from the passed in APropertyCallExpression instance.

Parameters:
expression - the APosfixExpression instance for which to retrieve the primary expression
Returns:
String the "real" primary expression or the passed in expression.

getArgumentNames

public static java.util.List getArgumentNames(VariableDeclarationCS[] variableDeclarations)
Loads a List of variable declaration names from the variableDeclarations

Parameters:
variableDeclarations - an array of VariableDeclarationCS objects
Returns:
List the list of argument names as Strings/


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.