Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.Expression


  protected Boolean _eq(ExpressionTE e1, ExpressionTE e2) {
    return isEquivalent(e1.getExpression(), e2.getExpression());
  }

  protected Boolean _eq(ExpressionTE e1, String e2) {
    Expression tmp = e1.getExpression();
    tmp = ((ParenthesisedExpression) tmp).getExpr();
    return isEquivalent(tmp, e2);
    // // The various expr that can represent a variable
    // if(tmp instanceof LiteralName)
    // return isEquivalent(tmp, e2);
View Full Code Here


    //
    // return Boolean.FALSE;
  }

  protected Boolean _eq(ExpressionTE e1, VariableExpression e2) {
    Expression tmp = e1.getExpression();
    tmp = ((ParenthesisedExpression) tmp).getExpr();
    // The various expr that can represent a variable
    if(tmp instanceof LiteralName)
      return isEquivalent(((LiteralName) tmp).getValue(), e2);
    if(tmp instanceof LiteralNameOrReference)
View Full Code Here

    return Boolean.FALSE;

  }

  protected Boolean _eq(ExpressionTE e1, VariableTE e2) {
    Expression tmp = e1.getExpression();
    tmp = ((ParenthesisedExpression) tmp).getExpr();
    // The various expr that can represent a variable
    if(tmp instanceof LiteralName)
      return isEquivalent(((LiteralName) tmp).getValue(), e2);
    if(tmp instanceof LiteralNameOrReference)
View Full Code Here

  protected Boolean _eq(SingleQuotedString e1, VerbatimTE e2) {
    return isEquivalent(e1.getText(), e2);
  }

  protected Boolean _eq(UnquotedString e1, Expression e2) {
    Expression tmp = e1.getExpression();
    boolean e2IsVar = e2 instanceof VariableExpression;
    if(tmp instanceof LiteralName) {
      if(e2IsVar)
        return isEquivalent(((LiteralName) tmp).getValue(), e2);
      return Boolean.FALSE;
View Full Code Here

  protected Boolean _eq(UnquotedString e1, UnquotedString e2) {
    return isEquivalent(e1.getExpression(), e2.getExpression());
  }

  protected Boolean _eq(UnquotedString e1, VariableExpression e2) {
    Expression tmp = e1.getExpression();
    if(tmp instanceof LiteralName)
      return isEquivalent(((LiteralName) tmp).getValue(), e2);
    if(tmp instanceof LiteralNameOrReference)
      return isEquivalent(((LiteralNameOrReference) tmp).getValue(), e2);
    if(tmp instanceof VariableExpression)
View Full Code Here

    LiteralListElements access = grammarAccess.getLiteralListAccess();

    Iterator<Expression> itor = semanticObject.getElements().iterator();
    int index = 0;
    while(itor.hasNext()) {
      Expression p = itor.next();
      if(index == 0)
        feeder.accept(access.getElementsAssignmentExpressionParserRuleCall_2_0_0(), p, index);
      else
        feeder.accept(access.getElementsAssignmentExpressionParserRuleCall_2_1_1_0(), p, index);
      index++;
View Full Code Here

    feeder.accept(access.getSelectorExpressionLeftExprAction_1_0(), semanticObject.getLeftExpr());
    Iterator<Expression> itor = semanticObject.getParameters().iterator();
    int index = 0;
    // always serialize with the non-shortened form left ? { a => b, ... }
    while(itor.hasNext()) {
      Expression p = itor.next();
      if(index == 0)
        feeder.accept(access.getParametersSelectorEntryParserRuleCall_1_2_0_1_0(), p, index);
      else
        feeder.accept(access.getParametersSelectorEntryParserRuleCall_1_2_0_2_0_1_0(), p, index);
      index++;
View Full Code Here

        appendStyled(result, nullSafeString(((VerbatimTE) te).getText()));
      else if(te instanceof VariableTE)
        appendStyled(result, nullSafeString(((VariableTE) te).getVarName()), EXPR_STYLER);
      else if(te instanceof ExpressionTE) {
        ExpressionTE exprTe = (ExpressionTE) te;
        Expression expr = exprTe.getExpression();
        if(expr instanceof ParenthesisedExpression)
          expr = ((ParenthesisedExpression) expr).getExpr();
        Object label = doGetText(expr);
        if(label == null)
          label = "<expr>";
View Full Code Here

    for(TextExpression te : dqString.getStringPart()) {
      if(te instanceof VariableTE) {
        result.add(((VariableTE) te).getVarName());
      }
      else if(te instanceof ExpressionTE) {
        Expression e = ((ExpressionTE) te).getExpression();
        if(e instanceof LiteralNameOrReference)
          result.add(((LiteralNameOrReference) e).getValue());
        else if(e instanceof LiteralName)
          result.add(((LiteralName) e).getValue());
        else if(e instanceof VariableExpression)
View Full Code Here

   * <!-- end-user-doc -->
   *
   * @generated
   */
  public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) {
    Expression oldExpression = expression;
    expression = newExpression;
    if(eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(
        this, Notification.SET, PPPackage.EXPRESSION_TE__EXPRESSION, oldExpression, newExpression);
      if(msgs == null)
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.pp.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.