Examples of SourcePosition


Examples of com.android.dx.rop.code.SourcePosition

            if (rop.getOpcode() == RegOps.MOVE_RESULT_PSEUDO) {
                // These get skipped
                return;
            }

            SourcePosition pos = insn.getPosition();
            Dop opcode = RopToDop.dopFor(insn);
            DalvInsn di;

            switch (rop.getBranchingness()) {
                case Rop.BRANCH_NONE:
View Full Code Here

Examples of com.dubture.doctrine.annotation.parser.antlr.SourcePosition

        @Override
        public boolean visit(Comment comment) {
            List<Annotation> annotations = AnnotationUtils.extractAnnotations(parser, comment, sourceModule);
            for (Annotation annotation : annotations) {
                SourcePosition sourcePosition = annotation.getSourcePosition();
                highlight(sourcePosition.startOffset, sourcePosition.length);
            }

            return true;
        }
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

                      Predicate<FileRef> allowedOutputPredicate) {
    Set<CompilationUnit> extractMessagesFrom = Sets.newHashSet();
    List<CompilationTask> sourceNotChanged = Lists.newArrayList();
    for (CompilationUnit cUnit : getCompilationUnits()) {
      FileRef sourceFileRef = cUnit.getSourceFileRef();
      SourcePosition sourcePosition = new SourcePosition(sourceFileRef);

      for (OutputLanguage language : outputLanguages) {
        String suffix = language.getSuffix(compilationVersion);
        FileRef outputFileRef = sourceFileRef.removeExtension().addSuffix(suffix);

        if (allowedOutputPredicate.apply(outputFileRef)) {
          extractMessagesFrom.add(cUnit);
          CompilationTask task =
              new CompilationTask(cUnit, codeGeneratorFactory, language,
                                  outputFileRef);
          // if the output file does not exist (last modified = 0) or if the source has been
          // modified since the last time that the output has been generated, or if the source has
          // changed, then we need to recompile the target
          if (outputFileRef.getLastModified() < sourceFileRef.getLastModified()
              || manager.sourceChanged(task)) {
            task.execute(alertSink, alertPolicy);
          } else {
            alertSink.add(new ProgressAlert(sourcePosition, "Skipped (source unchanged)"));
            sourceNotChanged.add(task);
          }
        } else {
          alertSink.add(new ProgressAlert(sourcePosition, "Skipped (output supressed)"));
        }
      }
    }

    // For each task we didn't execute, check to see if any of the interfaces
    // it depends on have changed (which could happen as a result of
    // recompiling one of the things it depends on).
    // TODO(laurence): see whether it's possible to combine these two loops by
    // having usedInterfacesChanged not change its value.
    for (CompilationTask task : sourceNotChanged) {
      if (manager.usedInterfacesChanged(task)) {
        FileRef sourceFileRef = task.getCompilationUnit().getSourceFileRef();
        SourcePosition sourcePosition = new SourcePosition(sourceFileRef);
        alertSink.add(new ProgressAlert(sourcePosition, "Reconsidered; callees have changed"));
        task.execute(alertSink, alertPolicy);
      }
    }

    // Optionally write out a java properties file that contains
    // strings extracted from <gxp:msg>s
    if (propertiesFile != null && !extractMessagesFrom.isEmpty()) {
      SourcePosition outputPosition = new SourcePosition(propertiesFile);
      alertSink.add(new ProgressAlert(outputPosition, "Generating"));

      List<ExtractedMessage> messages = Lists.newArrayList();
      for (CompilationUnit cUnit : extractMessagesFrom) {
        messages.addAll(cUnit.getMessageExtractedTree().getMessages());
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

    inputStream.close();
    return eventHandler.getSchema();
  }

  public static Schema getSchema(FileRef input, AlertSink alertSink) {
    SourcePosition pos = new SourcePosition(input);
    try {
      return Preconditions.checkNotNull(INSTANCE.parse(input));
    } catch (SAXException saxException) {
      alertSink.add(new SaxAlert(pos, Severity.ERROR, saxException));
      return null;
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

     */
    private SourcePosition getSourcePosition() {
      // Lines and columns start at 1. A value of 0 means we don't know, so in
      // that case just use the whole file as the position.
      if ((lineNumber > 0) && (columnNumber > 0)) {
        return new SourcePosition(source, lineNumber, columnNumber);
      } else {
        return new SourcePosition(source);
      }
    }
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

  private Schema addNonMarkupSchema(String name, String contentType, Schema msgSchema,
                                    String cppType, String cppAppender, String cppImport,
                                    String javaType, String javaAppender, String javaImport,
                                    String javaScriptType, String javaScriptImport) {
    Schema schema = new Schema(new SourcePosition(name), "<schema>",
                               name, "", contentType, false, contentType, null,
                               cppType, cppAppender, ImmutableList.of(cppImport),
                               javaType, javaAppender, ImmutableList.of(javaImport),
                               javaScriptType, ImmutableList.of(javaScriptImport),
                               ImmutableList.<ElementBuilder>of(), ImmutableList.<SchemaRef>of(),
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

  // used to synthesize unique (but somewhat deterministic) source positions.
  private int counter = 0;

  public SourcePosition pos() {
    counter++;
    return new SourcePosition("TEST" + counter, counter, counter);
  }
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

  private final NamespaceSet nsSet =
      new NamespaceSet(BuiltinSchemaFactory.INSTANCE);

  public void testExactMappings() throws Exception {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder();
    SourcePosition sourcePosition = new SourcePosition("<test>");
    assertTrue(nsSet.get(alertSetBuilder, sourcePosition,
                         "http://google.com/2001/gxp")
               instanceof GxpNamespace);
    assertTrue(alertSetBuilder.buildAndClear().isEmpty());
    assertTrue(nsSet.get(alertSetBuilder, sourcePosition,
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

    assertTrue(alertSetBuilder.buildAndClear().isEmpty());
  }

  public void testFailedMapping() throws Exception {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder();
    nsSet.get(alertSetBuilder, new SourcePosition("<test>"),
              "http://google.com/i/dont/exist");
    Alert alert = Iterables.getOnlyElement(alertSetBuilder.buildAndClear());
    assertTrue(alert instanceof UnknownNamespaceError);
  }
View Full Code Here

Examples of com.google.gxp.compiler.alerts.SourcePosition

  public void testList() throws Exception {
    assertContentsInOrder(list(1, 2, 3), 1, 2, 3);
  }

  public void testPos() throws Exception {
    SourcePosition pos1 = pos();
    SourcePosition pos2 = pos();
    assertNotEqual(pos1, pos2);
    assertNotEqual(pos1.getSourceName(), pos2.getSourceName());
    assertNotEqual(pos1.getLine(), pos2.getLine());
    assertNotEqual(pos1.getColumn(), pos2.getColumn());
  }
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.