You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/06/07 08:28:15 UTC

svn commit: r664290 [3/13] - in /directory/shared/branches/bigbang: ./ asn1/src/main/java/org/apache/directory/shared/asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ asn1/s...

Modified: directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g (original)
+++ directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g Fri Jun  6 23:28:06 2008
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.directory.shared.ldap.schema.parser.ParserMonitor;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 
@@ -42,12 +43,26 @@
 options    {
     k = 5 ;
     exportVocab=AntlrSchema ;
-    charVocabulary = '\u0000'..'\uFFFE'; 
-    caseSensitive = true ;
+    charVocabulary = '\u0000'..'\uFFFE';
+    caseSensitive = false ;
     defaultErrorHandler = false ;
 }
 
-WHSP : (options{greedy=true;}: ' ' )+ {$setType(Token.SKIP);} ;
+WHSP
+    :
+    ( options {greedy=true;} :
+    ' '
+    |
+    '\t'
+    |
+    '\r' (options {greedy=true;} : '\n')? { newline(); } 
+    |
+    '\n' { newline(); }
+    |
+    '#' (~'\n')* '\n' { newline(); }
+    )+
+    {$setType(Token.SKIP);} //ignore this token
+    ;
 
 LPAR : '(' ;
 RPAR : ')' ;
@@ -58,43 +73,51 @@
 
 LEN : LBRACKET ('0'..'9')+ RBRACKET ;
 
-SINGLE_VALUE : ( "SINGLE-VALUE" (WHSP)? ) ;
-COLLECTIVE : ( "COLLECTIVE" (WHSP)? ) ;
-NO_USER_MODIFICATION : ( "NO-USER-MODIFICATION" (WHSP)? ) ;
-
-OBSOLETE : ( "OBSOLETE" (WHSP)? ) ;
-ABSTRACT : ( "ABSTRACT" (WHSP)? ) ;
-STRUCTURAL : ( "STRUCTURAL" (WHSP)? ) ;
-AUXILIARY : ( "AUXILIARY" (WHSP)? ) ;
-
-STARTNUMERICOID : ( LPAR ( numericoid:VALUE ) ) { setText(numericoid.getText().trim()); } ;
-NAME : ( "NAME" WHSP qdstrings:VALUES ) { setText(qdstrings.getText().trim()); } ;
-DESC : ( "DESC" WHSP qdstring:VALUES ) { setText(qdstring.getText().trim()); } ;
-SUP : ( "SUP" WHSP sup:VALUES ) { setText(sup.getText().trim()); } ;
-MUST : ( "MUST" WHSP must:VALUES ) { setText(must.getText().trim()); } ;
-MAY : ( "MAY" WHSP may:VALUES ) { setText(may.getText()); } ;
-AUX : ( "AUX" WHSP aux:VALUES ) { setText(aux.getText()); } ;
-NOT : ( "NOT" WHSP not:VALUES ) { setText(not.getText()); } ;
-FORM : ( "FORM" WHSP form:VALUES ) { setText(form.getText()); } ;
-OC : ( "OC" WHSP oc:VALUES ) { setText(oc.getText()); } ;
-EQUALITY : ( "EQUALITY" WHSP equality:VALUES ) { setText(equality.getText().trim()); } ;
-ORDERING : ( "ORDERING" WHSP ordering:VALUES ) { setText(ordering.getText().trim()); } ;
-SUBSTR : ( "SUBSTR" WHSP substr:VALUES ) { setText(substr.getText().trim()); } ;
-SYNTAX : ( "SYNTAX" WHSP syntax:VALUES (len:LEN)? ) { setText(syntax.getText().trim() + (len!=null?len.getText().trim():"")); } ;
-APPLIES : ( "APPLIES" WHSP applies:VALUES ) { setText(applies.getText().trim()); } ;
-EXTENSION : x:( "X-" ( 'a'..'z' | 'A'..'Z' | '-' | '_' )+ WHSP VALUES ) ; 
-FQCN : ( "FQCN" WHSP fqcn:FQCN_VALUE ) { setText(fqcn.getText().trim()); } ;
-BYTECODE : ( "BYTECODE" WHSP bytecode:BYTECODE_VALUE ) { setText(bytecode.getText().trim()); } ;
+SINGLE_VALUE : ( "single-value" (WHSP)? ) ;
+COLLECTIVE : ( "collective" (WHSP)? ) ;
+NO_USER_MODIFICATION : ( "no-user-modification" (WHSP)? ) ;
+
+OBSOLETE : ( "obsolete" (WHSP)? ) ;
+ABSTRACT : ( "abstract" (WHSP)? ) ;
+STRUCTURAL : ( "structural" (WHSP)? ) ;
+protected AUXILIARY : ( "auxiliary" (WHSP)? ) ;
+
+OBJECTCLASS : ( "objectclass" (WHSP)? ) ;
+ATTRIBUTETYPE : ( "attributetype" (WHSP)? ) ;
+
+STARTNUMERICOID : ( LPAR (options {greedy=true;} : WHSP)? ( numericoid:VALUES ) ) { setText(numericoid.getText()); } ;
+NAME : ( "name" (options {greedy=true;} : WHSP)? qdstrings:VALUES ) { setText(qdstrings.getText().trim()); } ;
+DESC : ( "desc" (options {greedy=true;} : WHSP)? qdstring:VALUES ) { setText(qdstring.getText().trim()); } ;
+SUP : ( "sup" (options {greedy=true;} : WHSP)? sup:VALUES ) { setText(sup.getText().trim()); } ;
+MUST : ( "must" (options {greedy=true;} : WHSP)? must:VALUES ) { setText(must.getText().trim()); } ;
+MAY : ( "may" (options {greedy=true;} : WHSP)? may:VALUES ) { setText(may.getText()); } ;
+protected AUX : ( "aux" (options {greedy=true;} : WHSP)? aux:VALUES ) { setText(aux.getText()); } ;
+NOT : ( "not" (options {greedy=true;} : WHSP)? not:VALUES ) { setText(not.getText()); } ;
+FORM : ( "form" (options {greedy=true;} : WHSP)? form:VALUES ) { setText(form.getText()); } ;
+OC : ( "oc" (options {greedy=true;} : WHSP)? oc:VALUES ) { setText(oc.getText()); } ;
+EQUALITY : ( "equality" (options {greedy=true;} : WHSP)? equality:VALUES ) { setText(equality.getText().trim()); } ;
+ORDERING : ( "ordering" (options {greedy=true;} : WHSP)? ordering:VALUES ) { setText(ordering.getText().trim()); } ;
+SUBSTR : ( "substr" (options {greedy=true;} : WHSP)? substr:VALUES ) { setText(substr.getText().trim()); } ;
+SYNTAX : ( "syntax" (options {greedy=true;} : WHSP)? syntax:VALUES (len:LEN)? ) { setText(syntax.getText().trim() + (len!=null?len.getText().trim():"")); } ;
+APPLIES : ( "applies" (options {greedy=true;} : WHSP)? applies:VALUES ) { setText(applies.getText().trim()); } ;
+EXTENSION : x:( "x-" ( options {greedy=true;} : 'a'..'z' | '-' | '_' )+ (options {greedy=true;} : WHSP)? VALUES ) ; 
+FQCN : ( "fqcn" (options {greedy=true;} : WHSP)? fqcn:FQCN_VALUE ) { setText(fqcn.getText().trim()); } ;
+BYTECODE : ( "bytecode" (options {greedy=true;} : WHSP)? bytecode:BYTECODE_VALUE ) { setText(bytecode.getText().trim()); } ;
+
+AUX_OR_AUXILIARY :
+    ( AUXILIARY ) => AUXILIARY { $setType( AUXILIARY ); }
+    |
+    ( AUX ) { $setType( AUX ); }
+    ;
 
 protected VALUES : ( VALUE | LPAR  VALUE ( (DOLLAR)? VALUE )* RPAR ) ;
 protected VALUE : (WHSP)? ( QUOTED_STRING | UNQUOTED_STRING ) (options {greedy=true;}: WHSP)? ;
-protected UNQUOTED_STRING : (options{greedy=true;}: 'a'..'z' | 'A'..'Z' | '0'..'9' | '-' | ';' | '.' )+ ;
+protected UNQUOTED_STRING : (options{greedy=true;}: 'a'..'z' | '0'..'9' | '-' | '_' | ';' | '.' )+ ;
 protected QUOTED_STRING : ( QUOTE (~'\'')* QUOTE ) ;
 protected FQCN_VALUE : ( FQCN_IDENTIFIER ( '.' FQCN_IDENTIFIER )* ) ;
 protected FQCN_IDENTIFIER : ( FQCN_LETTER ( FQCN_LETTERORDIGIT )* ) ;
 protected FQCN_LETTER : 
        '\u0024' |
-       '\u0041'..'\u005a' |
        '\u005f' |
        '\u0061'..'\u007a' |
        '\u00c0'..'\u00d6' |
@@ -108,7 +131,6 @@
        '\uf900'..'\ufaff' ;
 protected FQCN_LETTERORDIGIT : 
        '\u0024' |
-       '\u0041'..'\u005a' |
        '\u005f' |
        '\u0061'..'\u007a' |
        '\u00c0'..'\u00d6' |
@@ -121,14 +143,14 @@
        '\u4e00'..'\u9fff' |
        '\uf900'..'\ufaff' |
        '\u0030'..'\u0039' ;
-protected BYTECODE_VALUE : ( 'a'..'z' | 'A'..'Z' | '0'..'9' | '+' | '/' | '=' )+ ;
+protected BYTECODE_VALUE : ( 'a'..'z' | '0'..'9' | '+' | '/' | '=' )+ ;
 
 
-USAGE : ( "USAGE" (WHSP)? ) ;
-USER_APPLICATIONS : ( "userApplications" (WHSP)? ) ;
-DIRECTORY_OPERATION : ( "directoryOperation" (WHSP)? ) ;
-DISTRIBUTED_OPERATION : ( "distributedOperation" (WHSP)? ) ;
-DSA_OPERATION : ( "dSAOperation" (WHSP)? ) ;
+USAGE : ( "usage" (WHSP)? ) ;
+USER_APPLICATIONS : ( "userapplications" (WHSP)? ) ;
+DIRECTORY_OPERATION : ( "directoryoperation" (WHSP)? ) ;
+DISTRIBUTED_OPERATION : ( "distributedoperation" (WHSP)? ) ;
+DSA_OPERATION : ( "dsaoperation" (WHSP)? ) ;
 
 /**
  * An antlr generated schema main parser.
@@ -144,40 +166,97 @@
 }
 
 {
-	static class Extension
-	{
-	    String key = "";
-	    List<String> values = new ArrayList<String>();
-	    
-	    public void addValue( String value )
-	    {
-	        this.values.add( value );
-	    }
-	}
-	static class NoidLen
-	{
-	    String noid = "";
-	    int len = 0;
-	}
+    private ParserMonitor monitor = null;
+    private boolean isQuirksModeEnabled = false;
+    public void setParserMonitor( ParserMonitor monitor )
+    {
+        this.monitor = monitor;
+    }
+    private void matchedProduction( String msg )
+    {
+        if ( null != monitor )
+        {
+            monitor.matchedProduction( msg );
+        }
+    }
+    public void setQuirksMode( boolean enabled )
+    {
+        this.isQuirksModeEnabled = enabled;
+    }
+    public boolean isQuirksMode()
+    {
+        return this.isQuirksModeEnabled;
+    }
+    static class Extension
+    {
+        String key = "";
+        List<String> values = new ArrayList<String>();
+        
+        public void addValue( String value )
+        {
+            this.values.add( value );
+        }
+    }
+    static class NoidLen
+    {
+        String noid = "";
+        int len = 0;
+    }
     static class ElementTracker
-	{
-	    Map<String, Integer> elementMap = new HashMap<String, Integer>();
-	    void track(String element, Token token) throws SemanticException 
-	    {
-	        if(elementMap.containsKey(element))
-	        {
-	            throw new SemanticException( element + " appears twice.", token.getFilename(), token.getLine() , token.getColumn() );
-	        }
-	        elementMap.put(element, new Integer(1));
-	    }
-	    boolean contains(String element) 
-	    {
-	        return elementMap.containsKey(element);
-	    }
-	}
+    {
+        Map<String, Integer> elementMap = new HashMap<String, Integer>();
+        void track(String element, Token token) throws SemanticException 
+        {
+            if(elementMap.containsKey(element))
+            {
+                throw new SemanticException( element + " appears twice.", token.getFilename(), token.getLine() , token.getColumn() );
+            }
+            elementMap.put(element, new Integer(1));
+        }
+        boolean contains(String element) 
+        {
+            return elementMap.containsKey(element);
+        }
+    }
 
 }
 
+openLdapSchema returns [List<AbstractSchemaDescription> list = new ArrayList<AbstractSchemaDescription>()]
+    {
+        AbstractSchemaDescription atd = null;
+        AbstractSchemaDescription ocd = null;
+    }
+    :
+    ( 
+        atd = openLdapAttributeType { list.add( atd ); }
+        |
+        ocd = openLdapObjectClass { list.add( ocd ); }
+    )*
+    ;
+
+openLdapObjectClass returns [ObjectClassDescription ocd]
+    {
+        matchedProduction( "openLdapObjectClass()" );
+    }
+    :
+    (
+        OBJECTCLASS
+        ( ocd=objectClassDescription )
+    )
+    ;
+    
+    
+openLdapAttributeType returns [AttributeTypeDescription atd]
+    {
+        matchedProduction( "openLdapAttributeType()" );
+    }
+    :
+    (
+        ATTRIBUTETYPE
+        ( atd=attributeTypeDescription )
+    )
+    ;
+
 
     /**
      * Production for matching object class descriptions. It is fault-tolerant
@@ -203,36 +282,37 @@
     */
 objectClassDescription returns [ObjectClassDescription ocd = new ObjectClassDescription()]
     {
+        matchedProduction( "objectClassDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { ocd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); ocd.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); ocd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); ocd.setObsolete( true ); } )
-	    |
-	    ( sup:SUP { et.track("SUP", sup); ocd.setSuperiorObjectClasses(oids(sup.getText())); } )
-	    |
-	    ( kind1:ABSTRACT { et.track("KIND", kind1); ocd.setKind( ObjectClassTypeEnum.ABSTRACT ); }
-	      |
-	      kind2:STRUCTURAL { et.track("KIND", kind2); ocd.setKind( ObjectClassTypeEnum.STRUCTURAL ); }
-	      |
-	      kind3:AUXILIARY { et.track("KIND", kind3); ocd.setKind( ObjectClassTypeEnum.AUXILIARY ); } 
-	    )
-	    |
-	    ( must:MUST { et.track("MUST", must); ocd.setMustAttributeTypes(oids(must.getText())); } )
-	    |
-	    ( may:MAY { et.track("MAY", may); ocd.setMayAttributeTypes(oids(may.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        ocd.addExtension(ex.key, ex.values); 
-	     } )
-	)*    
+        ( name:NAME { et.track("NAME", name); ocd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); ocd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); ocd.setObsolete( true ); } )
+        |
+        ( sup:SUP { et.track("SUP", sup); ocd.setSuperiorObjectClasses(oids(sup.getText())); } )
+        |
+        ( kind1:ABSTRACT { et.track("KIND", kind1); ocd.setKind( ObjectClassTypeEnum.ABSTRACT ); }
+          |
+          kind2:STRUCTURAL { et.track("KIND", kind2); ocd.setKind( ObjectClassTypeEnum.STRUCTURAL ); }
+          |
+          kind3:AUXILIARY { et.track("KIND", kind3); ocd.setKind( ObjectClassTypeEnum.AUXILIARY ); } 
+        )
+        |
+        ( must:MUST { et.track("MUST", must); ocd.setMustAttributeTypes(oids(must.getText())); } )
+        |
+        ( may:MAY { et.track("MAY", may); ocd.setMayAttributeTypes(oids(may.getText())); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            ocd.addExtension(ex.key, ex.values); 
+         } )
+    )*    
     RPAR
     ;
 
@@ -269,19 +349,20 @@
     */
 attributeTypeDescription returns [AttributeTypeDescription atd = new AttributeTypeDescription()]
     {
+        matchedProduction( "attributeTypeDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { atd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); atd.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); atd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); atd.setObsolete( true ); } )
-	    |
-	    ( sup:SUP { et.track("SUP", sup); atd.setSuperType(oid(sup.getText())); } )
-	    |
+        ( name:NAME { et.track("NAME", name); atd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); atd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); atd.setObsolete( true ); } )
+        |
+        ( sup:SUP { et.track("SUP", sup); atd.setSuperType(oid(sup.getText())); } )
+        |
         ( equality:EQUALITY { et.track("EQUALITY", equality); atd.setEqualityMatchingRule(oid(equality.getText())); } )
         |
         ( ordering:ORDERING { et.track("ORDERING", ordering); atd.setOrderingMatchingRule(oid(ordering.getText())); } )
@@ -301,39 +382,42 @@
         |
         ( noUserModification:NO_USER_MODIFICATION { et.track("NO_USER_MODIFICATION", noUserModification); atd.setUserModifiable( false ); } )
         |
-	    ( usage1:USAGE (WHSP)* USER_APPLICATIONS { et.track("USAGE", usage1); atd.setUsage( UsageEnum.USER_APPLICATIONS ); }
-	      |
-	      usage2:USAGE DIRECTORY_OPERATION { et.track("USAGE", usage2); atd.setUsage( UsageEnum.DIRECTORY_OPERATION ); }
-	      |
-	      usage3:USAGE DISTRIBUTED_OPERATION { et.track("USAGE", usage3); atd.setUsage( UsageEnum.DISTRIBUTED_OPERATION ); } 
-	      |
-	      usage4:USAGE DSA_OPERATION { et.track("USAGE", usage4); atd.setUsage( UsageEnum.DSA_OPERATION ); } 
-	    )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        atd.addExtension(ex.key, ex.values); 
-	     } )
-	)*    
+        ( usage1:USAGE (WHSP)* USER_APPLICATIONS { et.track("USAGE", usage1); atd.setUsage( UsageEnum.USER_APPLICATIONS ); }
+          |
+          usage2:USAGE DIRECTORY_OPERATION { et.track("USAGE", usage2); atd.setUsage( UsageEnum.DIRECTORY_OPERATION ); }
+          |
+          usage3:USAGE DISTRIBUTED_OPERATION { et.track("USAGE", usage3); atd.setUsage( UsageEnum.DISTRIBUTED_OPERATION ); } 
+          |
+          usage4:USAGE DSA_OPERATION { et.track("USAGE", usage4); atd.setUsage( UsageEnum.DSA_OPERATION ); } 
+        )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            atd.addExtension(ex.key, ex.values); 
+         } )
+    )*    
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("SYNTAX") && !et.contains("SUP") ) 
+        if( !isQuirksModeEnabled )
         {
-            throw new SemanticException( "One of SYNTAX or SUP is required", null, 0, 0 );
-        }
+            // semantic check: required elements
+            if( !et.contains("SYNTAX") && !et.contains("SUP") ) 
+            {
+                throw new SemanticException( "One of SYNTAX or SUP is required", null, 0, 0 );
+            }
         
-        // COLLECTIVE requires USAGE userApplications
-        if ( atd.isCollective() && ( atd.getUsage() != UsageEnum.USER_APPLICATIONS ) )
-        {
-            throw new SemanticException( "COLLECTIVE requires USAGE userApplications", null, 0, 0 );
-        }
+            // COLLECTIVE requires USAGE userApplications
+            if ( atd.isCollective() && ( atd.getUsage() != UsageEnum.USER_APPLICATIONS ) )
+            {
+                throw new SemanticException( "COLLECTIVE requires USAGE userApplications", null, 0, 0 );
+            }
         
-        // NO-USER-MODIFICATION requires an operational USAGE.
-        if ( !atd.isUserModifiable() && ( atd.getUsage() == UsageEnum.USER_APPLICATIONS ) )
-        {
-            throw new SemanticException( "NO-USER-MODIFICATION requires an operational USAGE", null, 0, 0 );
+            // NO-USER-MODIFICATION requires an operational USAGE.
+            if ( !atd.isUserModifiable() && ( atd.getUsage() == UsageEnum.USER_APPLICATIONS ) )
+            {
+                throw new SemanticException( "NO-USER-MODIFICATION requires an operational USAGE", null, 0, 0 );
+            }
         }
     }
     ;
@@ -352,18 +436,21 @@
     */
 ldapSyntaxDescription returns [LdapSyntaxDescription lsd = new LdapSyntaxDescription()]
     {
+        matchedProduction( "ldapSyntaxDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { lsd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( desc:DESC { et.track("DESC", desc); lsd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        lsd.addExtension(ex.key, ex.values); 
-	     } )
+        ( name:NAME { et.track("NAME", name); lsd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); lsd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            lsd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     ;
@@ -386,30 +473,34 @@
     */
 matchingRuleDescription returns [MatchingRuleDescription mrd = new MatchingRuleDescription()]
     {
+        matchedProduction( "matchingRuleDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { mrd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); mrd.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); mrd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); mrd.setObsolete( true ); } )
-	    |
+        ( name:NAME { et.track("NAME", name); mrd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); mrd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); mrd.setObsolete( true ); } )
+        |
         ( syntax:SYNTAX { et.track("SYNTAX", syntax); mrd.setSyntax(numericoid(syntax.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        mrd.addExtension(ex.key, ex.values); 
-	     } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            mrd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("SYNTAX") ) {
-            throw new SemanticException( "SYNTAX is required", null, 0, 0 );
+        if( !isQuirksModeEnabled )
+        {    
+            // semantic check: required elements
+            if( !et.contains("SYNTAX") ) {
+                throw new SemanticException( "SYNTAX is required", null, 0, 0 );
+            }
         }
     }
     ;
@@ -431,30 +522,34 @@
     */
 matchingRuleUseDescription returns [MatchingRuleUseDescription mrud = new MatchingRuleUseDescription()]
     {
+        matchedProduction( "matchingRuleUseDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { mrud.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); mrud.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); mrud.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); mrud.setObsolete( true ); } )
-	    |
+        ( name:NAME { et.track("NAME", name); mrud.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); mrud.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); mrud.setObsolete( true ); } )
+        |
         ( applies:APPLIES { et.track("APPLIES", applies); mrud.setApplicableAttributes(oids(applies.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        mrud.addExtension(ex.key, ex.values); 
-	     } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            mrud.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("APPLIES") ) {
-            throw new SemanticException( "APPLIES is required", null, 0, 0 );
+        if( !isQuirksModeEnabled )
+        {
+            // semantic check: required elements
+            if( !et.contains("APPLIES") ) {
+                throw new SemanticException( "APPLIES is required", null, 0, 0 );
+            }
         }
     }
     ;
@@ -479,30 +574,31 @@
     */
 ditContentRuleDescription returns [DITContentRuleDescription dcrd = new DITContentRuleDescription()]
     {
+        matchedProduction( "ditContentRuleDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { dcrd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); dcrd.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); dcrd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); dcrd.setObsolete( true ); } )
-	    |
-	    ( aux:AUX { et.track("AUX", aux); dcrd.setAuxiliaryObjectClasses(oids(aux.getText())); } )
-	    |
-	    ( must:MUST { et.track("MUST", must); dcrd.setMustAttributeTypes(oids(must.getText())); } )
-	    |
-	    ( may:MAY { et.track("MAY", may); dcrd.setMayAttributeTypes(oids(may.getText())); } )
-	    |
-	    ( not:NOT { et.track("NOT", not); dcrd.setNotAttributeTypes(oids(not.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        dcrd.addExtension(ex.key, ex.values); 
-	     } )
+        ( name:NAME { et.track("NAME", name); dcrd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); dcrd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); dcrd.setObsolete( true ); } )
+        |
+        ( aux:AUX { et.track("AUX", aux); dcrd.setAuxiliaryObjectClasses(oids(aux.getText())); } )
+        |
+        ( must:MUST { et.track("MUST", must); dcrd.setMustAttributeTypes(oids(must.getText())); } )
+        |
+        ( may:MAY { et.track("MAY", may); dcrd.setMayAttributeTypes(oids(may.getText())); } )
+        |
+        ( not:NOT { et.track("NOT", not); dcrd.setNotAttributeTypes(oids(not.getText())); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            dcrd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     ;
@@ -529,32 +625,36 @@
     */
 ditStructureRuleDescription returns [DITStructureRuleDescription dsrd = new DITStructureRuleDescription()]
     {
+        matchedProduction( "ditStructureRuleDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( ruleid:STARTNUMERICOID { dsrd.setRuleId(ruleid(ruleid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); dsrd.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); dsrd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); dsrd.setObsolete( true ); } )
-	    |
-	    ( form:FORM { et.track("FORM", form); dsrd.setForm(oid(form.getText())); } )
-	    |
-	    ( sup:SUP { et.track("SUP", sup); dsrd.setSuperRules(ruleids(sup.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        dsrd.addExtension(ex.key, ex.values); 
-	     } )
+        ( name:NAME { et.track("NAME", name); dsrd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); dsrd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); dsrd.setObsolete( true ); } )
+        |
+        ( form:FORM { et.track("FORM", form); dsrd.setForm(oid(form.getText())); } )
+        |
+        ( sup:SUP { et.track("SUP", sup); dsrd.setSuperRules(ruleids(sup.getText())); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            dsrd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("FORM") ) {
-            throw new SemanticException( "FORM is required", null, 0, 0 );
+        if( !isQuirksModeEnabled )
+        {
+            // semantic check: required elements
+            if( !et.contains("FORM") ) {
+                throw new SemanticException( "FORM is required", null, 0, 0 );
+            }
         }
     }
     ;
@@ -578,46 +678,50 @@
     */
 nameFormDescription returns [NameFormDescription nfd = new NameFormDescription()]
     {
+        matchedProduction( "nameFormDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { nfd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( name:NAME { et.track("NAME", name); nfd.setNames(qdescrs(name.getText())); } )
-	    |
-	    ( desc:DESC { et.track("DESC", desc); nfd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); nfd.setObsolete( true ); } )
-	    |
-	    ( oc:OC { et.track("OC", oc); nfd.setStructuralObjectClass(oid(oc.getText())); } )
-	    |
-	    ( must:MUST { et.track("MUST", must); nfd.setMustAttributeTypes(oids(must.getText())); } )
-	    |
-	    ( may:MAY { et.track("MAY", may); nfd.setMayAttributeTypes(oids(may.getText())); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        nfd.addExtension(ex.key, ex.values); 
-	     } )
+        ( name:NAME { et.track("NAME", name); nfd.setNames(qdescrs(name.getText())); } )
+        |
+        ( desc:DESC { et.track("DESC", desc); nfd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( obsolete:OBSOLETE { et.track("OBSOLETE", obsolete); nfd.setObsolete( true ); } )
+        |
+        ( oc:OC { et.track("OC", oc); nfd.setStructuralObjectClass(oid(oc.getText())); } )
+        |
+        ( must:MUST { et.track("MUST", must); nfd.setMustAttributeTypes(oids(must.getText())); } )
+        |
+        ( may:MAY { et.track("MAY", may); nfd.setMayAttributeTypes(oids(may.getText())); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            nfd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("MUST") ) {
-            throw new SemanticException( "MUST is required", null, 0, 0 );
-        }
-        if( !et.contains("OC") ) {
-            throw new SemanticException( "OC is required", null, 0, 0 );
-        }
+        if( !isQuirksModeEnabled )
+        {
+            // semantic check: required elements
+            if( !et.contains("MUST") ) {
+                throw new SemanticException( "MUST is required", null, 0, 0 );
+            }
+            if( !et.contains("OC") ) {
+                throw new SemanticException( "OC is required", null, 0, 0 );
+            }
         
-        // semantic check: MUST and MAY must be disjoint
-        //List<String> aList = new ArrayList<String>( nfd.getMustAttributeTypes() );
-        //aList.retainAll( nfd.getMayAttributeTypes() );
-        //if( !aList.isEmpty() ) 
-        //{
-        //    throw new SemanticException( "MUST and MAY must be disjoint, "+aList.get( 0 )+" appears in both", null, 0, 0 );
-        //}
+            // semantic check: MUST and MAY must be disjoint
+            //List<String> aList = new ArrayList<String>( nfd.getMustAttributeTypes() );
+            //aList.retainAll( nfd.getMayAttributeTypes() );
+            //if( !aList.isEmpty() ) 
+            //{
+            //    throw new SemanticException( "MUST and MAY must be disjoint, "+aList.get( 0 )+" appears in both", null, 0, 0 );
+            //}
+        }
     }
     ;
     
@@ -642,33 +746,37 @@
     */
 comparatorDescription returns [ComparatorDescription cd = new ComparatorDescription()]
     {
+        matchedProduction( "comparatorDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { cd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( desc:DESC { et.track("DESC", desc); cd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( fqcn:FQCN { et.track("FQCN", fqcn); cd.setFqcn(fqcn.getText()); } )
-	    |
-	    ( bytecode:BYTECODE { et.track("BYTECODE", bytecode); cd.setBytecode(bytecode.getText()); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        cd.addExtension(ex.key, ex.values); 
-	     } )
+        ( desc:DESC { et.track("DESC", desc); cd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( fqcn:FQCN { et.track("FQCN", fqcn); cd.setFqcn(fqcn.getText()); } )
+        |
+        ( bytecode:BYTECODE { et.track("BYTECODE", bytecode); cd.setBytecode(bytecode.getText()); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            cd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("FQCN") ) {
-            throw new SemanticException( "FQCN is required", null, 0, 0 );
-        }
+        if( !isQuirksModeEnabled )
+        {
+            // semantic check: required elements
+            if( !et.contains("FQCN") ) {
+                throw new SemanticException( "FQCN is required", null, 0, 0 );
+            }
         
-        // semantic check: length should be divisible by 4
-        if( cd.getBytecode() != null && ( cd.getBytecode().length() % 4 != 0 ) ) {
-            throw new SemanticException( "BYTECODE must be divisible by 4", null, 0, 0 );
+            // semantic check: length should be divisible by 4
+            if( cd.getBytecode() != null && ( cd.getBytecode().length() % 4 != 0 ) ) {
+                throw new SemanticException( "BYTECODE must be divisible by 4", null, 0, 0 );
+            }
         }
     }
     ;
@@ -694,34 +802,38 @@
     */
 normalizerDescription returns [NormalizerDescription nd = new NormalizerDescription()]
     {
+        matchedProduction( "normalizerDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { nd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( desc:DESC { et.track("DESC", desc); nd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( fqcn:FQCN { et.track("FQCN", fqcn); nd.setFqcn(fqcn.getText()); } )
-	    |
-	    ( bytecode:BYTECODE { et.track("BYTECODE", bytecode); nd.setBytecode(bytecode.getText()); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        nd.addExtension(ex.key, ex.values); 
-	     } )
+        ( desc:DESC { et.track("DESC", desc); nd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( fqcn:FQCN { et.track("FQCN", fqcn); nd.setFqcn(fqcn.getText()); } )
+        |
+        ( bytecode:BYTECODE { et.track("BYTECODE", bytecode); nd.setBytecode(bytecode.getText()); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            nd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("FQCN") ) {
-            throw new SemanticException( "FQCN is required", null, 0, 0 );
-        }
+        if( !isQuirksModeEnabled )
+        {
+            // semantic check: required elements
+            if( !et.contains("FQCN") ) {
+                throw new SemanticException( "FQCN is required", null, 0, 0 );
+            }
         
-        // semantic check: length should be divisible by 4
-        if( nd.getBytecode() != null && ( nd.getBytecode().length() % 4 != 0 ) ) {
-            throw new SemanticException( "BYTECODE must be divisible by 4", null, 0, 0 );
-        }        
+            // semantic check: length should be divisible by 4
+            if( nd.getBytecode() != null && ( nd.getBytecode().length() % 4 != 0 ) ) {
+                throw new SemanticException( "BYTECODE must be divisible by 4", null, 0, 0 );
+            }     
+        }   
     }
     ;
     
@@ -746,34 +858,38 @@
     */
 syntaxCheckerDescription returns [SyntaxCheckerDescription scd = new SyntaxCheckerDescription()]
     {
+        matchedProduction( "syntaxCheckerDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
     ( oid:STARTNUMERICOID { scd.setNumericOid(numericoid(oid.getText())); } )
     (
-	    ( desc:DESC { et.track("DESC", desc); scd.setDescription(qdstring(desc.getText())); } )
-	    |
-	    ( fqcn:FQCN { et.track("FQCN", fqcn); scd.setFqcn(fqcn.getText()); } )
-	    |
-	    ( bytecode:BYTECODE { et.track("BYTECODE", bytecode); scd.setBytecode(bytecode.getText()); } )
-	    |
-	    ( extension:EXTENSION { 
-	        Extension ex = extension(extension.getText());
-	        et.track(ex.key, extension); 
-	        scd.addExtension(ex.key, ex.values); 
-	     } )
+        ( desc:DESC { et.track("DESC", desc); scd.setDescription(qdstring(desc.getText())); } )
+        |
+        ( fqcn:FQCN { et.track("FQCN", fqcn); scd.setFqcn(fqcn.getText()); } )
+        |
+        ( bytecode:BYTECODE { et.track("BYTECODE", bytecode); scd.setBytecode(bytecode.getText()); } )
+        |
+        ( extension:EXTENSION { 
+            Extension ex = extension(extension.getText());
+            et.track(ex.key, extension); 
+            scd.addExtension(ex.key, ex.values); 
+         } )
     )*
     RPAR
     {
-        // semantic check: required elements
-        if( !et.contains("FQCN") ) {
-            throw new SemanticException( "FQCN is required", null, 0, 0 );
-        }
+        if( !isQuirksModeEnabled )
+        {
+            // semantic check: required elements
+            if( !et.contains("FQCN") ) {
+                throw new SemanticException( "FQCN is required", null, 0, 0 );
+            }
         
-        // semantic check: length should be divisible by 4
-        if( scd.getBytecode() != null && ( scd.getBytecode().length() % 4 != 0 ) ) {
-            throw new SemanticException( "BYTECODE must be divisible by 4", null, 0, 0 );
-        }        
+            // semantic check: length should be divisible by 4
+            if( scd.getBytecode() != null && ( scd.getBytecode().length() % 4 != 0 ) ) {
+                throw new SemanticException( "BYTECODE must be divisible by 4", null, 0, 0 );
+            }  
+        }      
     }
     ;
     
@@ -782,9 +898,11 @@
 
 noidlen [String s] returns [NoidLen noidlen]
     {
+        matchedProduction( "noidlen()" );
         AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
         AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
-        noidlen = parser.noidlen();
+        parser.setParserMonitor(monitor);
+        noidlen = isQuirksModeEnabled ? parser.quirksNoidlen() : parser.noidlen();
     }
     :
     ;
@@ -792,6 +910,7 @@
 
 extension [String s] returns [Extension extension]
     {
+        matchedProduction( "extension()" );
         AntlrSchemaExtensionLexer lexer = new AntlrSchemaExtensionLexer(new StringReader(s));
         AntlrSchemaExtensionParser parser = new AntlrSchemaExtensionParser(lexer);
         extension = parser.extension();
@@ -802,62 +921,96 @@
 
 numericoid [String s] returns [String numericoid]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
-        AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
-        numericoid = parser.numericoid();
+        matchedProduction( "numericoid()");
+        if(isQuirksModeEnabled)
+        {
+             numericoid = oid(s);
+        }
+        else
+        {
+	        AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
+	        AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
+	        parser.setParserMonitor(monitor);
+	        numericoid = parser.numericoid();
+        }
     }
     :
     ;
 
 oid [String s] returns [String oid]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
-        AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
-        oid = parser.oid();
+        matchedProduction( "oid()" );
+        List<String> oids = oids(s);
+        if( oids.size() != 1 ) 
+        {
+            throw new SemanticException( "Exactly one OID expected", null, 0, 0 );
+        }
+        oid = oids.get(0);
     }
     :
     ;
 
 oids [String s] returns [List<String> oids]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
-        AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
-        oids = parser.oids();
+        matchedProduction( "oids()" );
+        if(isQuirksModeEnabled)
+        {
+             oids = qdescrs(s);
+        }
+        else
+        {
+	        AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
+	        AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
+	        parser.setParserMonitor(monitor);
+	        oids = parser.oids();
+	    }
     }
     :
     ;
 
 qdescr [String s] returns [String qdescr]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
-        AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
-        qdescr = parser.qdescr();
+        matchedProduction( "qdescr()" );
+        List<String> qdescrs = qdescrs(s);
+        if( qdescrs.size() != 1 ) 
+        {
+            throw new SemanticException( "Exactly one qdescrs expected", null, 0, 0 );
+        }
+        qdescr = qdescrs.get(0);
     }
     :
     ;
 
 qdescrs [String s] returns [List<String> qdescrs]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
+        matchedProduction( "qdescrs()" );
+        AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
         AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
-        qdescrs = parser.qdescrs();
+        parser.setParserMonitor(monitor);
+        qdescrs = isQuirksModeEnabled ? parser.quirksQdescrs() : parser.qdescrs();
     }
     :
     ;
 
 qdstring [String s] returns [String qdstring]
     {
-    	AntlrSchemaQdstringLexer lexer = new AntlrSchemaQdstringLexer(new StringReader(s));
-        AntlrSchemaQdstringParser parser = new AntlrSchemaQdstringParser(lexer);
-        qdstring = parser.qdstring();
+        matchedProduction( "qdstring()" );
+        List<String> qdstrings = qdstrings(s);
+        if( qdstrings.size() != 1 ) 
+        {
+            throw new SemanticException( "Exactly one qdstrings expected", null, 0, 0 );
+        }
+        qdstring = qdstrings.get(0);
     }
     :
     ;
 
 qdstrings [String s] returns [List<String> qdstrings]
     {
-    	AntlrSchemaQdstringLexer lexer = new AntlrSchemaQdstringLexer(new StringReader(s));
+        matchedProduction( "qdstrings()" );
+        AntlrSchemaQdstringLexer lexer = new AntlrSchemaQdstringLexer(new StringReader(s));
         AntlrSchemaQdstringParser parser = new AntlrSchemaQdstringParser(lexer);
+        parser.setParserMonitor(monitor);
         qdstrings = parser.qdstrings();
     }
     :
@@ -865,8 +1018,10 @@
 
 ruleid [String s] returns [Integer ruleid]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
+        matchedProduction( "ruleid()" );
+        AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
         AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
+        parser.setParserMonitor(monitor);
         ruleid = parser.ruleid();
     }
     :
@@ -874,8 +1029,10 @@
 
 ruleids [String s] returns [List<Integer> ruleids]
     {
-    	AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
+        matchedProduction( "ruleids()" );
+        AntlrSchemaValueLexer lexer = new AntlrSchemaValueLexer(new StringReader(s));
         AntlrSchemaValueParser parser = new AntlrSchemaValueParser(lexer);
+        parser.setParserMonitor(monitor);
         ruleids = parser.ruleids();
     }
     :

Modified: directory/shared/branches/bigbang/ldap/src/main/antlr/subtree-specification.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/antlr/subtree-specification.g?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/antlr/subtree-specification.g (original)
+++ directory/shared/branches/bigbang/ldap/src/main/antlr/subtree-specification.g Fri Jun  6 23:28:06 2008
@@ -100,19 +100,19 @@
      */
     public void init( Map<String, OidNormalizer> oidsMap )
     {
-    	this.oidsMap = oidsMap;
+        this.oidsMap = oidsMap;
     }
     
     
     public void setNormalizerMappingResolver( NormalizerMappingResolver resolver )
     {
-    	this.resolver = resolver;
+        this.resolver = resolver;
     }
     
     
     public boolean isNormalizing()
     {
-    	return this.resolver != null;
+        return this.resolver != null;
     }
     
 
@@ -319,12 +319,12 @@
     
 filter returns [ ExprNode filterExpr = null ]
 {
-	log.debug( "entered filter()" );
+    log.debug( "entered filter()" );
 }
-	:
-	( filterToken:FILTER { filterExpr=FilterParser.parse( filterToken.getText() ); } )
-	;
-	exception
+    :
+    ( filterToken:FILTER { filterExpr=FilterParser.parse( filterToken.getText() ); } )
+    ;
+    exception
     catch [Exception e]
     {
         throw new RecognitionException( "filterParser failed. " + e.getMessage() );
@@ -342,7 +342,7 @@
         
         if ( isNormalizing() )
         {
-        	name.normalize( oidsMap );
+            name.normalize( oidsMap );
         }
         
         log.debug( "recognized a DistinguishedName: " + token.getText() );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java Fri Jun  6 23:28:06 2008
@@ -20,12 +20,12 @@
 package org.apache.directory.shared.ldap;
 
 
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.Collection;
-
-import java.io.PrintWriter;
-import java.io.PrintStream;
+import java.util.Iterator;
 
 
 /**

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/RuntimeMultiException.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/RuntimeMultiException.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/RuntimeMultiException.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/RuntimeMultiException.java Fri Jun  6 23:28:06 2008
@@ -21,12 +21,12 @@
 package org.apache.directory.shared.ldap;
 
 
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.Collection;
-
-import java.io.PrintWriter;
-import java.io.PrintStream;
+import java.util.Iterator;
 
 
 /**
@@ -37,7 +37,7 @@
  */
 public class RuntimeMultiException extends RuntimeException
 {
-    static final long serialVersionUID = 8582253398936366771L;
+    private static final long serialVersionUID = 8582253398936366771L;
 
     /** Collection of nested exceptions. */
     private Collection<Throwable> nestedExceptions = new ArrayList<Throwable>();

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java Fri Jun  6 23:28:06 2008
@@ -89,8 +89,8 @@
 
     public String toString()
     {
-    	StringBuilder buf = new StringBuilder();
-    	
+        StringBuilder buf = new StringBuilder();
+        
         // identificationTag
         buf.append( "{ identificationTag \"" );
         buf.append( getIdentificationTag() );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java Fri Jun  6 23:28:06 2008
@@ -126,12 +126,12 @@
          */
         public String toString()
         {
-        	StringBuilder buf = new StringBuilder();
-        	
-        	buf.append( "classes " );
-        	classes.printRefinementToBuffer( buf );
-        	
-        	return buf.toString();
+            StringBuilder buf = new StringBuilder();
+            
+            buf.append( "classes " );
+            classes.printRefinementToBuffer( buf );
+            
+            return buf.toString();
         }
     }
 
@@ -254,8 +254,8 @@
          */
         public String toString()
         {
-        	StringBuilder buf = new StringBuilder();
-        	
+            StringBuilder buf = new StringBuilder();
+            
             buf.append( "{ " );
             boolean isFirst = true;
             
@@ -274,8 +274,8 @@
             }
             
             buf.append( " }" );
-        	
-        	return buf.toString();
+            
+            return buf.toString();
         }
     }
 
@@ -411,8 +411,8 @@
 
         public String toString()
         {
-        	StringBuilder buf = new StringBuilder();
-        	
+            StringBuilder buf = new StringBuilder();
+            
             buf.append( "attributeValue {" );
             
             for ( Iterator<Attribute> it = attributes.iterator(); it.hasNext(); )
@@ -498,23 +498,23 @@
 
         public String toString()
         {
-        	StringBuilder buf = new StringBuilder();
-        	
-        	buf.append( "maxValueCount {" );
+            StringBuilder buf = new StringBuilder();
+            
+            buf.append( "maxValueCount {" );
 
-        	boolean isFirst = true;
-        	
+            boolean isFirst = true;
+            
             for ( MaxValueCountItem item:items )
             {
-            	if ( isFirst )
-            	{
-            		isFirst = false;
-            	}
-            	else
-            	{
-            		buf.append( ", " );
-            	}
-            	
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    buf.append( ", " );
+                }
+                
                 buf.append( item.toString() );
             }
             
@@ -580,7 +580,7 @@
 
         public String toString()
         {
-        	StringBuilder buf = new StringBuilder();
+            StringBuilder buf = new StringBuilder();
             
             buf.append( "rangeOfValues " );
             buf.append( filter.toString() );
@@ -705,23 +705,23 @@
 
         public String toString()
         {
-        	StringBuilder buf = new StringBuilder();
-        	
+            StringBuilder buf = new StringBuilder();
+            
             buf.append( "restrictedBy {" );
 
             boolean isFirst = true;
             
             for ( RestrictedByItem item:items )
             {
-            	if ( isFirst )
-            	{
-            		isFirst = false;
-            	}
-            	else
-            	{
-            		buf.append( ", " );
-            	}
-            	
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    buf.append( ", " );
+                }
+                
                 buf.append( item.toString() );
             }
             

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserFirstACIItem.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserFirstACIItem.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserFirstACIItem.java Fri Jun  6 23:28:06 2008
@@ -89,8 +89,8 @@
 
     public String toString()
     {
-    	StringBuilder buf = new StringBuilder();
-    	
+        StringBuilder buf = new StringBuilder();
+        
         // identificationTag
         buf.append( "{ identificationTag \"" );
         buf.append( getIdentificationTag() );
@@ -116,15 +116,15 @@
         
         for ( UserClass userClass:userClasses )
         {
-        	if ( isFirst )
-        	{
-        		isFirst = false;
-        	}
-        	else
-        	{
-        		buf.append( ", " );
-        	}
-        	
+            if ( isFirst )
+            {
+                isFirst = false;
+            }
+            else
+            {
+                buf.append( ", " );
+            }
+            
             buf.append( userClass.toString() );
         }
 
@@ -137,15 +137,15 @@
         
         for ( UserPermission permission:userPermissions )
         {
-        	if ( isFirst )
-        	{
-        		isFirst = false;
-        	}
-        	else
-        	{
-        		buf.append( ", " );
-        	}
-        	
+            if ( isFirst )
+            {
+                isFirst = false;
+            }
+            else
+            {
+                buf.append( ", " );
+            }
+            
             buf.append( permission.toString() );
         }
         

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserPermission.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserPermission.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserPermission.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserPermission.java Fri Jun  6 23:28:06 2008
@@ -68,8 +68,8 @@
 
     public String toString()
     {
-    	StringBuilder buf = new StringBuilder();
-    	
+        StringBuilder buf = new StringBuilder();
+        
         buf.append( "{ " );
 
         if ( getPrecedence() >= 0 && getPrecedence() <= 255 )
@@ -85,15 +85,15 @@
         
         for ( ProtectedItem item:protectedItems )
         {
-        	if ( isFirst )
-        	{
-        		isFirst = false;
-        	}
-        	else
-        	{
-        		buf.append( ", " );
-        	}
-        	
+            if ( isFirst )
+            {
+                isFirst = false;
+            }
+            else
+            {
+                buf.append( ", " );
+            }
+            
             buf.append( item.toString() );
         }
         
@@ -103,16 +103,16 @@
         
         for ( GrantAndDenial grantAndDenial:getGrantsAndDenials() )
         {
-        	if ( isFirst )
-        	{
-        		isFirst = false;
-        	}
-        	else
-        	{
-        		buf.append( ", " );
-        	}
+            if ( isFirst )
+            {
+                isFirst = false;
+            }
+            else
+            {
+                buf.append( ", " );
+            }
 
-        	buf.append( grantAndDenial.toString() );
+            buf.append( grantAndDenial.toString() );
         }
         
         buf.append( " } }" );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java Fri Jun  6 23:28:06 2008
@@ -36,6 +36,7 @@
  * AssertionValue ::= OCTET STRING
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class AttributeValueAssertion
 {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java Fri Jun  6 23:28:06 2008
@@ -36,6 +36,7 @@
  * A Asn1Object to store a Control.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class Control extends AbstractAsn1Object
 {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ControlDecoder.java Fri Jun  6 23:28:06 2008
@@ -28,6 +28,7 @@
  * An interface for decoders of controls.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public interface ControlDecoder
 {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapConstants.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapConstants.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapConstants.java Fri Jun  6 23:28:06 2008
@@ -22,6 +22,7 @@
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class LdapConstants
 {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java Fri Jun  6 23:28:06 2008
@@ -27,6 +27,7 @@
  * The Ldap decoder.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class LdapDecoder extends Asn1Decoder
 {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java Fri Jun  6 23:28:06 2008
@@ -20,6 +20,12 @@
 package org.apache.directory.shared.ldap.codec;
 
 
+import java.nio.BufferOverflowException;
+import java.nio.ByteBuffer;
+
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.directory.shared.asn1.AbstractAsn1Object;
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -47,18 +53,13 @@
 import org.apache.directory.shared.ldap.codec.search.SearchResultReference;
 import org.apache.directory.shared.ldap.codec.unbind.UnBindRequest;
 
-import java.nio.BufferOverflowException;
-import java.nio.ByteBuffer;
-
-import java.util.ArrayList;
-import java.util.List;
-
 
 /**
  * The main ldapObject : every Ldap Message are encapsulated in it. It contains
  * a message Id, a operation (protocolOp) and one ore more Controls.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class LdapMessage extends AbstractAsn1Object
 {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java Fri Jun  6 23:28:06 2008
@@ -30,6 +30,7 @@
  * ILdapContainer.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class LdapMessageContainer extends AbstractContainer
 {