Package org.drools.compiler

Examples of org.drools.compiler.ParserError


        private static final Pattern namePat = Pattern.compile( "[\\p{L}_$][\\p{L}_$\\d]*" );

        private void isIdentifier( Token name ){
            String nameString = name.getText();
            if( ! namePat.matcher( nameString ).matches() ){
                errors.add(new ParserError( "invalid variable identifier " + nameString,
                                            name.getLine(), name.getCharPositionInLine() ) );
            }
        }
View Full Code Here


            throw new IllegalStateException( "Serious error, unable to validate package." );
        }

        if ( this.parser.hasErrors() ) {
            for ( final Iterator iter = this.parser.getErrors().iterator(); iter.hasNext(); ) {
                final ParserError element = (ParserError) iter.next();
                this.errors.add( element.getMessage() );
            }
        }

        if (pkgDescr != null) { //only if no errors
View Full Code Here

     */
    protected void markParseErrors(List markers, List parserErrors) {
        for ( Iterator iter = parserErrors.iterator(); iter.hasNext(); ) {
            Object error = iter.next();
            if (error instanceof ParserError) {
                ParserError err = (ParserError) error;
                markers.add(new DroolsBuildMarker(err.getMessage(), err.getRow()));
            } else if (error instanceof ExpanderException) {
                ExpanderException exc = (ExpanderException) error;
                // TODO line mapping is incorrect
                markers.add(new DroolsBuildMarker(exc.getMessage(), -1));
            } else {
View Full Code Here

                    }
                } else {
                    markers.add(new DroolsBuildMarker(ruleError.getRule().getName() + ":" + ruleError.getMessage(), ruleError.getLine()));
                }
            } else if (error instanceof ParserError) {
                ParserError parserError = (ParserError) error;
                // TODO try to retrieve character start-end
                markers.add(new DroolsBuildMarker(parserError.getMessage(), parserError.getRow()));
            } else if (error instanceof FunctionError) {
                FunctionError functionError = (FunctionError) error;
                // TODO add line to function error
                // TODO try to retrieve character start-end
                if (functionError.getObject() instanceof CompilationProblem[]) {
View Full Code Here

TOP

Related Classes of org.drools.compiler.ParserError

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.