/** * Creates a ReusableAntlrSubtreeSpecificationLexer instance. * * @param in * the input to the lexer */ public ReusableAntlrSubtreeSpecificationLexer( Reader in ) { super( in ); savedCaseSensitive = getCaseSensitive(); savedCaseSensitiveLiterals = getCaseSensitiveLiterals(); }
/** * Resets the state of an antlr lexer and initializes it with new input. * * @param in * the input to the lexer */ public void prepareNextInput( Reader in ) { CharBuffer buf = new CharBuffer( in ); LexerSharedInputState state = new LexerSharedInputState( buf ); this.setInputState( state ); this.setCaseSensitive( savedCaseSensitive ); // no set method for this protected field. this.caseSensitiveLiterals = savedCaseSensitiveLiterals; } }
/** * Creates a subtree specification parser. * * @param schemaManager The SchemaManager */ public SubtreeSpecificationParser( SchemaManager schemaManager ) { // place holder for the first input StringReader in = new StringReader( "" ); this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in ); this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer ); // this method MUST be called while we cannot do // constructor overloading for antlr generated parser this.parser.init( schemaManager ); this.isNormalizing = false; }
/** * Initializes the plumbing by creating a pipe and coupling the parser/lexer * pair with it. * * @param spec The specification to parse */ private synchronized void reset( String spec ) { // append end of input token StringReader in = new StringReader( spec + "end" ); this.lexer.prepareNextInput( in ); this.parser.resetState(); }
/** * Resets the state of an antlr lexer and initializes it with new input. * * @param in * the input to the lexer */ public void prepareNextInput( Reader in ) { CharBuffer buf = new CharBuffer( in ); LexerSharedInputState state = new LexerSharedInputState( buf ); this.setInputState( state ); this.setCaseSensitive( savedCaseSensitive ); // no set method for this protected field. this.caseSensitiveLiterals = savedCaseSensitiveLiterals; } }
/** * Creates a subtree specification parser. * * @param schemaManager The SchemaManager */ public SubtreeSpecificationParser( SchemaManager schemaManager ) { // place holder for the first input StringReader in = new StringReader( "" ); this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in ); this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer ); // this method MUST be called while we cannot do // constructor overloading for antlr generated parser this.parser.init( schemaManager ); this.isNormalizing = false; }
/** * Initializes the plumbing by creating a pipe and coupling the parser/lexer * pair with it. * * @param spec The specification to parse */ private synchronized void reset( String spec ) { // append end of input token StringReader in = new StringReader( spec + "end" ); this.lexer.prepareNextInput( in ); this.parser.resetState(); }
/** * Creates a ReusableAntlrSubtreeSpecificationLexer instance. * * @param in * the input to the lexer */ public ReusableAntlrSubtreeSpecificationLexer( Reader in ) { super( in ); savedCaseSensitive = getCaseSensitive(); savedCaseSensitiveLiterals = getCaseSensitiveLiterals(); }
/** * Resets the state of an antlr lexer and initializes it with new input. * * @param in * the input to the lexer */ public void prepareNextInput( Reader in ) { CharBuffer buf = new CharBuffer( in ); LexerSharedInputState state = new LexerSharedInputState( buf ); this.setInputState( state ); this.setCaseSensitive( savedCaseSensitive ); // no set method for this protected field. this.caseSensitiveLiterals = savedCaseSensitiveLiterals; } }
/** * Creates a subtree specification parser. * * @param schemaManager The SchemaManager */ public SubtreeSpecificationParser( SchemaManager schemaManager ) { // place holder for the first input StringReader in = new StringReader( "" ); this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in ); this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer ); // this method MUST be called while we cannot do // constructor overloading for antlr generated parser this.parser.init( schemaManager ); this.isNormalizing = false; }
/** * Initializes the plumbing by creating a pipe and coupling the parser/lexer * pair with it. * * @param spec The specification to parse */ private synchronized void reset( String spec ) { // append end of input token StringReader in = new StringReader( spec + "end" ); this.lexer.prepareNextInput( in ); this.parser.resetState(); }
/** * Creates a ReusableAntlrSubtreeSpecificationLexer instance. * * @param in * the input to the lexer */ public ReusableAntlrSubtreeSpecificationLexer( Reader in ) { super( in ); savedCaseSensitive = getCaseSensitive(); savedCaseSensitiveLiterals = getCaseSensitiveLiterals(); }
/** * Creates a normalizing subtree specification parser. * * @param resolver The resolver to use * @param schemaManager The SchemaManager */ public SubtreeSpecificationParser( @SuppressWarnings("rawtypes") NormalizerMappingResolver resolver, SchemaManager schemaManager ) { // place holder for the first input StringReader in = new StringReader( "" ); this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in ); this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer ); this.parser.setNormalizerMappingResolver( resolver ); // this method MUST be called while we cannot do // constructor overloading for antlr generated parser this.parser.init( schemaManager ); this.isNormalizing = true; }
/** * Creates a normalizing subtree specification parser. * * @param resolver The resolver to use * @param schemaManager The SchemaManager */ public SubtreeSpecificationParser( @SuppressWarnings("rawtypes") NormalizerMappingResolver resolver, SchemaManager schemaManager ) { // place holder for the first input StringReader in = new StringReader( "" ); this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in ); this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer ); this.parser.setNormalizerMappingResolver( resolver ); // this method MUST be called while we cannot do // constructor overloading for antlr generated parser this.parser.init( schemaManager ); this.isNormalizing = true; }
/** * Creates a normalizing subtree specification parser. * * @param resolver The resolver to use * @param schemaManager The SchemaManager */ public SubtreeSpecificationParser( @SuppressWarnings("rawtypes") NormalizerMappingResolver resolver, SchemaManager schemaManager ) { // place holder for the first input StringReader in = new StringReader( "" ); this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in ); this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer ); this.parser.setNormalizerMappingResolver( resolver ); // this method MUST be called while we cannot do // constructor overloading for antlr generated parser this.parser.init( schemaManager ); this.isNormalizing = true; }