qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [3/3] qpid-jms git commit: add the generated selector parse, make the generation an optional step via a profile which generates in-place
Date Tue, 03 Mar 2015 14:59:52 GMT
add the generated selector parse, make the generation an optional step via a profile which generates in-place


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/d1f0b32b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/d1f0b32b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/d1f0b32b

Branch: refs/heads/master
Commit: d1f0b32ba63033641796da37021510a6cef1a312
Parents: ca69a07
Author: Robert Gemmell <robbie@apache.org>
Authored: Tue Mar 3 14:54:06 2015 +0000
Committer: Robert Gemmell <robbie@apache.org>
Committed: Tue Mar 3 14:54:06 2015 +0000

----------------------------------------------------------------------
 qpid-jms-client/pom.xml                         |   96 +-
 .../jms/selector/parser/ParseException.java     |  204 +++
 .../jms/selector/parser/SelectorParserImpl.java | 1193 ++++++++++++++++++
 .../parser/SelectorParserImplConstants.java     |  121 ++
 .../parser/SelectorParserImplTokenManager.java  | 1055 ++++++++++++++++
 .../jms/selector/parser/SimpleCharStream.java   |  488 +++++++
 .../apache/qpid/jms/selector/parser/Token.java  |  148 +++
 .../qpid/jms/selector/parser/TokenMgrError.java |  164 +++
 .../src/main/javacc/SelectorParserImpl.jj       |    1 +
 9 files changed, 3400 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d1f0b32b/qpid-jms-client/pom.xml
----------------------------------------------------------------------
diff --git a/qpid-jms-client/pom.xml b/qpid-jms-client/pom.xml
index 39e2c39..fc1a45e 100644
--- a/qpid-jms-client/pom.xml
+++ b/qpid-jms-client/pom.xml
@@ -90,76 +90,6 @@
         </includes>
       </resource>
     </resources>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>javacc-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>generate-sources</phase>
-            <configuration>
-              <sourceDirectory>${basedir}/src/main/javacc</sourceDirectory>
-              <outputDirectory>${basedir}/target/generated-sources/javacc</outputDirectory>
-            </configuration>
-            <goals>
-              <goal>javacc</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>add-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>${basedir}/target/generated-sources/javacc</source>
-              </sources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-    <pluginManagement>
-      <plugins>
-        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence
-          on the Maven build itself. -->
-        <plugin>
-          <groupId>org.eclipse.m2e</groupId>
-          <artifactId>lifecycle-mapping</artifactId>
-          <version>1.0.0</version>
-          <configuration>
-            <lifecycleMappingMetadata>
-              <pluginExecutions>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>
-                      javacc-maven-plugin
-                    </artifactId>
-                    <versionRange>[2.6,)</versionRange>
-                    <goals>
-                      <goal>javacc</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <execute>
-                      <runOnIncremental>true</runOnIncremental>
-                    </execute>
-                  </action>
-                </pluginExecution>
-              </pluginExecutions>
-            </lifecycleMappingMetadata>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
   </build>
 
   <reporting>
@@ -176,4 +106,30 @@
     </plugins>
   </reporting>
 
+  <profiles>
+    <profile>
+      <id>generate-selector-parser</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>javacc-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>generate-selector-parser</id>
+                <phase>generate-sources</phase>
+                <goals>
+                  <goal>javacc</goal>
+                </goals>
+                <configuration>
+                  <sourceDirectory>${basedir}/src/main/javacc</sourceDirectory>
+                  <outputDirectory>${basedir}/src/main/java/org/apache/qpid/jms/selector/parser</outputDirectory>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d1f0b32b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/ParseException.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/ParseException.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/ParseException.java
new file mode 100644
index 0000000..3f98bb7
--- /dev/null
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/ParseException.java
@@ -0,0 +1,204 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
+/* JavaCCOptions:KEEP_LINE_COL=null */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.qpid.jms.selector.parser;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+  /**
+   * The version identifier for this Serializable class.
+   * Increment only if the <i>serialized</i> form of the
+   * class changes.
+   */
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * This constructor is used by the method "generateParseException"
+   * in the generated parser.  Calling this constructor generates
+   * a new object of this type with the fields "currentToken",
+   * "expectedTokenSequences", and "tokenImage" set.
+   */
+  public ParseException(Token currentTokenVal,
+                        int[][] expectedTokenSequencesVal,
+                        String[] tokenImageVal
+                       )
+  {
+    super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
+    currentToken = currentTokenVal;
+    expectedTokenSequences = expectedTokenSequencesVal;
+    tokenImage = tokenImageVal;
+  }
+
+  /**
+   * The following constructors are for use by you for whatever
+   * purpose you can think of.  Constructing the exception in this
+   * manner makes the exception behave in the normal way - i.e., as
+   * documented in the class "Throwable".  The fields "errorToken",
+   * "expectedTokenSequences", and "tokenImage" do not contain
+   * relevant information.  The JavaCC generated code does not use
+   * these constructors.
+   */
+
+  public ParseException() {
+    super();
+  }
+
+  /** Constructor with message. */
+  public ParseException(String message) {
+    super(message);
+  }
+
+
+  /**
+   * This is the last token that has been consumed successfully.  If
+   * this object has been created due to a parse error, the token
+   * followng this token will (therefore) be the first error token.
+   */
+  public Token currentToken;
+
+  /**
+   * Each entry in this array is an array of integers.  Each array
+   * of integers represents a sequence of tokens (by their ordinal
+   * values) that is expected at this point of the parse.
+   */
+  public int[][] expectedTokenSequences;
+
+  /**
+   * This is a reference to the "tokenImage" array of the generated
+   * parser within which the parse error occurred.  This array is
+   * defined in the generated ...Constants interface.
+   */
+  public String[] tokenImage;
+
+  /**
+   * It uses "currentToken" and "expectedTokenSequences" to generate a parse
+   * error message and returns it.  If this object has been created
+   * due to a parse error, and you do not catch it (it gets thrown
+   * from the parser) the correct error message
+   * gets displayed.
+   */
+  private static String initialise(Token currentToken,
+                           int[][] expectedTokenSequences,
+                           String[] tokenImage) {
+    String eol = System.getProperty("line.separator", "\n");
+    StringBuffer expected = new StringBuffer();
+    int maxSize = 0;
+    for (int i = 0; i < expectedTokenSequences.length; i++) {
+      if (maxSize < expectedTokenSequences[i].length) {
+        maxSize = expectedTokenSequences[i].length;
+      }
+      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+        expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
+      }
+      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+        expected.append("...");
+      }
+      expected.append(eol).append("    ");
+    }
+    String retval = "Encountered \"";
+    Token tok = currentToken.next;
+    for (int i = 0; i < maxSize; i++) {
+      if (i != 0) retval += " ";
+      if (tok.kind == 0) {
+        retval += tokenImage[0];
+        break;
+      }
+      retval += " " + tokenImage[tok.kind];
+      retval += " \"";
+      retval += add_escapes(tok.image);
+      retval += " \"";
+      tok = tok.next;
+    }
+    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+    retval += "." + eol;
+    if (expectedTokenSequences.length == 1) {
+      retval += "Was expecting:" + eol + "    ";
+    } else {
+      retval += "Was expecting one of:" + eol + "    ";
+    }
+    retval += expected.toString();
+    return retval;
+  }
+
+  /**
+   * The end of line string for this machine.
+   */
+  protected String eol = System.getProperty("line.separator", "\n");
+
+  /**
+   * Used to convert raw characters to their escaped version
+   * when these raw version cannot be used as part of an ASCII
+   * string literal.
+   */
+  static String add_escapes(String str) {
+      StringBuffer retval = new StringBuffer();
+      char ch;
+      for (int i = 0; i < str.length(); i++) {
+        switch (str.charAt(i))
+        {
+           case 0 :
+              continue;
+           case '\b':
+              retval.append("\\b");
+              continue;
+           case '\t':
+              retval.append("\\t");
+              continue;
+           case '\n':
+              retval.append("\\n");
+              continue;
+           case '\f':
+              retval.append("\\f");
+              continue;
+           case '\r':
+              retval.append("\\r");
+              continue;
+           case '\"':
+              retval.append("\\\"");
+              continue;
+           case '\'':
+              retval.append("\\\'");
+              continue;
+           case '\\':
+              retval.append("\\\\");
+              continue;
+           default:
+              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                 String s = "0000" + Integer.toString(ch, 16);
+                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+              } else {
+                 retval.append(ch);
+              }
+              continue;
+        }
+      }
+      return retval.toString();
+   }
+
+}
+/* JavaCC - OriginalChecksum=3eff901bcee074270b0e9dedf1a477ea (do not edit this line) */

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d1f0b32b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImpl.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImpl.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImpl.java
new file mode 100644
index 0000000..af38b38
--- /dev/null
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImpl.java
@@ -0,0 +1,1193 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParserImpl.java */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.qpid.jms.selector.parser;
+
+import java.io.*;
+import java.util.*;
+
+import org.apache.qpid.jms.selector.filter.*;
+
+/**
+ * JMS Selector Parser generated by JavaCC
+ *
+ * Do not edit this .java file directly - it is generated from SelectorParserImpl.jj
+ * Edit SelectorParserImpl.jj and rebuild with the 'generate-selector-parser' profile.
+ */
+public class SelectorParserImpl implements SelectorParserImplConstants {
+    private BooleanExpression asBooleanExpression(Expression value) throws ParseException  {
+        if (value instanceof BooleanExpression) {
+            return (BooleanExpression) value;
+        }
+        if (value instanceof PropertyExpression) {
+            return UnaryExpression.createBooleanCast( value );
+        }
+        throw new ParseException("Expression will not result in a boolean value: " + value);
+    }
+
+// ----------------------------------------------------------------------------
+// Grammer
+// ----------------------------------------------------------------------------
+  final public BooleanExpression JmsSelector() throws ParseException {
+    Expression left=null;
+    left = orExpression();
+        {if (true) return asBooleanExpression(left);}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression orExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = andExpression();
+    label_1:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case OR:
+        ;
+        break;
+      default:
+        break label_1;
+      }
+      jj_consume_token(OR);
+      right = andExpression();
+                left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression andExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = equalityExpression();
+    label_2:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case AND:
+        ;
+        break;
+      default:
+        break label_2;
+      }
+      jj_consume_token(AND);
+      right = equalityExpression();
+                left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression equalityExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = comparisonExpression();
+    label_3:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case IS:
+      case 27:
+      case 28:
+        ;
+        break;
+      default:
+        break label_3;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 27:
+        jj_consume_token(27);
+        right = comparisonExpression();
+                left = ComparisonExpression.createEqual(left, right);
+        break;
+      case 28:
+        jj_consume_token(28);
+        right = comparisonExpression();
+                left = ComparisonExpression.createNotEqual(left, right);
+        break;
+      default:
+        if (jj_2_1(2)) {
+          jj_consume_token(IS);
+          jj_consume_token(NULL);
+                left = ComparisonExpression.createIsNull(left);
+        } else {
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case IS:
+            jj_consume_token(IS);
+            jj_consume_token(NOT);
+            jj_consume_token(NULL);
+                left = ComparisonExpression.createIsNotNull(left);
+            break;
+          default:
+            jj_consume_token(-1);
+            throw new ParseException();
+          }
+        }
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression comparisonExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    Expression low;
+    Expression high;
+    String t, u;
+    boolean not;
+    ArrayList list;
+    left = addExpression();
+    label_4:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NOT:
+      case BETWEEN:
+      case LIKE:
+      case IN:
+      case 29:
+      case 30:
+      case 31:
+      case 32:
+        ;
+        break;
+      default:
+        break label_4;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 29:
+        jj_consume_token(29);
+        right = addExpression();
+                    left = ComparisonExpression.createGreaterThan(left, right);
+        break;
+      case 30:
+        jj_consume_token(30);
+        right = addExpression();
+                    left = ComparisonExpression.createGreaterThanEqual(left, right);
+        break;
+      case 31:
+        jj_consume_token(31);
+        right = addExpression();
+                    left = ComparisonExpression.createLessThan(left, right);
+        break;
+      case 32:
+        jj_consume_token(32);
+        right = addExpression();
+                    left = ComparisonExpression.createLessThanEqual(left, right);
+        break;
+      case LIKE:
+                    u=null;
+        jj_consume_token(LIKE);
+        t = stringLitteral();
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case ESCAPE:
+          jj_consume_token(ESCAPE);
+          u = stringLitteral();
+          break;
+        default:
+          ;
+        }
+                    left = ComparisonExpression.createLike(left, t, u);
+        break;
+      default:
+        if (jj_2_2(2)) {
+                    u=null;
+          jj_consume_token(NOT);
+          jj_consume_token(LIKE);
+          t = stringLitteral();
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case ESCAPE:
+            jj_consume_token(ESCAPE);
+            u = stringLitteral();
+            break;
+          default:
+            ;
+          }
+                    left = ComparisonExpression.createNotLike(left, t, u);
+        } else {
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case BETWEEN:
+            jj_consume_token(BETWEEN);
+            low = addExpression();
+            jj_consume_token(AND);
+            high = addExpression();
+                    left = ComparisonExpression.createBetween(left, low, high);
+            break;
+          default:
+            if (jj_2_3(2)) {
+              jj_consume_token(NOT);
+              jj_consume_token(BETWEEN);
+              low = addExpression();
+              jj_consume_token(AND);
+              high = addExpression();
+                    left = ComparisonExpression.createNotBetween(left, low, high);
+            } else {
+              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+              case IN:
+                jj_consume_token(IN);
+                jj_consume_token(33);
+                t = stringLitteral();
+                        list = new ArrayList();
+                        list.add( t );
+                label_5:
+                while (true) {
+                  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+                  case 34:
+                    ;
+                    break;
+                  default:
+                    break label_5;
+                  }
+                  jj_consume_token(34);
+                  t = stringLitteral();
+                            list.add( t );
+                }
+                jj_consume_token(35);
+                   left = ComparisonExpression.createInFilter(left, list);
+                break;
+              default:
+                if (jj_2_4(2)) {
+                  jj_consume_token(NOT);
+                  jj_consume_token(IN);
+                  jj_consume_token(33);
+                  t = stringLitteral();
+                        list = new ArrayList();
+                        list.add( t );
+                  label_6:
+                  while (true) {
+                    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+                    case 34:
+                      ;
+                      break;
+                    default:
+                      break label_6;
+                    }
+                    jj_consume_token(34);
+                    t = stringLitteral();
+                            list.add( t );
+                  }
+                  jj_consume_token(35);
+                   left = ComparisonExpression.createNotInFilter(left, list);
+                } else {
+                  jj_consume_token(-1);
+                  throw new ParseException();
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression addExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = multExpr();
+    label_7:
+    while (true) {
+      if (jj_2_5(2147483647)) {
+        ;
+      } else {
+        break label_7;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 36:
+        jj_consume_token(36);
+        right = multExpr();
+                left = ArithmeticExpression.createPlus(left, right);
+        break;
+      case 37:
+        jj_consume_token(37);
+        right = multExpr();
+                left = ArithmeticExpression.createMinus(left, right);
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression multExpr() throws ParseException {
+    Expression left;
+    Expression right;
+    left = unaryExpr();
+    label_8:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 38:
+      case 39:
+      case 40:
+        ;
+        break;
+      default:
+        break label_8;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 38:
+        jj_consume_token(38);
+        right = unaryExpr();
+            left = ArithmeticExpression.createMultiply(left, right);
+        break;
+      case 39:
+        jj_consume_token(39);
+        right = unaryExpr();
+            left = ArithmeticExpression.createDivide(left, right);
+        break;
+      case 40:
+        jj_consume_token(40);
+        right = unaryExpr();
+            left = ArithmeticExpression.createMod(left, right);
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression unaryExpr() throws ParseException {
+    String s=null;
+    Expression left=null;
+    if (jj_2_6(2147483647)) {
+      jj_consume_token(36);
+      left = unaryExpr();
+    } else {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 37:
+        jj_consume_token(37);
+        left = unaryExpr();
+            left = UnaryExpression.createNegate(left);
+        break;
+      case NOT:
+        jj_consume_token(NOT);
+        left = unaryExpr();
+            left = UnaryExpression.createNOT( asBooleanExpression(left) );
+        break;
+      case TRUE:
+      case FALSE:
+      case NULL:
+      case DECIMAL_LITERAL:
+      case HEX_LITERAL:
+      case OCTAL_LITERAL:
+      case FLOATING_POINT_LITERAL:
+      case STRING_LITERAL:
+      case ID:
+      case QUOTED_ID:
+      case 33:
+        left = primaryExpr();
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression primaryExpr() throws ParseException {
+    Expression left=null;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case TRUE:
+    case FALSE:
+    case NULL:
+    case DECIMAL_LITERAL:
+    case HEX_LITERAL:
+    case OCTAL_LITERAL:
+    case FLOATING_POINT_LITERAL:
+    case STRING_LITERAL:
+      left = literal();
+      break;
+    case ID:
+    case QUOTED_ID:
+      left = variable();
+      break;
+    case 33:
+      jj_consume_token(33);
+      left = orExpression();
+      jj_consume_token(35);
+      break;
+    default:
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public ConstantExpression literal() throws ParseException {
+    Token t;
+    String s;
+    ConstantExpression left=null;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case STRING_LITERAL:
+      s = stringLitteral();
+                left = new ConstantExpression(s);
+      break;
+    case DECIMAL_LITERAL:
+      t = jj_consume_token(DECIMAL_LITERAL);
+                left = ConstantExpression.createFromDecimal(t.image);
+      break;
+    case HEX_LITERAL:
+      t = jj_consume_token(HEX_LITERAL);
+                left = ConstantExpression.createFromHex(t.image);
+      break;
+    case OCTAL_LITERAL:
+      t = jj_consume_token(OCTAL_LITERAL);
+                left = ConstantExpression.createFromOctal(t.image);
+      break;
+    case FLOATING_POINT_LITERAL:
+      t = jj_consume_token(FLOATING_POINT_LITERAL);
+                left = ConstantExpression.createFloat(t.image);
+      break;
+    case TRUE:
+      jj_consume_token(TRUE);
+                left = ConstantExpression.TRUE;
+      break;
+    case FALSE:
+      jj_consume_token(FALSE);
+                left = ConstantExpression.FALSE;
+      break;
+    case NULL:
+      jj_consume_token(NULL);
+                left = ConstantExpression.NULL;
+      break;
+    default:
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public String stringLitteral() throws ParseException {
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    boolean first=true;
+    t = jj_consume_token(STRING_LITERAL);
+        // Decode the sting value.
+        String image = t.image;
+        for( int i=1; i < image.length()-1; i++ ) {
+            char c = image.charAt(i);
+            if( c == '\u005c'' )
+                i++;
+               rc.append(c);
+        }
+        {if (true) return rc.toString();}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public PropertyExpression variable() throws ParseException {
+    Token t;
+    PropertyExpression left=null;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case ID:
+      t = jj_consume_token(ID);
+            left = new PropertyExpression(t.image);
+      break;
+    case QUOTED_ID:
+      t = jj_consume_token(QUOTED_ID);
+            // Decode the string value.
+            StringBuffer rc = new StringBuffer();
+            String image = t.image;
+            for( int i=1; i < image.length()-1; i++ ) {
+                char c = image.charAt(i);
+                if( c == '"' )
+                    i++;
+                rc.append(c);
+            }
+            {if (true) return new PropertyExpression(rc.toString());}
+      break;
+    default:
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  private boolean jj_2_1(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_1(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_2(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_2(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_3(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_3(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_4(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_4(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_5(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_5(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_6(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_6(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_3R_53() {
+    if (jj_scan_token(LIKE)) return true;
+    if (jj_3R_38()) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_58()) jj_scanpos = xsp;
+    return false;
+  }
+
+  private boolean jj_3R_27() {
+    if (jj_scan_token(DECIMAL_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_36() {
+    if (jj_3R_39()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_40()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_52() {
+    if (jj_scan_token(32)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_57() {
+    if (jj_scan_token(37)) return true;
+    if (jj_3R_9()) return true;
+    return false;
+  }
+
+  private boolean jj_3_5() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(36)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(37)) return true;
+    }
+    if (jj_3R_9()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_26() {
+    if (jj_3R_38()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_51() {
+    if (jj_scan_token(31)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_35() {
+    if (jj_scan_token(QUOTED_ID)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_56() {
+    if (jj_scan_token(36)) return true;
+    if (jj_3R_9()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_37() {
+    if (jj_scan_token(OR)) return true;
+    if (jj_3R_36()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_23() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_26()) {
+    jj_scanpos = xsp;
+    if (jj_3R_27()) {
+    jj_scanpos = xsp;
+    if (jj_3R_28()) {
+    jj_scanpos = xsp;
+    if (jj_3R_29()) {
+    jj_scanpos = xsp;
+    if (jj_3R_30()) {
+    jj_scanpos = xsp;
+    if (jj_3R_31()) {
+    jj_scanpos = xsp;
+    if (jj_3R_32()) {
+    jj_scanpos = xsp;
+    if (jj_3R_33()) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_50() {
+    if (jj_scan_token(30)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_34() {
+    if (jj_scan_token(ID)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_48() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_56()) {
+    jj_scanpos = xsp;
+    if (jj_3R_57()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_49() {
+    if (jj_scan_token(29)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_44() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_49()) {
+    jj_scanpos = xsp;
+    if (jj_3R_50()) {
+    jj_scanpos = xsp;
+    if (jj_3R_51()) {
+    jj_scanpos = xsp;
+    if (jj_3R_52()) {
+    jj_scanpos = xsp;
+    if (jj_3R_53()) {
+    jj_scanpos = xsp;
+    if (jj_3_2()) {
+    jj_scanpos = xsp;
+    if (jj_3R_54()) {
+    jj_scanpos = xsp;
+    if (jj_3_3()) {
+    jj_scanpos = xsp;
+    if (jj_3R_55()) {
+    jj_scanpos = xsp;
+    if (jj_3_4()) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_24() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_34()) {
+    jj_scanpos = xsp;
+    if (jj_3R_35()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_43() {
+    if (jj_3R_9()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_48()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_25() {
+    if (jj_3R_36()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_37()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_22() {
+    if (jj_scan_token(33)) return true;
+    if (jj_3R_25()) return true;
+    if (jj_scan_token(35)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_21() {
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_61() {
+    if (jj_scan_token(34)) return true;
+    if (jj_3R_38()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_20() {
+    if (jj_3R_23()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_19() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_20()) {
+    jj_scanpos = xsp;
+    if (jj_3R_21()) {
+    jj_scanpos = xsp;
+    if (jj_3R_22()) return true;
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_41() {
+    if (jj_3R_43()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_44()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_38() {
+    if (jj_scan_token(STRING_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_15() {
+    if (jj_3R_19()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_59() {
+    if (jj_scan_token(ESCAPE)) return true;
+    if (jj_3R_38()) return true;
+    return false;
+  }
+
+  private boolean jj_3_4() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(IN)) return true;
+    if (jj_scan_token(33)) return true;
+    if (jj_3R_38()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_61()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(35)) return true;
+    return false;
+  }
+
+  private boolean jj_3_6() {
+    if (jj_scan_token(36)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_14() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_60() {
+    if (jj_scan_token(34)) return true;
+    if (jj_3R_38()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_47() {
+    if (jj_scan_token(IS)) return true;
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(NULL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_13() {
+    if (jj_scan_token(37)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_33() {
+    if (jj_scan_token(NULL)) return true;
+    return false;
+  }
+
+  private boolean jj_3_1() {
+    if (jj_scan_token(IS)) return true;
+    if (jj_scan_token(NULL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_12() {
+    if (jj_scan_token(36)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_46() {
+    if (jj_scan_token(28)) return true;
+    if (jj_3R_41()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_10() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_12()) {
+    jj_scanpos = xsp;
+    if (jj_3R_13()) {
+    jj_scanpos = xsp;
+    if (jj_3R_14()) {
+    jj_scanpos = xsp;
+    if (jj_3R_15()) return true;
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_32() {
+    if (jj_scan_token(FALSE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_55() {
+    if (jj_scan_token(IN)) return true;
+    if (jj_scan_token(33)) return true;
+    if (jj_3R_38()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_60()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(35)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_45() {
+    if (jj_scan_token(27)) return true;
+    if (jj_3R_41()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_42() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_45()) {
+    jj_scanpos = xsp;
+    if (jj_3R_46()) {
+    jj_scanpos = xsp;
+    if (jj_3_1()) {
+    jj_scanpos = xsp;
+    if (jj_3R_47()) return true;
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_31() {
+    if (jj_scan_token(TRUE)) return true;
+    return false;
+  }
+
+  private boolean jj_3_3() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(BETWEEN)) return true;
+    if (jj_3R_43()) return true;
+    if (jj_scan_token(AND)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_18() {
+    if (jj_scan_token(40)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_30() {
+    if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_54() {
+    if (jj_scan_token(BETWEEN)) return true;
+    if (jj_3R_43()) return true;
+    if (jj_scan_token(AND)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_39() {
+    if (jj_3R_41()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_42()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_17() {
+    if (jj_scan_token(39)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_29() {
+    if (jj_scan_token(OCTAL_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_58() {
+    if (jj_scan_token(ESCAPE)) return true;
+    if (jj_3R_38()) return true;
+    return false;
+  }
+
+  private boolean jj_3_2() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(LIKE)) return true;
+    if (jj_3R_38()) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_59()) jj_scanpos = xsp;
+    return false;
+  }
+
+  private boolean jj_3R_16() {
+    if (jj_scan_token(38)) return true;
+    if (jj_3R_10()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_11() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_16()) {
+    jj_scanpos = xsp;
+    if (jj_3R_17()) {
+    jj_scanpos = xsp;
+    if (jj_3R_18()) return true;
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_40() {
+    if (jj_scan_token(AND)) return true;
+    if (jj_3R_39()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_28() {
+    if (jj_scan_token(HEX_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_9() {
+    if (jj_3R_10()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_11()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  /** Generated Token Manager. */
+  public SelectorParserImplTokenManager token_source;
+  SimpleCharStream jj_input_stream;
+  /** Current token. */
+  public Token token;
+  /** Next token. */
+  public Token jj_nt;
+  private int jj_ntk;
+  private Token jj_scanpos, jj_lastpos;
+  private int jj_la;
+
+  /** Constructor with InputStream. */
+  public SelectorParserImpl(java.io.InputStream stream) {
+     this(stream, null);
+  }
+  /** Constructor with InputStream and supplied encoding */
+  public SelectorParserImpl(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+    token_source = new SelectorParserImplTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Reinitialise. */
+  public void ReInit(java.io.InputStream stream) {
+     ReInit(stream, null);
+  }
+  /** Reinitialise. */
+  public void ReInit(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Constructor. */
+  public SelectorParserImpl(java.io.Reader stream) {
+    jj_input_stream = new SimpleCharStream(stream, 1, 1);
+    token_source = new SelectorParserImplTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Reinitialise. */
+  public void ReInit(java.io.Reader stream) {
+    jj_input_stream.ReInit(stream, 1, 1);
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Constructor with generated Token Manager. */
+  public SelectorParserImpl(SelectorParserImplTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Reinitialise. */
+  public void ReInit(SelectorParserImplTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  private Token jj_consume_token(int kind) throws ParseException {
+    Token oldToken;
+    if ((oldToken = token).next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    if (token.kind == kind) {
+      return token;
+    }
+    token = oldToken;
+    throw generateParseException();
+  }
+
+  static private final class LookaheadSuccess extends java.lang.Error { }
+  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+  private boolean jj_scan_token(int kind) {
+    if (jj_scanpos == jj_lastpos) {
+      jj_la--;
+      if (jj_scanpos.next == null) {
+        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
+      } else {
+        jj_lastpos = jj_scanpos = jj_scanpos.next;
+      }
+    } else {
+      jj_scanpos = jj_scanpos.next;
+    }
+    if (jj_scanpos.kind != kind) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+    return false;
+  }
+
+
+/** Get the next Token. */
+  final public Token getNextToken() {
+    if (token.next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    return token;
+  }
+
+/** Get the specific Token. */
+  final public Token getToken(int index) {
+    Token t = token;
+    for (int i = 0; i < index; i++) {
+      if (t.next != null) t = t.next;
+      else t = t.next = token_source.getNextToken();
+    }
+    return t;
+  }
+
+  private int jj_ntk() {
+    if ((jj_nt=token.next) == null)
+      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+    else
+      return (jj_ntk = jj_nt.kind);
+  }
+
+  /** Generate ParseException. */
+  public ParseException generateParseException() {
+    Token errortok = token.next;
+    int line = errortok.beginLine, column = errortok.beginColumn;
+    String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
+    return new ParseException("Parse error at line " + line + ", column " + column + ".  Encountered: " + mess);
+  }
+
+  /** Enable tracing. */
+  final public void enable_tracing() {
+  }
+
+  /** Disable tracing. */
+  final public void disable_tracing() {
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d1f0b32b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplConstants.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplConstants.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplConstants.java
new file mode 100644
index 0000000..a22a964
--- /dev/null
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplConstants.java
@@ -0,0 +1,121 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParserImplConstants.java */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.qpid.jms.selector.parser;
+
+
+/**
+ * Token literal values and constants.
+ * Generated by org.javacc.parser.OtherFilesGen#start()
+ */
+public interface SelectorParserImplConstants {
+
+  /** End of File. */
+  int EOF = 0;
+  /** RegularExpression Id. */
+  int LINE_COMMENT = 6;
+  /** RegularExpression Id. */
+  int BLOCK_COMMENT = 7;
+  /** RegularExpression Id. */
+  int NOT = 8;
+  /** RegularExpression Id. */
+  int AND = 9;
+  /** RegularExpression Id. */
+  int OR = 10;
+  /** RegularExpression Id. */
+  int BETWEEN = 11;
+  /** RegularExpression Id. */
+  int LIKE = 12;
+  /** RegularExpression Id. */
+  int ESCAPE = 13;
+  /** RegularExpression Id. */
+  int IN = 14;
+  /** RegularExpression Id. */
+  int IS = 15;
+  /** RegularExpression Id. */
+  int TRUE = 16;
+  /** RegularExpression Id. */
+  int FALSE = 17;
+  /** RegularExpression Id. */
+  int NULL = 18;
+  /** RegularExpression Id. */
+  int DECIMAL_LITERAL = 19;
+  /** RegularExpression Id. */
+  int HEX_LITERAL = 20;
+  /** RegularExpression Id. */
+  int OCTAL_LITERAL = 21;
+  /** RegularExpression Id. */
+  int FLOATING_POINT_LITERAL = 22;
+  /** RegularExpression Id. */
+  int EXPONENT = 23;
+  /** RegularExpression Id. */
+  int STRING_LITERAL = 24;
+  /** RegularExpression Id. */
+  int ID = 25;
+  /** RegularExpression Id. */
+  int QUOTED_ID = 26;
+
+  /** Lexical state. */
+  int DEFAULT = 0;
+
+  /** Literal token values. */
+  String[] tokenImage = {
+    "<EOF>",
+    "\" \"",
+    "\"\\t\"",
+    "\"\\n\"",
+    "\"\\r\"",
+    "\"\\f\"",
+    "<LINE_COMMENT>",
+    "<BLOCK_COMMENT>",
+    "\"NOT\"",
+    "\"AND\"",
+    "\"OR\"",
+    "\"BETWEEN\"",
+    "\"LIKE\"",
+    "\"ESCAPE\"",
+    "\"IN\"",
+    "\"IS\"",
+    "\"TRUE\"",
+    "\"FALSE\"",
+    "\"NULL\"",
+    "<DECIMAL_LITERAL>",
+    "<HEX_LITERAL>",
+    "<OCTAL_LITERAL>",
+    "<FLOATING_POINT_LITERAL>",
+    "<EXPONENT>",
+    "<STRING_LITERAL>",
+    "<ID>",
+    "<QUOTED_ID>",
+    "\"=\"",
+    "\"<>\"",
+    "\">\"",
+    "\">=\"",
+    "\"<\"",
+    "\"<=\"",
+    "\"(\"",
+    "\",\"",
+    "\")\"",
+    "\"+\"",
+    "\"-\"",
+    "\"*\"",
+    "\"/\"",
+    "\"%\"",
+  };
+
+}

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d1f0b32b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplTokenManager.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplTokenManager.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplTokenManager.java
new file mode 100644
index 0000000..e545521
--- /dev/null
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/parser/org/apache/qpid/jms/selector/parser/SelectorParserImplTokenManager.java
@@ -0,0 +1,1055 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParserImplTokenManager.java */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.qpid.jms.selector.parser;
+import java.io.*;
+import java.util.*;
+import org.apache.qpid.jms.selector.filter.*;
+
+/** Token Manager. */
+public class SelectorParserImplTokenManager implements SelectorParserImplConstants
+{
+
+  /** Debug output. */
+  public  java.io.PrintStream debugStream = System.out;
+  /** Set debug output. */
+  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private int jjStopAtPos(int pos, int kind)
+{
+   jjmatchedKind = kind;
+   jjmatchedPos = pos;
+   return pos + 1;
+}
+private int jjMoveStringLiteralDfa0_0()
+{
+   switch(curChar)
+   {
+      case 9:
+         jjmatchedKind = 2;
+         return jjMoveNfa_0(5, 0);
+      case 10:
+         jjmatchedKind = 3;
+         return jjMoveNfa_0(5, 0);
+      case 12:
+         jjmatchedKind = 5;
+         return jjMoveNfa_0(5, 0);
+      case 13:
+         jjmatchedKind = 4;
+         return jjMoveNfa_0(5, 0);
+      case 32:
+         jjmatchedKind = 1;
+         return jjMoveNfa_0(5, 0);
+      case 37:
+         jjmatchedKind = 40;
+         return jjMoveNfa_0(5, 0);
+      case 40:
+         jjmatchedKind = 33;
+         return jjMoveNfa_0(5, 0);
+      case 41:
+         jjmatchedKind = 35;
+         return jjMoveNfa_0(5, 0);
+      case 42:
+         jjmatchedKind = 38;
+         return jjMoveNfa_0(5, 0);
+      case 43:
+         jjmatchedKind = 36;
+         return jjMoveNfa_0(5, 0);
+      case 44:
+         jjmatchedKind = 34;
+         return jjMoveNfa_0(5, 0);
+      case 45:
+         jjmatchedKind = 37;
+         return jjMoveNfa_0(5, 0);
+      case 47:
+         jjmatchedKind = 39;
+         return jjMoveNfa_0(5, 0);
+      case 60:
+         jjmatchedKind = 31;
+         return jjMoveStringLiteralDfa1_0(0x110000000L);
+      case 61:
+         jjmatchedKind = 27;
+         return jjMoveNfa_0(5, 0);
+      case 62:
+         jjmatchedKind = 29;
+         return jjMoveStringLiteralDfa1_0(0x40000000L);
+      case 65:
+         return jjMoveStringLiteralDfa1_0(0x200L);
+      case 66:
+         return jjMoveStringLiteralDfa1_0(0x800L);
+      case 69:
+         return jjMoveStringLiteralDfa1_0(0x2000L);
+      case 70:
+         return jjMoveStringLiteralDfa1_0(0x20000L);
+      case 73:
+         return jjMoveStringLiteralDfa1_0(0xc000L);
+      case 76:
+         return jjMoveStringLiteralDfa1_0(0x1000L);
+      case 78:
+         return jjMoveStringLiteralDfa1_0(0x40100L);
+      case 79:
+         return jjMoveStringLiteralDfa1_0(0x400L);
+      case 84:
+         return jjMoveStringLiteralDfa1_0(0x10000L);
+      case 97:
+         return jjMoveStringLiteralDfa1_0(0x200L);
+      case 98:
+         return jjMoveStringLiteralDfa1_0(0x800L);
+      case 101:
+         return jjMoveStringLiteralDfa1_0(0x2000L);
+      case 102:
+         return jjMoveStringLiteralDfa1_0(0x20000L);
+      case 105:
+         return jjMoveStringLiteralDfa1_0(0xc000L);
+      case 108:
+         return jjMoveStringLiteralDfa1_0(0x1000L);
+      case 110:
+         return jjMoveStringLiteralDfa1_0(0x40100L);
+      case 111:
+         return jjMoveStringLiteralDfa1_0(0x400L);
+      case 116:
+         return jjMoveStringLiteralDfa1_0(0x10000L);
+      default :
+         return jjMoveNfa_0(5, 0);
+   }
+}
+private int jjMoveStringLiteralDfa1_0(long active0)
+{
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(5, 0);
+   }
+   switch(curChar)
+   {
+      case 61:
+         if ((active0 & 0x40000000L) != 0L)
+         {
+            jjmatchedKind = 30;
+            jjmatchedPos = 1;
+         }
+         else if ((active0 & 0x100000000L) != 0L)
+         {
+            jjmatchedKind = 32;
+            jjmatchedPos = 1;
+         }
+         break;
+      case 62:
+         if ((active0 & 0x10000000L) != 0L)
+         {
+            jjmatchedKind = 28;
+            jjmatchedPos = 1;
+         }
+         break;
+      case 65:
+         return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
+      case 69:
+         return jjMoveStringLiteralDfa2_0(active0, 0x800L);
+      case 73:
+         return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+      case 78:
+         if ((active0 & 0x4000L) != 0L)
+         {
+            jjmatchedKind = 14;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+      case 79:
+         return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+      case 82:
+         if ((active0 & 0x400L) != 0L)
+         {
+            jjmatchedKind = 10;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x10000L);
+      case 83:
+         if ((active0 & 0x8000L) != 0L)
+         {
+            jjmatchedKind = 15;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+      case 85:
+         return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
+      case 97:
+         return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
+      case 101:
+         return jjMoveStringLiteralDfa2_0(active0, 0x800L);
+      case 105:
+         return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+      case 110:
+         if ((active0 & 0x4000L) != 0L)
+         {
+            jjmatchedKind = 14;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+      case 111:
+         return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+      case 114:
+         if ((active0 & 0x400L) != 0L)
+         {
+            jjmatchedKind = 10;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x10000L);
+      case 115:
+         if ((active0 & 0x8000L) != 0L)
+         {
+            jjmatchedKind = 15;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+      case 117:
+         return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(5, 1);
+}
+private int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(5, 1);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(5, 1);
+   }
+   switch(curChar)
+   {
+      case 67:
+         return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+      case 68:
+         if ((active0 & 0x200L) != 0L)
+         {
+            jjmatchedKind = 9;
+            jjmatchedPos = 2;
+         }
+         break;
+      case 75:
+         return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+      case 76:
+         return jjMoveStringLiteralDfa3_0(active0, 0x60000L);
+      case 84:
+         if ((active0 & 0x100L) != 0L)
+         {
+            jjmatchedKind = 8;
+            jjmatchedPos = 2;
+         }
+         return jjMoveStringLiteralDfa3_0(active0, 0x800L);
+      case 85:
+         return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
+      case 99:
+         return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+      case 100:
+         if ((active0 & 0x200L) != 0L)
+         {
+            jjmatchedKind = 9;
+            jjmatchedPos = 2;
+         }
+         break;
+      case 107:
+         return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+      case 108:
+         return jjMoveStringLiteralDfa3_0(active0, 0x60000L);
+      case 116:
+         if ((active0 & 0x100L) != 0L)
+         {
+            jjmatchedKind = 8;
+            jjmatchedPos = 2;
+         }
+         return jjMoveStringLiteralDfa3_0(active0, 0x800L);
+      case 117:
+         return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(5, 2);
+}
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(5, 2);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(5, 2);
+   }
+   switch(curChar)
+   {
+      case 65:
+         return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
+      case 69:
+         if ((active0 & 0x1000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 3;
+         }
+         else if ((active0 & 0x10000L) != 0L)
+         {
+            jjmatchedKind = 16;
+            jjmatchedPos = 3;
+         }
+         break;
+      case 76:
+         if ((active0 & 0x40000L) != 0L)
+         {
+            jjmatchedKind = 18;
+            jjmatchedPos = 3;
+         }
+         break;
+      case 83:
+         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
+      case 87:
+         return jjMoveStringLiteralDfa4_0(active0, 0x800L);
+      case 97:
+         return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
+      case 101:
+         if ((active0 & 0x1000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 3;
+         }
+         else if ((active0 & 0x10000L) != 0L)
+         {
+            jjmatchedKind = 16;
+            jjmatchedPos = 3;
+         }
+         break;
+      case 108:
+         if ((active0 & 0x40000L) != 0L)
+         {
+            jjmatchedKind = 18;
+            jjmatchedPos = 3;
+         }
+         break;
+      case 115:
+         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
+      case 119:
+         return jjMoveStringLiteralDfa4_0(active0, 0x800L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(5, 3);
+}
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(5, 3);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(5, 3);
+   }
+   switch(curChar)
+   {
+      case 69:
+         if ((active0 & 0x20000L) != 0L)
+         {
+            jjmatchedKind = 17;
+            jjmatchedPos = 4;
+         }
+         return jjMoveStringLiteralDfa5_0(active0, 0x800L);
+      case 80:
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
+      case 101:
+         if ((active0 & 0x20000L) != 0L)
+         {
+            jjmatchedKind = 17;
+            jjmatchedPos = 4;
+         }
+         return jjMoveStringLiteralDfa5_0(active0, 0x800L);
+      case 112:
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(5, 4);
+}
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(5, 4);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(5, 4);
+   }
+   switch(curChar)
+   {
+      case 69:
+         if ((active0 & 0x2000L) != 0L)
+         {
+            jjmatchedKind = 13;
+            jjmatchedPos = 5;
+         }
+         return jjMoveStringLiteralDfa6_0(active0, 0x800L);
+      case 101:
+         if ((active0 & 0x2000L) != 0L)
+         {
+            jjmatchedKind = 13;
+            jjmatchedPos = 5;
+         }
+         return jjMoveStringLiteralDfa6_0(active0, 0x800L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(5, 5);
+}
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(5, 5);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(5, 5);
+   }
+   switch(curChar)
+   {
+      case 78:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 11;
+            jjmatchedPos = 6;
+         }
+         break;
+      case 110:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 11;
+            jjmatchedPos = 6;
+         }
+         break;
+      default :
+         break;
+   }
+   return jjMoveNfa_0(5, 6);
+}
+static final long[] jjbitVec0 = {
+   0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec2 = {
+   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private int jjMoveNfa_0(int startState, int curPos)
+{
+   int strKind = jjmatchedKind;
+   int strPos = jjmatchedPos;
+   int seenUpto;
+   input_stream.backup(seenUpto = curPos + 1);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) { throw new Error("Internal Error"); }
+   curPos = 0;
+   int startsAt = 0;
+   jjnewStateCnt = 48;
+   int i = 1;
+   jjstateSet[0] = startState;
+   int kind = 0x7fffffff;
+   for (;;)
+   {
+      if (++jjround == 0x7fffffff)
+         ReInitRounds();
+      if (curChar < 64)
+      {
+         long l = 1L << curChar;
+         do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 5:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjCheckNAddStates(0, 3);
+                  else if (curChar == 34)
+                     jjCheckNAddStates(4, 6);
+                  else if (curChar == 36)
+                  {
+                     if (kind > 25)
+                        kind = 25;
+                     jjCheckNAdd(27);
+                  }
+                  else if (curChar == 39)
+                     jjCheckNAddStates(7, 9);
+                  else if (curChar == 46)
+                     jjCheckNAdd(17);
+                  else if (curChar == 47)
+                     jjstateSet[jjnewStateCnt++] = 6;
+                  else if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 0;
+                  if ((0x3fe000000000000L & l) != 0L)
+                  {
+                     if (kind > 19)
+                        kind = 19;
+                     jjCheckNAddTwoStates(14, 15);
+                  }
+                  else if (curChar == 48)
+                  {
+                     if (kind > 21)
+                        kind = 21;
+                     jjCheckNAddTwoStates(45, 47);
+                  }
+                  break;
+               case 0:
+                  if (curChar == 45)
+                     jjCheckNAddStates(10, 12);
+                  break;
+               case 1:
+                  if ((0xffffffffffffdbffL & l) != 0L)
+                     jjCheckNAddStates(10, 12);
+                  break;
+               case 2:
+                  if ((0x2400L & l) != 0L && kind > 6)
+                     kind = 6;
+                  break;
+               case 3:
+                  if (curChar == 10 && kind > 6)
+                     kind = 6;
+                  break;
+               case 4:
+                  if (curChar == 13)
+                     jjstateSet[jjnewStateCnt++] = 3;
+                  break;
+               case 6:
+                  if (curChar == 42)
+                     jjCheckNAddTwoStates(7, 8);
+                  break;
+               case 7:
+                  if ((0xfffffbffffffffffL & l) != 0L)
+                     jjCheckNAddTwoStates(7, 8);
+                  break;
+               case 8:
+                  if (curChar == 42)
+                     jjCheckNAddStates(13, 15);
+                  break;
+               case 9:
+                  if ((0xffff7bffffffffffL & l) != 0L)
+                     jjCheckNAddTwoStates(10, 8);
+                  break;
+               case 10:
+                  if ((0xfffffbffffffffffL & l) != 0L)
+                     jjCheckNAddTwoStates(10, 8);
+                  break;
+               case 11:
+                  if (curChar == 47 && kind > 7)
+                     kind = 7;
+                  break;
+               case 12:
+                  if (curChar == 47)
+                     jjstateSet[jjnewStateCnt++] = 6;
+                  break;
+               case 13:
+                  if ((0x3fe000000000000L & l) == 0L)
+                     break;
+                  if (kind > 19)
+                     kind = 19;
+                  jjCheckNAddTwoStates(14, 15);
+                  break;
+               case 14:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 19)
+                     kind = 19;
+                  jjCheckNAddTwoStates(14, 15);
+                  break;
+               case 16:
+                  if (curChar == 46)
+                     jjCheckNAdd(17);
+                  break;
+               case 17:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAddTwoStates(17, 18);
+                  break;
+               case 19:
+                  if ((0x280000000000L & l) != 0L)
+                     jjCheckNAdd(20);
+                  break;
+               case 20:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAdd(20);
+                  break;
+               case 21:
+               case 22:
+                  if (curChar == 39)
+                     jjCheckNAddStates(7, 9);
+                  break;
+               case 23:
+                  if (curChar == 39)
+                     jjstateSet[jjnewStateCnt++] = 22;
+                  break;
+               case 24:
+                  if ((0xffffff7fffffffffL & l) != 0L)
+                     jjCheckNAddStates(7, 9);
+                  break;
+               case 25:
+                  if (curChar == 39 && kind > 24)
+                     kind = 24;
+                  break;
+               case 26:
+                  if (curChar != 36)
+                     break;
+                  if (kind > 25)
+                     kind = 25;
+                  jjCheckNAdd(27);
+                  break;
+               case 27:
+                  if ((0x3ff001000000000L & l) == 0L)
+                     break;
+                  if (kind > 25)
+                     kind = 25;
+                  jjCheckNAdd(27);
+                  break;
+               case 28:
+               case 29:
+                  if (curChar == 34)
+                     jjCheckNAddStates(4, 6);
+                  break;
+               case 30:
+                  if (curChar == 34)
+                     jjstateSet[jjnewStateCnt++] = 29;
+                  break;
+               case 31:
+                  if ((0xfffffffbffffffffL & l) != 0L)
+                     jjCheckNAddStates(4, 6);
+                  break;
+               case 32:
+                  if (curChar == 34 && kind > 26)
+                     kind = 26;
+                  break;
+               case 33:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjCheckNAddStates(0, 3);
+                  break;
+               case 34:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjCheckNAddTwoStates(34, 35);
+                  break;
+               case 35:
+                  if (curChar != 46)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAddTwoStates(36, 37);
+                  break;
+               case 36:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAddTwoStates(36, 37);
+                  break;
+               case 38:
+                  if ((0x280000000000L & l) != 0L)
+                     jjCheckNAdd(39);
+                  break;
+               case 39:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAdd(39);
+                  break;
+               case 40:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjCheckNAddTwoStates(40, 41);
+                  break;
+               case 42:
+                  if ((0x280000000000L & l) != 0L)
+                     jjCheckNAdd(43);
+                  break;
+               case 43:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAdd(43);
+                  break;
+               case 44:
+                  if (curChar != 48)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(45, 47);
+                  break;
+               case 46:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 20)
+                     kind = 20;
+                  jjstateSet[jjnewStateCnt++] = 46;
+                  break;
+               case 47:
+                  if ((0xff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAdd(47);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else if (curChar < 128)
+      {
+         long l = 1L << (curChar & 077);
+         do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 5:
+               case 27:
+                  if ((0x7fffffe87fffffeL & l) == 0L)
+                     break;
+                  if (kind > 25)
+                     kind = 25;
+                  jjCheckNAdd(27);
+                  break;
+               case 1:
+                  jjAddStates(10, 12);
+                  break;
+               case 7:
+                  jjCheckNAddTwoStates(7, 8);
+                  break;
+               case 9:
+               case 10:
+                  jjCheckNAddTwoStates(10, 8);
+                  break;
+               case 15:
+                  if ((0x100000001000L & l) != 0L && kind > 19)
+                     kind = 19;
+                  break;
+               case 18:
+                  if ((0x2000000020L & l) != 0L)
+                     jjAddStates(16, 17);
+                  break;
+               case 24:
+                  jjAddStates(7, 9);
+                  break;
+               case 31:
+                  jjAddStates(4, 6);
+                  break;
+               case 37:
+                  if ((0x2000000020L & l) != 0L)
+                     jjAddStates(18, 19);
+                  break;
+               case 41:
+                  if ((0x2000000020L & l) != 0L)
+                     jjAddStates(20, 21);
+                  break;
+               case 45:
+                  if ((0x100000001000000L & l) != 0L)
+                     jjCheckNAdd(46);
+                  break;
+               case 46:
+                  if ((0x7e0000007eL & l) == 0L)
+                     break;
+                  if (kind > 20)
+                     kind = 20;
+                  jjCheckNAdd(46);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else
+      {
+         int hiByte = (int)(curChar >> 8);
+         int i1 = hiByte >> 6;
+         long l1 = 1L << (hiByte & 077);
+         int i2 = (curChar & 0xff) >> 6;
+         long l2 = 1L << (curChar & 077);
+         do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 1:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     jjAddStates(10, 12);
+                  break;
+               case 7:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     jjCheckNAddTwoStates(7, 8);
+                  break;
+               case 9:
+               case 10:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     jjCheckNAddTwoStates(10, 8);
+                  break;
+               case 24:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     jjAddStates(7, 9);
+                  break;
+               case 31:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     jjAddStates(4, 6);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      if (kind != 0x7fffffff)
+      {
+         jjmatchedKind = kind;
+         jjmatchedPos = curPos;
+         kind = 0x7fffffff;
+      }
+      ++curPos;
+      if ((i = jjnewStateCnt) == (startsAt = 48 - (jjnewStateCnt = startsAt)))
+         break;
+      try { curChar = input_stream.readChar(); }
+      catch(java.io.IOException e) { break; }
+   }
+   if (jjmatchedPos > strPos)
+      return curPos;
+
+   int toRet = Math.max(curPos, seenUpto);
+
+   if (curPos < toRet)
+      for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
+         try { curChar = input_stream.readChar(); }
+         catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
+
+   if (jjmatchedPos < strPos)
+   {
+      jjmatchedKind = strKind;
+      jjmatchedPos = strPos;
+   }
+   else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
+      jjmatchedKind = strKind;
+
+   return toRet;
+}
+static final int[] jjnextStates = {
+   34, 35, 40, 41, 30, 31, 32, 23, 24, 25, 1, 2, 4, 8, 9, 11, 
+   19, 20, 38, 39, 42, 43, 
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((jjbitVec2[i2] & l2) != 0L);
+      default :
+         if ((jjbitVec0[i1] & l1) != 0L)
+            return true;
+         return false;
+   }
+}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, null, null, null, null, null, 
+null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
+"\75", "\74\76", "\76", "\76\75", "\74", "\74\75", "\50", "\54", "\51", "\53", "\55", 
+"\52", "\57", "\45", };
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+   "DEFAULT",
+};
+static final long[] jjtoToken = {
+   0x1ffff7fff01L, 
+};
+static final long[] jjtoSkip = {
+   0xfeL, 
+};
+static final long[] jjtoSpecial = {
+   0x3eL, 
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[48];
+private final int[] jjstateSet = new int[96];
+protected char curChar;
+/** Constructor. */
+public SelectorParserImplTokenManager(SimpleCharStream stream){
+   if (SimpleCharStream.staticFlag)
+      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+   input_stream = stream;
+}
+
+/** Constructor. */
+public SelectorParserImplTokenManager(SimpleCharStream stream, int lexState){
+   this(stream);
+   SwitchTo(lexState);
+}
+
+/** Reinitialise parser. */
+public void ReInit(SimpleCharStream stream)
+{
+   jjmatchedPos = jjnewStateCnt = 0;
+   curLexState = defaultLexState;
+   input_stream = stream;
+   ReInitRounds();
+}
+private void ReInitRounds()
+{
+   int i;
+   jjround = 0x80000001;
+   for (i = 48; i-- > 0;)
+      jjrounds[i] = 0x80000000;
+}
+
+/** Reinitialise parser. */
+public void ReInit(SimpleCharStream stream, int lexState)
+{
+   ReInit(stream);
+   SwitchTo(lexState);
+}
+
+/** Switch to specified lex state. */
+public void SwitchTo(int lexState)
+{
+   if (lexState >= 1 || lexState < 0)
+      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+   else
+      curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+   final Token t;
+   final String curTokenImage;
+   final int beginLine;
+   final int endLine;
+   final int beginColumn;
+   final int endColumn;
+   String im = jjstrLiteralImages[jjmatchedKind];
+   curTokenImage = (im == null) ? input_stream.GetImage() : im;
+   beginLine = input_stream.getBeginLine();
+   beginColumn = input_stream.getBeginColumn();
+   endLine = input_stream.getEndLine();
+   endColumn = input_stream.getEndColumn();
+   t = Token.newToken(jjmatchedKind, curTokenImage);
+
+   t.beginLine = beginLine;
+   t.endLine = endLine;
+   t.beginColumn = beginColumn;
+   t.endColumn = endColumn;
+
+   return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+/** Get the next Token. */
+public Token getNextToken() 
+{
+  Token specialToken = null;
+  Token matchedToken;
+  int curPos = 0;
+
+  EOFLoop :
+  for (;;)
+  {
+   try
+   {
+      curChar = input_stream.BeginToken();
+   }
+   catch(java.io.IOException e)
+   {
+      jjmatchedKind = 0;
+      matchedToken = jjFillToken();
+      matchedToken.specialToken = specialToken;
+      return matchedToken;
+   }
+
+   jjmatchedKind = 0x7fffffff;
+   jjmatchedPos = 0;
+   curPos = jjMoveStringLiteralDfa0_0();
+   if (jjmatchedKind != 0x7fffffff)
+   {
+      if (jjmatchedPos + 1 < curPos)
+         input_stream.backup(curPos - jjmatchedPos - 1);
+      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+      {
+         matchedToken = jjFillToken();
+         matchedToken.specialToken = specialToken;
+         return matchedToken;
+      }
+      else
+      {
+         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+         {
+            matchedToken = jjFillToken();
+            if (specialToken == null)
+               specialToken = matchedToken;
+            else
+            {
+               matchedToken.specialToken = specialToken;
+               specialToken = (specialToken.next = matchedToken);
+            }
+         }
+         continue EOFLoop;
+      }
+   }
+   int error_line = input_stream.getEndLine();
+   int error_column = input_stream.getEndColumn();
+   String error_after = null;
+   boolean EOFSeen = false;
+   try { input_stream.readChar(); input_stream.backup(1); }
+   catch (java.io.IOException e1) {
+      EOFSeen = true;
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+      if (curChar == '\n' || curChar == '\r') {
+         error_line++;
+         error_column = 0;
+      }
+      else
+         error_column++;
+   }
+   if (!EOFSeen) {
+      input_stream.backup(1);
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+   }
+   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+  }
+}
+
+private void jjCheckNAdd(int state)
+{
+   if (jjrounds[state] != jjround)
+   {
+      jjstateSet[jjnewStateCnt++] = state;
+      jjrounds[state] = jjround;
+   }
+}
+private void jjAddStates(int start, int end)
+{
+   do {
+      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+   } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+   jjCheckNAdd(state1);
+   jjCheckNAdd(state2);
+}
+
+private void jjCheckNAddStates(int start, int end)
+{
+   do {
+      jjCheckNAdd(jjnextStates[start]);
+   } while (start++ != end);
+}
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message