Package org.apache.cocoon.components.language.programming

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


      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

      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

      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

      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

      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

      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

            while (tokens.hasMoreTokens())
                message.append("\n").append(tokens.nextToken());
        }

        return new CompilerError(file, type.equals("error"), startline, startcolumn, endline, endcolumn, message.toString());
    }
View Full Code Here

        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

    void handleError(String className, int line, int column, Object errorMessage) {
        String fileName =
            className.replace('.', File.separatorChar) + ".java";
        if (column < 0) column = 0;
        errors.add(new CompilerError(fileName,
                                     true,
                                     line,
                                     column,
                                     line,
                                     column,
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.language.programming.CompilerError

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.