You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2013/09/29 19:45:25 UTC
svn commit: r1527366 [3/29] - in /qpid/trunk/qpid/java:
broker-core/src/main/java/org/apache/qpid/server/logging/messages/
common/src/main/java/org/apache/qpid/filter/selector/
common/src/main/java/org/apache/qpid/framing/
common/src/main/java/org/apac...
Added: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java (added)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,368 @@
+/*
+ * 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.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of TransactionLog_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class TransactionLogMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String TRANSACTIONLOG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.closed";
+ public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_complete";
+ public static final String XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_message";
+ public static final String XA_INCOMPLETE_QUEUE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_queue";
+ public static final String RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovered";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.created";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.store_location";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_start";
+
+ static
+ {
+ Logger.getLogger(TRANSACTIONLOG_LOG_HIERARCHY);
+ Logger.getLogger(CLOSED_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
+ Logger.getLogger(XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY);
+ Logger.getLogger(XA_INCOMPLETE_QUEUE_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERED_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_START_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.TransactionLog_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1003 : Closed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSED()
+ {
+ String rawMessage = _messages.getString("CLOSED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1006 : Recovery Complete[ : {0}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_COMPLETE(String param1, boolean opt1)
+ {
+ String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1008 : XA transaction recover for xid {0} incomplete as it references a message {1} which was not durably retained</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage XA_INCOMPLETE_MESSAGE(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("XA_INCOMPLETE_MESSAGE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1007 : XA transaction recover for xid {0} incomplete as it references a queue {1} which was not durably retained</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage XA_INCOMPLETE_QUEUE(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("XA_INCOMPLETE_QUEUE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return XA_INCOMPLETE_QUEUE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1005 : Recovered {0,number} messages for queue {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERED(Number param1, String param2)
+ {
+ String rawMessage = _messages.getString("RECOVERED");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1001 : Created</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED()
+ {
+ String rawMessage = _messages.getString("CREATED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1002 : Store location : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STORE_LOCATION(String param1)
+ {
+ String rawMessage = _messages.getString("STORE_LOCATION");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STORE_LOCATION_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1004 : Recovery Start[ : {0}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_START(String param1, boolean opt1)
+ {
+ String rawMessage = _messages.getString("RECOVERY_START");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_START_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private TransactionLogMessages()
+ {
+ }
+
+}
Added: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java (added)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,220 @@
+/*
+ * 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.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of VirtualHost_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class VirtualHostMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String VIRTUALHOST_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.closed";
+ public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_data";
+ public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_msgs";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.created";
+ public static final String ERRORED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.errored";
+
+ static
+ {
+ Logger.getLogger(VIRTUALHOST_LOG_HIERARCHY);
+ Logger.getLogger(CLOSED_LOG_HIERARCHY);
+ Logger.getLogger(STATS_DATA_LOG_HIERARCHY);
+ Logger.getLogger(STATS_MSGS_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(ERRORED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.VirtualHost_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1002 : Closed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSED()
+ {
+ String rawMessage = _messages.getString("CLOSED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1003 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} kB/s peak : {3,number,#} bytes total</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATS_DATA(String param1, Number param2, Number param3, Number param4)
+ {
+ String rawMessage = _messages.getString("STATS_DATA");
+
+ final Object[] messageArguments = {param1, param2, param3, param4};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATS_DATA_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1004 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} msg/s peak : {3,number,#} msgs total</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATS_MSGS(String param1, Number param2, Number param3, Number param4)
+ {
+ String rawMessage = _messages.getString("STATS_MSGS");
+
+ final Object[] messageArguments = {param1, param2, param3, param4};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATS_MSGS_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1001 : Created : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED(String param1)
+ {
+ String rawMessage = _messages.getString("CREATED");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1005 : Unexpected fatal error</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage ERRORED()
+ {
+ String rawMessage = _messages.getString("ERRORED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return ERRORED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private VirtualHostMessages()
+ {
+ }
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,208 @@
+/* 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.filter.selector;
+
+/**
+ * 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=d315306e736475f86f69c53861799960 (do not edit this line) */
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,1224 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParser.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.filter.selector;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+
+import org.apache.qpid.filter.ArithmeticExpression;
+import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.ComparisonExpression;
+import org.apache.qpid.filter.ConstantExpression;
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.filter.LogicExpression;
+import org.apache.qpid.filter.PropertyExpression;
+import org.apache.qpid.filter.UnaryExpression;
+
+/**
+ * JMS Selector Parser generated by JavaCC
+ *
+ * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
+ */
+public class SelectorParser implements SelectorParserConstants {
+
+ public SelectorParser()
+ {
+ this(new StringReader(""));
+ }
+
+ public BooleanExpression parse(String sql) throws ParseException
+ {
+ this.ReInit(new StringReader(sql));
+
+ return this.JmsSelector();
+
+ }
+
+ 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 = stringLiteral();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ESCAPE:
+ jj_consume_token(ESCAPE);
+ u = stringLiteral();
+ 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 = stringLiteral();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ESCAPE:
+ jj_consume_token(ESCAPE);
+ u = stringLiteral();
+ 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 = stringLiteral();
+ 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 = stringLiteral();
+ 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 = stringLiteral();
+ 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 = stringLiteral();
+ 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 = stringLiteral();
+ 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 stringLiteral() 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 == (char) 0x27 )//single quote
+ {
+ 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;
+ StringBuffer rc = new StringBuffer();
+ 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 sting value.
+ 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_59() {
+ if (jj_scan_token(ESCAPE)) return true;
+ if (jj_3R_38()) return true;
+ 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_14() {
+ if (jj_scan_token(NOT)) return true;
+ if (jj_3R_10()) 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_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_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_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_46() {
+ if (jj_scan_token(28)) return true;
+ if (jj_3R_41()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_32() {
+ if (jj_scan_token(FALSE)) 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_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_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_31() {
+ if (jj_scan_token(TRUE)) 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_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_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_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_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_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_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;
+ }
+
+ private boolean jj_3R_27() {
+ if (jj_scan_token(DECIMAL_LITERAL)) 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_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_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_52() {
+ if (jj_scan_token(32)) 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_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_34() {
+ if (jj_scan_token(ID)) 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_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_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_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_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_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_20() {
+ if (jj_3R_23()) 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_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_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;
+ }
+
+ /** Generated Token Manager. */
+ public SelectorParserTokenManager 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 SelectorParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ /** Constructor with InputStream and supplied encoding */
+ public SelectorParser(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 SelectorParserTokenManager(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 SelectorParser(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new SelectorParserTokenManager(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 SelectorParser(SelectorParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(SelectorParserTokenManager 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() {
+ }
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,125 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParserConstants.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.filter.selector;
+
+
+/**
+ * Token literal values and constants.
+ * Generated by org.javacc.parser.OtherFilesGen#start()
+ */
+public interface SelectorParserConstants {
+
+ /** 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>",
+ "\"=\"",
+ "\"<>\"",
+ "\">\"",
+ "\">=\"",
+ "\"<\"",
+ "\"<=\"",
+ "\"(\"",
+ "\",\"",
+ "\")\"",
+ "\"+\"",
+ "\"-\"",
+ "\"*\"",
+ "\"/\"",
+ "\"%\"",
+ };
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org