Package com.google.gxp.compiler.alerts

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


      super(out, alertSink, template);
      this.extraIncludess = ImmutableSet.copyOf(extraIncludess);
    }

    protected void appendClass() {
      SourcePosition pos = template.getSourcePosition();
      TemplateName templateName = template.getName();

      appendIfdefGuardStart(template);
      appendLine();
      appendLine("#include \"gxp/base/base.h\"");
View Full Code Here


      appendLine();
      appendIfdefGuardEnd(template);
    }

    protected void appendExtraWriteMethods(boolean isStatic) {
      SourcePosition pos = template.getSourcePosition();
      Iterable<Parameter> params = isStatic
          ? template.getAllParameters()
          : template.getParameters();

      for (ExtraOutType extraOutType : extraOutTypes) {
View Full Code Here

        appendLine("}");
      }
    }

    protected void appendInterface() {
      SourcePosition pos = template.getSourcePosition();

      appendLine("//");
      appendLine("// Interface that defines a strategy for writing this GXP");
      appendLine("//");
      appendCppFormalTypeParameters(true, template.getFormalTypeParameters());
View Full Code Here

    protected void appendInstance() {
      StringBuilder sb;
      Constructor constructor = template.getConstructor();
      List<Parameter> cParams = constructor.getParameters();
      SourcePosition pos = constructor.getSourcePosition();

      appendLine("//");
      appendLine("// Instantiable instance of this GXP");
      appendLine("//");
      appendCppFormalTypeParameters(true, template.getFormalTypeParameters());
View Full Code Here

  public void testCall_nonEmptyNonContainer() throws Exception {
    String startCall = "<my:" + getTemplateBaseName() + ">";
    String endCall = "</my:" + getTemplateBaseName() + ">";
    compile(startCall + "stuff inside" + endCall);
    SourcePosition errorPos = pos(2, endCall.length());
    assertAlert(new BadNodePlacementError(errorPos, "text",
                                          "inside " + startCall));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

        tcMessageBuilder.setDescription(msg.getComment());
      }

      // - Include the source gxp file so that l10n experts for other projects
      //   can avoid clobbering this project's translated strings.
      SourcePosition source = msg.getSourcePosition();
      if (source != null) {
        tcMessageBuilder.addSource(source.getSource().toRelativeFilename()
                                   + ": L" + source.getLine()
                                   // For backwards compatibility with the old
                                   // compiler, report a 0-based column number.
                                   + ", C" + (source.getColumn() - 1));
      }
    }
View Full Code Here

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

    SourcePosition errorPos = pos(errorLine, errorColumn);

    for (IllegalOperatorExpression illegalOp : ILLEGAL_OPERATORS) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalOp.getExpression()) + suffix);
      for (OutputLanguage outputLanguage : illegalOp.getOutputLanguages()) {
        assertAlert(new IllegalOperatorError(errorPos, outputLanguage.getDisplay(),
View Full Code Here

      assertNoUnexpectedAlerts();
    }

    for (String illegalName : ILLEGAL_VAR_NAMES) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalName) + suffix);
      SourcePosition errorPos = pos(2, 1);
      assertAlert(new IllegalVariableNameError(errorPos, illegalName));
      assertNoUnexpectedAlerts();
    }

    for (Map.Entry<String, Collection<OutputLanguage>> illegalName :
             ILLEGAL_OUTPUT_LANGUAGE_NAMES.entrySet()) {
      compile(prefix + CharEscapers.xmlEscaper().escape(illegalName.getKey()) + suffix);
      SourcePosition errorPos = pos(2, 1);
      for (OutputLanguage outputLanguage : illegalName.getValue()) {
        assertAlert(new IllegalNameError(errorPos, outputLanguage.getDisplay(),
                                         illegalName.getKey()));
      }
      assertNoUnexpectedAlerts();
View Full Code Here

    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

  /**
   * 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

TOP

Related Classes of com.google.gxp.compiler.alerts.SourcePosition

Copyright © 2018 www.massapicom. 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.