001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 package org.apache.directory.shared.asn1.ber.grammar; 021 022 023 /** 024 * This interface is used to store the different states of a grammar. While 025 * tracing debugging information, the methods to dump the current state as a 026 * string are called. 027 * 028 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 029 * @version $Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sat, 07 Jun 2008) $ 030 */ 031 public interface IStates 032 { 033 /** The initial state of every grammar */ 034 int INIT_GRAMMAR_STATE = 0; 035 036 /** The ending state for every grammars */ 037 int GRAMMAR_END = -1; 038 039 /** The END_STATE */ 040 int END_STATE = -1; 041 042 /** 043 * Get the current state's name 044 * 045 * @param state the current state 046 * @return the associated name for this state 047 */ 048 String getState( int state ); 049 050 /** 051 * Return the grammar name of a grammar 052 * 053 * @param grammar the grammar from which we want the name 054 * @return the grammar's name 055 */ 056 String getGrammarName( IGrammar grammar ); 057 058 /** 059 * Return the grammar name from a grammar number 060 * 061 * @param grammar the grammar number from which we want the name 062 * @return the grammar's name 063 */ 064 String getGrammarName( int grammar ); 065 }