directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r267440 - /directory/shared/ldap/branches/new-codec-integration/common/src/antlr/subtree-specification.g
Date Sat, 03 Sep 2005 09:07:24 GMT
Author: elecharny
Date: Sat Sep  3 02:07:19 2005
New Revision: 267440

URL: http://svn.apache.org/viewcvs?rev=267440&view=rev
Log:
Backporting trunk modifications to the branch

Modified:
    directory/shared/ldap/branches/new-codec-integration/common/src/antlr/subtree-specification.g

Modified: directory/shared/ldap/branches/new-codec-integration/common/src/antlr/subtree-specification.g
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/common/src/antlr/subtree-specification.g?rev=267440&r1=267439&r2=267440&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/common/src/antlr/subtree-specification.g
(original)
+++ directory/shared/ldap/branches/new-codec-integration/common/src/antlr/subtree-specification.g
Sat Sep  3 02:07:19 2005
@@ -1,7 +1,7 @@
 header
 {
 /*
- *   Copyright 2004 The Apache Software Foundation
+ *   Copyright 2005 The Apache Software Foundation
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@
 
 options
 {
-    k = 3;
+    k = 2;
 
     defaultErrorHandler = false;
 }
@@ -76,6 +76,8 @@
     private static final Logger log = LoggerFactory.getLogger( AntlrSubtreeSpecificationParser.class
);
     private DnParser dnParser;
     
+    private boolean matchedAnyComponentYet = false;
+    
     private boolean isNormalizing = false;
     NameComponentNormalizer normalizer;
     
@@ -150,25 +152,76 @@
     ss = null;
     ssModifier = new SubtreeSpecificationModifier();
 } :
-    LBRACKET
-        ( SP ss_base )?
-        ( SEP SP ss_specificExclusions )?
-        ( SEP SP ss_minimum )?
-        ( SEP SP ss_maximum )?
-        ( SEP SP ss_specificationFilter )?
-    SP RBRACKET
+    LBRACKET ( SP )*
+        (
+            (
+              ss_base ss_base_follower
+            | ss_specificExclusions ss_specificExclusions_follower
+            | ss_minimum ss_minimum_follower
+            | ss_maximum ss_maximum_follower
+            | ss_specificationFilter
+            )
+            ( SP )*
+        )?
+    RBRACKET
     {
         ss = ssModifier.getSubtreeSpecification();
     }
     ;
 
+    
+ss_base_follower
+    :
+    ( SEP ( SP )*
+        (
+            ss_specificExclusions ss_specificExclusions_follower
+            | ss_minimum ss_minimum_follower
+            | ss_maximum ss_maximum_follower
+            | ss_specificationFilter
+        )
+    )?
+    ;
+
+    
+ss_specificExclusions_follower
+    :
+    ( SEP ( SP )*
+        (
+            ss_minimum ss_minimum_follower
+            | ss_maximum ss_maximum_follower
+            | ss_specificationFilter
+        )
+    )?
+    ;
+
+    
+ss_minimum_follower
+    :
+    ( SEP ( SP )*
+        (
+            ss_maximum ss_maximum_follower
+            | ss_specificationFilter
+        )
+    )?
+    ;
+
+    
+ss_maximum_follower
+    :
+    ( SEP ( SP )*
+        (
+            ss_specificationFilter
+        )
+    )?
+    ;
+
 
 ss_base
 {
     log.debug( "entered ss_base()" );
     Name base = null;
 } :
-    "base" (SP)+ base=localName
+    "base" ( SP )+ base=localName
     {
         ssModifier.setBase( base );
     }
@@ -192,8 +245,8 @@
     log.debug( "entered specificExclusions()" );
 } :
     LBRACKET
-        ( SP specificExclusion
-            (SEP SP specificExclusion)*
+        ( ( SP )* specificExclusion
+            ( SEP ( SP )* specificExclusion )*
         )?
     SP RBRACKET
     ;
@@ -260,10 +313,10 @@
     log.debug( "entered ss_specificationFilter()" );
     ExprNode theRefinement = null;
 }:
-    ( "specificationFilter" ( SP )+ theRefinement=refinement
+    "specificationFilter" ( SP )+ theRefinement=refinement
     {
         ssModifier.setRefinement( theRefinement );
-    } )?
+    }
     ;
 
 
@@ -386,11 +439,11 @@
         {
             tempChildren.add( child );
         }
-        ( SEP SP child=refinement
+        ( SEP ( SP )* child=refinement
         {
             tempChildren.add( child );
         } )*
-    )? SP RBRACKET
+    )? ( SP )* RBRACKET
     {
         children = tempChildren;
     }
@@ -417,7 +470,7 @@
 
 options
 {
-    k = 3;
+    k = 2;
 
     charVocabulary = '\u0001'..'\u0127';
 
@@ -438,7 +491,7 @@
 // attribute description lexer rules from models
 // ----------------------------------------------------------------------------
 
-SP : ' ' ;
+SP : ' ';
 
 COLON : ':' { log.debug( "matched COLON(':')" ); } ;
 



Mime
View raw message