directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r496126 - /directory/trunks/shared/convert/src/main/antlr/schema.g
Date Sun, 14 Jan 2007 20:08:39 GMT
Author: elecharny
Date: Sun Jan 14 12:08:39 2007
New Revision: 496126

URL: http://svn.apache.org/viewvc?view=rev&rev=496126
Log:
Fixed the grammar for Schema2Ldif

Modified:
    directory/trunks/shared/convert/src/main/antlr/schema.g

Modified: directory/trunks/shared/convert/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/trunks/shared/convert/src/main/antlr/schema.g?view=diff&rev=496126&r1=496125&r2=496126
==============================================================================
--- directory/trunks/shared/convert/src/main/antlr/schema.g (original)
+++ directory/trunks/shared/convert/src/main/antlr/schema.g Sun Jan 14 12:08:39 2007
@@ -99,6 +99,11 @@
         ( 'a' .. 'z') ( 'a' .. 'z' | '0' .. '9' | '-' | ';' )*
     ;
 
+//XSTRING 
+//	: 
+//		"x-" ( 'a' .. 'z' ) ( 'a' .. 'z' | '-' | '_' )*
+//	;
+
 DESC
     :
         "desc" WS QUOTE ( ~'\'' )+ QUOTE
@@ -118,9 +123,6 @@
 
 
 {
-	
-    public static final String[] EMPTY = new String[0];
-
     private List<SchemaElement> schemaElements = new ArrayList<SchemaElement>();
 
     // ------------------------------------------------------------------------
@@ -176,6 +178,7 @@
     )?
     ( must[objectClass] )?
     ( may[objectClass] )?
+    // @TODO : add ( extension[type] )*
     CLOSE_PAREN
     {
         schemaElements.add( objectClass );
@@ -185,33 +188,33 @@
 
 may [ObjectClassHolder objectClass]
 {
-    ArrayList list = null;
+    List<String> list = null;
 }
     : "MAY" list=woidlist
     {
-        objectClass.setMay( ( String[] ) list.toArray( EMPTY ) );
+        objectClass.setMay( list );
     }
     ;
 
 
 must [ObjectClassHolder objectClass]
 {
-    ArrayList list = null;
+    List<String> list = null;
 }
     : "MUST" list=woidlist
     {
-        objectClass.setMust( ( String[] ) list.toArray( EMPTY ) );
+        objectClass.setMust( list );
     }
     ;
 
 
 objectClassSuperiors [ObjectClassHolder objectClass]
 {
-    ArrayList list = null;
+    List<String> list = null;
 }
     : "SUP" list=woidlist
     {
-        objectClass.setSuperiors( ( String[] ) list.toArray( EMPTY ) );
+        objectClass.setSuperiors( list );
     }
     ;
 
@@ -235,9 +238,9 @@
     ;
 
 
-woidlist returns [ArrayList list]
+woidlist returns [List<String> list]
 {
-    list = new ArrayList( 2 );
+    list = new ArrayList<String>( 2 );
     String oid = null;
 }
     :
@@ -284,7 +287,7 @@
 
 objectClassNames [ObjectClassHolder objectClass]
 {
-    ArrayList list = new ArrayList();
+    List<String> list = new ArrayList<String>();
 }
     :
     (
@@ -337,6 +340,7 @@
         ( "COLLECTIVE" { type.setCollective( true ); } )?
         ( "NO-USER-MODIFICATION" { type.setNoUserModification( true ); } )?
         ( usage[type] )?
+        // @TODO : add ( extension[type] )*
 
     CLOSE_PAREN
     {
@@ -438,7 +442,7 @@
 
 names [AttributeTypeHolder type]
 {
-    ArrayList list = new ArrayList();
+    List<String> list = new ArrayList<String>();
 }
     :
         "NAME"
@@ -479,7 +483,7 @@
         String length = comps[1].substring( index + 1, comps[1].length() - 1 );
 
         type.setSyntax( oid );
-        type.setLength( Integer.parseInt( length ) );
+        type.setOidLen( Integer.parseInt( length ) );
     }
     ;
 



Mime
View raw message