Examples of CompilerError


Examples of com.redhat.ceylon.compiler.java.test.CompilerError

    public void testAnnoSuppressesNothing() {
        assertErrors(new String[]{"SuppressesNothing.ceylon"},
                defaultOptions,
                null,
                new Kind[]{Kind.WARNING},
                new CompilerError(Kind.WARNING, "", 1, "suppresses no warnings"));
    }
View Full Code Here

Examples of net.jangaroo.jooc.CompilerError

    }

    private void detectExtConfigAnnotation(Annotation annotation) {
      if (EXT_CONFIG_META_NAME.equals(annotation.getMetaName())) {
        if (configClass.getComponentClassName() != null) {
          throw new CompilerError(annotation.getSymbol(), "Only one [" + EXT_CONFIG_META_NAME + "] annotation may be given.");
        }

        CommaSeparatedList<AnnotationParameter> annotationParameters = annotation.getOptAnnotationParameters();
        while (annotationParameters != null) {
          AnnotationParameter annotationParameter = annotationParameters.getHead();
          Ide optNameIde = annotationParameter.getOptName();
          if (optNameIde != null) {
            String parameterName = optNameIde.getName();
            LiteralExpr annotationParameterValue = annotationParameter.getValue();
            String parameterValue = null;
            if (annotationParameterValue != null) {
              JooSymbol symbol = annotationParameterValue.getSymbol();
              if (symbol.sym != sym.STRING_LITERAL) {
                throw new CompilerError(symbol, "The " + parameterName + " parameter of an [" + EXT_CONFIG_META_NAME + "] annotation must be a string literal.");
              }
              parameterValue = (String) symbol.getJooValue();
            }
            if (TARGET_ANNOTATION_PARAMETER_NAME.equals(parameterName)) {
              if (parameterValue == null) {
                throw new CompilerError(optNameIde.getSymbol(), "The " + parameterName + " parameter of an [" + EXT_CONFIG_META_NAME + "] annotation must have a value.");
              }
              configClass.setComponentClassName(parameterValue);
            } else {
              try {
                configClass.setType(ConfigClassType.fromExtConfigAttribute(parameterName));
              } catch (IllegalArgumentException e) {
                throw new CompilerError(optNameIde.getSymbol(), "'" + parameterName + "' is not a valid parameter of an [" + EXT_CONFIG_META_NAME + "] annotation (only 'xtype', 'ptype', 'type', 'gctype' are allowed).", e);
              }
              configClass.setTypeValue(parameterValue);
            }
          }
          annotationParameters = annotationParameters.getTail();
        }
        if (configClass.getComponentClassName() == null) {
          throw new CompilerError(annotation.getSymbol(), "A " + TARGET_ANNOTATION_PARAMETER_NAME + " parameter must be provided for an [" + EXT_CONFIG_META_NAME + "] annotation.");
        }
      }
    }
View Full Code Here

Examples of org.apache.axis.components.compiler.CompilerError

                    message.append(":\n");
                   
                    List errors = compiler.getErrors();
                    int count = errors.size();
                    for (int i = 0; i < count; i++) {
                        CompilerError error = (CompilerError) errors.get(i);
                        if (i > 0) message.append("\n");
                        message.append("Line ");
                        message.append(error.getStartLine());
                        message.append(", column ");
                        message.append(error.getStartColumn());
                        message.append(": ");
                        message.append(error.getMessage());
                    }
                    root.appendChild( doc.createTextNode( message.toString() ) );
                    throw new AxisFault( "Server.compileError",
                                         JavaUtils.getMessage("badCompile00", jFile),
                                         null, new Element[] { root } );
View Full Code Here

Examples of org.apache.axis.utils.compiler.CompilerError

                    message.append(":\n");

                    List errors = compiler.getErrors();
                    int count = errors.size();
                    for (int i = 0; i < count; i++) {
                      CompilerError error = (CompilerError) errors.get(i);
                      if (i > 0) message.append("\n");
                      message.append("Line ");
                      message.append(error.getStartLine());
                      message.append(", column ");
                      message.append(error.getStartColumn());
                      message.append(": ");
                      message.append(error.getMessage());
                    }
                    root.appendChild( doc.createTextNode( message.toString() ) );
                    throw new AxisFault( "Server.compileError",
                         JavaUtils.getMessage("badCompile00", jFile),
                        null, new Element[] { root } );
View Full Code Here

Examples of org.apache.axis.utils.compiler.CompilerError

                    message.append(":\n");

                    List errors = compiler.getErrors();
                    int count = errors.size();
                    for (int i = 0; i < count; i++) {
                      CompilerError error = (CompilerError) errors.get(i);
                      if (i > 0) message.append("\n");
                      message.append("Line ");
                      message.append(error.getStartLine());
                      message.append(", column ");
                      message.append(error.getStartColumn());
                      message.append(": ");
                      message.append(error.getMessage());
                    }
                    root.appendChild( doc.createTextNode( message.toString() ) );
                    throw new AxisFault( "Server.compileError",
                         JavaUtils.getMessage("badCompile00", jFile),
                        null, new Element[] { root } );
View Full Code Here

Examples of org.apache.cocoon.components.language.programming.CompilerError

                message.append(":\n");

                List errors = compiler.getErrors();
                int count = errors.size();
                for (int i = 0; i < count; i++) {
                    CompilerError error = (CompilerError) errors.get(i);
                    if (i > 0) message.append("\n");
                    message.append("Line ");
                    message.append(error.getStartLine());
                    message.append(", column ");
                    message.append(error.getStartColumn());
                    message.append(": ");
                    message.append(error.getMessage());
                }

                throw new LanguageException(message.toString());
            }
View Full Code Here

Examples of org.apache.cocoon.components.language.programming.CompilerError

      do {
        if ((line = input.readLine()) == null)
        {
            if (buffer.length() > 0) {
                // There's an error which doesn't end with a '^'
                errors.add(new CompilerError("\n" + buffer.toString()));
            }
            return errors;
        }
        buffer.append(line);
        buffer.append('\n');
View Full Code Here

Examples of org.apache.cocoon.components.language.programming.CompilerError

      String context = tokens.nextToken("\n");
      String pointer = tokens.nextToken("\n");
      int startcolumn = pointer.indexOf("^");
      int endcolumn = context.indexOf(" ", startcolumn);
      if (endcolumn == -1) endcolumn = context.length();
      return new CompilerError(file, false, line, startcolumn, line, endcolumn, message);
    } catch(NoSuchElementException nse) {
      return new CompilerError("no more tokens - could not parse error message: " + error);
    } catch(Exception nse) {
      return new CompilerError("could not parse error message: " + error);
    }
  }
View Full Code Here

Examples of org.apache.cocoon.components.language.programming.CompilerError

      String pointer = tokens.nextToken();
      int startcolumn = pointer.indexOf("^");
      int endcolumn = context.indexOf(" ", startcolumn);
      if (endcolumn == -1) endcolumn = context.length();

      return new CompilerError(srcDir + File.separator + file, true, line, startcolumn, line, endcolumn, message);
    } catch(NoSuchElementException nse) {
      return new CompilerError("no more tokens - could not parse error message: " + error);
    } catch(Exception nse) {
      return new CompilerError("could not parse error message: " + error);
    }
  }
View Full Code Here

Examples of org.apache.cocoon.components.language.programming.CompilerError

      do {
        if ((line = input.readLine()) == null)
        {
            if (buffer.length() > 0) {
                // There's an error which doesn't end with a '^'
                errors.add(new CompilerError("\n" + buffer.toString()));
            }
            return errors;
        }
        buffer.append(line);
        buffer.append('\n');
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.