Examples of SourcePosition


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

    for (String legalType : LEGAL_TYPES) {
      compile(prefix + CharEscapers.xmlEscaper().escape(legalType) + suffix);
      assertNoUnexpectedAlerts();
    }

    SourcePosition errorPos = pos(2, 1);
    for (String illegalType : ILLEGAL_TYPES) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalType) + suffix);
      assertAlert(new IllegalJavaTypeError(errorPos, illegalType));
      assertNoUnexpectedAlerts();
    }
View Full Code Here

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

  /**
   * Generates output for the specified {@code CompilationUnit} in the
   * specified {@code OutputLanguage}.
   */
  void execute(AlertSink alertSink, AlertPolicy alertPolicy) {
    SourcePosition outputPosition = new SourcePosition(outputFileRef);
    alertSink.add(new ProgressAlert(outputPosition, "Generating"));
    CodeGenerator codeGenerator =
        codeGeneratorFactory.getCodeGenerator(language, compilationUnit);

    AlertCounter counter = new AlertCounter(alertSink, alertPolicy);
View Full Code Here

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

*/
public class IOError extends ErrorAlert {
  private final IOException exception;

  public IOError(FileRef source, IOException exception) {
    this(new SourcePosition(source), exception);
  }
View Full Code Here

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

      // will always be one more text segment than non-text value.
      List<String> textSegments = Lists.newArrayList();
      List<SourcePosition> textPositions = Lists.newArrayList();
      List<Expression> nonTextValues = Lists.newArrayList();
      {
        SourcePosition sbPos = null;
        for (Expression value : values) {
          if (value instanceof StringConstant) {
            StringConstant stringConstant = (StringConstant) value;
            sb.append(stringConstant.evaluate());
            if (sbPos == null) {
View Full Code Here

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

    line++;
    int column = 1;
    for (Node node : children) {
      column = Math.max(column, node.getSourcePosition().getColumn() + 1);
    }
    return new SourcePosition(filename, line, column);
  }
View Full Code Here

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

  /**
   * Creates a parse tree.
   */
  private IfExpandedTree tree(ParsedElement... children) {
    return new IfExpandedTree(new SourcePosition(filename),
                              parseAlerts.buildAndClear(), list(children));
  }
View Full Code Here

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

    ReparentedTree output = reparent(input);
    assertTrue(output.getRoot() instanceof NullRoot);
  }

  public void testWithAlerts() throws Exception {
    Alert parseWarning = new WarningAlert(new SourcePosition("baz", 1, 2),
                                          "test warning"){};
    parseAlerts.add(parseWarning);
    expectedAlerts.add(parseWarning);

    ReparentedTree output = reparent(tree());
View Full Code Here

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

        xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);

        xmlReader.parse(inputSource);
      } catch (SAXException saxException) {
        if (!saxEventAdapter.getExceptionMessages().contains(saxException.getMessage())) {
          eventHandler.add(new SaxAlert(new SourcePosition(input),
                                        Severity.ERROR, saxException));
        }
      }
    } finally {
      inputStream.close();
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(input, lineNumber, columnNumber);
      } else {
        return new SourcePosition(input);
      }
    }
View Full Code Here

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

    } catch (UnsupportedExternalEntityException e) {
      alertSetBuilder.add(new UnsupportedExternalEntityError(
                              e.getSourcePosition(), e.getEntity()));
    }

    return new ParseTree(new SourcePosition(input), alertSetBuilder.buildAndClear(),
                         eventHandler.getParsedRoots());
  }
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.