Package org.drools.compiler

Examples of org.drools.compiler.ParserError


                      parser.getErrors().size() );
        parser.parse( new InputStreamReader( getClass().getResourceAsStream( "errors_parser_multiple.drl" ) ) );
        assertTrue( parser.hasErrors() );
        assertTrue( parser.getErrors().size() > 0 );
        assertTrue( parser.getErrors().get( 0 ) instanceof ParserError );
        final ParserError first = ((ParserError) parser.getErrors().get( 0 ));
        assertTrue( first.getMessage() != null );
        assertFalse( first.getMessage().equals( "" ) );
    }
View Full Code Here


    public static final int MISC=33;

        private List<ParserError> errors = new ArrayList<ParserError>();

        public void reportError(RecognitionException ex) {
            errors.add(new ParserError( "DSL lexer error", ex.line, ex.charPositionInLine ) );
        }
View Full Code Here


        private List<ParserError> errors = new ArrayList<ParserError>();

        public void reportError(RecognitionException ex) {
            errors.add(new ParserError( "DSL parser error", ex.line, ex.charPositionInLine ) );
        }
View Full Code Here

        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() );
            }
        }
        // populating information for the model itself
        this.populateModelInfo( pkgDescr,
                                jars );
View Full Code Here

                      parser.getErrors().size() );
        parser.parse( new InputStreamReader( getClass().getResourceAsStream( "errors_parser_multiple.drl" ) ) );
        assertTrue( parser.hasErrors() );
        assertTrue( parser.getErrors().size() > 0 );
        assertTrue( parser.getErrors().get( 0 ) instanceof ParserError );
        final ParserError first = ((ParserError) parser.getErrors().get( 0 ));
        assertTrue( first.getMessage() != null );
        assertFalse( first.getMessage().equals( "" ) );
    }
View Full Code Here

                      parser.getErrors().size() );
        parser.parse( new InputStreamReader( getClass().getResourceAsStream( "errors_parser_multiple.drl" ) ) );
        assertTrue( parser.hasErrors() );
        assertTrue( parser.getErrors().size() > 0 );
        assertTrue( parser.getErrors().get( 0 ) instanceof ParserError );
        final ParserError first = ((ParserError) parser.getErrors().get( 0 ));
        assertTrue( first.getMessage() != null );
        assertFalse( first.getMessage().equals( "" ) );
    }
View Full Code Here

                    while( (len = lineLengths.get( row )) < col ){
                        col -= len + 1;
                        row++;
                    }
                }
                moderr.add( new ParserError( err.getMessage(), row, col ) );
            }
            errors = moderr;
        } catch(Exception e){
            final String msg = "Error parsing DSL mapping: " + e.getMessage();
            ParserError parserError = new ParserError( msg, -1, 0 );
            errors.add( parserError );
        }
        setErrors( errors );

        //        for( ParserError err: errors ){
View Full Code Here

    public static final int MISC=33;

        private List<ParserError> errors = new ArrayList<ParserError>();

        public void reportError(RecognitionException ex) {
            errors.add(new ParserError( "DSL lexer error", ex.line, ex.charPositionInLine ) );
        }
View Full Code Here


        private List<ParserError> errors = new ArrayList<ParserError>();

        public void reportError(RecognitionException ex) {
            errors.add(new ParserError( "DSL parser error", ex.line, ex.charPositionInLine ) );
        }
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.