Examples of VariableReference


Examples of lombok.ast.VariableReference

        String methodName = node.astName().astValue();
        if (methodName.equals(FORMAT_METHOD)) {
            // String.format(getResources().getString(R.string.foo), arg1, arg2, ...)
            // Check that the arguments in R.string.foo match arg1, arg2, ...
            if (node.astOperand() instanceof VariableReference) {
                VariableReference ref = (VariableReference) node.astOperand();
                if ("String".equals(ref.astIdentifier().astValue())) { //$NON-NLS-1$
                    // Found a String.format call
                    // Look inside to see if we can find an R string
                    // Find surrounding method
                    checkFormatCall(context, node);
                }
View Full Code Here

Examples of net.sf.saxon.expr.VariableReference

    public Expression bindVariable(StructuredQName qName) throws XPathException {
        XPathVariable var = variables.get(qName);
        if (var==null) {
            if (autoDeclare) {
                return new VariableReference(declareVariable(qName));
            } else {
                throw new XPathException("Undeclared variable in XPath expression: $" + qName.getClarkName());
            }
        } else {
            return new VariableReference(var);
        }
    }
View Full Code Here

Examples of net.sf.saxon.expr.VariableReference

    public final Expression bindVariable(StructuredQName qName) throws XPathException {
        // bindVariable is called at compile time, but the JAXP variable resolver
        // is designed to be called at run time. So we need to create a variable now,
        // which will call the variableResolver when called upon to return the run-time value
        if (variableResolver != null) {
            return new VariableReference(new JAXPVariable(qName, variableResolver));
        } else {
            throw new XPathException(
                    "Variable is used in XPath expression, but no JAXP VariableResolver is available");
        }
    }
View Full Code Here

Examples of net.sf.saxon.expr.VariableReference

    public VariableReference bindVariable(StructuredQName qName) throws XPathException {
        XPathVariable var = (XPathVariable)variables.get(qName);
        if (var==null) {
            throw new XPathException("Undeclared variable in a standalone expression");
        } else {
            return new VariableReference(var);
        }
    }
View Full Code Here

Examples of net.sf.saxon.expr.VariableReference

     * @throws XPathException if the variable has not been declared
    */

    public VariableReference bindVariable(StructuredQName qName) throws XPathException {
        XSLVariableDeclaration xslVariableDeclaration = element.bindVariable(qName);
        VariableReference var = new VariableReference();
        xslVariableDeclaration.registerReference(var);
        return var;
    }
View Full Code Here

Examples of net.sf.saxon.expr.VariableReference

    public final VariableReference bindVariable(StructuredQName qName) throws XPathException {
        // bindVariable is called at compile time, but the JAXP variable resolver
        // is designed to be called at run time. So we need to create a variable now,
        // which will call the variableResolver when called upon to return the run-time value
        if (variableResolver != null) {
            return new VariableReference(new JAXPVariable(qName, variableResolver));
        } else {
            throw new XPathException(
                    "Variable is used in XPath expression, but no JAXP VariableResolver is available");
        }
    }
View Full Code Here

Examples of org.eclipse.dltk.ast.references.VariableReference

      popScope();
      return false;
    }
    for (Object o : node.getArguments()) {
      if (o instanceof FormalParameter) {
        VariableReference parameterName = ((FormalParameter) o).getParameterName();
        Variable v = new ImportedVariable(parameterName);
        v.setInitialized(((FormalParameter) o).start());
        current.variables.put(parameterName.getName(), v);
      }
    }
    if (inClassDecl + 1 == depth && !node.isStatic()) {
      Variable v = new ImportedVariable(node);
      v.setInitialized(node.start());
View Full Code Here

Examples of org.eclipse.dltk.ast.references.VariableReference

  public boolean visit(LambdaFunctionDeclaration decl) throws Exception {
    Scope prev = current;
    pushScope();
    for (Object o : decl.getArguments()) {
      if (o instanceof FormalParameter) {
        VariableReference parameterName = ((FormalParameter) o).getParameterName();
        Variable v = new ImportedVariable(parameterName);
        v.setInitialized(((FormalParameter) o).start());
        current.variables.put(parameterName.getName(), v);
      }
    }
    if (decl.getLexicalVars() != null) {
      for (Expression var : decl.getLexicalVars()) {
        if (var instanceof ReferenceExpression) {
View Full Code Here

Examples of org.eclipse.dltk.ast.references.VariableReference

   * TODO Allow mark Variable as global
   */
  public boolean visit(GlobalStatement s) throws Exception {
    for (Expression el : s.getVariables()) {
      if (el instanceof VariableReference) {
        VariableReference ref = (VariableReference) el;
        if (scopes.size() > 1) {
          Scope parentScope = scopes.get(scopes.size() - 2);
          if (parentScope.variables.containsKey(ref.getName())) {
            current.variables.put(ref.getName(), new ImportedVariable(parentScope.variables.get(ref.getName())));
            continue;
          }
        }
        Variable var = current.variables.get(ref.getName());
        if (var == null) {
          var = new Variable(ref);
          current.variables.put(ref.getName(), var);
        }
        if (var.initialized < 0) {
          var.initialized = ref.start();
        }
      } else {
        operations.push(Operation.ASSIGN);
        el.traverse(this);
        operations.pop();
View Full Code Here

Examples of org.eclipse.dltk.ast.references.VariableReference

    @Override
    public boolean visit(Expression s) throws Exception {
      if (s.sourceStart() <= offset && offset <= s.sourceEnd()) {
        if (s instanceof VariableReference) {
          VariableReference ref = (VariableReference) s;
          // TODO refactor: extern declaration always checked, even if
          // local decl found
          String name = ((VariableReference) s).getName();
          findLocalDeclaration(name, results, IField.class);
          if (impFields.containsKey(name)) {
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.