org.eclipse.internal.xtend.expression.parser
Class ExpressionFactory

java.lang.Object
  extended by org.eclipse.internal.xtend.expression.parser.ExpressionFactory
Direct Known Subclasses:
ExtensionFactory, XpandFactory

public class ExpressionFactory
extends java.lang.Object

Author:
Sven Efftinge (http://www.efftinge.de), Arno Haase

Constructor Summary
ExpressionFactory()
           
ExpressionFactory(java.lang.String string)
           
 
Method Summary
 Expression createBinaryOperation(Identifier name, Expression left, Expression right)
           
 BooleanLiteral createBooleanLiteral(Identifier t)
           
 BooleanOperation createBooleanOperation(Identifier name, Expression e, Expression r)
           
 Case createCase(Expression cond, Expression then)
           
 Expression createCast(Identifier t, Expression e)
           
 ChainExpression createChainExpression(Expression head, Expression next)
           
 CollectionExpression createCollectionExpression(Identifier opName, Identifier elementName, Expression closure)
           
 Expression createConstructorCall(Identifier type)
           
 DeclaredParameter createDeclaredParameter(Identifier type, Identifier name)
           
 FeatureCall createFeatureCall(Identifier name, Expression target)
           
 GlobalVarExpression createGlobalVarExpression(Identifier name)
           
 Identifier createIdentifier(java.lang.String text)
           
 IfExpression createIf(Expression cond, Expression then, Expression elseExpr)
           
 IntegerLiteral createIntegerLiteral(Identifier t)
           
 LetExpression createLetExpression(Identifier v, Expression varExpr, Expression target)
           
 ListLiteral createListLiteral(java.util.List<Expression> paramExpr)
           
 NullLiteral createNullLiteral(Identifier t)
           
 OperationCall createOperationCall(Identifier name, Expression singleParam)
           
 OperationCall createOperationCall(Identifier name, java.util.List<Expression> paramExpr)
           
 Expression createParanthesizedExpression(Expression x)
           
 RealLiteral createRealLiteral(Identifier lit)
           
 StringLiteral createStringLiteral(Identifier t)
           
 SwitchExpression createSwitchExpression(Expression switchExpr, java.util.List<Case> cases, Expression defaultExpr)
           
 FeatureCall createTypeSelectExpression(Identifier id, Identifier ident)
           
protected  SyntaxElement handle(ExtensionFile expr)
           
protected
<T extends SyntaxElement>
T
handle(T expr)
           
protected
<T> java.util.List<T>
nonNull(java.util.List<T> l)
           
protected
<T> T[]
toArray(java.util.List<?> list, T[] empty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionFactory

public ExpressionFactory(java.lang.String string)

ExpressionFactory

public ExpressionFactory()
Method Detail

createIdentifier

public Identifier createIdentifier(java.lang.String text)

createStringLiteral

public StringLiteral createStringLiteral(Identifier t)

createIntegerLiteral

public IntegerLiteral createIntegerLiteral(Identifier t)

createBooleanLiteral

public BooleanLiteral createBooleanLiteral(Identifier t)

createNullLiteral

public NullLiteral createNullLiteral(Identifier t)

createListLiteral

public ListLiteral createListLiteral(java.util.List<Expression> paramExpr)

createFeatureCall

public FeatureCall createFeatureCall(Identifier name,
                                     Expression target)

createOperationCall

public OperationCall createOperationCall(Identifier name,
                                         Expression singleParam)

createOperationCall

public OperationCall createOperationCall(Identifier name,
                                         java.util.List<Expression> paramExpr)

createBinaryOperation

public Expression createBinaryOperation(Identifier name,
                                        Expression left,
                                        Expression right)

createIf

public IfExpression createIf(Expression cond,
                             Expression then,
                             Expression elseExpr)

createCollectionExpression

public CollectionExpression createCollectionExpression(Identifier opName,
                                                       Identifier elementName,
                                                       Expression closure)

createDeclaredParameter

public DeclaredParameter createDeclaredParameter(Identifier type,
                                                 Identifier name)

createCast

public Expression createCast(Identifier t,
                             Expression e)

handle

protected <T extends SyntaxElement> T handle(T expr)

handle

protected SyntaxElement handle(ExtensionFile expr)

createCase

public Case createCase(Expression cond,
                       Expression then)

createSwitchExpression

public SwitchExpression createSwitchExpression(Expression switchExpr,
                                               java.util.List<Case> cases,
                                               Expression defaultExpr)

createChainExpression

public ChainExpression createChainExpression(Expression head,
                                             Expression next)

createRealLiteral

public RealLiteral createRealLiteral(Identifier lit)

createTypeSelectExpression

public FeatureCall createTypeSelectExpression(Identifier id,
                                              Identifier ident)

createBooleanOperation

public BooleanOperation createBooleanOperation(Identifier name,
                                               Expression e,
                                               Expression r)

createLetExpression

public LetExpression createLetExpression(Identifier v,
                                         Expression varExpr,
                                         Expression target)

createConstructorCall

public Expression createConstructorCall(Identifier type)

createGlobalVarExpression

public GlobalVarExpression createGlobalVarExpression(Identifier name)

createParanthesizedExpression

public Expression createParanthesizedExpression(Expression x)

nonNull

protected <T> java.util.List<T> nonNull(java.util.List<T> l)

toArray

protected <T> T[] toArray(java.util.List<?> list,
                          T[] empty)