Examples of SyntaxErrorMessage


Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

                }
            } else {
                txt += "The sources " + nodeSource.getName() + " and " + storedSource.getName() + " are containing both a class of the name " + node.getName() + ".\n";
            }
            nodeSource.getErrorCollector().addErrorAndContinue(
                    new SyntaxErrorMessage(new SyntaxException(txt, node.getLineNumber(), node.getColumnNumber()), nodeSource)
            );
        }
        classes.put(name, node);

        if (classesToCompile.containsKey(name)) {
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

    protected void addError(String msg, ASTNode expr) {
        int line = expr.getLineNumber();
        int col = expr.getColumnNumber();
        SourceUnit source = getSourceUnit();
        source.getErrorCollector().addErrorAndContinue(
          new SyntaxErrorMessage(new SyntaxException(msg + '\n', line, col), source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

                }
            } else {
                txt += "The sources "+nodeSource.getName()+" and "+storedSource.getName()+" are containing both a class of the name "+node.getName()+".\n";
            }
            nodeSource.getErrorCollector().addErrorAndContinue(
                    new SyntaxErrorMessage(new SyntaxException(txt, node.getLineNumber(), node.getColumnNumber()), nodeSource)
            );
        }
        classes.put(name, node);
       
        if (classesToCompile.containsKey(name)) {
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

        while (iterator.hasNext()) {
            Message message = (Message) iterator.next();
            message.write(writer, janitor);
           
            if (configuration.getDebug() && (message instanceof SyntaxErrorMessage)){
                SyntaxErrorMessage sem = (SyntaxErrorMessage) message;
                sem.getCause().printStackTrace(writer);
            }
        }

        writer.println();
        writer.print(messages.size());
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

            this.ast = parserPlugin.buildAST(this, this.classLoader, this.cst);

            this.ast.setDescription(this.name);
        }
        catch (SyntaxException e) {
            getErrorCollector().addError(new SyntaxErrorMessage(e,this));
        }

        String property = (String) AccessController.doPrivileged(new PrivilegedAction() {
          public Object run() {
            return System.getProperty("groovy.ast");
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

        return CompilerConfiguration.POST_JDK5.equals(this.source.getConfiguration().getTargetBytecode());
    }
   
    protected void addError(String msg, ASTNode expr) {
        this.source.getErrorCollector().addErrorAndContinue(
            new SyntaxErrorMessage(
                    new SyntaxException(msg + '\n', expr.getLineNumber(), expr.getColumnNumber()), this.source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

        this.annotation.setAllowedTargets(bitmap);
    }
   
    protected void addError(String msg) {
        this.errorCollector.addErrorAndContinue(
          new SyntaxErrorMessage(new SyntaxException(msg
                  + " in @" + this.annotationClass.getName() + '\n',
                  this.annotation.getLineNumber(),
                  this.annotation.getColumnNumber()), this.source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

        );
    }
   
    protected void addError(String msg, ASTNode expr) {
        this.errorCollector.addErrorAndContinue(
          new SyntaxErrorMessage(new SyntaxException(msg
                  + " in @" + this.annotationClass.getName() + '\n',
                  expr.getLineNumber(),
                  expr.getColumnNumber()), this.source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

        if (cause instanceof MultipleCompilationErrorsException) {
            MultipleCompilationErrorsException mcee = (MultipleCompilationErrorsException)cause;
            Object message = mcee.getErrorCollector().getErrors().iterator().next();
            if (message instanceof SyntaxErrorMessage) {
                SyntaxErrorMessage sem = (SyntaxErrorMessage)message;
                lineNumber = sem.getCause().getLine();
                className = sem.getCause().getSourceLocator();
                sem.write(pw);
            }
        }
        else {
            Matcher m1 = PARSE_DETAILS_STEP1.matcher(stackTrace);
            Matcher m2 = PARSE_DETAILS_STEP2.matcher(stackTrace);
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SyntaxErrorMessage

     * @param message The error message
     * @param fatal indicates if this is a fatal error
     */
    public static void error(final SourceUnit sourceUnit, final ASTNode astNode, final String message, final boolean fatal) {
        final SyntaxException syntaxException = new SyntaxException(message, astNode.getLineNumber(), astNode.getColumnNumber());
        final SyntaxErrorMessage syntaxErrorMessage = new SyntaxErrorMessage(syntaxException, sourceUnit);
        sourceUnit.getErrorCollector().addError(syntaxErrorMessage, fatal);
    }
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.