View Javadoc

1   /*
2    *   Copyright 2005 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  package org.apache.asn1new.ber.grammar;
18  
19  /***
20   * This interface is used to store the different states of a grammar. While
21   * tracing debugging information, the methods to dump the current state
22   * as a string are called.
23   * 
24   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
25   */
26  public interface IStates {
27      /*** The initial state of every grammar */
28      static int INIT_GRAMMAR_STATE = 0;
29  
30      /*** The ending state for every grammars */
31      static int GRAMMAR_END = -1;
32      
33      /*** The END_STATE */
34      static int END_STATE = -1;
35  
36      /*** The mask to filter grammar switch */
37      final static int GRAMMAR_SWITCH_MASK = 0xFF00;
38      
39      /*** The mask to filter states transition */
40      final static int STATES_SWITCH_MASK = 0x00FF;
41      
42      /*** Get the current state for a specified grammar */
43      String getState( int grammar, int state );
44      
45      /*** Return the grammar name from a grammar */ 
46      String getGrammarName(IGrammar grammar);
47  
48      /*** Return the grammar name from a grammar number */ 
49      String getGrammarName(int grammar);
50  }