This is an automated email from the ASF dual-hosted git repository.

jeb pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-filter.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ee5bd1  documentation updates
1ee5bd1 is described below

commit 1ee5bd1ec844b8bc767593640df677275814038b
Author: JE Bailey <[email protected]>
AuthorDate: Wed Aug 8 09:00:24 2018 -0400

    documentation updates
---
 README.md                                          |  46 ++--
 .../resource/filter/ResourceFilterException.java   |   4 +-
 .../filter/impl/script/FilterParserConstants.java  |   2 +-
 .../impl/script/FilterParserTokenManager.java      | 236 ++++++++++-----------
 src/main/javacc/resourceFilter.jj                  |   6 +-
 5 files changed, 146 insertions(+), 148 deletions(-)

diff --git a/README.md b/README.md
index 976e35a..9887c4f 100644
--- a/README.md
+++ b/README.md
@@ -29,28 +29,30 @@
 
 ### Operators
 
-| Name       | Comparison Type | Description                                |
-| ---------  | --------------- | --------------------------------           |
-| and        | NA              | Logical AND                                |
-| &&         | NA              | Logical AND                                |
-| or         | NA              | Logical OR                                 |
-|&#124;&#124;| NA              | Logical OR                                 |
-| ==         | String          | Equal operator for Strings                 |
-| <          | Number         | Less than operator for Numbers             |
-| <=         | Number         | Less than or equal operator for Numbers    |
-| >          | Number         | Greater than operator for Numbers          |
-| >=         | Number         | Greater than or equal operator for Numbers |
-| !=         | String          | Is not equal to for Strings                |
-| less than  | Number         | less than operator for Numbers             |
-| greater than| Number        | greater than operator for Numbers          |
-| is          | String         | Equal operator for Strings                 |
-| is not      | String         | Is not equal operator for Strings          |
-| like        | String - Regex  | Regex match against String                |
-| like not    | String - Regex  | Regex match against String                |
-| contains         | String[] &#124; String[] | String[] contains all of items 
|
-| contains not     | String[] | String[] does not contain all of the items |
-| contains any     | String[] | String[] contains at least one of items |
-| contains not any | String[] | String[] does not contain any of the items |
+| Name        | Comparison Type | Description                                |
+| ---------        | --------------- | --------------------------------        
   |
+| and              | NA              | Logical AND                             
   |
+| &&               | NA              | Logical AND                             
   |
+| or               | NA              | Logical OR                              
   |
+|&#124;&#124;      | NA              | Logical OR                              
   |
+| ==               | String          | Equal operator for Strings              
   |
+| <                | Number          | Less than operator for Numbers          
   |
+| <=               | Number          | Less than or equal operator for Numbers 
   |
+| >                | Number          | Greater than operator for Numbers       
   |
+| >=               | Number          | Greater than or equal operator for 
Numbers |
+| !=               | String          | Is not equal to for Strings             
   |
+| ~=               | String - Regex  | Regex match against String              
   |
+| less than        | Number          | less than operator for Numbers          
   |
+| greater than     | Number          | greater than operator for Numbers       
   |
+| is               | String          | Equal operator for Strings              
   |
+| is not           | String          | Is not equal operator for Strings       
   |
+| like             | String - Regex  | Regex match against String              
   |
+| is like          | String - Regex  | Regex match against String              
   |
+| not like         | String - Regex  | Regex does not match String             
   |
+| contains         | String[]        | String[] contains all of items          
   |
+| contains not     | String[]        | String[] does not contain all of the 
items |
+| contains any     | String[]        | String[] contains at least one of items 
   |
+| contains not any | String[]        | String[] does not contain any of the 
items |
 ### Logical Operators
 The 'and' and 'or' operators are logical operators that string together 
conditions. 'And' operators take precedence. 'Or' operators evaluate from left 
to right
 
diff --git 
a/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java 
b/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java
index 5829f29..99db709 100644
--- 
a/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java
+++ 
b/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java
@@ -19,8 +19,8 @@
 package org.apache.sling.resource.filter;
 
 /**
- * Used to wrap internally generated Parser exceptions when a malformed scipt 
is
- * provided
+ * Used to wrap internally generated Parser exceptions when a malformed script
+ * is provided
  * 
  *
  */
diff --git 
a/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserConstants.java
 
b/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserConstants.java
index 225d4d2..83a4ed0 100644
--- 
a/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserConstants.java
+++ 
b/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserConstants.java
@@ -142,7 +142,7 @@ public interface FilterParserConstants {
     "\"contains not\"",
     "\"contains any\"",
     "\"contains not any\"",
-    "\"in\"",
+    "<IN>",
     "\"not in\"",
     "\"$\"",
     "<FUNCTION_NAME>",
diff --git 
a/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserTokenManager.java
 
b/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserTokenManager.java
index f2060f4..5965356 100644
--- 
a/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserTokenManager.java
+++ 
b/src/main/java/org/apache/sling/resource/filter/impl/script/FilterParserTokenManager.java
@@ -22,11 +22,6 @@ private final int jjStopStringLiteralDfa_0(int pos, long 
active0)
             jjmatchedKind = 32;
             return -1;
          }
-         if ((active0 & 0x10000000000L) != 0L)
-         {
-            jjmatchedKind = 43;
-            return 168;
-         }
          if ((active0 & 0xf000000000L) != 0L)
          {
             jjmatchedKind = 43;
@@ -61,8 +56,6 @@ private final int jjStopStringLiteralDfa_0(int pos, long 
active0)
             jjmatchedPos = 1;
             return 57;
          }
-         if ((active0 & 0x10000000000L) != 0L)
-            return 60;
          if ((active0 & 0x80000000L) != 0L)
          {
             if (jjmatchedPos == 0)
@@ -192,8 +185,6 @@ private int jjMoveStringLiteralDfa0_0()
          return jjMoveStringLiteralDfa1_0(0x80000000L);
       case 99:
          return jjMoveStringLiteralDfa1_0(0xf000000000L);
-      case 105:
-         return jjMoveStringLiteralDfa1_0(0x10000000000L);
       case 110:
          return jjMoveStringLiteralDfa1_0(0x20000800000L);
       default :
@@ -215,10 +206,6 @@ private int jjMoveStringLiteralDfa1_0(long active0)
          else if ((active0 & 0x200000000L) != 0L)
             return jjStopAtPos(1, 33);
          break;
-      case 110:
-         if ((active0 & 0x10000000000L) != 0L)
-            return jjStartNfaWithStates_0(1, 40, 60);
-         break;
       case 111:
          return jjMoveStringLiteralDfa2_0(active0, 0x2f000000000L);
       case 117:
@@ -533,7 +520,7 @@ static final long[] jjbitVec2 = {
 private int jjMoveNfa_0(int startState, int curPos)
 {
    int startsAt = 0;
-   jjnewStateCnt = 193;
+   jjnewStateCnt = 202;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -556,6 +543,23 @@ private int jjMoveNfa_0(int startState, int curPos)
                      kind = 43;
                   jjCheckNAdd(60);
                   break;
+               case 56:
+                  if ((0x8c00846affffffffL & l) != 0L)
+                  {
+                     if (kind > 43)
+                        kind = 43;
+                     jjCheckNAdd(60);
+                  }
+                  else if (curChar == 32)
+                     jjstateSet[jjnewStateCnt++] = 55;
+                  break;
+               case 58:
+                  if ((0x8c00846affffffffL & l) == 0L)
+                     break;
+                  if (kind > 43)
+                     kind = 43;
+                  jjCheckNAdd(60);
+                  break;
                case 0:
                   if ((0x8c00846affffffffL & l) != 0L)
                   {
@@ -594,30 +598,6 @@ private int jjMoveNfa_0(int startState, int curPos)
                   else if (curChar == 38)
                      jjstateSet[jjnewStateCnt++] = 15;
                   break;
-               case 168:
-                  if ((0x8c00846affffffffL & l) == 0L)
-                     break;
-                  if (kind > 43)
-                     kind = 43;
-                  jjCheckNAdd(60);
-                  break;
-               case 56:
-                  if ((0x8c00846affffffffL & l) != 0L)
-                  {
-                     if (kind > 43)
-                        kind = 43;
-                     jjCheckNAdd(60);
-                  }
-                  else if (curChar == 32)
-                     jjstateSet[jjnewStateCnt++] = 55;
-                  break;
-               case 58:
-                  if ((0x8c00846affffffffL & l) == 0L)
-                     break;
-                  if (kind > 43)
-                     kind = 43;
-                  jjCheckNAdd(60);
-                  break;
                case 1:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
@@ -1129,14 +1109,18 @@ private int jjMoveNfa_0(int startState, int curPos)
                   if (curChar == 32)
                      jjstateSet[jjnewStateCnt++] = 171;
                   break;
-               case 179:
+               case 178:
                   if (curChar == 32)
-                     jjstateSet[jjnewStateCnt++] = 178;
+                     jjstateSet[jjnewStateCnt++] = 177;
                   break;
                case 189:
                   if (curChar == 32)
                      jjstateSet[jjnewStateCnt++] = 188;
                   break;
+               case 198:
+                  if (curChar == 32)
+                     jjstateSet[jjnewStateCnt++] = 197;
+                  break;
                default : break;
             }
          } while(i != startsAt);
@@ -1158,6 +1142,24 @@ private int jjMoveNfa_0(int startState, int curPos)
                   if (curChar == 116)
                      jjstateSet[jjnewStateCnt++] = 56;
                   break;
+               case 56:
+               case 60:
+                  if ((0xffffffffd7ffffffL & l) == 0L)
+                     break;
+                  if (kind > 43)
+                     kind = 43;
+                  jjCheckNAdd(60);
+                  break;
+               case 58:
+                  if ((0xffffffffd7ffffffL & l) != 0L)
+                  {
+                     if (kind > 43)
+                        kind = 43;
+                     jjCheckNAdd(60);
+                  }
+                  if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 57;
+                  break;
                case 0:
                   if ((0xffffffffd7ffffffL & l) != 0L)
                   {
@@ -1172,7 +1174,7 @@ private int jjMoveNfa_0(int startState, int curPos)
                   else if (curChar == 108)
                      jjAddStates(70, 72);
                   else if (curChar == 105)
-                     jjAddStates(73, 74);
+                     jjCheckNAddStates(73, 77);
                   else if (curChar == 110)
                      jjstateSet[jjnewStateCnt++] = 58;
                   else if (curChar == 126)
@@ -1190,39 +1192,6 @@ private int jjMoveNfa_0(int startState, int curPos)
                   else if (curChar == 97)
                      jjstateSet[jjnewStateCnt++] = 18;
                   break;
-               case 168:
-                  if ((0xffffffffd7ffffffL & l) != 0L)
-                  {
-                     if (kind > 43)
-                        kind = 43;
-                     jjCheckNAdd(60);
-                  }
-                  if (curChar == 115)
-                     jjstateSet[jjnewStateCnt++] = 172;
-                  if (curChar == 115)
-                  {
-                     if (kind > 28)
-                        kind = 28;
-                  }
-                  break;
-               case 56:
-               case 60:
-                  if ((0xffffffffd7ffffffL & l) == 0L)
-                     break;
-                  if (kind > 43)
-                     kind = 43;
-                  jjCheckNAdd(60);
-                  break;
-               case 58:
-                  if ((0xffffffffd7ffffffL & l) != 0L)
-                  {
-                     if (kind > 43)
-                        kind = 43;
-                     jjCheckNAdd(60);
-                  }
-                  if (curChar == 111)
-                     jjstateSet[jjnewStateCnt++] = 57;
-                  break;
                case 2:
                   if ((0x2000000020L & l) != 0L)
                      jjAddStates(68, 69);
@@ -1406,15 +1375,19 @@ private int jjMoveNfa_0(int startState, int curPos)
                   break;
                case 155:
                   if ((0x2000000020L & l) != 0L)
-                     jjAddStates(75, 76);
+                     jjAddStates(78, 79);
                   break;
                case 161:
                   if ((0x2000000020L & l) != 0L)
-                     jjAddStates(77, 78);
+                     jjAddStates(80, 81);
                   break;
                case 167:
                   if (curChar == 105)
-                     jjAddStates(73, 74);
+                     jjCheckNAddStates(73, 77);
+                  break;
+               case 168:
+                  if (curChar == 115 && kind > 28)
+                     kind = 28;
                   break;
                case 169:
                   if (curChar == 116 && kind > 29)
@@ -1433,73 +1406,102 @@ private int jjMoveNfa_0(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 172;
                   break;
                case 174:
-                  if (curChar == 108)
-                     jjAddStates(70, 72);
+                  if (curChar == 101 && kind > 34)
+                     kind = 34;
                   break;
                case 175:
-                  if (curChar == 110 && kind > 32)
-                     kind = 32;
+               case 193:
+                  if (curChar == 107)
+                     jjCheckNAdd(174);
                   break;
                case 176:
-                  if (curChar == 97)
+                  if (curChar == 105)
                      jjstateSet[jjnewStateCnt++] = 175;
                   break;
                case 177:
-                  if (curChar == 104)
+                  if (curChar == 108)
                      jjstateSet[jjnewStateCnt++] = 176;
                   break;
-               case 178:
-                  if (curChar == 116)
-                     jjstateSet[jjnewStateCnt++] = 177;
+               case 179:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 178;
                   break;
                case 180:
-                  if (curChar == 115)
-                     jjstateSet[jjnewStateCnt++] = 179;
+                  if (curChar == 110 && kind > 40)
+                     kind = 40;
                   break;
                case 181:
-                  if (curChar == 115)
-                     jjstateSet[jjnewStateCnt++] = 180;
+                  if (curChar == 105)
+                     jjCheckNAdd(180);
                   break;
                case 182:
-                  if (curChar == 101)
+                  if (curChar == 95)
                      jjstateSet[jjnewStateCnt++] = 181;
                   break;
                case 183:
-                  if (curChar == 101 && kind > 34)
-                     kind = 34;
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 182;
                   break;
                case 184:
-                  if (curChar == 107)
-                     jjstateSet[jjnewStateCnt++] = 183;
+                  if (curChar == 108)
+                     jjAddStates(70, 72);
                   break;
                case 185:
-                  if (curChar == 105)
-                     jjstateSet[jjnewStateCnt++] = 184;
+                  if (curChar == 110 && kind > 32)
+                     kind = 32;
                   break;
                case 186:
-                  if (curChar == 116 && kind > 35)
-                     kind = 35;
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 185;
                   break;
                case 187:
-                  if (curChar == 111)
+                  if (curChar == 104)
                      jjstateSet[jjnewStateCnt++] = 186;
                   break;
                case 188:
-                  if (curChar == 110)
+                  if (curChar == 116)
                      jjstateSet[jjnewStateCnt++] = 187;
                   break;
                case 190:
-                  if (curChar == 101)
+                  if (curChar == 115)
                      jjstateSet[jjnewStateCnt++] = 189;
                   break;
                case 191:
-                  if (curChar == 107)
+                  if (curChar == 115)
                      jjstateSet[jjnewStateCnt++] = 190;
                   break;
                case 192:
-                  if (curChar == 105)
+                  if (curChar == 101)
                      jjstateSet[jjnewStateCnt++] = 191;
                   break;
+               case 194:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 193;
+                  break;
+               case 195:
+                  if (curChar == 116 && kind > 35)
+                     kind = 35;
+                  break;
+               case 196:
+                  if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 195;
+                  break;
+               case 197:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 196;
+                  break;
+               case 199:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 198;
+                  break;
+               case 200:
+                  if (curChar == 107)
+                     jjstateSet[jjnewStateCnt++] = 199;
+                  break;
+               case 201:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 200;
+                  break;
                default : break;
             }
          } while(i != startsAt);
@@ -1523,28 +1525,21 @@ private int jjMoveNfa_0(int startState, int curPos)
                      kind = 43;
                   jjCheckNAdd(60);
                   break;
-               case 0:
-                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     break;
-                  if (kind > 43)
-                     kind = 43;
-                  jjCheckNAdd(60);
-                  break;
-               case 168:
+               case 56:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 43)
                      kind = 43;
                   jjCheckNAdd(60);
                   break;
-               case 56:
+               case 58:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 43)
                      kind = 43;
                   jjCheckNAdd(60);
                   break;
-               case 58:
+               case 0:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 43)
@@ -1577,7 +1572,7 @@ private int jjMoveNfa_0(int startState, int curPos)
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 193 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 202 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
@@ -1588,7 +1583,8 @@ static final int[] jjnextStates = {
    103, 133, 150, 151, 154, 158, 164, 11, 13, 14, 6, 8, 9, 62, 64, 65, 
    72, 73, 74, 100, 70, 72, 100, 101, 68, 70, 101, 102, 108, 109, 110, 130, 
    106, 108, 130, 131, 104, 106, 131, 132, 138, 139, 140, 147, 136, 138, 147, 
148, 
-   134, 136, 148, 149, 3, 4, 182, 185, 192, 168, 173, 156, 157, 162, 163, 
+   134, 136, 148, 149, 3, 4, 192, 194, 201, 168, 173, 179, 183, 180, 156, 157, 
+   162, 163, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, 
long l2)
 {
@@ -1609,7 +1605,7 @@ public static final String[] jjstrLiteralImages = {
 null, null, null, null, null, null, null, null, null, null, 
"\156\165\154\154", 
 "\50", "\51", "\54", null, null, null, null, "\76\75", null, "\74\75", null, 
null, 
 "\143\157\156\164\141\151\156\163", 
"\143\157\156\164\141\151\156\163\40\156\157\164", 
-"\143\157\156\164\141\151\156\163\40\141\156\171", 
"\143\157\156\164\141\151\156\163\40\156\157\164\40\141\156\171", "\151\156", 
+"\143\157\156\164\141\151\156\163\40\141\156\171", 
"\143\157\156\164\141\151\156\163\40\156\157\164\40\141\156\171", null, 
 "\156\157\164\40\151\156", "\44", null, null, null, };
 
 /** Lexer state names. */
@@ -1623,8 +1619,8 @@ static final long[] jjtoSkip = {
    0x6L, 
 };
 protected SimpleCharStream input_stream;
-private final int[] jjrounds = new int[193];
-private final int[] jjstateSet = new int[386];
+private final int[] jjrounds = new int[202];
+private final int[] jjstateSet = new int[404];
 private final StringBuilder jjimage = new StringBuilder();
 private StringBuilder image = jjimage;
 private int jjimageLen;
@@ -1655,7 +1651,7 @@ private void ReInitRounds()
 {
    int i;
    jjround = 0x80000001;
-   for (i = 193; i-- > 0;)
+   for (i = 202; i-- > 0;)
       jjrounds[i] = 0x80000000;
 }
 
diff --git a/src/main/javacc/resourceFilter.jj 
b/src/main/javacc/resourceFilter.jj
index c1c1cd7..3570900 100644
--- a/src/main/javacc/resourceFilter.jj
+++ b/src/main/javacc/resourceFilter.jj
@@ -96,13 +96,13 @@ TOKEN :
 | < GREATER_THAN_OR_EQUAL : ">=" >
 | < LESS_THAN : "<" | "less than" >
 | < LESS_THAN_OR_EQUAL : "<=" >
-| < LIKE : "~=" | "like" >
-| < LIKE_NOT : "like not" | "not like" >
+| < LIKE : "~=" | "like" | "is like" >
+| < LIKE_NOT : "not like" >
 | < CONTAINS : "contains" >
 | < CONTAINS_NOT : "contains not" >
 | < CONTAINS_ANY : "contains any" >
 | < CONTAINS_NOT_ANY : "contains not any" >
-| < IN : "in" >
+| < IN : "is in" | "in" >
 | < NOT_IN : "not in" >
 | < DYNAMIC_ARG : "$" >
 | < FUNCTION_NAME : (~[ "\"", "'", "$", "(", ")", ",", "=", "<", ">", " ", 
"[", "]","+","-",".","0"-"9" ])+ >

Reply via email to