| 1 |
/*
|
| 2 |
* Copyright 2004 The Apache Software Foundation
|
| 3 |
*
|
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
* you may not use this file except in compliance with the License.
|
| 6 |
* You may obtain a copy of the License at
|
| 7 |
*
|
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
*
|
| 10 |
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
* See the License for the specific language governing permissions and
|
| 14 |
* limitations under the License.
|
| 15 |
*
|
| 16 |
*/
|
| 17 |
|
| 18 |
|
| 19 |
package org.apache.ldap.common.subtree;
|
| 20 |
|
| 21 |
|
| 22 |
import antlr.TokenStream;
|
| 23 |
|
| 24 |
|
| 25 |
/**
|
| 26 |
* A reusable parser class extended from antlr generated parser for an LDAP
|
| 27 |
* subtree specification as defined by <a href="http://www.faqs.org/rfcs/rfc3672.html">
|
| 28 |
* RFC 3672</a>. This class enables the reuse of the antlr parser without having to
|
| 29 |
* recreate the it every time as stated in
|
| 30 |
* <a href="http://www.antlr.org:8080/pipermail/antlr-interest/2003-April/003631.html">
|
| 31 |
* a Antlr Interest Group mail</a> .
|
| 32 |
*
|
| 33 |
* @see <a href="http://www.faqs.org/rfcs/rfc3672.html">RFC 3672</a>
|
| 34 |
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
|
| 35 |
* @version $Rev$
|
| 36 |
*/
|
| 37 |
class ReusableAntlrSubtreeSpecificationParser extends AntlrSubtreeSpecificationParser
|
| 38 |
{
|
| 39 |
/**
|
| 40 |
* Creates a ReusableAntlrSubtreeSpecificationParser instance.
|
| 41 |
*/
|
| 42 |
public ReusableAntlrSubtreeSpecificationParser( TokenStream lexer )
|
| 43 |
{
|
| 44 |
super( lexer );
|
| 45 |
}
|
| 46 |
|
| 47 |
|
| 48 |
/**
|
| 49 |
* Resets the state of an antlr parser.
|
| 50 |
*/
|
| 51 |
public void resetState()
|
| 52 |
{
|
| 53 |
// no set method for this protected field.
|
| 54 |
this.traceDepth = 0;
|
| 55 |
|
| 56 |
this.getInputState().reset();
|
| 57 |
}
|
| 58 |
}
|