Package org.codehaus.groovy.control.messages

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


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


    private void wrapCompilationFailure(ScriptSource source, MultipleCompilationErrorsException e) {
        // Fix the source file name displayed in the error messages
        for (Object message : e.getErrorCollector().getErrors()) {
            if (message instanceof SyntaxErrorMessage) {
                try {
                    SyntaxErrorMessage syntaxErrorMessage = (SyntaxErrorMessage) message;
                    Field sourceField = SyntaxErrorMessage.class.getDeclaredField("source");
                    sourceField.setAccessible(true);
                    SourceUnit sourceUnit = (SourceUnit) sourceField.get(syntaxErrorMessage);
                    Field nameField = SourceUnit.class.getDeclaredField("name");
                    nameField.setAccessible(true);
View Full Code Here

    return names.toArray(new String[names.size()]);
  }

  protected void reportError(final String message, final SourceUnit sourceUnit, final ASTNode node) {
    SyntaxException se = new SyntaxException(message, node.getLineNumber(), node.getColumnNumber());
    sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(se, sourceUnit));
  }
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.control.messages.SyntaxErrorMessage

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.