lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [09/15] lucenenet git commit: Lucene.Net.QueryParser refactor: renamed all protected fields camelCase prefixed with m_
Date Wed, 01 Feb 2017 05:19:08 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
index 7a4b1b9..ff0b637 100644
--- a/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
+++ b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs
@@ -93,13 +93,13 @@ namespace Lucene.Net.QueryParsers.Simple
     public class SimpleQueryParser : QueryBuilder
     {
         /// <summary>Map of fields to query against with their weights</summary>
-        protected readonly IDictionary<string, float> weights;
+        protected readonly IDictionary<string, float> m_weights;
 
         // LUCENENET specific - Made the int operator constants into a [Flags] enum
         // to make them easier to pass in .NET.
 
         /// <summary>flags to the parser (to turn features on/off)</summary>
-        protected readonly Operator flags;
+        protected readonly Operator m_flags;
 
         [Flags]
         public enum Operator : int
@@ -146,8 +146,8 @@ namespace Lucene.Net.QueryParsers.Simple
         public SimpleQueryParser(Analyzer analyzer, IDictionary<string, float> weights,
Operator flags)
             : base(analyzer)
         {
-            this.weights = weights;
-            this.flags = flags;
+            this.m_weights = weights;
+            this.m_flags = flags;
         }
 
         /// <summary>Parses the query text and returns parsed query (or null if empty)</summary>
@@ -165,22 +165,22 @@ namespace Lucene.Net.QueryParsers.Simple
         {
             while (state.Index < state.Length)
             {
-                if (state.Data[state.Index] == '(' && (flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
+                if (state.Data[state.Index] == '(' && (m_flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
                 {
                     // the beginning of a subquery has been found
                     ConsumeSubQuery(state);
                 }
-                else if (state.Data[state.Index] == ')' && (flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
+                else if (state.Data[state.Index] == ')' && (m_flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
                 {
                     // this is an extraneous character so it is ignored
                     ++state.Index;
                 }
-                else if (state.Data[state.Index] == '"' && (flags & Operator.PHRASE_OPERATOR)
!= 0)
+                else if (state.Data[state.Index] == '"' && (m_flags & Operator.PHRASE_OPERATOR)
!= 0)
                 {
                     // the beginning of a phrase has been found
                     ConsumePhrase(state);
                 }
-                else if (state.Data[state.Index] == '+' && (flags & Operator.AND_OPERATOR)
!= 0)
+                else if (state.Data[state.Index] == '+' && (m_flags & Operator.AND_OPERATOR)
!= 0)
                 {
                     // an and operation has been explicitly set
                     // if an operation has already been set this one is ignored
@@ -194,7 +194,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
                     ++state.Index;
                 }
-                else if (state.Data[state.Index] == '|' && (flags & Operator.OR_OPERATOR)
!= 0)
+                else if (state.Data[state.Index] == '|' && (m_flags & Operator.OR_OPERATOR)
!= 0)
                 {
                     // an or operation has been explicitly set
                     // if an operation has already been set this one is ignored
@@ -208,7 +208,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
                     ++state.Index;
                 }
-                else if (state.Data[state.Index] == '-' && (flags & Operator.NOT_OPERATOR)
!= 0)
+                else if (state.Data[state.Index] == '-' && (m_flags & Operator.NOT_OPERATOR)
!= 0)
                 {
                     // a not operator has been found, so increase the not count
                     // two not operators in a row negate each other
@@ -222,7 +222,7 @@ namespace Lucene.Net.QueryParsers.Simple
                 else if ((state.Data[state.Index] == ' '
                   || state.Data[state.Index] == '\t'
                   || state.Data[state.Index] == '\n'
-                  || state.Data[state.Index] == '\r') && (flags & Operator.WHITESPACE_OPERATOR)
!= 0)
+                  || state.Data[state.Index] == '\r') && (m_flags & Operator.WHITESPACE_OPERATOR)
!= 0)
                 {
                     // ignore any whitespace found as it may have already been
                     // used a delimiter across a term (or phrase or subquery)
@@ -243,7 +243,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         private void ConsumeSubQuery(State state)
         {
-            Debug.Assert((flags & Operator.PRECEDENCE_OPERATORS) != 0);
+            Debug.Assert((m_flags & Operator.PRECEDENCE_OPERATORS) != 0);
             int start = ++state.Index;
             int precedence = 1;
             bool escaped = false;
@@ -252,7 +252,7 @@ namespace Lucene.Net.QueryParsers.Simple
             {
                 if (!escaped)
                 {
-                    if (state.Data[state.Index] == '\\' && (flags & Operator.ESCAPE_OPERATOR)
!= 0)
+                    if (state.Data[state.Index] == '\\' && (m_flags & Operator.ESCAPE_OPERATOR)
!= 0)
                     {
                         // an escape character has been found so
                         // whatever character is next will become
@@ -316,7 +316,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         private void ConsumePhrase(State state)
         {
-            Debug.Assert((flags & Operator.PHRASE_OPERATOR) != 0);
+            Debug.Assert((m_flags & Operator.PHRASE_OPERATOR) != 0);
             int start = ++state.Index;
             int copied = 0;
             bool escaped = false;
@@ -326,7 +326,7 @@ namespace Lucene.Net.QueryParsers.Simple
             {
                 if (!escaped)
                 {
-                    if (state.Data[state.Index] == '\\' && (flags & Operator.ESCAPE_OPERATOR)
!= 0)
+                    if (state.Data[state.Index] == '\\' && (m_flags & Operator.ESCAPE_OPERATOR)
!= 0)
                     {
                         // an escape character has been found so
                         // whatever character is next will become
@@ -343,7 +343,7 @@ namespace Lucene.Net.QueryParsers.Simple
                         // tilde
                         if (state.Length > (state.Index + 1) &&
                             state.Data[state.Index + 1] == '~' &&
-                            (flags & Operator.NEAR_OPERATOR) != 0)
+                            (m_flags & Operator.NEAR_OPERATOR) != 0)
                         {
                             state.Index++;
                             // check for characters after the tilde
@@ -413,7 +413,7 @@ namespace Lucene.Net.QueryParsers.Simple
             {
                 if (!escaped)
                 {
-                    if (state.Data[state.Index] == '\\' && (flags & Operator.ESCAPE_OPERATOR)
!= 0)
+                    if (state.Data[state.Index] == '\\' && (m_flags & Operator.ESCAPE_OPERATOR)
!= 0)
                     {
                         // an escape character has been found so
                         // whatever character is next will become
@@ -432,7 +432,7 @@ namespace Lucene.Net.QueryParsers.Simple
                         // creating the term query
                         break;
                     }
-                    else if (copied > 0 && state.Data[state.Index] == '~' &&
(flags & Operator.FUZZY_OPERATOR) != 0)
+                    else if (copied > 0 && state.Data[state.Index] == '~' &&
(m_flags & Operator.FUZZY_OPERATOR) != 0)
                     {
                         fuzzy = true;
                         break;
@@ -442,7 +442,7 @@ namespace Lucene.Net.QueryParsers.Simple
                     // was a '*' operator that hasn't been escaped
                     // there must be at least one valid character before
                     // searching for a prefixed set of terms
-                    prefix = copied > 0 && state.Data[state.Index] == '*' &&
(flags & Operator.PREFIX_OPERATOR) != 0;
+                    prefix = copied > 0 && state.Data[state.Index] == '*' &&
(m_flags & Operator.PREFIX_OPERATOR) != 0;
                 }
 
                 escaped = false;
@@ -453,7 +453,7 @@ namespace Lucene.Net.QueryParsers.Simple
             {
                 Query branch;
 
-                if (fuzzy && (flags & Operator.FUZZY_OPERATOR) != 0)
+                if (fuzzy && (m_flags & Operator.FUZZY_OPERATOR) != 0)
                 {
                     string token = new string(state.Buffer, 0, copied);
                     int fuzziness = ParseFuzziness(state);
@@ -586,15 +586,15 @@ namespace Lucene.Net.QueryParsers.Simple
         /// </summary>
         private bool TokenFinished(State state)
         {
-            if ((state.Data[state.Index] == '"' && (flags & Operator.PHRASE_OPERATOR)
!= 0)
-                || (state.Data[state.Index] == '|' && (flags & Operator.OR_OPERATOR)
!= 0)
-                || (state.Data[state.Index] == '+' && (flags & Operator.AND_OPERATOR)
!= 0)
-                || (state.Data[state.Index] == '(' && (flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
-                || (state.Data[state.Index] == ')' && (flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
+            if ((state.Data[state.Index] == '"' && (m_flags & Operator.PHRASE_OPERATOR)
!= 0)
+                || (state.Data[state.Index] == '|' && (m_flags & Operator.OR_OPERATOR)
!= 0)
+                || (state.Data[state.Index] == '+' && (m_flags & Operator.AND_OPERATOR)
!= 0)
+                || (state.Data[state.Index] == '(' && (m_flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
+                || (state.Data[state.Index] == ')' && (m_flags & Operator.PRECEDENCE_OPERATORS)
!= 0)
                 || ((state.Data[state.Index] == ' '
                 || state.Data[state.Index] == '\t'
                 || state.Data[state.Index] == '\n'
-                || state.Data[state.Index] == '\r') && (flags & Operator.WHITESPACE_OPERATOR)
!= 0))
+                || state.Data[state.Index] == '\r') && (m_flags & Operator.WHITESPACE_OPERATOR)
!= 0))
             {
                 return true;
             }
@@ -607,7 +607,7 @@ namespace Lucene.Net.QueryParsers.Simple
         protected virtual Query NewDefaultQuery(string text)
         {
             BooleanQuery bq = new BooleanQuery(true);
-            foreach (var entry in weights)
+            foreach (var entry in m_weights)
             {
                 Query q = CreateBooleanQuery(entry.Key, text, defaultOperator);
                 if (q != null)
@@ -625,7 +625,7 @@ namespace Lucene.Net.QueryParsers.Simple
         protected virtual Query NewFuzzyQuery(string text, int fuzziness)
         {
             BooleanQuery bq = new BooleanQuery(true);
-            foreach (var entry in weights)
+            foreach (var entry in m_weights)
             {
                 Query q = new FuzzyQuery(new Term(entry.Key, text), fuzziness);
                 if (q != null)
@@ -643,7 +643,7 @@ namespace Lucene.Net.QueryParsers.Simple
         protected virtual Query NewPhraseQuery(string text, int slop)
         {
             BooleanQuery bq = new BooleanQuery(true);
-            foreach (var entry in weights)
+            foreach (var entry in m_weights)
             {
                 Query q = CreatePhraseQuery(entry.Key, text, slop);
                 if (q != null)
@@ -661,7 +661,7 @@ namespace Lucene.Net.QueryParsers.Simple
         protected virtual Query NewPrefixQuery(string text)
         {
             BooleanQuery bq = new BooleanQuery(true);
-            foreach (var entry in weights)
+            foreach (var entry in m_weights)
             {
                 PrefixQuery prefix = new PrefixQuery(new Term(entry.Key, text));
                 prefix.Boost = entry.Value;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
index b83813b..58fcbbf 100644
--- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
@@ -53,7 +53,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         }
         private int jjMoveStringLiteralDfa0_1()
         {
-            switch (curChar)
+            switch (m_curChar)
             {
                 case (char)40:
                     return JjStopAtPos(0, 13);
@@ -86,9 +86,9 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             {
                 if (++jjround == 0x7fffffff)
                     ReInitRounds();
-                if (curChar < 64)
+                if (m_curChar < 64)
                 {
-                    ulong l = (ulong)(1L << (int)curChar);
+                    ulong l = (ulong)(1L << (int)m_curChar);
                     do
                     {
                         switch (jjstateSet[--i])
@@ -105,11 +105,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     if (kind > 7)
                                         kind = 7;
                                 }
-                                else if (curChar == 34)
+                                else if (m_curChar == 34)
                                     JjCheckNAddStates(5, 7);
                                 if ((0x3fc000000000000L & l) != 0L)
                                     JjCheckNAddStates(8, 11);
-                                else if (curChar == 49)
+                                else if (m_curChar == 49)
                                     JjCheckNAddTwoStates(20, 21);
                                 break;
                             case 19:
@@ -125,11 +125,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     JjCheckNAdd(18);
                                 break;
                             case 22:
-                                if (curChar == 49)
+                                if (m_curChar == 49)
                                     JjCheckNAddTwoStates(20, 21);
                                 break;
                             case 23:
-                                if (curChar == 34)
+                                if (m_curChar == 34)
                                     JjCheckNAddStates(5, 7);
                                 break;
                             case 24:
@@ -137,11 +137,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     JjCheckNAddTwoStates(24, 25);
                                 break;
                             case 25:
-                                if (curChar == 34)
+                                if (m_curChar == 34)
                                     jjstateSet[jjnewStateCnt++] = 26;
                                 break;
                             case 26:
-                                if (curChar == 42 && kind > 18)
+                                if (m_curChar == 42 && kind > 18)
                                     kind = 18;
                                 break;
                             case 27:
@@ -149,11 +149,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     JjCheckNAddStates(12, 14);
                                 break;
                             case 29:
-                                if (curChar == 34)
+                                if (m_curChar == 34)
                                     JjCheckNAddStates(12, 14);
                                 break;
                             case 30:
-                                if (curChar == 34 && kind > 19)
+                                if (m_curChar == 34 && kind > 19)
                                     kind = 19;
                                 break;
                             case 31:
@@ -168,7 +168,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     JjCheckNAddTwoStates(32, 33);
                                 break;
                             case 33:
-                                if (curChar == 42 && kind > 20)
+                                if (m_curChar == 42 && kind > 20)
                                     kind = 20;
                                 break;
                             case 34:
@@ -200,12 +200,12 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                         }
                     } while (i != startsAt);
                 }
-                else if (curChar < 128)
+                else if (m_curChar < 128)
                 {
                     // NOTE: See the note in the Classic.QueryParserTokenManager.cs file.
                     // I am working under the assumption 63 is the correct value, since it
                     // made the tests pass there.
-                    ulong l = (ulong)(1L << (curChar & 63));
+                    ulong l = (ulong)(1L << (m_curChar & 63));
                     //long l = 1L << (curChar & 077);
                     do
                     {
@@ -228,81 +228,81 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     if (kind > 11)
                                         kind = 11;
                                 }
-                                else if (curChar == 97)
+                                else if (m_curChar == 97)
                                     jjstateSet[jjnewStateCnt++] = 9;
-                                else if (curChar == 65)
+                                else if (m_curChar == 65)
                                     jjstateSet[jjnewStateCnt++] = 6;
-                                else if (curChar == 111)
+                                else if (m_curChar == 111)
                                     jjstateSet[jjnewStateCnt++] = 3;
-                                else if (curChar == 79)
+                                else if (m_curChar == 79)
                                     jjstateSet[jjnewStateCnt++] = 1;
-                                if (curChar == 110)
+                                if (m_curChar == 110)
                                     jjstateSet[jjnewStateCnt++] = 15;
-                                else if (curChar == 78)
+                                else if (m_curChar == 78)
                                     jjstateSet[jjnewStateCnt++] = 12;
                                 break;
                             case 1:
-                                if (curChar == 82 && kind > 8)
+                                if (m_curChar == 82 && kind > 8)
                                     kind = 8;
                                 break;
                             case 2:
-                                if (curChar == 79)
+                                if (m_curChar == 79)
                                     jjstateSet[jjnewStateCnt++] = 1;
                                 break;
                             case 3:
-                                if (curChar == 114 && kind > 8)
+                                if (m_curChar == 114 && kind > 8)
                                     kind = 8;
                                 break;
                             case 4:
-                                if (curChar == 111)
+                                if (m_curChar == 111)
                                     jjstateSet[jjnewStateCnt++] = 3;
                                 break;
                             case 5:
-                                if (curChar == 68 && kind > 9)
+                                if (m_curChar == 68 && kind > 9)
                                     kind = 9;
                                 break;
                             case 6:
-                                if (curChar == 78)
+                                if (m_curChar == 78)
                                     jjstateSet[jjnewStateCnt++] = 5;
                                 break;
                             case 7:
-                                if (curChar == 65)
+                                if (m_curChar == 65)
                                     jjstateSet[jjnewStateCnt++] = 6;
                                 break;
                             case 8:
-                                if (curChar == 100 && kind > 9)
+                                if (m_curChar == 100 && kind > 9)
                                     kind = 9;
                                 break;
                             case 9:
-                                if (curChar == 110)
+                                if (m_curChar == 110)
                                     jjstateSet[jjnewStateCnt++] = 8;
                                 break;
                             case 10:
-                                if (curChar == 97)
+                                if (m_curChar == 97)
                                     jjstateSet[jjnewStateCnt++] = 9;
                                 break;
                             case 11:
-                                if (curChar == 84 && kind > 10)
+                                if (m_curChar == 84 && kind > 10)
                                     kind = 10;
                                 break;
                             case 12:
-                                if (curChar == 79)
+                                if (m_curChar == 79)
                                     jjstateSet[jjnewStateCnt++] = 11;
                                 break;
                             case 13:
-                                if (curChar == 78)
+                                if (m_curChar == 78)
                                     jjstateSet[jjnewStateCnt++] = 12;
                                 break;
                             case 14:
-                                if (curChar == 116 && kind > 10)
+                                if (m_curChar == 116 && kind > 10)
                                     kind = 10;
                                 break;
                             case 15:
-                                if (curChar == 111)
+                                if (m_curChar == 111)
                                     jjstateSet[jjnewStateCnt++] = 14;
                                 break;
                             case 16:
-                                if (curChar == 110)
+                                if (m_curChar == 110)
                                     jjstateSet[jjnewStateCnt++] = 15;
                                 break;
                             case 17:
@@ -321,11 +321,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                     JjCheckNAddStates(12, 14);
                                 break;
                             case 28:
-                                if (curChar == 92)
+                                if (m_curChar == 92)
                                     jjstateSet[jjnewStateCnt++] = 29;
                                 break;
                             case 29:
-                                if (curChar == 92)
+                                if (m_curChar == 92)
                                     JjCheckNAddStates(12, 14);
                                 break;
                             case 31:
@@ -363,13 +363,13 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 }
                 else
                 {
-                    int hiByte = (int)(curChar >> 8);
+                    int hiByte = (int)(m_curChar >> 8);
                     int i1 = hiByte >> 6;
                     //long l1 = 1L << (hiByte & 077);
                     ulong l1 = (ulong)(1L << (hiByte & 63));
-                    int i2 = (curChar & 0xff) >> 6;
+                    int i2 = (m_curChar & 0xff) >> 6;
                     //long l2 = 1L << (curChar & 077);
-                    ulong l2 = (ulong)(1L << (curChar & 63));
+                    ulong l2 = (ulong)(1L << (m_curChar & 63));
                     do
                     {
                         switch (jjstateSet[--i])
@@ -424,7 +424,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 ++curPos;
                 if ((i = jjnewStateCnt) == (startsAt = 38 - (jjnewStateCnt = startsAt)))
                     return curPos;
-                try { curChar = input_stream.ReadChar(); }
+                try { m_curChar = m_input_stream.ReadChar(); }
                 catch (System.IO.IOException /*e*/) { return curPos; }
             }
         }
@@ -444,9 +444,9 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             {
                 if (++jjround == 0x7fffffff)
                     ReInitRounds();
-                if (curChar < 64)
+                if (m_curChar < 64)
                 {
-                    long l = 1L << curChar;
+                    long l = 1L << m_curChar;
                     do
                     {
                         switch (jjstateSet[--i])
@@ -459,7 +459,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                                 JjAddStates(17, 18);
                                 break;
                             case 1:
-                                if (curChar == 46)
+                                if (m_curChar == 46)
                                     JjCheckNAdd(2);
                                 break;
                             case 2:
@@ -473,10 +473,10 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                         }
                     } while (i != startsAt);
                 }
-                else if (curChar < 128)
+                else if (m_curChar < 128)
                 {
                     //long l = 1L << (curChar & 077);
-                    ulong l = (ulong)(1L << (curChar & 63)); 
+                    ulong l = (ulong)(1L << (m_curChar & 63)); 
                     do
                     {
                         switch (jjstateSet[--i])
@@ -487,13 +487,13 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 }
                 else
                 {
-                    int hiByte = (int)(curChar >> 8);
+                    int hiByte = (int)(m_curChar >> 8);
                     int i1 = hiByte >> 6;
                     //long l1 = 1L << (hiByte & 077);
                     ulong l1 = (ulong)(1L << (hiByte & 63));
-                    int i2 = (curChar & 0xff) >> 6;
+                    int i2 = (m_curChar & 0xff) >> 6;
                     //long l2 = 1L << (curChar & 077);
-                    ulong l2 = (ulong)(1L << (curChar & 63));
+                    ulong l2 = (ulong)(1L << (m_curChar & 63));
                     do
                     {
                         switch (jjstateSet[--i])
@@ -511,7 +511,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 ++curPos;
                 if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
                     return curPos;
-                try { curChar = input_stream.ReadChar(); }
+                try { m_curChar = m_input_stream.ReadChar(); }
                 catch (System.IO.IOException /*e*/) { return curPos; }
             }
         }
@@ -560,15 +560,15 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         internal static readonly long[] jjtoSkip = {
            0x80L, 
         };
-        protected ICharStream input_stream;
+        protected ICharStream m_input_stream;
         private readonly uint[] jjrounds = new uint[38];
         private readonly int[] jjstateSet = new int[76];
-        protected internal char curChar;
+        protected char m_curChar;
 
         /// <summary>Constructor.</summary>
         public QueryParserTokenManager(ICharStream stream)
         {
-            input_stream = stream;
+            m_input_stream = stream;
         }
 
         /// <summary>Constructor.</summary>
@@ -583,7 +583,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         {
             jjmatchedPos = jjnewStateCnt = 0;
             curLexState = defaultLexState;
-            input_stream = stream;
+            m_input_stream = stream;
             ReInitRounds();
         }
         private void ReInitRounds()
@@ -619,11 +619,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             int beginColumn;
             int endColumn;
             string im = jjstrLiteralImages[jjmatchedKind];
-            curTokenImage = (im == null) ? input_stream.Image : im;
-            beginLine = input_stream.BeginLine;
-            beginColumn = input_stream.BeginColumn;
-            endLine = input_stream.EndLine;
-            endColumn = input_stream.EndColumn;
+            curTokenImage = (im == null) ? m_input_stream.Image : im;
+            beginLine = m_input_stream.BeginLine;
+            beginColumn = m_input_stream.BeginColumn;
+            endLine = m_input_stream.EndLine;
+            endColumn = m_input_stream.EndColumn;
             t = Token.NewToken(jjmatchedKind, curTokenImage);
 
             t.beginLine = beginLine;
@@ -652,7 +652,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             {
                 try
                 {
-                    curChar = input_stream.BeginToken();
+                    m_curChar = m_input_stream.BeginToken();
                 }
                 catch (System.IO.IOException /*e*/)
                 {
@@ -677,7 +677,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 if (jjmatchedKind != 0x7fffffff)
                 {
                     if (jjmatchedPos + 1 < curPos)
-                        input_stream.BackUp(curPos - jjmatchedPos - 1);
+                        m_input_stream.BackUp(curPos - jjmatchedPos - 1);
                     if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind
& 63 /*077*/))) != 0L)
                     {
                         matchedToken = JjFillToken();
@@ -692,16 +692,16 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                         goto EOFLoop;
                     }
                 }
-                int error_line = input_stream.EndLine;
-                int error_column = input_stream.EndColumn;
+                int error_line = m_input_stream.EndLine;
+                int error_column = m_input_stream.EndColumn;
                 string error_after = null;
                 bool EOFSeen = false;
-                try { input_stream.ReadChar(); input_stream.BackUp(1); }
+                try { m_input_stream.ReadChar(); m_input_stream.BackUp(1); }
                 catch (System.IO.IOException /*e1*/)
                 {
                     EOFSeen = true;
-                    error_after = curPos <= 1 ? "" : input_stream.Image;
-                    if (curChar == '\n' || curChar == '\r')
+                    error_after = curPos <= 1 ? "" : m_input_stream.Image;
+                    if (m_curChar == '\n' || m_curChar == '\r')
                     {
                         error_line++;
                         error_column = 0;
@@ -711,10 +711,10 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 }
                 if (!EOFSeen)
                 {
-                    input_stream.BackUp(1);
-                    error_after = curPos <= 1 ? "" : input_stream.Image;
+                    m_input_stream.BackUp(1);
+                    error_after = curPos <= 1 ? "" : m_input_stream.Image;
                 }
-                throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after,
curChar, TokenMgrError.LEXICAL_ERROR);
+                throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after,
m_curChar, TokenMgrError.LEXICAL_ERROR);
             EOFLoop: ;
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs
index aff2dee..e35780d 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs
@@ -31,28 +31,28 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         {
             Recompose(qs);
             this.operatorInfix = operatorInfix;
-            this.opName = opName;
+            this.m_opName = opName;
         }
 
         protected virtual void Recompose(IEnumerable<SrndQuery> queries)
         {
             if (queries.Count() < 2) throw new InvalidOperationException("Too few subqueries");
-            this.queries = new List<SrndQuery>(queries);
+            this.m_queries = new List<SrndQuery>(queries);
         }
 
-        protected string opName;
-        public virtual string OperatorName { get { return opName; } }
+        protected string m_opName;
+        public virtual string OperatorName { get { return m_opName; } }
 
-        protected IList<SrndQuery> queries;
+        protected IList<SrndQuery> m_queries;
 
         public virtual IEnumerator<SrndQuery> GetSubQueriesEnumerator()
         {
-            return queries.GetEnumerator();
+            return m_queries.GetEnumerator();
         }
 
-        public virtual int NrSubQueries { get { return queries.Count; } }
+        public virtual int NrSubQueries { get { return m_queries.Count; } }
 
-        public virtual SrndQuery GetSubQuery(int qn) { return queries[qn]; }
+        public virtual SrndQuery GetSubQuery(int qn) { return m_queries[qn]; }
 
         private bool operatorInfix;
         public virtual bool IsOperatorInfix { get { return operatorInfix; } } /* else prefix
operator */

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs
index d888483..569a710 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs
@@ -29,7 +29,7 @@
 
         public override Search.Query Rewrite(Index.IndexReader reader)
         {
-            return srndQuery.GetSpanNearQuery(reader, fieldName, Boost, qf);
+            return m_srndQuery.GetSpanNearQuery(reader, m_fieldName, Boost, m_qf);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
index 7c0ade0..b2d3c5b 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
@@ -22,18 +22,18 @@ namespace Lucene.Net.QueryParsers.Surround.Query
 
     internal abstract class RewriteQuery<SQ> : Search.Query
     {
-        protected readonly SQ srndQuery;
-        protected readonly string fieldName;
-        protected readonly BasicQueryFactory qf;
+        protected readonly SQ m_srndQuery;
+        protected readonly string m_fieldName;
+        protected readonly BasicQueryFactory m_qf;
 
         public RewriteQuery(
             SQ srndQuery,
             string fieldName,
             BasicQueryFactory qf)
         {
-            this.srndQuery = srndQuery;
-            this.fieldName = fieldName;
-            this.qf = qf;
+            this.m_srndQuery = srndQuery;
+            this.m_fieldName = fieldName;
+            this.m_qf = qf;
         }
 
         public abstract override Search.Query Rewrite(IndexReader reader);
@@ -47,18 +47,18 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         {
             return GetType().Name
                 + (field == null ? "" : "(unused: " + field + ")")
-                + "(" + fieldName
-                + ", " + srndQuery.ToString()
-                + ", " + qf.ToString()
+                + "(" + m_fieldName
+                + ", " + m_srndQuery.ToString()
+                + ", " + m_qf.ToString()
                 + ")";
         }
 
         public override int GetHashCode()
         {
             return GetType().GetHashCode()
-                ^ fieldName.GetHashCode()
-                ^ qf.GetHashCode()
-                ^ srndQuery.GetHashCode();
+                ^ m_fieldName.GetHashCode()
+                ^ m_qf.GetHashCode()
+                ^ m_srndQuery.GetHashCode();
         }
 
         public override bool Equals(object obj)
@@ -68,9 +68,9 @@ namespace Lucene.Net.QueryParsers.Surround.Query
             if (!GetType().Equals(obj.GetType()))
                 return false;
             RewriteQuery<SQ> other = (RewriteQuery<SQ>)obj;
-            return fieldName.Equals(other.fieldName)
-                && qf.Equals(other.qf)
-                && srndQuery.Equals(other.srndQuery);
+            return m_fieldName.Equals(other.m_fieldName)
+                && m_qf.Equals(other.m_qf)
+                && m_srndQuery.Equals(other.m_srndQuery);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs
index 9d251fe..a73434c 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs
@@ -35,8 +35,8 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         public override Search.Query Rewrite(IndexReader reader)
         {
             var luceneSubQueries = new List<Search.Query>();
-            srndQuery.VisitMatchingTerms(reader, fieldName, 
-                new SimpleTermRewriteMatchingTermVisitor(luceneSubQueries, qf));
+            m_srndQuery.VisitMatchingTerms(reader, m_fieldName, 
+                new SimpleTermRewriteMatchingTermVisitor(luceneSubQueries, m_qf));
             return (luceneSubQueries.Count == 0) ? SrndQuery.TheEmptyLcnQuery
                 : (luceneSubQueries.Count == 1) ? luceneSubQueries.First()
                 : SrndBooleanQuery.MakeBooleanQuery(

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/CoreParser.cs b/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
index 5430fec..dfc6859 100644
--- a/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
+++ b/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
@@ -30,10 +30,10 @@ namespace Lucene.Net.QueryParsers.Xml
     /// </summary>
     public class CoreParser : IQueryBuilder
     {
-        protected Analyzer analyzer;
-        protected QueryParser parser;
-        protected QueryBuilderFactory queryFactory;
-        protected FilterBuilderFactory filterFactory;
+        protected Analyzer m_analyzer;
+        protected QueryParser m_parser;
+        protected QueryBuilderFactory m_queryFactory;
+        protected FilterBuilderFactory m_filterFactory;
         //Controls the max size of the LRU cache used for QueryFilter objects parsed.
         public static int maxNumCachedFilters = 20;
 
@@ -60,62 +60,62 @@ namespace Lucene.Net.QueryParsers.Xml
 
         protected CoreParser(string defaultField, Analyzer analyzer, QueryParser parser)
         {
-            this.analyzer = analyzer;
-            this.parser = parser;
-            filterFactory = new FilterBuilderFactory();
-            filterFactory.AddBuilder("RangeFilter", new RangeFilterBuilder());
-            filterFactory.AddBuilder("NumericRangeFilter", new NumericRangeFilterBuilder());
-
-            queryFactory = new QueryBuilderFactory();
-            queryFactory.AddBuilder("TermQuery", new TermQueryBuilder());
-            queryFactory.AddBuilder("TermsQuery", new TermsQueryBuilder(analyzer));
-            queryFactory.AddBuilder("MatchAllDocsQuery", new MatchAllDocsQueryBuilder());
-            queryFactory.AddBuilder("BooleanQuery", new BooleanQueryBuilder(queryFactory));
-            queryFactory.AddBuilder("NumericRangeQuery", new NumericRangeQueryBuilder());
-            queryFactory.AddBuilder("DisjunctionMaxQuery", new DisjunctionMaxQueryBuilder(queryFactory));
+            this.m_analyzer = analyzer;
+            this.m_parser = parser;
+            m_filterFactory = new FilterBuilderFactory();
+            m_filterFactory.AddBuilder("RangeFilter", new RangeFilterBuilder());
+            m_filterFactory.AddBuilder("NumericRangeFilter", new NumericRangeFilterBuilder());
+
+            m_queryFactory = new QueryBuilderFactory();
+            m_queryFactory.AddBuilder("TermQuery", new TermQueryBuilder());
+            m_queryFactory.AddBuilder("TermsQuery", new TermsQueryBuilder(analyzer));
+            m_queryFactory.AddBuilder("MatchAllDocsQuery", new MatchAllDocsQueryBuilder());
+            m_queryFactory.AddBuilder("BooleanQuery", new BooleanQueryBuilder(m_queryFactory));
+            m_queryFactory.AddBuilder("NumericRangeQuery", new NumericRangeQueryBuilder());
+            m_queryFactory.AddBuilder("DisjunctionMaxQuery", new DisjunctionMaxQueryBuilder(m_queryFactory));
             if (parser != null)
             {
-                queryFactory.AddBuilder("UserQuery", new UserInputQueryBuilder(parser));
+                m_queryFactory.AddBuilder("UserQuery", new UserInputQueryBuilder(parser));
             }
             else
             {
-                queryFactory.AddBuilder("UserQuery", new UserInputQueryBuilder(defaultField,
analyzer));
+                m_queryFactory.AddBuilder("UserQuery", new UserInputQueryBuilder(defaultField,
analyzer));
             }
-            queryFactory.AddBuilder("FilteredQuery", new FilteredQueryBuilder(filterFactory,
queryFactory));
-            queryFactory.AddBuilder("ConstantScoreQuery", new ConstantScoreQueryBuilder(filterFactory));
+            m_queryFactory.AddBuilder("FilteredQuery", new FilteredQueryBuilder(m_filterFactory,
m_queryFactory));
+            m_queryFactory.AddBuilder("ConstantScoreQuery", new ConstantScoreQueryBuilder(m_filterFactory));
 
-            filterFactory.AddBuilder("CachedFilter", new CachedFilterBuilder(queryFactory,
-                filterFactory, maxNumCachedFilters));
+            m_filterFactory.AddBuilder("CachedFilter", new CachedFilterBuilder(m_queryFactory,
+                m_filterFactory, maxNumCachedFilters));
 
             SpanQueryBuilderFactory sqof = new SpanQueryBuilderFactory();
 
             SpanNearBuilder snb = new SpanNearBuilder(sqof);
             sqof.AddBuilder("SpanNear", snb);
-            queryFactory.AddBuilder("SpanNear", snb);
+            m_queryFactory.AddBuilder("SpanNear", snb);
 
             BoostingTermBuilder btb = new BoostingTermBuilder();
             sqof.AddBuilder("BoostingTermQuery", btb);
-            queryFactory.AddBuilder("BoostingTermQuery", btb);
+            m_queryFactory.AddBuilder("BoostingTermQuery", btb);
 
             SpanTermBuilder snt = new SpanTermBuilder();
             sqof.AddBuilder("SpanTerm", snt);
-            queryFactory.AddBuilder("SpanTerm", snt);
+            m_queryFactory.AddBuilder("SpanTerm", snt);
 
             SpanOrBuilder sot = new SpanOrBuilder(sqof);
             sqof.AddBuilder("SpanOr", sot);
-            queryFactory.AddBuilder("SpanOr", sot);
+            m_queryFactory.AddBuilder("SpanOr", sot);
 
             SpanOrTermsBuilder sots = new SpanOrTermsBuilder(analyzer);
             sqof.AddBuilder("SpanOrTerms", sots);
-            queryFactory.AddBuilder("SpanOrTerms", sots);
+            m_queryFactory.AddBuilder("SpanOrTerms", sots);
 
             SpanFirstBuilder sft = new SpanFirstBuilder(sqof);
             sqof.AddBuilder("SpanFirst", sft);
-            queryFactory.AddBuilder("SpanFirst", sft);
+            m_queryFactory.AddBuilder("SpanFirst", sft);
 
             SpanNotBuilder snot = new SpanNotBuilder(sqof);
             sqof.AddBuilder("SpanNot", snot);
-            queryFactory.AddBuilder("SpanNot", snot);
+            m_queryFactory.AddBuilder("SpanNot", snot);
         }
 
         public virtual Query Parse(Stream xmlStream)
@@ -143,12 +143,12 @@ namespace Lucene.Net.QueryParsers.Xml
 
         public virtual void AddQueryBuilder(string nodeName, IQueryBuilder builder)
         {
-            queryFactory.AddBuilder(nodeName, builder);
+            m_queryFactory.AddBuilder(nodeName, builder);
         }
 
         public virtual void AddFilterBuilder(string nodeName, IFilterBuilder builder)
         {
-            filterFactory.AddBuilder(nodeName, builder);
+            m_filterFactory.AddBuilder(nodeName, builder);
         }
 
         private static XmlDocument ParseXML(Stream pXmlFile)
@@ -197,7 +197,7 @@ namespace Lucene.Net.QueryParsers.Xml
 
         public virtual Query GetQuery(XmlElement e)
         {
-            return queryFactory.GetQuery(e);
+            return m_queryFactory.GetQuery(e);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b170b54b/src/Lucene.Net.QueryParser/Xml/CorePlusExtensionsParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/CorePlusExtensionsParser.cs b/src/Lucene.Net.QueryParser/Xml/CorePlusExtensionsParser.cs
index 4c6b77f..231d52e 100644
--- a/src/Lucene.Net.QueryParser/Xml/CorePlusExtensionsParser.cs
+++ b/src/Lucene.Net.QueryParser/Xml/CorePlusExtensionsParser.cs
@@ -52,13 +52,13 @@ namespace Lucene.Net.QueryParsers.Xml
         private CorePlusExtensionsParser(string defaultField, Analyzer analyzer, QueryParser
parser)
             : base(defaultField, analyzer, parser)
         {
-            filterFactory.AddBuilder("TermsFilter", new TermsFilterBuilder(analyzer));
-            filterFactory.AddBuilder("BooleanFilter", new BooleanFilterBuilder(filterFactory));
-            filterFactory.AddBuilder("DuplicateFilter", new DuplicateFilterBuilder());
+            m_filterFactory.AddBuilder("TermsFilter", new TermsFilterBuilder(analyzer));
+            m_filterFactory.AddBuilder("BooleanFilter", new BooleanFilterBuilder(m_filterFactory));
+            m_filterFactory.AddBuilder("DuplicateFilter", new DuplicateFilterBuilder());
             string[] fields = { "contents" };
-            queryFactory.AddBuilder("LikeThisQuery", new LikeThisQueryBuilder(analyzer, fields));
-            queryFactory.AddBuilder("BoostingQuery", new BoostingQueryBuilder(queryFactory));
-            queryFactory.AddBuilder("FuzzyLikeThisQuery", new FuzzyLikeThisQueryBuilder(analyzer));
+            m_queryFactory.AddBuilder("LikeThisQuery", new LikeThisQueryBuilder(analyzer,
fields));
+            m_queryFactory.AddBuilder("BoostingQuery", new BoostingQueryBuilder(m_queryFactory));
+            m_queryFactory.AddBuilder("FuzzyLikeThisQuery", new FuzzyLikeThisQueryBuilder(analyzer));
         }
     }
 }


Mime
View raw message