Examples of VariableDeclaration


Examples of lombok.ast.VariableDeclaration

                return nativeNode;
            }
        }

        if (node instanceof VariableDeclaration) {
            VariableDeclaration declaration = (VariableDeclaration) node;
            VariableDefinition definition = declaration.astDefinition();
            if (definition != null) {
                lombok.ast.TypeReference typeReference = definition.astTypeReference();
                if (typeReference != null) {
                    return typeReference.getNativeNode();
                }
View Full Code Here

Examples of net.jangaroo.jooc.ast.VariableDeclaration

    }
    if (AUX_VAR_NAME_PATTERN.matcher(name).matches()) {
      DeclarationScope packageDeclarationScope = getPackageDeclarationScope();
      if (packageDeclarationScope != null && packageDeclarationScope != this) {
        // also declare local auxiliary vars in package scope to reserve them so they are not used for package names:
        new VariableDeclaration(null, new Ide(name), null).scope(packageDeclarationScope);
      }
    }
    return ides.put(name, decl);
  }
View Full Code Here

Examples of net.jangaroo.jooc.ast.VariableDeclaration

  }

  @Override
  public Ide createAuxVar(Scope lookupScope) {
    Ide auxVar = findFreeAuxVar();
    new VariableDeclaration(null, auxVar, null).scope(this);
    return auxVar;
  }
View Full Code Here

Examples of net.jangaroo.jooc.ast.VariableDeclaration

    final Ide exprAuxIde = forInStatement.getExprAuxIde();
    IdeDeclaration exprType = forInStatement.getExpr().getType();
    String exprTypeName = exprType != null  ? exprType.getQualifiedNameStr() : "";
    boolean iterateArrayMode = "Array".equals(exprTypeName) || "Vector$object".equals(exprTypeName);
    if (exprAuxIde != null && !iterateArrayMode) {
      new SemicolonTerminatedStatement(new VariableDeclaration(SYM_VAR, exprAuxIde, null, null), SYM_SEMICOLON).visit(this);
    }
    out.writeSymbol(forInStatement.getSymKeyword());
    final boolean isForEach = forInStatement.getSymEach() != null;
    if (isForEach) {
      out.beginComment();
      out.writeSymbol(forInStatement.getSymEach());
      out.endComment();
    }
    out.writeSymbol(forInStatement.getLParen());
    if (isForEach || iterateArrayMode) {
      new VariableDeclaration(SYM_VAR, forInStatement.getAuxIde(), null, null).visit(this);
    } else {
      if (forInStatement.getDecl() != null) {
        forInStatement.getDecl().visit(this);
      } else {
        forInStatement.getLValue().visit(this);
View Full Code Here

Examples of net.jangaroo.jooc.ast.VariableDeclaration

  }

  protected static void declareValues(Scope scope, String[] identifiers) {
    for (String identifier : identifiers) {
      Ide ide = new Ide(new JooSymbol(identifier));
      IdeDeclaration decl = new VariableDeclaration(new JooSymbol("var"), ide, null, null);
      decl.scope(scope);
    }
  }
View Full Code Here

Examples of net.sf.saxon.expr.VariableDeclaration

    * declareVariable method of this class.
    */

    public VariableDeclaration bindVariable(int fingerprint) throws StaticError {

        VariableDeclaration var = (VariableDeclaration)variables.get(new Integer(fingerprint));
        if (var==null) {
            throw new StaticError("Undeclared variable in query");
        } else {
            return var;
        }
View Full Code Here

Examples of org.activiti.engine.impl.variable.VariableDeclaration

    if (propertyType == null) {
      String type = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "type");
      propertyType = type != null ? type : "string"; // default is string
    }

    VariableDeclaration variableDeclaration = new VariableDeclaration(propertyName, propertyType);
    addVariableDeclaration(activity, variableDeclaration);
    activity.setScope(true);

    String src = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "src");
    if (src != null) {
      variableDeclaration.setSourceVariableName(src);
    }

    String srcExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "srcExpr");
    if (srcExpr != null) {
      Expression sourceExpression = expressionManager.createExpression(srcExpr);
      variableDeclaration.setSourceExpression(sourceExpression);
    }

    String dst = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "dst");
    if (dst != null) {
      variableDeclaration.setDestinationVariableName(dst);
    }

    String destExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "dstExpr");
    if (destExpr != null) {
      Expression destinationExpression = expressionManager.createExpression(destExpr);
      variableDeclaration.setDestinationExpression(destinationExpression);
    }

    String link = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "link");
    if (link != null) {
      variableDeclaration.setLink(link);
    }

    String linkExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "linkExpr");
    if (linkExpr != null) {
      Expression linkExpression = expressionManager.createExpression(linkExpr);
      variableDeclaration.setLinkExpression(linkExpression);
    }

    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseProperty(propertyElement, variableDeclaration, activity);
    }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.variable.VariableDeclaration

    if (propertyType == null) {
      String type = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "type");
      propertyType = type != null ? type : "string"; // default is string
    }

    VariableDeclaration variableDeclaration = new VariableDeclaration(propertyName, propertyType);
    addVariableDeclaration(activity, variableDeclaration);
    activity.setScope(true);

    String src = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "src");
    if (src != null) {
      variableDeclaration.setSourceVariableName(src);
    }

    String srcExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "srcExpr");
    if (srcExpr != null) {
      Expression sourceExpression = expressionManager.createExpression(srcExpr);
      variableDeclaration.setSourceExpression(sourceExpression);
    }

    String dst = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "dst");
    if (dst != null) {
      variableDeclaration.setDestinationVariableName(dst);
    }

    String destExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "dstExpr");
    if (destExpr != null) {
      Expression destinationExpression = expressionManager.createExpression(destExpr);
      variableDeclaration.setDestinationExpression(destinationExpression);
    }

    String link = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "link");
    if (link != null) {
      variableDeclaration.setLink(link);
    }

    String linkExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "linkExpr");
    if (linkExpr != null) {
      Expression linkExpression = expressionManager.createExpression(linkExpr);
      variableDeclaration.setLinkExpression(linkExpression);
    }

    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseProperty(propertyElement, variableDeclaration, activity);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.VariableDeclaration

      } else if (node instanceof Type) {
        return resolveBinding(((Type) node).resolveBinding());
      } else if (node instanceof TypeParameter) {
        return resolveBinding(((TypeParameter) node).resolveBinding());
      } else if (node instanceof VariableDeclaration) {
      VariableDeclaration n = (VariableDeclaration) node;
        ISourceLocation result = resolveBinding(n.resolveBinding());
        // Have to move towards parent to make the binding unique
        if (result.getScheme() == "unresolved") {
          result = resolveBinding(n.getParent(), n);
        }
        return result;
      } else if (node instanceof ConstructorInvocation) {
        return resolveBinding(((ConstructorInvocation) node).resolveConstructorBinding());
      } else if (node instanceof SuperConstructorInvocation) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.VariableDeclaration

   
    TACInstruction decl, init;
    for(int i = 0; i < 4; i++) {
      VariableDeclarationStatement s = (VariableDeclarationStatement) stmts.get(i);
      Assert.assertTrue("Statement: " + s, s.fragments().size() == 1);
      VariableDeclaration d = (VariableDeclaration) s.fragments().get(0);
      decl = tac.instruction(d);
      Assert.assertNotNull("Statement: " + s, decl);
      Assert.assertNotNull("Statement: " + s, d.getInitializer());
      if(d.getInitializer() instanceof ParenthesizedExpression)
        init = tac.instruction(((ParenthesizedExpression) d.getInitializer()).getExpression());
      else
        init = tac.instruction(d.getInitializer());
      Assert.assertNotNull("Statement: " + s, init);
     
      Assert.assertTrue("Statement: " + s, init instanceof AssignmentInstruction);
      Variable t = ((AssignmentInstruction) init).getTarget();
     
      Variable declared = null;
//      if(decl instanceof SourceVariableDeclaration) {
//        declared = ((SourceVariableDeclaration) decl).getDeclaredVariable();
//        Assert.assertEquals("Statement: " + s, declared, t);
//      }
//      else
      if(decl instanceof EclipseInstructionSequence) {
        TACInstruction[] seq = ((EclipseInstructionSequence) decl).getInstructions();
        Assert.assertTrue("Statement: " + s, seq.length == 2);
        Assert.assertTrue("Statement: " + s, seq[0] instanceof SourceVariableDeclaration);
        declared = ((SourceVariableDeclaration) seq[0]).getDeclaredVariable();
        Assert.assertTrue("Statement: " + s, seq[1] instanceof CopyInstruction);
        Assert.assertEquals("Statement: " + s, declared, ((CopyInstruction) seq[1]).getTarget());
        Assert.assertEquals("Statement: " + s, t, ((CopyInstruction) seq[1]).getOperand());
      }
      else
        Assert.fail("Statement has unexpected translation: " + s);
     
      Assert.assertEquals("Statement: " + s, tac.sourceVariable(d.resolveBinding()), declared);
    }
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.