Search in sources :

Example 26 with SourceUnit

use of org.codehaus.groovy.control.SourceUnit in project gcontracts by andresteingress.

the class ProcessingContextInformation method addError.

public void addError(String msg, ASTNode expr) {
    int line = expr.getLineNumber();
    int col = expr.getColumnNumber();
    SourceUnit source = sourceUnit();
    source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException(msg + '\n', line, col), source));
}
Also used : SyntaxErrorMessage(org.codehaus.groovy.control.messages.SyntaxErrorMessage) SyntaxException(org.codehaus.groovy.syntax.SyntaxException) SourceUnit(org.codehaus.groovy.control.SourceUnit)

Aggregations

SourceUnit (org.codehaus.groovy.control.SourceUnit)26 CompilationUnit (org.codehaus.groovy.control.CompilationUnit)10 ClassNode (org.codehaus.groovy.ast.ClassNode)8 SyntaxException (org.codehaus.groovy.syntax.SyntaxException)8 SyntaxErrorMessage (org.codehaus.groovy.control.messages.SyntaxErrorMessage)6 CompilationFailedException (org.codehaus.groovy.control.CompilationFailedException)5 GeneratorContext (org.codehaus.groovy.classgen.GeneratorContext)4 RecognitionException (antlr.RecognitionException)2 TokenStreamException (antlr.TokenStreamException)2 GroovyObject (groovy.lang.GroovyObject)2 IncorrectTypeHintException (groovy.transform.stc.IncorrectTypeHintException)2 StringReader (java.io.StringReader)2 ArrayList (java.util.ArrayList)2 LinkedHashSet (java.util.LinkedHashSet)2 List (java.util.List)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 AntlrParserPlugin (org.codehaus.groovy.antlr.AntlrParserPlugin)2 GroovyLexer (org.codehaus.groovy.antlr.parser.GroovyLexer)2 GroovyRecognizer (org.codehaus.groovy.antlr.parser.GroovyRecognizer)2 GenericsType (org.codehaus.groovy.ast.GenericsType)2