directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1696172 - /directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/OpenLdapAclParser.java
Date Sun, 16 Aug 2015 22:17:52 GMT
Author: elecharny
Date: Sun Aug 16 22:17:52 2015
New Revision: 1696172

URL: http://svn.apache.org/r1696172
Log:
Added the parsed grammar in the header

Modified:
    directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/OpenLdapAclParser.java

Modified: directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/OpenLdapAclParser.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/OpenLdapAclParser.java?rev=1696172&r1=1696171&r2=1696172&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/OpenLdapAclParser.java
(original)
+++ directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/OpenLdapAclParser.java
Sun Aug 16 22:17:52 2015
@@ -30,7 +30,45 @@ import antlr.TokenStreamException;
 
 
 /**
- * A reusable wrapper around the antlr generated parser for an OpenLDAP ACL.
+ * A reusable wrapper around the antlr generated parser for an OpenLDAP ACL. The grammar

+ * to parse is the following :
+ * <pre>
+ * parse                ::= SP* aclItem SP* EOF
+ * aclItem              ::= ( ID_access SP+ )? ID_to ( SP+ (what_star | what_dn | what_attrs
| what_filter | ( ID_by SP+ who ) ) )+ 
+ * what_star            ::= STAR
+ * what_dn              ::= ID_dn ( DOT what_dn_type )? SP+ EQUAL SP+ DOUBLE_QUOTED_STRING
+ * what_dn_type         ::= ID_regex | ID_base | ID_exact | ID_one | ID_subtree | ID_children
+ * what_attrs           ::= ( ID_attrs | ID_attr ) SP* EQUAL SP* ATTR_IDENT ( SEP ATTR_IDENT
)* 
+ *                              ( SP* VAL ( SLASH MATCHING_RULE )? ( DOT what_attrs_style)?
) SP* EQUAL SP* DOUBLE_QUOTED_STRING )?
+ * what_attrs_attr_ident::= ATTR_IDENT
+ * what_attrs_style     ::= EXACT | BASE | BASE_OBJECT | REGEX | ONE | ONE_LEVEL | SUB |
SUB_TREE | CHILDREN
+ * what_filter          ::= ID_filter SP* EQUAL SP* FILTER
+ * who                  ::= ( who_star | who_anonymous | who_users | who_self | who_dn |
who_dnattr | who_group | who_ssf | 
+ *                              who_transport_ssf | who_tls_ssf | who_sasl_ssf ) ( SP+ who_access_level
)? ( SP+  who_control )?
+ * who_anonymous        ::= ID_anonymous
+ * who_users            ::= ID_users
+ * who_self             ::= ID_self
+ * who_star             ::= STAR
+ * who_dnattr           ::= ID_dnattr SP* EQUAL SP* ATTR_IDENT
+ * who_group            ::= ID_group ( SLASH ATTR_IDENT ( SLASH ATTR_IDENT )? )? ( DOT who_group_type
)? 
+ *                              EQUAL DOUBLE_QUOTED_STRING
+ * who_group_type       ::= ID_exact | ID_expand
+ * who_dn               ::= ID_dn ( DOT who_dn_type ( SEP who_dn_modifier )? )? SP* EQUAL
SP* DOUBLE_QUOTED_STRING
+ * who_dn_type          ::= ID_regex | ID_base | ID_exact | ID_one | ID_subtree | ID_children
| 
+ *                              ID_level OPEN_CURLY token:INTEGER CLOSE_CURLY
+ * who_dn_modifier      ::= ID_expand
+ * who_access_level     ::= ID_self SP+ ( who_access_level_level | who_access_level_priv
)? | 
+ *                              ( who_access_level_level | who_access_level_priv )?
+ * who_access_level_level           ::= ID_manage | ID_write | ID_read | ID_search | ID_compare
| ID_auth | ID_disclose | ID_none
+ * who_access_level_priv            ::= who_access_level_priv_modifier ( who_access_level_priv_priv
)+
+ * who_access_level_priv_modifier   ::= EQUAL | PLUS | MINUS
+ * who_access_level_priv_priv       ::= ID_m | ID_w | ID_r | ID_s | ID_c | ID_x
+ * who_control          ::= ID_stop | ID_continue | ID_break
+ * who_ssf              ::= strength:SSF
+ * who_transport_ssf    ::= TRANSPORT_SSF
+ * who_tls_ssf          ::= strength:TLS_SSF
+ * who_sasl_ssf         ::= strength:SASL_SSF
+ * </pre>
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -56,11 +94,9 @@ public class OpenLdapAclParser
     /**
      * Parses an OpenLDAP ACL.
      * 
-     * @param s
-     *            the string to be parsed
+     * @param s the string to be parsed
      * @return the specification bean
-     * @throws ParseException
-     *             if there are any recognition errors (bad syntax)
+     * @throws ParseException if there are any recognition errors (bad syntax)
      */
     public synchronized AclItem parse( String s ) throws ParseException
     {
@@ -71,6 +107,7 @@ public class OpenLdapAclParser
             this.parser.getInputState().reset();
 
             parser.parse();
+            
             return parser.getAclItem();
         }
         catch ( TokenStreamException e )



Mime
View raw message