Search in sources :

Example 6 with Attribute

use of org.applause.lang.applauseDsl.Attribute in project applause by applause.

the class EntityHeaderFileCompiler method compileHeader.

public CharSequence compileHeader(final Entity it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("#import <Foundation/Foundation.h>");
    _builder.newLine();
    CharSequence _superTypeForwardDeclaration = this.superTypeForwardDeclaration(it);
    _builder.append(_superTypeForwardDeclaration, "");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("@interface ");
    String _name = it.getName();
    _builder.append(_name, "");
    _builder.append(" : ");
    Entity _superType = it.getSuperType();
    String _typeName = this._typeExtensions.typeName(_superType);
    _builder.append(_typeName, "");
    _builder.newLineIfNotEmpty();
    {
        EList<Attribute> _attributes = it.getAttributes();
        for (final Attribute attribute : _attributes) {
            CharSequence _compile = this.compile(attribute);
            _builder.append(_compile, "");
            _builder.newLineIfNotEmpty();
        }
    }
    _builder.append("@end");
    _builder.newLine();
    return _builder;
}
Also used : Entity(org.applause.lang.applauseDsl.Entity) EList(org.eclipse.emf.common.util.EList) Attribute(org.applause.lang.applauseDsl.Attribute) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation)

Example 7 with Attribute

use of org.applause.lang.applauseDsl.Attribute in project applause by applause.

the class EntityCompiler method compile.

public CharSequence compile(final Entity it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("public class ");
    String _name = it.getName();
    _builder.append(_name, "");
    _builder.append(" {");
    _builder.newLineIfNotEmpty();
    {
        EList<Attribute> _attributes = it.getAttributes();
        for (final Attribute attribute : _attributes) {
            _builder.append("\t");
            CharSequence _compile = this.compile(attribute);
            _builder.append(_compile, "	");
            _builder.newLineIfNotEmpty();
        }
    }
    _builder.append("}");
    _builder.newLine();
    return _builder;
}
Also used : EList(org.eclipse.emf.common.util.EList) Attribute(org.applause.lang.applauseDsl.Attribute) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation)

Example 8 with Attribute

use of org.applause.lang.applauseDsl.Attribute in project applause by applause.

the class ExpressionExtensions method _evaluateExpression.

protected String _evaluateExpression(final EntityMemberCall it) {
    Attribute _head = it.getHead();
    String _evaluateExpression = this.evaluateExpression(_head);
    String _xifexpression = null;
    EntityMemberCallTail _tail = it.getTail();
    boolean _notEquals = (!Objects.equal(_tail, null));
    if (_notEquals) {
        EntityMemberCallTail _tail_1 = it.getTail();
        String _evaluateExpression_1 = this.evaluateExpression(_tail_1);
        String _plus = ("memberCall.tail:" + _evaluateExpression_1);
        _xifexpression = _plus;
    } else {
        _xifexpression = "";
    }
    String _plus_1 = (_evaluateExpression + _xifexpression);
    return _plus_1;
}
Also used : Attribute(org.applause.lang.applauseDsl.Attribute) EntityMemberCallTail(org.applause.lang.applauseDsl.EntityMemberCallTail)

Example 9 with Attribute

use of org.applause.lang.applauseDsl.Attribute in project applause by applause.

the class AttributeReferenceImpl method setValue.

/**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
public void setValue(Attribute newValue) {
    Attribute oldValue = value;
    value = newValue;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.ATTRIBUTE_REFERENCE__VALUE, oldValue, value));
}
Also used : Attribute(org.applause.lang.applauseDsl.Attribute) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 10 with Attribute

use of org.applause.lang.applauseDsl.Attribute in project applause by applause.

the class EntityMemberCallImpl method setHead.

/**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
public void setHead(Attribute newHead) {
    Attribute oldHead = head;
    head = newHead;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.ENTITY_MEMBER_CALL__HEAD, oldHead, head));
}
Also used : Attribute(org.applause.lang.applauseDsl.Attribute) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

Attribute (org.applause.lang.applauseDsl.Attribute)11 Entity (org.applause.lang.applauseDsl.Entity)3 EList (org.eclipse.emf.common.util.EList)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)3 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)3 EntityMemberCallTail (org.applause.lang.applauseDsl.EntityMemberCallTail)2 Model (org.applause.lang.applauseDsl.Model)2 NamedElement (org.applause.lang.applauseDsl.NamedElement)2 Type (org.applause.lang.applauseDsl.Type)1 IScope (org.eclipse.xtext.scoping.IScope)1 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)1