org.eclipse.xtext.xbase.compiler
Class AbstractXbaseCompiler

java.lang.Object
  extended by org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler
Direct Known Subclasses:
TypeConvertingCompiler

public abstract class AbstractXbaseCompiler
extends java.lang.Object

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
AbstractXbaseCompiler()
           
 
Method Summary
 void _toJavaExpression(java.lang.Void func, IAppendable b)
           
 void _toJavaExpression(XExpression func, IAppendable b)
           
 void _toJavaStatement(java.lang.Void func, IAppendable b, boolean isReferenced)
           
 void _toJavaStatement(XExpression func, IAppendable b, boolean isReferenced)
           
 IAppendable compile(XExpression obj, IAppendable appendable, JvmTypeReference expectedReturnType)
           
protected  void declareLocalVariable(XExpression expr, IAppendable b)
           
protected  void declareLocalVariable(XExpression expr, IAppendable b, Later expression)
           
protected  void declareLocalVariable(XExpression expr, IAppendable b, java.lang.String expression)
           
protected  java.lang.String declareNameInVariableScope(org.eclipse.emf.ecore.EObject declaration, IAppendable appendable)
           
protected  java.lang.String getDefaultValueLiteral(XExpression expr)
           
protected  java.lang.String getFavoriteVariableName(org.eclipse.emf.ecore.EObject ex)
           
protected  IdentifiableSimpleNameProvider getNameProvider()
           
protected  Primitives getPrimitives()
           
protected  TypeConformanceComputer getTypeConformanceComputer()
           
protected  ITypeProvider getTypeProvider()
           
protected  TypeReferences getTypeReferences()
           
protected  java.lang.String getVarName(java.lang.Object ex, IAppendable appendable)
           
protected  void internalToJavaExpression(XExpression obj, IAppendable appendable)
           
protected  void internalToJavaStatement(XExpression obj, IAppendable builder, boolean isReferenced)
           
protected  boolean isLocalTypeParameter(org.eclipse.emf.ecore.EObject context, JvmTypeParameter parameter)
           
protected  boolean isPrimitiveVoid(XExpression xExpression)
           
protected  boolean isVariableDeclarationRequired(XExpression expr, IAppendable b)
          whether an expression needs to be declared in a statement If an expression has side effects this method must return true for it.
protected  java.lang.String makeJavaIdentifier(java.lang.String name)
           
protected  JvmTypeReference resolveMultiType(JvmTypeReference reference)
           
protected  void serialize(JvmTypeReference type, org.eclipse.emf.ecore.EObject context, IAppendable appendable)
           
protected  void serialize(JvmTypeReference type, org.eclipse.emf.ecore.EObject context, IAppendable appendable, boolean withoutConstraints, boolean paramsToWildcard)
           
protected  void serialize(JvmTypeReference type, org.eclipse.emf.ecore.EObject context, IAppendable appendable, boolean withoutConstraints, boolean paramsToWildcard, boolean paramsToObject, boolean allowPrimitives)
           
 void setNameProvider(IdentifiableSimpleNameProvider nameProvider)
           
 void setTypeReferences(TypeReferences typeReferences)
          Public for testing purpose.
 void toJavaExpression(XExpression obj, IAppendable appendable)
           
 void toJavaStatement(XExpression obj, IAppendable appendable, boolean isReferenced)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXbaseCompiler

public AbstractXbaseCompiler()
Method Detail

getTypeReferences

protected TypeReferences getTypeReferences()

setTypeReferences

public void setTypeReferences(TypeReferences typeReferences)
Public for testing purpose.

This method is not intended to be referenced by clients.
This method is not intended to be referenced by clients.

getTypeProvider

protected ITypeProvider getTypeProvider()

getPrimitives

protected Primitives getPrimitives()

compile

public IAppendable compile(XExpression obj,
                           IAppendable appendable,
                           JvmTypeReference expectedReturnType)

isPrimitiveVoid

protected boolean isPrimitiveVoid(XExpression xExpression)

internalToJavaStatement

protected void internalToJavaStatement(XExpression obj,
                                       IAppendable builder,
                                       boolean isReferenced)

toJavaExpression

public void toJavaExpression(XExpression obj,
                             IAppendable appendable)

toJavaStatement

public void toJavaStatement(XExpression obj,
                            IAppendable appendable,
                            boolean isReferenced)

internalToJavaExpression

protected void internalToJavaExpression(XExpression obj,
                                        IAppendable appendable)

_toJavaStatement

public void _toJavaStatement(XExpression func,
                             IAppendable b,
                             boolean isReferenced)

_toJavaExpression

public void _toJavaExpression(XExpression func,
                              IAppendable b)

_toJavaStatement

public void _toJavaStatement(java.lang.Void func,
                             IAppendable b,
                             boolean isReferenced)

_toJavaExpression

public void _toJavaExpression(java.lang.Void func,
                              IAppendable b)

serialize

protected void serialize(JvmTypeReference type,
                         org.eclipse.emf.ecore.EObject context,
                         IAppendable appendable)

serialize

protected void serialize(JvmTypeReference type,
                         org.eclipse.emf.ecore.EObject context,
                         IAppendable appendable,
                         boolean withoutConstraints,
                         boolean paramsToWildcard)

serialize

protected void serialize(JvmTypeReference type,
                         org.eclipse.emf.ecore.EObject context,
                         IAppendable appendable,
                         boolean withoutConstraints,
                         boolean paramsToWildcard,
                         boolean paramsToObject,
                         boolean allowPrimitives)

isLocalTypeParameter

protected boolean isLocalTypeParameter(org.eclipse.emf.ecore.EObject context,
                                       JvmTypeParameter parameter)

resolveMultiType

protected JvmTypeReference resolveMultiType(JvmTypeReference reference)

getVarName

protected java.lang.String getVarName(java.lang.Object ex,
                                      IAppendable appendable)

declareNameInVariableScope

protected java.lang.String declareNameInVariableScope(org.eclipse.emf.ecore.EObject declaration,
                                                      IAppendable appendable)

setNameProvider

public void setNameProvider(IdentifiableSimpleNameProvider nameProvider)

getNameProvider

protected IdentifiableSimpleNameProvider getNameProvider()

getFavoriteVariableName

protected java.lang.String getFavoriteVariableName(org.eclipse.emf.ecore.EObject ex)

makeJavaIdentifier

protected java.lang.String makeJavaIdentifier(java.lang.String name)

declareLocalVariable

protected void declareLocalVariable(XExpression expr,
                                    IAppendable b)

getDefaultValueLiteral

protected java.lang.String getDefaultValueLiteral(XExpression expr)

declareLocalVariable

protected void declareLocalVariable(XExpression expr,
                                    IAppendable b,
                                    java.lang.String expression)

declareLocalVariable

protected void declareLocalVariable(XExpression expr,
                                    IAppendable b,
                                    Later expression)

isVariableDeclarationRequired

protected boolean isVariableDeclarationRequired(XExpression expr,
                                                IAppendable b)
whether an expression needs to be declared in a statement If an expression has side effects this method must return true for it.


getTypeConformanceComputer

protected TypeConformanceComputer getTypeConformanceComputer()