activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r1751831 [4/4] - in /activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk: ./ src/main/csharp/ src/main/csharp/Readers/ src/main/csharp/Selector/
Date Thu, 07 Jul 2016 20:47:10 GMT
Added: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SelectorParserTokenManager.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SelectorParserTokenManager.cs?rev=1751831&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SelectorParserTokenManager.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SelectorParserTokenManager.cs Thu Jul  7 20:47:10 2016
@@ -0,0 +1,1042 @@
+/* Generated By:CSharpCC: Do not edit this line. SelectorParserTokenManager.cs */
+/**
+ *
+ * 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.
+ */
+using System;
+using System.IO;
+using System.Text;
+using System.Collections;
+using Apache.NMS;
+
+public  class SelectorParserTokenManager : SelectorParserConstants {
+  public  System.IO.TextWriter debugStream = Console.Out;
+  public  void SetDebugStream(System.IO.TextWriter ds) { debugStream = ds; }
+private int mccStopAtPos(int pos, int kind)
+{
+   mccmatchedKind = kind;
+   mccmatchedPos = pos;
+   return pos + 1;
+}
+private int mccMoveStringLiteralDfa0_0()
+{
+   switch((int)curChar) {
+      case 9:
+         mccmatchedKind = 2;
+         return mccMoveNfa_0(5, 0);
+      case 10:
+         mccmatchedKind = 3;
+         return mccMoveNfa_0(5, 0);
+      case 12:
+         mccmatchedKind = 5;
+         return mccMoveNfa_0(5, 0);
+      case 13:
+         mccmatchedKind = 4;
+         return mccMoveNfa_0(5, 0);
+      case 32:
+         mccmatchedKind = 1;
+         return mccMoveNfa_0(5, 0);
+      case 37:
+         mccmatchedKind = 41;
+         return mccMoveNfa_0(5, 0);
+      case 40:
+         mccmatchedKind = 34;
+         return mccMoveNfa_0(5, 0);
+      case 41:
+         mccmatchedKind = 36;
+         return mccMoveNfa_0(5, 0);
+      case 42:
+         mccmatchedKind = 39;
+         return mccMoveNfa_0(5, 0);
+      case 43:
+         mccmatchedKind = 37;
+         return mccMoveNfa_0(5, 0);
+      case 44:
+         mccmatchedKind = 35;
+         return mccMoveNfa_0(5, 0);
+      case 45:
+         mccmatchedKind = 38;
+         return mccMoveNfa_0(5, 0);
+      case 47:
+         mccmatchedKind = 40;
+         return mccMoveNfa_0(5, 0);
+      case 60:
+         mccmatchedKind = 32;
+         return mccMoveStringLiteralDfa1_0(9126805504L);
+      case 61:
+         mccmatchedKind = 28;
+         return mccMoveNfa_0(5, 0);
+      case 62:
+         mccmatchedKind = 30;
+         return mccMoveStringLiteralDfa1_0(2147483648L);
+      case 65:
+         return mccMoveStringLiteralDfa1_0(512L);
+      case 66:
+         return mccMoveStringLiteralDfa1_0(2048L);
+      case 69:
+         return mccMoveStringLiteralDfa1_0(8192L);
+      case 70:
+         return mccMoveStringLiteralDfa1_0(131072L);
+      case 73:
+         return mccMoveStringLiteralDfa1_0(49152L);
+      case 76:
+         return mccMoveStringLiteralDfa1_0(4096L);
+      case 78:
+         return mccMoveStringLiteralDfa1_0(262400L);
+      case 79:
+         return mccMoveStringLiteralDfa1_0(1024L);
+      case 84:
+         return mccMoveStringLiteralDfa1_0(65536L);
+      case 88:
+         return mccMoveStringLiteralDfa1_0(1572864L);
+      case 97:
+         return mccMoveStringLiteralDfa1_0(512L);
+      case 98:
+         return mccMoveStringLiteralDfa1_0(2048L);
+      case 101:
+         return mccMoveStringLiteralDfa1_0(8192L);
+      case 102:
+         return mccMoveStringLiteralDfa1_0(131072L);
+      case 105:
+         return mccMoveStringLiteralDfa1_0(49152L);
+      case 108:
+         return mccMoveStringLiteralDfa1_0(4096L);
+      case 110:
+         return mccMoveStringLiteralDfa1_0(262400L);
+      case 111:
+         return mccMoveStringLiteralDfa1_0(1024L);
+      case 116:
+         return mccMoveStringLiteralDfa1_0(65536L);
+      case 120:
+         return mccMoveStringLiteralDfa1_0(1572864L);
+      default :
+         return mccMoveNfa_0(5, 0);
+   }
+}
+private int mccMoveStringLiteralDfa1_0(long active0)
+{
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) {
+   return mccMoveNfa_0(5, 0);
+   }
+   switch((int)curChar) {
+      case 61:
+         if ((active0 & 2147483648L) != 0L)
+         {
+            mccmatchedKind = 31;
+            mccmatchedPos = 1;
+         }
+         else if ((active0 & 8589934592L) != 0L)
+         {
+            mccmatchedKind = 33;
+            mccmatchedPos = 1;
+         }
+         break;
+      case 62:
+         if ((active0 & 536870912L) != 0L)
+         {
+            mccmatchedKind = 29;
+            mccmatchedPos = 1;
+         }
+         break;
+      case 65:
+         return mccMoveStringLiteralDfa2_0(active0, 131072L);
+      case 69:
+         return mccMoveStringLiteralDfa2_0(active0, 2048L);
+      case 73:
+         return mccMoveStringLiteralDfa2_0(active0, 4096L);
+      case 78:
+         if ((active0 & 16384L) != 0L)
+         {
+            mccmatchedKind = 14;
+            mccmatchedPos = 1;
+         }
+         return mccMoveStringLiteralDfa2_0(active0, 512L);
+      case 79:
+         return mccMoveStringLiteralDfa2_0(active0, 256L);
+      case 80:
+         return mccMoveStringLiteralDfa2_0(active0, 524288L);
+      case 81:
+         return mccMoveStringLiteralDfa2_0(active0, 1048576L);
+      case 82:
+         if ((active0 & 1024L) != 0L)
+         {
+            mccmatchedKind = 10;
+            mccmatchedPos = 1;
+         }
+         return mccMoveStringLiteralDfa2_0(active0, 65536L);
+      case 83:
+         if ((active0 & 32768L) != 0L)
+         {
+            mccmatchedKind = 15;
+            mccmatchedPos = 1;
+         }
+         return mccMoveStringLiteralDfa2_0(active0, 8192L);
+      case 85:
+         return mccMoveStringLiteralDfa2_0(active0, 262144L);
+      case 97:
+         return mccMoveStringLiteralDfa2_0(active0, 131072L);
+      case 101:
+         return mccMoveStringLiteralDfa2_0(active0, 2048L);
+      case 105:
+         return mccMoveStringLiteralDfa2_0(active0, 4096L);
+      case 110:
+         if ((active0 & 16384L) != 0L)
+         {
+            mccmatchedKind = 14;
+            mccmatchedPos = 1;
+         }
+         return mccMoveStringLiteralDfa2_0(active0, 512L);
+      case 111:
+         return mccMoveStringLiteralDfa2_0(active0, 256L);
+      case 112:
+         return mccMoveStringLiteralDfa2_0(active0, 524288L);
+      case 113:
+         return mccMoveStringLiteralDfa2_0(active0, 1048576L);
+      case 114:
+         if ((active0 & 1024L) != 0L)
+         {
+            mccmatchedKind = 10;
+            mccmatchedPos = 1;
+         }
+         return mccMoveStringLiteralDfa2_0(active0, 65536L);
+      case 115:
+         if ((active0 & 32768L) != 0L)
+         {
+            mccmatchedKind = 15;
+            mccmatchedPos = 1;
+         }
+         return mccMoveStringLiteralDfa2_0(active0, 8192L);
+      case 117:
+         return mccMoveStringLiteralDfa2_0(active0, 262144L);
+      default :
+         break;
+   }
+   return mccMoveNfa_0(5, 1);
+}
+private int mccMoveStringLiteralDfa2_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return mccMoveNfa_0(5, 1);
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) {
+   return mccMoveNfa_0(5, 1);
+   }
+   switch((int)curChar) {
+      case 65:
+         return mccMoveStringLiteralDfa3_0(active0, 524288L);
+      case 67:
+         return mccMoveStringLiteralDfa3_0(active0, 8192L);
+      case 68:
+         if ((active0 & 512L) != 0L)
+         {
+            mccmatchedKind = 9;
+            mccmatchedPos = 2;
+         }
+         break;
+      case 75:
+         return mccMoveStringLiteralDfa3_0(active0, 4096L);
+      case 76:
+         return mccMoveStringLiteralDfa3_0(active0, 393216L);
+      case 84:
+         if ((active0 & 256L) != 0L)
+         {
+            mccmatchedKind = 8;
+            mccmatchedPos = 2;
+         }
+         return mccMoveStringLiteralDfa3_0(active0, 2048L);
+      case 85:
+         return mccMoveStringLiteralDfa3_0(active0, 1114112L);
+      case 97:
+         return mccMoveStringLiteralDfa3_0(active0, 524288L);
+      case 99:
+         return mccMoveStringLiteralDfa3_0(active0, 8192L);
+      case 100:
+         if ((active0 & 512L) != 0L)
+         {
+            mccmatchedKind = 9;
+            mccmatchedPos = 2;
+         }
+         break;
+      case 107:
+         return mccMoveStringLiteralDfa3_0(active0, 4096L);
+      case 108:
+         return mccMoveStringLiteralDfa3_0(active0, 393216L);
+      case 116:
+         if ((active0 & 256L) != 0L)
+         {
+            mccmatchedKind = 8;
+            mccmatchedPos = 2;
+         }
+         return mccMoveStringLiteralDfa3_0(active0, 2048L);
+      case 117:
+         return mccMoveStringLiteralDfa3_0(active0, 1114112L);
+      default :
+         break;
+   }
+   return mccMoveNfa_0(5, 2);
+}
+private int mccMoveStringLiteralDfa3_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return mccMoveNfa_0(5, 2);
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) {
+   return mccMoveNfa_0(5, 2);
+   }
+   switch((int)curChar) {
+      case 65:
+         return mccMoveStringLiteralDfa4_0(active0, 8192L);
+      case 69:
+         if ((active0 & 4096L) != 0L)
+         {
+            mccmatchedKind = 12;
+            mccmatchedPos = 3;
+         }
+         else if ((active0 & 65536L) != 0L)
+         {
+            mccmatchedKind = 16;
+            mccmatchedPos = 3;
+         }
+         return mccMoveStringLiteralDfa4_0(active0, 1048576L);
+      case 76:
+         if ((active0 & 262144L) != 0L)
+         {
+            mccmatchedKind = 18;
+            mccmatchedPos = 3;
+         }
+         break;
+      case 83:
+         return mccMoveStringLiteralDfa4_0(active0, 131072L);
+      case 84:
+         return mccMoveStringLiteralDfa4_0(active0, 524288L);
+      case 87:
+         return mccMoveStringLiteralDfa4_0(active0, 2048L);
+      case 97:
+         return mccMoveStringLiteralDfa4_0(active0, 8192L);
+      case 101:
+         if ((active0 & 4096L) != 0L)
+         {
+            mccmatchedKind = 12;
+            mccmatchedPos = 3;
+         }
+         else if ((active0 & 65536L) != 0L)
+         {
+            mccmatchedKind = 16;
+            mccmatchedPos = 3;
+         }
+         return mccMoveStringLiteralDfa4_0(active0, 1048576L);
+      case 108:
+         if ((active0 & 262144L) != 0L)
+         {
+            mccmatchedKind = 18;
+            mccmatchedPos = 3;
+         }
+         break;
+      case 115:
+         return mccMoveStringLiteralDfa4_0(active0, 131072L);
+      case 116:
+         return mccMoveStringLiteralDfa4_0(active0, 524288L);
+      case 119:
+         return mccMoveStringLiteralDfa4_0(active0, 2048L);
+      default :
+         break;
+   }
+   return mccMoveNfa_0(5, 3);
+}
+private int mccMoveStringLiteralDfa4_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return mccMoveNfa_0(5, 3);
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) {
+   return mccMoveNfa_0(5, 3);
+   }
+   switch((int)curChar) {
+      case 69:
+         if ((active0 & 131072L) != 0L)
+         {
+            mccmatchedKind = 17;
+            mccmatchedPos = 4;
+         }
+         return mccMoveStringLiteralDfa5_0(active0, 2048L);
+      case 72:
+         if ((active0 & 524288L) != 0L)
+         {
+            mccmatchedKind = 19;
+            mccmatchedPos = 4;
+         }
+         break;
+      case 80:
+         return mccMoveStringLiteralDfa5_0(active0, 8192L);
+      case 82:
+         return mccMoveStringLiteralDfa5_0(active0, 1048576L);
+      case 101:
+         if ((active0 & 131072L) != 0L)
+         {
+            mccmatchedKind = 17;
+            mccmatchedPos = 4;
+         }
+         return mccMoveStringLiteralDfa5_0(active0, 2048L);
+      case 104:
+         if ((active0 & 524288L) != 0L)
+         {
+            mccmatchedKind = 19;
+            mccmatchedPos = 4;
+         }
+         break;
+      case 112:
+         return mccMoveStringLiteralDfa5_0(active0, 8192L);
+      case 114:
+         return mccMoveStringLiteralDfa5_0(active0, 1048576L);
+      default :
+         break;
+   }
+   return mccMoveNfa_0(5, 4);
+}
+private int mccMoveStringLiteralDfa5_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return mccMoveNfa_0(5, 4);
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) {
+   return mccMoveNfa_0(5, 4);
+   }
+   switch((int)curChar) {
+      case 69:
+         if ((active0 & 8192L) != 0L)
+         {
+            mccmatchedKind = 13;
+            mccmatchedPos = 5;
+         }
+         return mccMoveStringLiteralDfa6_0(active0, 2048L);
+      case 89:
+         if ((active0 & 1048576L) != 0L)
+         {
+            mccmatchedKind = 20;
+            mccmatchedPos = 5;
+         }
+         break;
+      case 101:
+         if ((active0 & 8192L) != 0L)
+         {
+            mccmatchedKind = 13;
+            mccmatchedPos = 5;
+         }
+         return mccMoveStringLiteralDfa6_0(active0, 2048L);
+      case 121:
+         if ((active0 & 1048576L) != 0L)
+         {
+            mccmatchedKind = 20;
+            mccmatchedPos = 5;
+         }
+         break;
+      default :
+         break;
+   }
+   return mccMoveNfa_0(5, 5);
+}
+private int mccMoveStringLiteralDfa6_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return mccMoveNfa_0(5, 5);
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) {
+   return mccMoveNfa_0(5, 5);
+   }
+   switch((int)curChar) {
+      case 78:
+         if ((active0 & 2048L) != 0L)
+         {
+            mccmatchedKind = 11;
+            mccmatchedPos = 6;
+         }
+         break;
+      case 110:
+         if ((active0 & 2048L) != 0L)
+         {
+            mccmatchedKind = 11;
+            mccmatchedPos = 6;
+         }
+         break;
+      default :
+         break;
+   }
+   return mccMoveNfa_0(5, 6);
+}
+private void mccCheckNAdd(int state)
+{
+   if (mccrounds[state] != mccround)
+   {
+      mccstateSet[mccnewStateCnt++] = state;
+      mccrounds[state] = mccround;
+   }
+}
+private void mccAddStates(int start, int end)
+{
+   do {
+      mccstateSet[mccnewStateCnt++] = mccnextStates[start];
+   } while (start++ != end);
+}
+private void mccCheckNAddTwoStates(int state1, int state2)
+{
+   mccCheckNAdd(state1);
+   mccCheckNAdd(state2);
+}
+private void mccCheckNAddStates(int start, int end)
+{
+   do {
+      mccCheckNAdd(mccnextStates[start]);
+   } while (start++ != end);
+}
+private void mccCheckNAddStates(int start)
+{
+   mccCheckNAdd(mccnextStates[start]);
+   mccCheckNAdd(mccnextStates[start + 1]);
+}
+static readonly long[] mccbitVec0 = {
+   -2, -1L, -1L, -1L
+};
+static readonly long[] mccbitVec1 = {
+   -1L, -1L, -1L, -1L
+};
+static readonly long[] mccbitVec2 = {
+   0L, 0L, -1L, -1L
+};
+private int mccMoveNfa_0(int startState, int curPos)
+{
+   int strKind = mccmatchedKind;
+   int strPos = mccmatchedPos;
+   int seenUpto = curPos + 1;
+   input_stream.Backup(seenUpto);
+   try { curChar = input_stream.ReadChar(); }
+   catch(System.IO.IOException) { throw new Exception("Internal Error"); }
+   curPos = 0;
+   //int[] nextStates;
+   int startsAt = 0;
+   mccnewStateCnt = 43;
+   int i = 1;
+   mccstateSet[0] = startState;
+   int /*j,*/ kind = Int32.MaxValue;
+   for (;;)
+   {
+      if (++mccround == Int32.MaxValue)
+         ReInitRounds();
+      if (curChar < 64)
+      {
+         long l = 1L << curChar;
+         do
+         {
+            switch(mccstateSet[--i])
+            {
+               case 5:
+                  if ((287948901175001088 & l) != 0L)
+                     mccCheckNAddStates(0, 3);
+                  else if (curChar == 36)
+                  {
+                     if (kind > 27)
+                        kind = 27;
+                     mccCheckNAdd(27);
+                  }
+                  else if (curChar == 39)
+                     mccCheckNAddStates(4, 6);
+                  else if (curChar == 46)
+                     mccCheckNAdd(17);
+                  else if (curChar == 47)
+                     mccstateSet[mccnewStateCnt++] = 6;
+                  else if (curChar == 45)
+                     mccstateSet[mccnewStateCnt++] = 0;
+                  if ((287667426198290432 & l) != 0L)
+                  {
+                     if (kind > 21)
+                        kind = 21;
+                     mccCheckNAddTwoStates(14, 15);
+                  }
+                  else if (curChar == 48)
+                  {
+                     if (kind > 23)
+                        kind = 23;
+                     mccCheckNAddTwoStates(40, 42);
+                  }
+                  break;
+               case 0:
+                  if (curChar == 45)
+                     mccCheckNAddStates(7, 9);
+                  break;
+               case 1:
+                  if ((-9217 & l) != 0L)
+                     mccCheckNAddStates(7, 9);
+                  break;
+               case 2:
+                  if ((9216 & l) != 0L && kind > 6)
+                     kind = 6;
+                  break;
+               case 3:
+                  if (curChar == 10 && kind > 6)
+                     kind = 6;
+                  break;
+               case 4:
+                  if (curChar == 13)
+                     mccstateSet[mccnewStateCnt++] = 3;
+                  break;
+               case 6:
+                  if (curChar == 42)
+                     mccCheckNAddTwoStates(7, 8);
+                  break;
+               case 7:
+                  if ((-4398046511105 & l) != 0L)
+                     mccCheckNAddTwoStates(7, 8);
+                  break;
+               case 8:
+                  if (curChar == 42)
+                     mccCheckNAddStates(10, 12);
+                  break;
+               case 9:
+                  if ((-145135534866433 & l) != 0L)
+                     mccCheckNAddTwoStates(10, 8);
+                  break;
+               case 10:
+                  if ((-4398046511105 & l) != 0L)
+                     mccCheckNAddTwoStates(10, 8);
+                  break;
+               case 11:
+                  if (curChar == 47 && kind > 7)
+                     kind = 7;
+                  break;
+               case 12:
+                  if (curChar == 47)
+                     mccstateSet[mccnewStateCnt++] = 6;
+                  break;
+               case 13:
+                  if ((287667426198290432 & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  mccCheckNAddTwoStates(14, 15);
+                  break;
+               case 14:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  mccCheckNAddTwoStates(14, 15);
+                  break;
+               case 16:
+                  if (curChar == 46)
+                     mccCheckNAdd(17);
+                  break;
+               case 17:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  mccCheckNAddTwoStates(17, 18);
+                  break;
+               case 19:
+                  if ((43980465111040 & l) != 0L)
+                     mccCheckNAdd(20);
+                  break;
+               case 20:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  mccCheckNAdd(20);
+                  break;
+               case 21:
+               case 22:
+                  if (curChar == 39)
+                     mccCheckNAddStates(4, 6);
+                  break;
+               case 23:
+                  if (curChar == 39)
+                     mccstateSet[mccnewStateCnt++] = 22;
+                  break;
+               case 24:
+                  if ((-549755813889 & l) != 0L)
+                     mccCheckNAddStates(4, 6);
+                  break;
+               case 25:
+                  if (curChar == 39 && kind > 26)
+                     kind = 26;
+                  break;
+               case 26:
+                  if (curChar != 36)
+                     break;
+                  if (kind > 27)
+                     kind = 27;
+                  mccCheckNAdd(27);
+                  break;
+               case 27:
+                  if ((287948969894477824 & l) == 0L)
+                     break;
+                  if (kind > 27)
+                     kind = 27;
+                  mccCheckNAdd(27);
+                  break;
+               case 28:
+                  if ((287948901175001088 & l) != 0L)
+                     mccCheckNAddStates(0, 3);
+                  break;
+               case 29:
+                  if ((287948901175001088 & l) != 0L)
+                     mccCheckNAddTwoStates(29, 30);
+                  break;
+               case 30:
+                  if (curChar != 46)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  mccCheckNAddTwoStates(31, 32);
+                  break;
+               case 31:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  mccCheckNAddTwoStates(31, 32);
+                  break;
+               case 33:
+                  if ((43980465111040 & l) != 0L)
+                     mccCheckNAdd(34);
+                  break;
+               case 34:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  mccCheckNAdd(34);
+                  break;
+               case 35:
+                  if ((287948901175001088 & l) != 0L)
+                     mccCheckNAddTwoStates(35, 36);
+                  break;
+               case 37:
+                  if ((43980465111040 & l) != 0L)
+                     mccCheckNAdd(38);
+                  break;
+               case 38:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  mccCheckNAdd(38);
+                  break;
+               case 39:
+                  if (curChar != 48)
+                     break;
+                  if (kind > 23)
+                     kind = 23;
+                  mccCheckNAddTwoStates(40, 42);
+                  break;
+               case 41:
+                  if ((287948901175001088 & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  mccstateSet[mccnewStateCnt++] = 41;
+                  break;
+               case 42:
+                  if ((71776119061217280 & l) == 0L)
+                     break;
+                  if (kind > 23)
+                     kind = 23;
+                  mccCheckNAdd(42);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else if (curChar < 128)
+      {
+         long l = 1L << (curChar & 63);
+         do
+         {
+            switch(mccstateSet[--i])
+            {
+               case 5:
+               case 27:
+                  if ((576460745995190270 & l) == 0L)
+                     break;
+                  if (kind > 27)
+                     kind = 27;
+                  mccCheckNAdd(27);
+                  break;
+               case 1:
+                  mccAddStates(7, 9);
+                  break;
+               case 7:
+                  mccCheckNAddTwoStates(7, 8);
+                  break;
+               case 9:
+               case 10:
+                  mccCheckNAddTwoStates(10, 8);
+                  break;
+               case 15:
+                  if ((17592186048512 & l) != 0L && kind > 21)
+                     kind = 21;
+                  break;
+               case 18:
+                  if ((137438953504 & l) != 0L)
+                     mccAddStates(13, 14);
+                  break;
+               case 24:
+                  mccAddStates(4, 6);
+                  break;
+               case 32:
+                  if ((137438953504 & l) != 0L)
+                     mccAddStates(15, 16);
+                  break;
+               case 36:
+                  if ((137438953504 & l) != 0L)
+                     mccAddStates(17, 18);
+                  break;
+               case 40:
+                  if ((72057594054705152 & l) != 0L)
+                     mccCheckNAdd(41);
+                  break;
+               case 41:
+                  if ((541165879422 & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  mccCheckNAdd(41);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else
+      {
+         int hiByte = (curChar >> 8);
+         int i1 = hiByte >> 6;
+         long l1 = 1L << (hiByte & 63);
+         int i2 = (curChar & 0xff) >> 6;
+         long l2 = 1L << (curChar & 63);
+         do
+         {
+            switch(mccstateSet[--i])
+            {
+               case 1:
+                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
+                     mccAddStates(7, 9);
+                  break;
+               case 7:
+                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
+                     mccCheckNAddTwoStates(7, 8);
+                  break;
+               case 9:
+               case 10:
+                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
+                     mccCheckNAddTwoStates(10, 8);
+                  break;
+               case 24:
+                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
+                     mccAddStates(4, 6);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      if (kind != Int32.MaxValue)
+      {
+         mccmatchedKind = kind;
+         mccmatchedPos = curPos;
+         kind = Int32.MaxValue;
+      }
+      ++curPos;
+      if ((i = mccnewStateCnt) == (startsAt = 43 - (mccnewStateCnt = startsAt)))
+         break;
+      try { curChar = input_stream.ReadChar(); }
+      catch(System.IO.IOException) { break; }
+   }
+   if (mccmatchedPos > 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(System.IO.IOException) { throw new Exception("Internal Error : Please send a bug report."); }
+
+   if (mccmatchedPos < strPos)
+   {
+      mccmatchedKind = strKind;
+      mccmatchedPos = strPos;
+   }
+   else if (mccmatchedPos == strPos && mccmatchedKind > strKind)
+      mccmatchedKind = strKind;
+
+   return toRet;
+}
+static readonly int[] mccnextStates = {
+   29, 30, 35, 36, 23, 24, 25, 1, 2, 4, 8, 9, 11, 19, 20, 33, 
+   34, 37, 38, 
+};
+private static bool mccCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((mccbitVec2[i2] & l2) != 0L);
+      default : 
+         if ((mccbitVec0[i1] & l1) != 0L)
+            if ((mccbitVec1[i2] & l2) == 0L)
+               return false;
+            else
+            return true;
+         return false;
+   }
+}
+public static readonly string[] mccstrLiteralImages = {
+"", 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, 
+null, "=", "<>", ">", ">=", "<", "<=", "(", ",", ")", "+", "-", "*", "/", "%", };
+public static readonly string[] lexStateNames = {
+   "DEFAULT", 
+};
+static readonly long[] mcctoToken = {
+   4398012956417, 
+};
+static readonly long[] mcctoSkip = {
+   254, 
+};
+static readonly long[] mcctoSpecial = {
+   62, 
+};
+protected SimpleCharStream input_stream;
+private readonly int[] mccrounds = new int[43];
+private readonly int[] mccstateSet = new int[86];
+protected char curChar;
+public SelectorParserTokenManager(SimpleCharStream stream) {
+   if (SimpleCharStream.staticFlag)
+      throw new System.SystemException("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+   input_stream = stream;
+}
+public SelectorParserTokenManager(SimpleCharStream stream, int lexState)
+   : this(stream) {
+   SwitchTo(lexState);
+}
+public void ReInit(SimpleCharStream stream) {
+   mccmatchedPos = mccnewStateCnt = 0;
+   curLexState = defaultLexState;
+   input_stream = stream;
+   ReInitRounds();
+}
+private void ReInitRounds()
+{
+   int i;
+   mccround = -2147483647;
+   for (i = 43; i-- > 0;)
+      mccrounds[i] = Int32.MinValue;
+}
+public void ReInit(SimpleCharStream stream, int lexState) {
+   ReInit(stream);
+   SwitchTo(lexState);
+}
+public void SwitchTo(int lexState) {
+   if (lexState >= 1 || lexState < 0)
+      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.InvalidLexicalState);
+   else
+      curLexState = lexState;
+}
+
+protected Token mccFillToken()
+{
+   Token t = Token.NewToken(mccmatchedKind);
+   t.kind = mccmatchedKind;
+   string im = mccstrLiteralImages[mccmatchedKind];
+   t.image = (im == null) ? input_stream.GetImage() : im;
+   t.beginLine = input_stream.BeginLine;
+   t.beginColumn = input_stream.BeginColumn;
+   t.endLine = input_stream.EndLine;
+   t.endColumn = input_stream.EndColumn;
+   return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int mccnewStateCnt;
+int mccround;
+int mccmatchedPos;
+int mccmatchedKind;
+
+public Token GetNextToken() {
+  //int kind;
+  Token specialToken = null;
+  Token matchedToken;
+  int curPos = 0;
+
+for (;;) {
+   try {
+      curChar = input_stream.BeginToken();
+   } catch(System.IO.IOException) {
+      mccmatchedKind = 0;
+      matchedToken = mccFillToken();
+      matchedToken.specialToken = specialToken;
+      return matchedToken;
+   }
+
+   mccmatchedKind = Int32.MaxValue;
+   mccmatchedPos = 0;
+   curPos = mccMoveStringLiteralDfa0_0();
+   if (mccmatchedKind != Int32.MaxValue) {
+      if (mccmatchedPos + 1 < curPos)
+         input_stream.Backup(curPos - mccmatchedPos - 1);
+      if ((mcctoToken[mccmatchedKind >> 6] & (1L << (mccmatchedKind & 63))) != 0L) {
+         matchedToken = mccFillToken();
+         matchedToken.specialToken = specialToken;
+         return matchedToken;
+      }
+      else
+      {
+         if ((mcctoSpecial[mccmatchedKind >> 6] & (1L << (mccmatchedKind & 63))) != 0L) {
+            matchedToken = mccFillToken();
+            if (specialToken == null)
+               specialToken = matchedToken;
+            else {
+               matchedToken.specialToken = specialToken;
+               specialToken = (specialToken.next = matchedToken);
+            }
+         }
+         goto EOFLoop;
+      }
+   }
+   int error_line = input_stream.EndLine;
+   int error_column = input_stream.EndColumn;
+   string error_after = null;
+   bool EOFSeen = false;
+   try { input_stream.ReadChar(); input_stream.Backup(1); }
+   catch (System.IO.IOException) {
+      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.LexicalError);
+EOFLoop: ;
+  }
+}
+
+}

Added: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SimpleCharStream.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SimpleCharStream.cs?rev=1751831&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SimpleCharStream.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/SimpleCharStream.cs Thu Jul  7 20:47:10 2016
@@ -0,0 +1,366 @@
+/* Generated By:CSharpCC: Do not edit this line. SimpleCharStream.cs Version 3.3 */
+/// <summary>
+/// An implementation of interface CharStream, where the stream is assumed to
+/// contain only ASCII characters (without unicode processing).
+/// </summary>
+
+public  class SimpleCharStream {
+  public static readonly bool staticFlag = false;
+  int bufsize;
+  int available;
+  int tokenBegin;
+  public int bufpos = -1;
+  protected int[] bufline;
+  protected int[] bufcolumn;
+
+  protected int column = 0;
+  protected int line = 1;
+
+  protected bool prevCharIsCR = false;
+  protected bool prevCharIsLF = false;
+
+  protected System.IO.TextReader inputStream;
+
+  protected char[] buffer;
+  protected int maxNextCharInd = 0;
+  protected int inBuf = 0;
+
+  protected void ExpandBuff(bool wrapAround)
+  {
+     char[] newbuffer = new char[bufsize + 2048];
+     int[] newbufline = new int[bufsize + 2048];
+     int[] newbufcolumn = new int[bufsize + 2048];
+
+     try {
+        if (wrapAround) {
+           System.Array.Copy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           System.Array.Copy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
+           buffer = newbuffer;
+
+           System.Array.Copy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           System.Array.Copy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+           bufline = newbufline;
+
+           System.Array.Copy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           System.Array.Copy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+        } else {
+           System.Array.Copy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           buffer = newbuffer;
+
+           System.Array.Copy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           bufline = newbufline;
+
+           System.Array.Copy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos -= tokenBegin);
+        }
+     } catch (System.Exception e) {
+        throw new System.SystemException(e.Message);
+     }
+
+
+     bufsize += 2048;
+     available = bufsize;
+     tokenBegin = 0;
+  }
+
+  protected void FillBuff() {
+     if (maxNextCharInd == available) {
+        if (available == bufsize) {
+           if (tokenBegin > 2048) {
+              bufpos = maxNextCharInd = 0;
+              available = tokenBegin;
+           } else if (tokenBegin < 0)
+              bufpos = maxNextCharInd = 0;
+           else
+              ExpandBuff(false);
+        } else if (available > tokenBegin)
+           available = bufsize;
+        else if ((tokenBegin - available) < 2048)
+           ExpandBuff(true);
+        else
+           available = tokenBegin;
+     }
+
+     int i;
+     try {
+        if ((i = inputStream.Read(buffer, maxNextCharInd,
+                                    available - maxNextCharInd)) == -1) {
+           inputStream.Close();
+           throw new System.IO.IOException();
+        } else
+           maxNextCharInd += i;
+        return;
+     } catch(System.IO.IOException e) {
+        --bufpos;
+        Backup(0);
+        if (tokenBegin == -1)
+           tokenBegin = bufpos;
+        throw e;
+     }
+  }
+
+  public char BeginToken() {
+     tokenBegin = -1;
+     try {
+         char c = ReadChar();
+         tokenBegin = bufpos;
+         return c;
+     } catch (System.IO.EndOfStreamException e) {
+         if (tokenBegin == -1)
+             tokenBegin = bufpos;
+         throw e;
+     }
+  }
+
+  protected void UpdateLineColumn(char c) {
+     column++;
+
+     if (prevCharIsLF) {
+        prevCharIsLF = false;
+        line += (column = 1);
+     } else if (prevCharIsCR) {
+        prevCharIsCR = false;
+        if (c == '\n') {
+           prevCharIsLF = true;
+        } else
+           line += (column = 1);
+     }
+
+     switch (c) {
+        case '\r' :
+           prevCharIsCR = true;
+           break;
+        case '\n' :
+           prevCharIsLF = true;
+           break;
+        case '\t' :
+           column--;
+           column += (8 - (column & 07));
+           break;
+        default :
+           break;
+     }
+
+     bufline[bufpos] = line;
+     bufcolumn[bufpos] = column;
+  }
+
+  public char ReadChar() {
+     if (inBuf > 0) {
+        --inBuf;
+
+        if (++bufpos == bufsize)
+           bufpos = 0;
+
+        return buffer[bufpos];
+     }
+
+     if (++bufpos >= maxNextCharInd)
+        FillBuff();
+     if (bufpos >= maxNextCharInd) {
+        bufpos--;
+        if (bufpos < 0)
+            bufpos += bufsize;
+        throw new System.IO.EndOfStreamException();
+     }
+
+     char c = buffer[bufpos];
+
+     UpdateLineColumn(c);
+     return (c);
+  }
+
+[System.Obsolete("Deprecated - use EndColumn instead.", false)]
+
+  public int Column {
+  get {
+       return bufcolumn[bufpos];
+    }
+  }
+
+[System.Obsolete("Deprecated - use EndLine instead.", false)]
+
+  public int Line {
+  get {
+       return bufline[bufpos];
+    }
+  }
+
+  public int EndColumn {
+  get {
+       return bufcolumn[bufpos];
+    }
+  }
+
+  public int EndLine {
+  get {
+       return bufline[bufpos];
+    }
+  }
+
+  public int BeginColumn {
+  get {
+       return bufcolumn[tokenBegin];
+    }
+  }
+
+  public int BeginLine {
+  get {
+       return bufline[tokenBegin];
+    }
+  }
+
+  public void Backup(int amount) {
+
+    inBuf += amount;
+    if ((bufpos -= amount) < 0)
+       bufpos += bufsize;
+  }
+
+  public SimpleCharStream(System.IO.TextReader dstream, int startline,
+  int startcolumn, int buffersize) {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    available = bufsize = buffersize;
+    buffer = new char[buffersize];
+    bufline = new int[buffersize];
+    bufcolumn = new int[buffersize];
+  }
+
+  public SimpleCharStream(System.IO.TextReader dstream, int startline,
+                                                           int startcolumn) : 
+     this(dstream, startline, startcolumn, 4096) {
+  }
+
+  public SimpleCharStream(System.IO.TextReader dstream) :
+     this(dstream, 1, 1, 4096) {
+  }
+  public void ReInit(System.IO.TextReader dstream, int startline,
+  int startcolumn, int buffersize) {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    if (buffer == null || buffersize != buffer.Length) {
+      available = bufsize = buffersize;
+      buffer = new char[buffersize];
+      bufline = new int[buffersize];
+      bufcolumn = new int[buffersize];
+    }
+    prevCharIsLF = prevCharIsCR = false;
+    tokenBegin = inBuf = maxNextCharInd = 0;
+    bufpos = -1;
+  }
+
+  public void ReInit(System.IO.TextReader dstream, int startline,
+                                                           int startcolumn) {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+
+  public void ReInit(System.IO.TextReader dstream) {
+     ReInit(dstream, 1, 1, 4096);
+  }
+  public SimpleCharStream(System.IO.Stream dstream, int startline,
+  int startcolumn, int buffersize) :
+     this(new System.IO.StreamReader(dstream), startline, startcolumn, 4096) {
+  }
+
+  public SimpleCharStream(System.IO.Stream dstream, int startline,
+                                                           int startcolumn) :
+     this(dstream, startline, startcolumn, 4096) {
+  }
+
+  public SimpleCharStream(System.IO.Stream dstream) :
+     this(dstream, 1, 1, 4096) {
+  }
+
+  public void ReInit(System.IO.Stream dstream, int startline,
+                          int startcolumn, int buffersize) {
+     ReInit(new System.IO.StreamReader(dstream), startline, startcolumn, 4096);
+  }
+
+  public void ReInit(System.IO.Stream dstream) {
+     ReInit(dstream, 1, 1, 4096);
+  }
+  public void ReInit(System.IO.Stream dstream, int startline,
+                                                           int startcolumn) {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+  public string GetImage() {
+     if (bufpos >= tokenBegin)
+        return new string(buffer, tokenBegin, bufpos - tokenBegin + 1);
+     else
+        return new string(buffer, tokenBegin, bufsize - tokenBegin) +
+                              new string(buffer, 0, bufpos + 1);
+  }
+
+  public char[] GetSuffix(int len) {
+     char[] ret = new char[len];
+
+     if ((bufpos + 1) >= len)
+        System.Array.Copy(buffer, bufpos - len + 1, ret, 0, len);
+     else {
+        System.Array.Copy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+                                                          len - bufpos - 1);
+        System.Array.Copy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+     }
+
+     return ret;
+  }
+
+  public void Done()
+  {
+     buffer = null;
+     bufline = null;
+     bufcolumn = null;
+  }
+
+  /// <summary>
+  /// Method to adjust line and column numbers for the start of a token.
+  /// </summary>
+  public void AdjustBeginLineColumn(int newLine, int newCol) {
+     int start = tokenBegin;
+     int len;
+
+     if (bufpos >= tokenBegin) {
+        len = bufpos - tokenBegin + inBuf + 1;
+     } else {
+        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+     }
+
+     int i = 0, j = 0, k = 0;
+     int nextColDiff = 0, columnDiff = 0;
+
+     while (i < len &&
+            bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {
+        bufline[j] = newLine;
+        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+        bufcolumn[j] = newCol + columnDiff;
+        columnDiff = nextColDiff;
+        i++;
+     } 
+
+     if (i < len) {
+        bufline[j] = newLine++;
+        bufcolumn[j] = newCol + columnDiff;
+
+        while (i++ < len) {
+           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+              bufline[j] = newLine++;
+           else
+              bufline[j] = newLine;
+        }
+     }
+
+     line = bufline[j];
+     column = bufcolumn[j];
+  }
+
+}

Added: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/Token.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/Token.cs?rev=1751831&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/Token.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/Token.cs Thu Jul  7 20:47:10 2016
@@ -0,0 +1,78 @@
+/* Generated By:CSharpCC: Do not edit this line. Token.cs Version 3.0 */
+/// <summary>
+/// Describes the input token stream.
+/// </summary>
+
+public  class Token {
+
+  /// <summary>
+  /// Gets an integer that describes the kind of this token.
+  /// </summary>
+  /// <remarks>
+  /// This numbering system is determined by CSharpCCParser, and 
+  /// a table of these numbers is stored in the class <see cref="SelectorParserConstants"/>.
+  /// </remarks>
+  public int kind;
+
+  /**
+   * beginLine and beginColumn describe the position of the first character
+   * of this token; endLine and endColumn describe the position of the
+   * last character of this token.
+   */
+  public int beginLine, beginColumn, endLine, endColumn;
+
+  /**
+   * The string image of the token.
+   */
+  public string image;
+
+  /**
+   * A reference to the next regular (non-special) token from the input
+   * stream.  If this is the last token from the input stream, or if the
+   * token manager has not read tokens beyond this one, this field is
+   * set to null.  This is true only if this token is also a regular
+   * token.  Otherwise, see below for a description of the contents of
+   * this field.
+   */
+  public Token next;
+
+  /**
+   * This field is used to access special tokens that occur prior to this
+   * token, but after the immediately preceding regular (non-special) token.
+   * If there are no such special tokens, this field is set to null.
+   * When there are more than one such special token, this field refers
+   * to the last of these special tokens, which in turn refers to the next
+   * previous special token through its specialToken field, and so on
+   * until the first special token (whose specialToken field is null).
+   * The next fields of special tokens refer to other special tokens that
+   * immediately follow it (without an intervening regular token).  If there
+   * is no such token, this field is null.
+   */
+  public Token specialToken;
+
+  /**
+   * Returns the image.
+   */
+  public override string ToString() {
+     return image;
+  }
+
+  /**
+   * Returns a new Token object, by default. However, if you want, you
+   * can create and return subclass objects based on the value of ofKind.
+   * Simply add the cases to the switch for all those special cases.
+   * For example, if you have a subclass of Token called IDToken that
+   * you want to create if ofKind is ID, simlpy add something like :
+   *
+   *    case MyParserConstants.ID : return new IDToken();
+   *
+   * to the following switch statement. Then you can cast matchedToken
+   * variable to the appropriate type and use it in your lexical actions.
+   */
+  public static Token NewToken(int ofKind) {
+     switch(ofKind) {
+       default : return new Token();
+     }
+  }
+
+}

Added: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/TokenMgrError.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/TokenMgrError.cs?rev=1751831&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/TokenMgrError.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/TokenMgrError.cs Thu Jul  7 20:47:10 2016
@@ -0,0 +1,130 @@
+/* Generated By:CSharpCC: Do not edit this line. TokenMgrError.cs Version 3.0 */
+public  class TokenMgrError : System.SystemException
+{
+   /*
+    * Ordinals for various reasons why an Exceptions of this type can be thrown.
+    */
+
+   /**
+    * Lexical error occured.
+    */
+   internal static readonly int LexicalError = 0;
+
+   /**
+    * An attempt wass made to create a second instance of a static token manager.
+    */
+   internal static readonly int StaticLexerError = 1;
+
+   /**
+    * Tried to change to an invalid lexical state.
+    */
+   internal static readonly int InvalidLexicalState = 2;
+
+   /**
+    * Detected (and bailed out of) an infinite loop in the token manager.
+    */
+   internal static readonly int LoopDetected = 3;
+
+   /**
+    * Indicates the reason why the exception is thrown. It will have
+    * one of the above 4 values.
+    */
+   int errorCode;
+
+   /**
+    * Replaces unprintable characters by their espaced (or unicode escaped)
+    * equivalents in the given string
+    */
+   protected static string AddEscapes(string str) {
+      System.Text.StringBuilder retval = new System.Text.StringBuilder();
+      char ch;
+      for (int i = 0; i < str.Length; i++) {
+        switch (str[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[i]) < 0x20 || ch > 0x7e) {
+                 string s = "0000" + System.Convert.ToString((int)ch, 16);
+                 retval.Append("\\u" + s.Substring(s.Length - 4, s.Length - (s.Length - 4)));
+              } else {
+                 retval.Append(ch);
+              }
+              continue;
+        }
+      }
+      return retval.ToString();
+   }
+
+   /**
+    * Returns a detailed message for the Exception when it is thrown by the
+    * token manager to indicate a lexical error.
+    * Parameters : 
+    *    EOFSeen     : indicates if EOF caused the lexicl error
+    *    curLexState : lexical state in which this error occured
+    *    errorLine   : line number when the error occured
+    *    errorColumn : column number when the error occured
+    *    errorAfter  : prefix that was seen before this error occured
+    *    curchar     : the offending character
+    * Note: You can customize the lexical error message by modifying this method.
+    */
+   protected static string GetLexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar) {
+      return("Lexical error at line " +
+           errorLine + ", column " +
+           errorColumn + ".  Encountered: " +
+           (EOFSeen ? "<EOF> " : ("\"" + AddEscapes(curChar.ToString()) + "\"") + " (" + (int)curChar + "), ") +
+           "after : \"" + AddEscapes(errorAfter) + "\"");
+   }
+
+   /**
+    * You can also modify the body of this method to customize your error messages.
+    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+    * of end-users concern, so you can return something like : 
+    *
+    *     "Internal Error : Please file a bug report .... "
+    *
+    * from this method for such cases in the release version of your parser.
+    */
+   public override string Message {
+      get { return base.Message; }
+   }
+
+   /*
+    * Constructors of various flavors follow.
+    */
+
+   public TokenMgrError() {
+   }
+
+   public TokenMgrError(string message, int reason) :
+      base(message) {
+      errorCode = reason;
+   }
+
+   public TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, string errorAfter, char curChar, int reason) :
+      this(GetLexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason) {
+   }
+}

Added: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/UnaryExpression.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/UnaryExpression.cs?rev=1751831&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/UnaryExpression.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Selector/UnaryExpression.cs Thu Jul  7 20:47:10 2016
@@ -0,0 +1,66 @@
+using System;
+/**
+ *
+ * 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.
+ */
+
+namespace Apache.NMS.Selector
+{
+    /// <summary>
+    /// An expression which performs an operation on one expression value.
+    /// </summary>
+    public abstract class UnaryExpression : IExpression
+    {
+        protected IExpression rightExpression;
+        public IExpression Right
+        {
+            get { return rightExpression; }
+            set { rightExpression = value; }
+        }
+
+        protected abstract string ExpressionSymbol
+        {
+            get;
+        }
+
+        public UnaryExpression(IExpression left)
+        {
+            this.rightExpression = left;
+        }
+
+        public abstract object Evaluate(MessageEvaluationContext message);
+
+        public override string ToString()
+        {
+            return "(" + ExpressionSymbol + " " + rightExpression.ToString() + ")";
+        }
+
+        public static IExpression CreateNegate(IExpression left)
+        {
+            return new NegateExpression(left);
+        }
+
+        public static IBooleanExpression CreateNOT(IBooleanExpression left)
+        {
+            return new NOTExpression(left);
+        }
+
+        public static IBooleanExpression CreateBooleanCast(IExpression left)
+        {
+            return new BooleanCastExpression(left);
+        }
+    }
+}

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs?rev=1751831&r1=1751830&r2=1751831&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs Thu Jul  7 20:47:10 2016
@@ -70,12 +70,8 @@ namespace Apache.NMS.MSMQ
 
         public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal)
         {
-            if(selector != null)
-            {
-                throw new NotSupportedException("Selectors are not supported by MSMQ");
-            }
             MessageQueue queue = MessageConverter.ToMsmqDestination(destination);
-            return new MessageConsumer(this, acknowledgementMode, queue);
+            return new MessageConsumer(this, acknowledgementMode, queue, selector);
         }
 
         public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal)
@@ -95,12 +91,8 @@ namespace Apache.NMS.MSMQ
 
         public IQueueBrowser CreateBrowser(IQueue queue, string selector)
         {
-            if(selector != null)
-            {
-                throw new NotSupportedException("Selectors are not supported by MSMQ");
-            }
             MessageQueue msmqQueue = MessageConverter.ToMsmqDestination(queue);
-            return new QueueBrowser(this, msmqQueue);
+            return new QueueBrowser(this, msmqQueue, selector);
         }
 
         public IQueue GetQueue(string name)

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq.csproj?rev=1751831&r1=1751830&r2=1751831&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq.csproj (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq.csproj Thu Jul  7 20:47:10 2016
@@ -75,6 +75,7 @@
     <Compile Include="src\main\csharp\DefaultMessageConverter.cs" />
     <Compile Include="src\main\csharp\Destination.cs" />
     <Compile Include="src\main\csharp\IMessageConverter.cs" />
+    <Compile Include="src\main\csharp\IMessageConverterEx.cs" />
     <Compile Include="src\main\csharp\MapMessage.cs" />
     <Compile Include="src\main\csharp\MessageConsumer.cs" />
     <Compile Include="src\main\csharp\MessageProducer.cs" />
@@ -84,6 +85,52 @@
     <Compile Include="src\main\csharp\Session.cs" />
     <Compile Include="src\main\csharp\StreamMessage.cs" />
     <Compile Include="src\main\csharp\TextMessage.cs" />
+    <Compile Include="src\main\csharp\Readers\AbstractMessageReader.cs" />
+    <Compile Include="src\main\csharp\Readers\ByCorrelationIdMessageReader.cs" />
+    <Compile Include="src\main\csharp\Readers\ByIdMessageReader.cs" />
+    <Compile Include="src\main\csharp\Readers\ByLookupIdMessageReader.cs" />
+    <Compile Include="src\main\csharp\Readers\BySelectorMessageReader.cs" />
+    <Compile Include="src\main\csharp\Readers\IMessageReader.cs" />
+    <Compile Include="src\main\csharp\Readers\MessageReaderUtil.cs" />
+    <Compile Include="src\main\csharp\Readers\NonFilteringMessageReader.cs" />
+    <Compile Include="src\main\csharp\Selector\AlignedNumericValues.cs" />
+    <Compile Include="src\main\csharp\Selector\ANDExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\ArithmeticExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\BinaryExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\BooleanCastExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\BooleanConstantExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\BooleanUnaryExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\ComparisonExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\ConstantExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\DivideExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\EqualExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\GreaterExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\GreaterOrEqualExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\IBooleanExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\IExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\InExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\IsNullExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\LesserExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\LesserOrEqualExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\LikeExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\LogicExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\MessageEvaluationContext.cs" />
+    <Compile Include="src\main\csharp\Selector\MinusExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\ModExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\MultiplyExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\NegateExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\NOTExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\ORExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\ParseException.cs" />
+    <Compile Include="src\main\csharp\Selector\PlusExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\PropertyExpression.cs" />
+    <Compile Include="src\main\csharp\Selector\SelectorParser.cs" />
+    <Compile Include="src\main\csharp\Selector\SelectorParserConstants.cs" />
+    <Compile Include="src\main\csharp\Selector\SelectorParserTokenManager.cs" />
+    <Compile Include="src\main\csharp\Selector\SimpleCharStream.cs" />
+    <Compile Include="src\main\csharp\Selector\Token.cs" />
+    <Compile Include="src\main\csharp\Selector\TokenMgrError.cs" />
+    <Compile Include="src\main\csharp\Selector\UnaryExpression.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="keyfile\NMSKey.snk" />



Mime
View raw message