Examples of ISourceLocation


Examples of org.eclipse.imp.pdb.facts.ISourceLocation

    return false;
  }
 
  private void addTypeDependency(ISourceLocation dependency) {
    if (!scopeManager.isEmpty()) {
      ISourceLocation parent = getParent();
      if (!parent.isEqual(dependency)) {
        insert(typeDependency, parent, dependency);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

  public boolean visit(AnonymousClassDeclaration node) {
    insert(containment, getParent(), ownValue);
    // enum constant declaration and classinstancecreation gives types for anonymousclasses
    ASTNode parent = node.getParent();
    if (parent instanceof ClassInstanceCreation) {
      ISourceLocation superclass = resolveBinding(((ClassInstanceCreation) parent).getType());
      insert(typeDependency, ownValue, superclass);
      IConstructor type = bindingsResolver.resolveType(((ClassInstanceCreation) parent).getType().resolveBinding(), false);
        insert(types, ownValue, type);
       
        if (!superclass.getScheme().contains("+interface")) {
          insert(extendsRelations, ownValue, superclass);
        }
        else {
          insert(implementsRelations, ownValue, superclass);
        }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

   
 
    @Override
    public Result<IValue> interpret(IEvaluator<Result<IValue>> eval) {
      // Compute the URI location, which contains the scheme (and other info we need later)
      ISourceLocation sl = (ISourceLocation)getAt().interpret(eval).getValue();
     
      // If we have a resource scheme, given as resource scheme + standard scheme, we
      // extract that out, e.g., jdbctable+mysql would give a resource scheme of
      // jdbctable and a standard URI scheme of mysql. If we do not have a separate
      // resource scheme, we just use the specified scheme, e.g., sdf would give
      // a resource scheme of sdf and a URI scheme of sdf.
      URI uri = sl.getURI();
      String resourceScheme = uri.getScheme();
     
      if (resourceScheme.contains("+")) {
        String uriScheme = resourceScheme.substring(resourceScheme.indexOf("+")+1);
        resourceScheme = resourceScheme.substring(0,resourceScheme.indexOf("+"));
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

          Map<String, String> files) {
        IConstructor methodVal = makeMethod(method);
        IMap headersVal = makeMap(headers);
        IMap paramsVal= makeMap(parms);
        IMap filesVal= makeMap(files);
        ISourceLocation loc = vf.sourceLocation(URIUtil.assumeCorrect("request", "", uri));
        try {
          synchronized (callee.getEval()) {
            callee.getEval().__setInterrupt(false);
            Result<IValue> response = callee.call(argTypes, new IValue[] { loc, methodVal, headersVal, paramsVal, filesVal }, null);
            return translateResponse(method, response.getValue())
          }
        }
        catch (Throw rascalException) {
          ctx.getStdErr().println(rascalException.getMessage());
          return new Response(Status.INTERNAL_ERROR, "text/plain", rascalException.getMessage());
        }
        catch (Throwable unexpected) {
          ctx.getStdErr().println(unexpected.getMessage());
          unexpected.printStackTrace(ctx.getStdErr());
          return new Response(Status.INTERNAL_ERROR, "text/plain", unexpected.getMessage());
        }
      }

      private Response translateResponse(Method method, IValue value) {
        IConstructor cons = (IConstructor) value;
        initMethodAndStatusValues(ctx);
       
        if (cons.getName().equals("fileResponse")) {
          return translateFileResponse(method, cons);
        }
        else {
          return translateTextResponse(method, cons);
        }
      }
     
      private Response translateFileResponse(Method method, IConstructor cons) {
        ISourceLocation l = (ISourceLocation) cons.get("file");
        IString mimeType = (IString) cons.get("mimeType");
        IMap header = (IMap) cons.get("header");
        URI uri = l.getURI();
       
        Response response;
        try {
          response = new Response(Status.OK, mimeType.getValue(), ctx.getResolverRegistry().getInputStream(uri));
          addHeaders(response, header);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

        String nested = "";
        URI uri = URIUtil.assumeCorrect("tmp:///");
       
        if (stRandom.nextDouble() > 0.5) {
          RandomValueTypeVisitor visitor = descend();
          ISourceLocation loc = (ISourceLocation) visitor.generate(type);
          uri = loc.getURI();
          nested = uri.getPath();
        }
       
        path = path.startsWith("/") ? path : "/" + path;
        uri = URIUtil.changePath(uri, nested.length() > 0 && !nested.equals("/") ? nested + path : path);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

  public void set(ISourceLocation loc) {
    this.loc = loc;
  }
 
  protected ISourceLocation resolveBinding(String packageComponent) {
    ISourceLocation packageBinding = new BindingsResolver(typeStore, this.collectBindings) {
      public ISourceLocation resolveBinding(String packageC) {
        try {
          if (collectBindings) {
            if (EclipseJavaCompiler.cache.containsKey(packageC)) {
              return EclipseJavaCompiler.cache.get(packageC);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

    EclipseJavaCompiler.cache.put(packageComponent, packageBinding);
    return packageBinding;
  }
 
  protected ISourceLocation resolveBinding(CompilationUnit node) {
    ISourceLocation compilationUnit = new BindingsResolver(typeStore, true) {
      public ISourceLocation resolveBinding(CompilationUnit node) {
        return makeBinding("java+compilationUnit", null, loc.getPath());
      }
    }.resolveBinding(node);
   
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

   
    return compilationUnit;
  }
 
  protected ISourceLocation resolveBinding(IBinding binding) {
    ISourceLocation resolvedBinding = bindingsResolver.resolveBinding(binding);
    if (binding != null)
      EclipseJavaCompiler.cache.put(binding.getKey(), resolvedBinding);
    return resolvedBinding;
  }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

      EclipseJavaCompiler.cache.put(binding.getKey(), resolvedBinding);
    return resolvedBinding;
  }
 
  protected ISourceLocation resolveDeclaringClass(IBinding binding) {
    ISourceLocation resolvedBinding;
    if (binding instanceof ITypeBinding) {
      resolvedBinding = bindingsResolver.resolveBinding(((ITypeBinding) binding).getDeclaringClass());
    } else if (binding instanceof IMethodBinding) {
      resolvedBinding = bindingsResolver.resolveBinding(((IMethodBinding) binding).getDeclaringClass());
    } else if (binding instanceof IVariableBinding) {
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISourceLocation

      IProblem[] problems = compilUnit.getProblems();
      for (i = 0; i < problems.length; i++) {
        int offset = problems[i].getSourceStart();
        int length = problems[i].getSourceEnd() - offset + 1;
        int sl = problems[i].getSourceLineNumber();
        ISourceLocation pos = values.sourceLocation(loc, offset, length, sl, sl, 0, 0);
        org.eclipse.imp.pdb.facts.type.Type constr;
        if (problems[i].isError()) {
          constr = typeStore.lookupConstructor(this.typeStore.lookupAbstractDataType("Message"), "error", args);
        } else {
          constr = typeStore.lookupConstructor(this.typeStore.lookupAbstractDataType("Message"), "warning", args);
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.