directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r179173 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1: ber/grammar/AbstractGrammar.java ber/grammar/IStates.java ldap/codec/grammars/LdapStatesEnum.java
Date Mon, 30 May 2005 23:44:10 GMT
Author: elecharny
Date: Mon May 30 16:44:09 2005
New Revision: 179173

URL: http://svn.apache.org/viewcvs?rev=179173&view=rev
Log:
- Added the END_STATE constant
- used the GRAMMAR_END constant instead of -1

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/AbstractGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/IStates.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/AbstractGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/AbstractGrammar.java?rev=179173&r1=179172&r2=179173&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/AbstractGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/AbstractGrammar.java
Mon May 30 16:44:09 2005
@@ -136,11 +136,11 @@
         IGrammar currentGrammar = container.getGrammar();
 
         // We have to deal with the special case of a GRAMLMAR_END state
-        if ( currentState == -1 )
+        if ( currentState == IStates.END_STATE )
         {
             currentState = container.restoreGrammar();
 
-            if ( currentState == -1 )
+            if ( currentState == IStates.END_STATE )
             {
                 return;
             }
@@ -186,7 +186,8 @@
 
             int nextState = transition.getNextState();
 
-            if ( ( ( nextState & IStates.GRAMMAR_SWITCH_MASK ) != 0 ) && ( nextState
!= -1 ) )
+            if ( ( ( nextState & IStates.GRAMMAR_SWITCH_MASK ) != 0 ) &&
+                    ( nextState != IStates.END_STATE ) )
             {
 
                 if ( DEBUG )

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/IStates.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/IStates.java?rev=179173&r1=179172&r2=179173&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/IStates.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/grammar/IStates.java
Mon May 30 16:44:09 2005
@@ -29,6 +29,9 @@
 
     /** The ending state for every grammars */
     public static int GRAMMAR_END = -1;
+    
+    /** The END_STATE */
+    public static int END_STATE = -1;
 
     /** The mask to filter between states transition and grammar switch */
     public final static int GRAMMAR_SWITCH_MASK = 0x0F00;

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java?rev=179173&r1=179172&r2=179173&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java
Mon May 30 16:44:09 2005
@@ -647,7 +647,7 @@
 
         if ( ( state & GRAMMAR_SWITCH_MASK ) != 0 )
         {
-            return ( state == -1 ) ? "END_STATE"
+            return ( state == END_STATE ) ? "END_STATE"
                 : GrammarSwitchString[( ( state & GRAMMAR_SWITCH_MASK ) >> 8 )
- 1];
         }
         else
@@ -657,28 +657,28 @@
             {
 
                 case LDAP_MESSAGE_GRAMMAR :
-                    return ( ( state == -1 ) ? "LDAP_MESSAGE_END_STATE" : LdapMessageString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "LDAP_MESSAGE_END_STATE" : LdapMessageString[state]
);
 
                 case LDAP_RESULT_GRAMMAR :
-                    return ( ( state == -1 ) ? "LDAP_RESULT_END_STATE" : LdapResultString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "LDAP_RESULT_END_STATE" : LdapResultString[state]
);
 
                 case LDAP_CONTROL_GRAMMAR :
-                    return ( ( state == -1 ) ? "LDAP_CONTROL_END_STATE" : LdapControlString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "LDAP_CONTROL_END_STATE" : LdapControlString[state]
);
 
                 case BIND_REQUEST_GRAMMAR :
-                    return ( ( state == -1 ) ? "BIND_REQUEST_END_STATE" : BindRequestString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "BIND_REQUEST_END_STATE" : BindRequestString[state]
);
 
                 case BIND_RESPONSE_GRAMMAR :
-                    return ( ( state == -1 ) ? "IND_RESPONSE_END_STATE" : BindResponseString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "IND_RESPONSE_END_STATE" : BindResponseString[state]
);
 
                 case UNBIND_REQUEST_GRAMMAR :
-                    return ( ( state == -1 ) ? "UNBIND_REQUEST_END_STATE" : UnBindRequestString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "UNBIND_REQUEST_END_STATE" : UnBindRequestString[state]
);
 
                 case ABANDON_REQUEST_GRAMMAR :
-                    return ( ( state == -1 ) ? "ABANDON_REQUEST_END_STATE" : AbandonRequestString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "ABANDON_REQUEST_END_STATE" : AbandonRequestString[state]
);
 
                 case ADD_REQUEST_GRAMMAR :
-                    return ( ( state == -1 ) ? "ADD_REQUEST_END_STATE" : AddRequestString[state]
);
+                    return ( ( state == GRAMMAR_END ) ? "ADD_REQUEST_END_STATE" : AddRequestString[state]
);
 
                 default :
                     return "UNKNOWN";



Mime
View raw message