diff --git a/doc/reference/src/expressions.xml b/doc/reference/src/expressions.xml index 9d3f1a08..bfda5125 100644 --- a/doc/reference/src/expressions.xml +++ b/doc/reference/src/expressions.xml @@ -71,7 +71,7 @@ public static void SetValue(object root, string expression, IDictionary variable tesla.PlaceOfBirth.City = "Smiljan"; -string evaluatedName = (string) ExpressionEvaluator.GetValue(tesla, "Name"); +string evaluatedName = (string) ExpressionEvaluator.GetValue(tesla, "Name"); string evaluatedCity = (string) ExpressionEvaluator.GetValue(tesla, "PlaceOfBirth.City")); The value of 'evaluatedName' is 'Nikola Tesla' and that of 'evaluatedCity' @@ -148,7 +148,7 @@ int maxValue = (int) ExpressionEvaluator.GetValue(null, "0x7FFFFFFF"); // eval DateTime birthday = (DateTime) ExpressionEvaluator.GetValue(null, "date('1974/08/24')"); -DateTime exactBirthday = +DateTime exactBirthday = (DateTime) ExpressionEvaluator.GetValue(null, " date('19740824T131030', 'yyyyMMddTHHmmss')"); bool trueValue = (bool) ExpressionEvaluator.GetValue(null, "true"); @@ -266,10 +266,10 @@ new string[] {'abc', 'xyz'} Methods are invoked using typical C# programming syntax. You may also invoke methods on literals. - //string literal + //string literal char[] chars = (char[]) ExpressionEvaluator.GetValue(null, "'test'.ToCharArray(1, 2)")) // 't','e' -//date literal +//date literal int year = (int) ExpressionEvaluator.GetValue(null, "date('1974/08/24').AddYears(31).Year") // 2005 // object usage, calculate age of tesla navigating from the IEEE society. @@ -372,6 +372,26 @@ string expression = @"IsMember('Nikola Tesla') and !IsMember('Mihajlo Pupin')"; bool falseValue = (bool) ExpressionEvaluator.GetValue(ieee, expression); + + Bitwise operators + + The bitwise operators that are supported are + and, or, xor and not. Their use is demonstrated below. +Note, that the logical and bitwise operators are the same and their interpretation depends if you pass in integral values or boolean values. +// AND +int result = (int) ExpressionEvaluator.GetValue(null, "1 and 3"); // 1 & 3 + +// OR +int result = (int) ExpressionEvaluator.GetValue(null, "1 or 3"); // 1 | 3 + +// XOR +int result = (int) ExpressionEvaluator.GetValue(null, "1 xor 3"); // 1 ^ 3 + +// NOT +int result = (int) ExpressionEvaluator.GetValue(null, "!1"); // ~1 + + + Mathematical operators @@ -386,7 +406,7 @@ int two = (int)ExpressionEvaluator.GetValue(null, "1 + 1"); // 2 String testString = (String)ExpressionEvaluator.GetValue(null, "'test' + ' ' + 'string'"); //'test string' DateTime dt = (DateTime)ExpressionEvaluator.GetValue(null, "date('1974-08-24') + 5"); // 8/29/1974 - + // Subtraction int four = (int) ExpressionEvaluator.GetValue(null, "1 - -3"); //4 @@ -450,7 +470,7 @@ Inventor tesla = (Inventor) ExpressionEvaluator.GetValue(ieee, "Officers['vp'] = last expression in the list. Examples of this are shown below //Perform property assignments and then return Name property. -String pupin = (String) ExpressionEvaluator.GetValue(ieee.Members, +String pupin = (String) ExpressionEvaluator.GetValue(ieee.Members, "( [1].PlaceOfBirth.City = 'Beograd'; [1].PlaceOfBirth.Country = 'Serbia'; [1].Name )")); // pupin = "Mihajlo Pupin" @@ -514,12 +534,12 @@ Inventor pupin = (Inventor) ExpressionEvaluator.GetValue(ieee, "Officers[Society // simple ctor DateTime dt = (DateTime) ExpressionEvaluator.GetValue(null, "new DateTime(1974, 8, 24)"); -// Register Inventor type then create new inventor instance within Add method inside an expression list. +// Register Inventor type then create new inventor instance within Add method inside an expression list. // Then return the new count of the Members collection. TypeRegistry.RegisterType(typeof(Inventor)); int three = (int) ExpressionEvaluator.GetValue(ieee.Members, "{ Add(new Inventor('Aleksandar Seovic', date('1974-08-24'), 'Serbian')); Count}")); - + As a convenience, Spring.NET also allows you to define named @@ -602,8 +622,8 @@ ExpressionEvaluator.GetValue(ieee, "Officers['president'].( #root.Officers.Remov IDictionary vars = new Hashtable(); vars["queryName"] = "Nikola Tesla"; -string expression = @"IsMember(#queryName) - ? #queryName + ' is a member of the ' + Name + ' Society' +string expression = @"IsMember(#queryName) + ? #queryName + ' is a member of the ' + Name + ' Society' : #queryName + ' is not a member of the ' + Name + ' Society'"; String queryResultString = (String) ExpressionEvaluator.GetValue(ieee, expression, vars)); @@ -868,7 +888,7 @@ object[] ordered = exp.GetValue(input); // { 1, 2.0, "a", 'b' } if ((int)item % 2 == 0) { total = NumberUtils.Add(total, item); - } + } } else { @@ -905,11 +925,11 @@ object[] ordered = exp.GetValue(input); // { 1, 2.0, "a", 'b' } { . . . -// Retrieve context defined in the spring/context section of +// Retrieve context defined in the spring/context section of // the standard .NET configuration file. IApplicationContext ctx = ContextRegistry.GetContext(); -int numMovies = (int) ExpressionEvaluator.GetValue(null, +int numMovies = (int) ExpressionEvaluator.GetValue(null, "@(MyMovieLister).MoviesDirectedBy('Roberto Benigni').Length"); . . . diff --git a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/ObjectNameAutoProxyCreator.cs b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/ObjectNameAutoProxyCreator.cs index f931d031..890f92f6 100644 --- a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/ObjectNameAutoProxyCreator.cs +++ b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/ObjectNameAutoProxyCreator.cs @@ -1,7 +1,7 @@ #region License /* - * Copyright © 2002-2005 the original author or authors. + * Copyright © 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,15 +18,11 @@ #endregion -#region Imports - using System; using System.Collections; using Spring.Objects.Factory; using Spring.Util; -#endregion - namespace Spring.Aop.Framework.AutoProxy { /// @@ -46,6 +42,7 @@ namespace Spring.Aop.Framework.AutoProxy /// /// Juergen Hoeller /// Adhari C Mahendra (.NET) + /// Erich Eichinger public class ObjectNameAutoProxyCreator : AbstractFilteringAutoProxyCreator { private IList objectNames; diff --git a/src/Spring/Spring.Core/Expressions/BaseNode.cs b/src/Spring/Spring.Core/Expressions/BaseNode.cs index f718529b..c56caae0 100644 --- a/src/Spring/Spring.Core/Expressions/BaseNode.cs +++ b/src/Spring/Spring.Core/Expressions/BaseNode.cs @@ -176,7 +176,7 @@ namespace Spring.Expressions /// /// This is the entrypoint into evaluating this expression. /// - private object GetValue(object context, IDictionary variables) + public object GetValue(object context, IDictionary variables) { EvaluationContext evalContext = new EvaluationContext( context,variables ); return Get( context, evalContext ); @@ -223,7 +223,7 @@ namespace Spring.Expressions /// /// This is the entrypoint into evaluating this expression. /// - private void SetValue(object context,IDictionary variables,object newValue) + public void SetValue(object context,IDictionary variables,object newValue) { EvaluationContext evalContext = new EvaluationContext( context,variables ); Set( context, evalContext,newValue ); diff --git a/src/Spring/Spring.Core/Expressions/BinaryOperator.cs b/src/Spring/Spring.Core/Expressions/BinaryOperator.cs index 541b158f..fc2068bb 100644 --- a/src/Spring/Spring.Core/Expressions/BinaryOperator.cs +++ b/src/Spring/Spring.Core/Expressions/BinaryOperator.cs @@ -1,7 +1,7 @@ #region License /* - * Copyright © 2002-2006 the original author or authors. + * Copyright © 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ using System.Runtime.Serialization; namespace Spring.Expressions { /// - /// Base class for unary operators. + /// Base class for binary operators. /// /// Aleksandar Seovic [Serializable] @@ -33,9 +33,20 @@ namespace Spring.Expressions /// /// Create a new instance /// - public BinaryOperator() + protected BinaryOperator() {} + /// + /// Create a new instance with the supplied operands + /// + /// + /// + protected BinaryOperator(BaseNode left, BaseNode right) + { + base.addChild(left); + base.addChild(right); + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Expressions/BooleanLiteralNode.cs b/src/Spring/Spring.Core/Expressions/BooleanLiteralNode.cs index cc01f0aa..47f4cbaa 100644 --- a/src/Spring/Spring.Core/Expressions/BooleanLiteralNode.cs +++ b/src/Spring/Spring.Core/Expressions/BooleanLiteralNode.cs @@ -39,6 +39,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public BooleanLiteralNode(string text) + { + this.Text = text; + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Expressions/ConstructorNode.cs b/src/Spring/Spring.Core/Expressions/ConstructorNode.cs index 2e70eaee..43170f59 100644 --- a/src/Spring/Spring.Core/Expressions/ConstructorNode.cs +++ b/src/Spring/Spring.Core/Expressions/ConstructorNode.cs @@ -49,6 +49,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public ConstructorNode(Type type) + :base(type.FullName) + { + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Expressions/Expression.g b/src/Spring/Spring.Core/Expressions/Expression.g index 5fff4a15..dd7f5e50 100644 --- a/src/Spring/Spring.Core/Expressions/Expression.g +++ b/src/Spring/Spring.Core/Expressions/Expression.g @@ -22,6 +22,7 @@ tokens { TRUE = "true"; AND = "and"; OR = "or"; + XOR = "xor"; IN = "in"; IS = "is"; BETWEEN = "between"; @@ -84,7 +85,9 @@ expression : logicalOrExpression parenExpr : LPAREN! expression RPAREN!; -logicalOrExpression : logicalAndExpression (OR^ logicalAndExpression)* ; +logicalOrExpression : logicalXorExpression (OR^ logicalXorExpression)* ; + +logicalXorExpression : logicalAndExpression (XOR^ logicalAndExpression)* ; logicalAndExpression : relationalExpression (AND^ relationalExpression)* ; diff --git a/src/Spring/Spring.Core/Expressions/IntLiteralNode.cs b/src/Spring/Spring.Core/Expressions/IntLiteralNode.cs index 3034e41c..505ab31a 100644 --- a/src/Spring/Spring.Core/Expressions/IntLiteralNode.cs +++ b/src/Spring/Spring.Core/Expressions/IntLiteralNode.cs @@ -39,6 +39,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public IntLiteralNode(string text) + { + this.Text = text; + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Expressions/NodeWithArguments.cs b/src/Spring/Spring.Core/Expressions/NodeWithArguments.cs index 0f1953c6..79277f72 100644 --- a/src/Spring/Spring.Core/Expressions/NodeWithArguments.cs +++ b/src/Spring/Spring.Core/Expressions/NodeWithArguments.cs @@ -42,6 +42,23 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public NodeWithArguments(string text) + { + this.Text = text; + } + + /// + /// Append an argument node to the list of child nodes + /// + /// + public void AddArgument(BaseNode argumentNode) + { + base.addChild(argumentNode); + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Expressions/OpAND.cs b/src/Spring/Spring.Core/Expressions/OpAND.cs index 633fc26f..8cf1ad38 100644 --- a/src/Spring/Spring.Core/Expressions/OpAND.cs +++ b/src/Spring/Spring.Core/Expressions/OpAND.cs @@ -19,12 +19,13 @@ #endregion using System; -using System.Runtime.Serialization; +using System.Runtime.Serialization; +using Spring.Util; namespace Spring.Expressions { - /// - /// Represents logical AND operator. + /// + /// Represents AND operator (both, bitwise and logical). /// /// Aleksandar Seovic [Serializable] @@ -37,6 +38,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public OpAND(BaseNode left, BaseNode right) + :base(left, right) + { + } + /// /// Create a new instance from SerializationInfo /// @@ -53,8 +62,14 @@ namespace Spring.Expressions /// Node's value. protected override object Get(object context, EvaluationContext evalContext) { - return Convert.ToBoolean(Left.GetValueInternal(context, evalContext)) - && Convert.ToBoolean(Right.GetValueInternal(context, evalContext)); + object l = Left.GetValueInternal(context, evalContext); + object r = Right.GetValueInternal(context, evalContext); + + if (NumberUtils.IsInteger(l) && NumberUtils.IsInteger(r)) + { + return NumberUtils.BitwiseAnd(l, r); + } + return Convert.ToBoolean(l) && Convert.ToBoolean(r); } } } \ No newline at end of file diff --git a/src/Spring/Spring.Core/Expressions/OpNOT.cs b/src/Spring/Spring.Core/Expressions/OpNOT.cs index 9b966704..f7870fad 100644 --- a/src/Spring/Spring.Core/Expressions/OpNOT.cs +++ b/src/Spring/Spring.Core/Expressions/OpNOT.cs @@ -19,12 +19,13 @@ #endregion using System; -using System.Runtime.Serialization; +using System.Runtime.Serialization; +using Spring.Util; namespace Spring.Expressions { - /// - /// Represents logical NOT operator. + /// + /// Represents NOT operator (both, bitwise and logical). /// /// Aleksandar Seovic [Serializable] @@ -37,6 +38,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public OpNOT(BaseNode operand) + :base(operand) + { + } + /// /// Create a new instance from SerializationInfo /// @@ -52,8 +61,13 @@ namespace Spring.Expressions /// Current expression evaluation context. /// Node's value. protected override object Get(object context, EvaluationContext evalContext) - { - return !Convert.ToBoolean(Operand.GetValueInternal(context, evalContext)); + { + object operand = Operand.GetValueInternal(context, evalContext); + if (NumberUtils.IsInteger(operand)) + { + return NumberUtils.BitwiseNot(operand); + } + return !Convert.ToBoolean(operand); } } } \ No newline at end of file diff --git a/src/Spring/Spring.Core/Expressions/OpOR.cs b/src/Spring/Spring.Core/Expressions/OpOR.cs index 50df3696..95534f70 100644 --- a/src/Spring/Spring.Core/Expressions/OpOR.cs +++ b/src/Spring/Spring.Core/Expressions/OpOR.cs @@ -19,12 +19,13 @@ #endregion using System; -using System.Runtime.Serialization; +using System.Runtime.Serialization; +using Spring.Util; namespace Spring.Expressions { /// - /// Represents logical OR operator. + /// Represents OR operator (both, bitwise and logical). /// /// Aleksandar Seovic [Serializable] @@ -37,6 +38,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public OpOR(BaseNode left, BaseNode right) + :base(left, right) + { + } + /// /// Create a new instance from SerializationInfo /// @@ -52,9 +61,15 @@ namespace Spring.Expressions /// Current expression evaluation context. /// Node's value. protected override object Get(object context, EvaluationContext evalContext) - { - return Convert.ToBoolean( Left.GetValueInternal( context, evalContext ) ) - || Convert.ToBoolean( Right.GetValueInternal( context, evalContext ) ); + { + object l = Left.GetValueInternal(context, evalContext); + object r = Right.GetValueInternal(context, evalContext); + + if (NumberUtils.IsInteger(l) && NumberUtils.IsInteger(r)) + { + return NumberUtils.BitwiseOr(l, r); + } + return Convert.ToBoolean(l) || Convert.ToBoolean(r); } } } \ No newline at end of file diff --git a/src/Spring/Spring.Core/Expressions/OpXOR.cs b/src/Spring/Spring.Core/Expressions/OpXOR.cs new file mode 100644 index 00000000..c025f474 --- /dev/null +++ b/src/Spring/Spring.Core/Expressions/OpXOR.cs @@ -0,0 +1,73 @@ +#region License + +/* + * Copyright 2002-2009 the original author or authors. + * + * Licensed 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. + */ + +#endregion + +using System; +using System.Runtime.Serialization; +using Spring.Util; + +namespace Spring.Expressions +{ + /// + /// + /// Erich Eichinger + [Serializable] + public class OpXOR : BinaryOperator + { + /// + /// Create a new instance + /// + public OpXOR() + { } + + /// + /// Create a new instance + /// + public OpXOR(BaseNode left, BaseNode right) + :base(left, right) + { + } + + /// + /// Create a new instance from SerializationInfo + /// + protected OpXOR(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + + /// + /// Returns a value for the logical AND operator node. + /// + /// Context to evaluate expressions against. + /// Current expression evaluation context. + /// Node's value. + protected override object Get(object context, EvaluationContext evalContext) + { + object l = Left.GetValueInternal(context, evalContext); + object r = Right.GetValueInternal(context, evalContext); + + if (NumberUtils.IsInteger(l) && NumberUtils.IsInteger(r)) + { + return NumberUtils.BitwiseXor(l, r); + } + return Convert.ToBoolean(l) ^ Convert.ToBoolean(r); + } + } +} \ No newline at end of file diff --git a/src/Spring/Spring.Core/Expressions/Parser/ExpressionLexer.cs b/src/Spring/Spring.Core/Expressions/Parser/ExpressionLexer.cs index 0393200f..9a361070 100644 --- a/src/Spring/Spring.Core/Expressions/Parser/ExpressionLexer.cs +++ b/src/Spring/Spring.Core/Expressions/Parser/ExpressionLexer.cs @@ -40,68 +40,69 @@ namespace Spring.Expressions public const int TRUE = 7; public const int AND = 8; public const int OR = 9; - public const int IN = 10; - public const int IS = 11; - public const int BETWEEN = 12; - public const int LIKE = 13; - public const int MATCHES = 14; - public const int NULL_LITERAL = 15; - public const int LPAREN = 16; - public const int SEMI = 17; - public const int RPAREN = 18; - public const int ASSIGN = 19; - public const int DEFAULT = 20; - public const int QMARK = 21; - public const int COLON = 22; - public const int PLUS = 23; - public const int MINUS = 24; - public const int STAR = 25; - public const int DIV = 26; - public const int MOD = 27; - public const int POWER = 28; - public const int BANG = 29; - public const int DOT = 30; - public const int POUND = 31; - public const int ID = 32; - public const int DOLLAR = 33; - public const int COMMA = 34; - public const int AT = 35; - public const int LBRACKET = 36; - public const int RBRACKET = 37; - public const int PROJECT = 38; - public const int RCURLY = 39; - public const int SELECT = 40; - public const int SELECT_FIRST = 41; - public const int SELECT_LAST = 42; - public const int TYPE = 43; - public const int QUOTE = 44; - public const int STRING_LITERAL = 45; - public const int LAMBDA = 46; - public const int PIPE = 47; - public const int LITERAL_new = 48; - public const int LCURLY = 49; - public const int INTEGER_LITERAL = 50; - public const int HEXADECIMAL_INTEGER_LITERAL = 51; - public const int REAL_LITERAL = 52; - public const int LITERAL_date = 53; - public const int EQUAL = 54; - public const int NOT_EQUAL = 55; - public const int LESS_THAN = 56; - public const int LESS_THAN_OR_EQUAL = 57; - public const int GREATER_THAN = 58; - public const int GREATER_THAN_OR_EQUAL = 59; - public const int WS = 60; - public const int BACKTICK = 61; - public const int BACKSLASH = 62; - public const int DOT_ESCAPED = 63; - public const int APOS = 64; - public const int NUMERIC_LITERAL = 65; - public const int DECIMAL_DIGIT = 66; - public const int INTEGER_TYPE_SUFFIX = 67; - public const int HEX_DIGIT = 68; - public const int EXPONENT_PART = 69; - public const int SIGN = 70; - public const int REAL_TYPE_SUFFIX = 71; + public const int XOR = 10; + public const int IN = 11; + public const int IS = 12; + public const int BETWEEN = 13; + public const int LIKE = 14; + public const int MATCHES = 15; + public const int NULL_LITERAL = 16; + public const int LPAREN = 17; + public const int SEMI = 18; + public const int RPAREN = 19; + public const int ASSIGN = 20; + public const int DEFAULT = 21; + public const int QMARK = 22; + public const int COLON = 23; + public const int PLUS = 24; + public const int MINUS = 25; + public const int STAR = 26; + public const int DIV = 27; + public const int MOD = 28; + public const int POWER = 29; + public const int BANG = 30; + public const int DOT = 31; + public const int POUND = 32; + public const int ID = 33; + public const int DOLLAR = 34; + public const int COMMA = 35; + public const int AT = 36; + public const int LBRACKET = 37; + public const int RBRACKET = 38; + public const int PROJECT = 39; + public const int RCURLY = 40; + public const int SELECT = 41; + public const int SELECT_FIRST = 42; + public const int SELECT_LAST = 43; + public const int TYPE = 44; + public const int QUOTE = 45; + public const int STRING_LITERAL = 46; + public const int LAMBDA = 47; + public const int PIPE = 48; + public const int LITERAL_new = 49; + public const int LCURLY = 50; + public const int INTEGER_LITERAL = 51; + public const int HEXADECIMAL_INTEGER_LITERAL = 52; + public const int REAL_LITERAL = 53; + public const int LITERAL_date = 54; + public const int EQUAL = 55; + public const int NOT_EQUAL = 56; + public const int LESS_THAN = 57; + public const int LESS_THAN_OR_EQUAL = 58; + public const int GREATER_THAN = 59; + public const int GREATER_THAN_OR_EQUAL = 60; + public const int WS = 61; + public const int BACKTICK = 62; + public const int BACKSLASH = 63; + public const int DOT_ESCAPED = 64; + public const int APOS = 65; + public const int NUMERIC_LITERAL = 66; + public const int DECIMAL_DIGIT = 67; + public const int INTEGER_TYPE_SUFFIX = 68; + public const int HEX_DIGIT = 69; + public const int EXPONENT_PART = 70; + public const int SIGN = 71; + public const int REAL_TYPE_SUFFIX = 72; // CLOVER:OFF @@ -128,15 +129,16 @@ namespace Spring.Expressions literals = new Hashtable(100, (float) 0.4, null, Comparer.Default); literals.Add("true", 7); literals.Add("and", 8); - literals.Add("matches", 14); - literals.Add("in", 10); - literals.Add("null", 15); - literals.Add("between", 12); + literals.Add("matches", 15); + literals.Add("in", 11); + literals.Add("xor", 10); + literals.Add("null", 16); + literals.Add("between", 13); literals.Add("or", 9); - literals.Add("is", 11); - literals.Add("like", 13); - literals.Add("new", 48); - literals.Add("date", 53); + literals.Add("is", 12); + literals.Add("like", 14); + literals.Add("new", 49); + literals.Add("date", 54); literals.Add("false", 6); } @@ -1008,11 +1010,11 @@ tryAgain: } else { - goto _loop160_breakloop; + goto _loop163_breakloop; } } -_loop160_breakloop: ; +_loop163_breakloop: ; } // ( ... )* _saveIndex = text.Length; mQUOTE(false); @@ -1125,11 +1127,11 @@ _loop160_breakloop: ; } default: { - goto _loop165_breakloop; + goto _loop168_breakloop; } } } -_loop165_breakloop: ; +_loop168_breakloop: ; } // ( ... )* _ttype = testLiteralsTable(_ttype); if (_createToken && (null == _token) && (_ttype != Token.SKIP)) @@ -1145,11 +1147,11 @@ _loop165_breakloop: ; int _ttype; IToken _token=null; int _begin=text.Length; _ttype = NUMERIC_LITERAL; - bool synPredMatched168 = false; + bool synPredMatched171 = false; if (((cached_LA1=='.') && ((cached_LA2 >= '0' && cached_LA2 <= '9')))) { - int _m168 = mark(); - synPredMatched168 = true; + int _m171 = mark(); + synPredMatched171 = true; inputState.guessing++; try { { @@ -1159,16 +1161,16 @@ _loop165_breakloop: ; } catch (RecognitionException) { - synPredMatched168 = false; + synPredMatched171 = false; } - rewind(_m168); + rewind(_m171); inputState.guessing--; } - if ( synPredMatched168 ) + if ( synPredMatched171 ) { match('.'); { // ( ... )+ - int _cnt170=0; + int _cnt173=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1177,12 +1179,12 @@ _loop165_breakloop: ; } else { - if (_cnt170 >= 1) { goto _loop170_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt173 >= 1) { goto _loop173_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt170++; + _cnt173++; } -_loop170_breakloop: ; +_loop173_breakloop: ; } // ( ... )+ { if ((cached_LA1=='E'||cached_LA1=='e')) @@ -1208,16 +1210,16 @@ _loop170_breakloop: ; } } else { - bool synPredMatched176 = false; + bool synPredMatched179 = false; if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_1_.member(cached_LA2)))) { - int _m176 = mark(); - synPredMatched176 = true; + int _m179 = mark(); + synPredMatched179 = true; inputState.guessing++; try { { { // ( ... )+ - int _cnt175=0; + int _cnt178=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1226,12 +1228,12 @@ _loop170_breakloop: ; } else { - if (_cnt175 >= 1) { goto _loop175_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt178 >= 1) { goto _loop178_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt175++; + _cnt178++; } -_loop175_breakloop: ; +_loop178_breakloop: ; } // ( ... )+ match('.'); mDECIMAL_DIGIT(false); @@ -1239,15 +1241,15 @@ _loop175_breakloop: ; } catch (RecognitionException) { - synPredMatched176 = false; + synPredMatched179 = false; } - rewind(_m176); + rewind(_m179); inputState.guessing--; } - if ( synPredMatched176 ) + if ( synPredMatched179 ) { { // ( ... )+ - int _cnt178=0; + int _cnt181=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1256,16 +1258,16 @@ _loop175_breakloop: ; } else { - if (_cnt178 >= 1) { goto _loop178_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt181 >= 1) { goto _loop181_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt178++; + _cnt181++; } -_loop178_breakloop: ; +_loop181_breakloop: ; } // ( ... )+ match('.'); { // ( ... )+ - int _cnt180=0; + int _cnt183=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1274,12 +1276,12 @@ _loop178_breakloop: ; } else { - if (_cnt180 >= 1) { goto _loop180_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt183 >= 1) { goto _loop183_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt180++; + _cnt183++; } -_loop180_breakloop: ; +_loop183_breakloop: ; } // ( ... )+ { if ((cached_LA1=='E'||cached_LA1=='e')) @@ -1305,16 +1307,16 @@ _loop180_breakloop: ; } } else { - bool synPredMatched187 = false; + bool synPredMatched190 = false; if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_4_.member(cached_LA2)))) { - int _m187 = mark(); - synPredMatched187 = true; + int _m190 = mark(); + synPredMatched190 = true; inputState.guessing++; try { { { // ( ... )+ - int _cnt185=0; + int _cnt188=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1323,12 +1325,12 @@ _loop180_breakloop: ; } else { - if (_cnt185 >= 1) { goto _loop185_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt188 >= 1) { goto _loop188_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt185++; + _cnt188++; } -_loop185_breakloop: ; +_loop188_breakloop: ; } // ( ... )+ { mEXPONENT_PART(false); @@ -1337,15 +1339,15 @@ _loop185_breakloop: ; } catch (RecognitionException) { - synPredMatched187 = false; + synPredMatched190 = false; } - rewind(_m187); + rewind(_m190); inputState.guessing--; } - if ( synPredMatched187 ) + if ( synPredMatched190 ) { { // ( ... )+ - int _cnt189=0; + int _cnt192=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1354,12 +1356,12 @@ _loop185_breakloop: ; } else { - if (_cnt189 >= 1) { goto _loop189_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt192 >= 1) { goto _loop192_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt189++; + _cnt192++; } -_loop189_breakloop: ; +_loop192_breakloop: ; } // ( ... )+ { mEXPONENT_PART(false); @@ -1379,16 +1381,16 @@ _loop189_breakloop: ; } } else { - bool synPredMatched196 = false; + bool synPredMatched199 = false; if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_5_.member(cached_LA2)))) { - int _m196 = mark(); - synPredMatched196 = true; + int _m199 = mark(); + synPredMatched199 = true; inputState.guessing++; try { { { // ( ... )+ - int _cnt194=0; + int _cnt197=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1397,12 +1399,12 @@ _loop189_breakloop: ; } else { - if (_cnt194 >= 1) { goto _loop194_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt197 >= 1) { goto _loop197_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt194++; + _cnt197++; } -_loop194_breakloop: ; +_loop197_breakloop: ; } // ( ... )+ { mREAL_TYPE_SUFFIX(false); @@ -1411,39 +1413,13 @@ _loop194_breakloop: ; } catch (RecognitionException) { - synPredMatched196 = false; + synPredMatched199 = false; } - rewind(_m196); + rewind(_m199); inputState.guessing--; } - if ( synPredMatched196 ) + if ( synPredMatched199 ) { - { // ( ... )+ - int _cnt198=0; - for (;;) - { - if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) - { - mDECIMAL_DIGIT(false); - } - else - { - if (_cnt198 >= 1) { goto _loop198_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } - } - - _cnt198++; - } -_loop198_breakloop: ; - } // ( ... )+ - { - mREAL_TYPE_SUFFIX(false); - } - if (0==inputState.guessing) - { - _ttype = REAL_LITERAL; - } - } - else if (((cached_LA1 >= '0' && cached_LA1 <= '9')) && (true)) { { // ( ... )+ int _cnt201=0; for (;;) @@ -1460,6 +1436,32 @@ _loop198_breakloop: ; _cnt201++; } _loop201_breakloop: ; + } // ( ... )+ + { + mREAL_TYPE_SUFFIX(false); + } + if (0==inputState.guessing) + { + _ttype = REAL_LITERAL; + } + } + else if (((cached_LA1 >= '0' && cached_LA1 <= '9')) && (true)) { + { // ( ... )+ + int _cnt204=0; + for (;;) + { + if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) + { + mDECIMAL_DIGIT(false); + } + else + { + if (_cnt204 >= 1) { goto _loop204_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + } + + _cnt204++; + } +_loop204_breakloop: ; } // ( ... )+ { if ((tokenSet_6_.member(cached_LA1))) @@ -1528,14 +1530,14 @@ _loop201_breakloop: ; } else { - goto _loop213_breakloop; + goto _loop216_breakloop; } } -_loop213_breakloop: ; +_loop216_breakloop: ; } // ( ... )* { // ( ... )+ - int _cnt215=0; + int _cnt218=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1544,12 +1546,12 @@ _loop213_breakloop: ; } else { - if (_cnt215 >= 1) { goto _loop215_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt218 >= 1) { goto _loop218_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt215++; + _cnt218++; } -_loop215_breakloop: ; +_loop218_breakloop: ; } // ( ... )+ break; } @@ -1565,14 +1567,14 @@ _loop215_breakloop: ; } else { - goto _loop217_breakloop; + goto _loop220_breakloop; } } -_loop217_breakloop: ; +_loop220_breakloop: ; } // ( ... )* { // ( ... )+ - int _cnt219=0; + int _cnt222=0; for (;;) { if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) @@ -1581,12 +1583,12 @@ _loop217_breakloop: ; } else { - if (_cnt219 >= 1) { goto _loop219_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt222 >= 1) { goto _loop222_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt219++; + _cnt222++; } -_loop219_breakloop: ; +_loop222_breakloop: ; } // ( ... )+ break; } @@ -1717,7 +1719,7 @@ _loop219_breakloop: ; match("0x"); { // ( ... )+ - int _cnt205=0; + int _cnt208=0; for (;;) { if ((tokenSet_7_.member(cached_LA1))) @@ -1726,12 +1728,12 @@ _loop219_breakloop: ; } else { - if (_cnt205 >= 1) { goto _loop205_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } + if (_cnt208 >= 1) { goto _loop208_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; } } - _cnt205++; + _cnt208++; } -_loop205_breakloop: ; +_loop208_breakloop: ; } // ( ... )+ { if ((tokenSet_6_.member(cached_LA1))) diff --git a/src/Spring/Spring.Core/Expressions/Parser/ExpressionParser.cs b/src/Spring/Spring.Core/Expressions/Parser/ExpressionParser.cs index 3fa4cb7d..50d38a33 100644 --- a/src/Spring/Spring.Core/Expressions/Parser/ExpressionParser.cs +++ b/src/Spring/Spring.Core/Expressions/Parser/ExpressionParser.cs @@ -34,68 +34,69 @@ namespace Spring.Expressions public const int TRUE = 7; public const int AND = 8; public const int OR = 9; - public const int IN = 10; - public const int IS = 11; - public const int BETWEEN = 12; - public const int LIKE = 13; - public const int MATCHES = 14; - public const int NULL_LITERAL = 15; - public const int LPAREN = 16; - public const int SEMI = 17; - public const int RPAREN = 18; - public const int ASSIGN = 19; - public const int DEFAULT = 20; - public const int QMARK = 21; - public const int COLON = 22; - public const int PLUS = 23; - public const int MINUS = 24; - public const int STAR = 25; - public const int DIV = 26; - public const int MOD = 27; - public const int POWER = 28; - public const int BANG = 29; - public const int DOT = 30; - public const int POUND = 31; - public const int ID = 32; - public const int DOLLAR = 33; - public const int COMMA = 34; - public const int AT = 35; - public const int LBRACKET = 36; - public const int RBRACKET = 37; - public const int PROJECT = 38; - public const int RCURLY = 39; - public const int SELECT = 40; - public const int SELECT_FIRST = 41; - public const int SELECT_LAST = 42; - public const int TYPE = 43; - public const int QUOTE = 44; - public const int STRING_LITERAL = 45; - public const int LAMBDA = 46; - public const int PIPE = 47; - public const int LITERAL_new = 48; - public const int LCURLY = 49; - public const int INTEGER_LITERAL = 50; - public const int HEXADECIMAL_INTEGER_LITERAL = 51; - public const int REAL_LITERAL = 52; - public const int LITERAL_date = 53; - public const int EQUAL = 54; - public const int NOT_EQUAL = 55; - public const int LESS_THAN = 56; - public const int LESS_THAN_OR_EQUAL = 57; - public const int GREATER_THAN = 58; - public const int GREATER_THAN_OR_EQUAL = 59; - public const int WS = 60; - public const int BACKTICK = 61; - public const int BACKSLASH = 62; - public const int DOT_ESCAPED = 63; - public const int APOS = 64; - public const int NUMERIC_LITERAL = 65; - public const int DECIMAL_DIGIT = 66; - public const int INTEGER_TYPE_SUFFIX = 67; - public const int HEX_DIGIT = 68; - public const int EXPONENT_PART = 69; - public const int SIGN = 70; - public const int REAL_TYPE_SUFFIX = 71; + public const int XOR = 10; + public const int IN = 11; + public const int IS = 12; + public const int BETWEEN = 13; + public const int LIKE = 14; + public const int MATCHES = 15; + public const int NULL_LITERAL = 16; + public const int LPAREN = 17; + public const int SEMI = 18; + public const int RPAREN = 19; + public const int ASSIGN = 20; + public const int DEFAULT = 21; + public const int QMARK = 22; + public const int COLON = 23; + public const int PLUS = 24; + public const int MINUS = 25; + public const int STAR = 26; + public const int DIV = 27; + public const int MOD = 28; + public const int POWER = 29; + public const int BANG = 30; + public const int DOT = 31; + public const int POUND = 32; + public const int ID = 33; + public const int DOLLAR = 34; + public const int COMMA = 35; + public const int AT = 36; + public const int LBRACKET = 37; + public const int RBRACKET = 38; + public const int PROJECT = 39; + public const int RCURLY = 40; + public const int SELECT = 41; + public const int SELECT_FIRST = 42; + public const int SELECT_LAST = 43; + public const int TYPE = 44; + public const int QUOTE = 45; + public const int STRING_LITERAL = 46; + public const int LAMBDA = 47; + public const int PIPE = 48; + public const int LITERAL_new = 49; + public const int LCURLY = 50; + public const int INTEGER_LITERAL = 51; + public const int HEXADECIMAL_INTEGER_LITERAL = 52; + public const int REAL_LITERAL = 53; + public const int LITERAL_date = 54; + public const int EQUAL = 55; + public const int NOT_EQUAL = 56; + public const int LESS_THAN = 57; + public const int LESS_THAN_OR_EQUAL = 58; + public const int GREATER_THAN = 59; + public const int GREATER_THAN_OR_EQUAL = 60; + public const int WS = 61; + public const int BACKTICK = 62; + public const int BACKSLASH = 63; + public const int DOT_ESCAPED = 64; + public const int APOS = 65; + public const int NUMERIC_LITERAL = 66; + public const int DECIMAL_DIGIT = 67; + public const int INTEGER_TYPE_SUFFIX = 68; + public const int HEX_DIGIT = 69; + public const int EXPONENT_PART = 70; + public const int SIGN = 71; + public const int REAL_TYPE_SUFFIX = 72; // CLOVER:OFF @@ -366,7 +367,7 @@ _loop4_breakloop: ; Spring.Expressions.SpringAST logicalOrExpression_AST = null; try { // for error handling - logicalAndExpression(); + logicalXorExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); @@ -380,7 +381,7 @@ _loop4_breakloop: ; tmp9_AST = (Spring.Expressions.OpOR) astFactory.create(LT(1), "Spring.Expressions.OpOR"); astFactory.makeASTRoot(ref currentAST, (AST)tmp9_AST); match(OR); - logicalAndExpression(); + logicalXorExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); @@ -443,6 +444,59 @@ _loop13_breakloop: ; returnAST = parenExpr_AST; } + public void logicalXorExpression() //throws RecognitionException, TokenStreamException +{ + + returnAST = null; + ASTPair currentAST = new ASTPair(); + Spring.Expressions.SpringAST logicalXorExpression_AST = null; + + try { // for error handling + logicalAndExpression(); + if (0 == inputState.guessing) + { + astFactory.addASTChild(ref currentAST, (AST)returnAST); + } + { // ( ... )* + for (;;) + { + if ((LA(1)==XOR)) + { + Spring.Expressions.OpXOR tmp12_AST = null; + tmp12_AST = (Spring.Expressions.OpXOR) astFactory.create(LT(1), "Spring.Expressions.OpXOR"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp12_AST); + match(XOR); + logicalAndExpression(); + if (0 == inputState.guessing) + { + astFactory.addASTChild(ref currentAST, (AST)returnAST); + } + } + else + { + goto _loop16_breakloop; + } + + } +_loop16_breakloop: ; + } // ( ... )* + logicalXorExpression_AST = (Spring.Expressions.SpringAST)currentAST.root; + } + catch (RecognitionException ex) + { + if (0 == inputState.guessing) + { + reportError(ex); + recover(ex,tokenSet_4_); + } + else + { + throw ex; + } + } + returnAST = logicalXorExpression_AST; + } + public void logicalAndExpression() //throws RecognitionException, TokenStreamException { @@ -461,9 +515,9 @@ _loop13_breakloop: ; { if ((LA(1)==AND)) { - Spring.Expressions.OpAND tmp12_AST = null; - tmp12_AST = (Spring.Expressions.OpAND) astFactory.create(LT(1), "Spring.Expressions.OpAND"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp12_AST); + Spring.Expressions.OpAND tmp13_AST = null; + tmp13_AST = (Spring.Expressions.OpAND) astFactory.create(LT(1), "Spring.Expressions.OpAND"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp13_AST); match(AND); relationalExpression(); if (0 == inputState.guessing) @@ -473,11 +527,11 @@ _loop13_breakloop: ; } else { - goto _loop16_breakloop; + goto _loop19_breakloop; } } -_loop16_breakloop: ; +_loop19_breakloop: ; } // ( ... )* logicalAndExpression_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -486,7 +540,7 @@ _loop16_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_4_); + recover(ex,tokenSet_5_); } else { @@ -514,7 +568,7 @@ _loop16_breakloop: ; astFactory.addASTChild(ref currentAST, (AST)returnAST); } { - if ((tokenSet_5_.member(LA(1)))) + if ((tokenSet_6_.member(LA(1)))) { relationalOperator(); if (0 == inputState.guessing) @@ -539,7 +593,7 @@ _loop16_breakloop: ; currentAST.advanceChildToEnd(); } } - else if ((tokenSet_6_.member(LA(1)))) { + else if ((tokenSet_7_.member(LA(1)))) { } else { @@ -554,7 +608,7 @@ _loop16_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_6_); + recover(ex,tokenSet_7_); } else { @@ -585,15 +639,15 @@ _loop16_breakloop: ; { if ((LA(1)==PLUS)) { - Spring.Expressions.OpADD tmp13_AST = null; - tmp13_AST = (Spring.Expressions.OpADD) astFactory.create(LT(1), "Spring.Expressions.OpADD"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp13_AST); + Spring.Expressions.OpADD tmp14_AST = null; + tmp14_AST = (Spring.Expressions.OpADD) astFactory.create(LT(1), "Spring.Expressions.OpADD"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp14_AST); match(PLUS); } else if ((LA(1)==MINUS)) { - Spring.Expressions.OpSUBTRACT tmp14_AST = null; - tmp14_AST = (Spring.Expressions.OpSUBTRACT) astFactory.create(LT(1), "Spring.Expressions.OpSUBTRACT"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp14_AST); + Spring.Expressions.OpSUBTRACT tmp15_AST = null; + tmp15_AST = (Spring.Expressions.OpSUBTRACT) astFactory.create(LT(1), "Spring.Expressions.OpSUBTRACT"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp15_AST); match(MINUS); } else @@ -610,11 +664,11 @@ _loop16_breakloop: ; } else { - goto _loop22_breakloop; + goto _loop25_breakloop; } } -_loop22_breakloop: ; +_loop25_breakloop: ; } // ( ... )* sumExpr_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -623,7 +677,7 @@ _loop22_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_7_); + recover(ex,tokenSet_8_); } else { @@ -645,99 +699,99 @@ _loop22_breakloop: ; { case EQUAL: { - Spring.Expressions.SpringAST tmp15_AST = null; - tmp15_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp15_AST); + Spring.Expressions.SpringAST tmp16_AST = null; + tmp16_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp16_AST); match(EQUAL); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case NOT_EQUAL: { - Spring.Expressions.SpringAST tmp16_AST = null; - tmp16_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp16_AST); + Spring.Expressions.SpringAST tmp17_AST = null; + tmp17_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp17_AST); match(NOT_EQUAL); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case LESS_THAN: { - Spring.Expressions.SpringAST tmp17_AST = null; - tmp17_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp17_AST); + Spring.Expressions.SpringAST tmp18_AST = null; + tmp18_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp18_AST); match(LESS_THAN); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case LESS_THAN_OR_EQUAL: { - Spring.Expressions.SpringAST tmp18_AST = null; - tmp18_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp18_AST); + Spring.Expressions.SpringAST tmp19_AST = null; + tmp19_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp19_AST); match(LESS_THAN_OR_EQUAL); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case GREATER_THAN: { - Spring.Expressions.SpringAST tmp19_AST = null; - tmp19_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp19_AST); + Spring.Expressions.SpringAST tmp20_AST = null; + tmp20_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp20_AST); match(GREATER_THAN); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case GREATER_THAN_OR_EQUAL: { - Spring.Expressions.SpringAST tmp20_AST = null; - tmp20_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp20_AST); + Spring.Expressions.SpringAST tmp21_AST = null; + tmp21_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp21_AST); match(GREATER_THAN_OR_EQUAL); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case IN: { - Spring.Expressions.SpringAST tmp21_AST = null; - tmp21_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp21_AST); + Spring.Expressions.SpringAST tmp22_AST = null; + tmp22_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp22_AST); match(IN); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case IS: { - Spring.Expressions.SpringAST tmp22_AST = null; - tmp22_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp22_AST); + Spring.Expressions.SpringAST tmp23_AST = null; + tmp23_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp23_AST); match(IS); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case BETWEEN: { - Spring.Expressions.SpringAST tmp23_AST = null; - tmp23_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp23_AST); + Spring.Expressions.SpringAST tmp24_AST = null; + tmp24_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp24_AST); match(BETWEEN); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case LIKE: { - Spring.Expressions.SpringAST tmp24_AST = null; - tmp24_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp24_AST); + Spring.Expressions.SpringAST tmp25_AST = null; + tmp25_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp25_AST); match(LIKE); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case MATCHES: { - Spring.Expressions.SpringAST tmp25_AST = null; - tmp25_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp25_AST); + Spring.Expressions.SpringAST tmp26_AST = null; + tmp26_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp26_AST); match(MATCHES); relationalOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; @@ -753,7 +807,7 @@ _loop22_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_8_); + recover(ex,tokenSet_9_); } else { @@ -786,25 +840,25 @@ _loop22_breakloop: ; { case STAR: { - Spring.Expressions.OpMULTIPLY tmp26_AST = null; - tmp26_AST = (Spring.Expressions.OpMULTIPLY) astFactory.create(LT(1), "Spring.Expressions.OpMULTIPLY"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp26_AST); + Spring.Expressions.OpMULTIPLY tmp27_AST = null; + tmp27_AST = (Spring.Expressions.OpMULTIPLY) astFactory.create(LT(1), "Spring.Expressions.OpMULTIPLY"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp27_AST); match(STAR); break; } case DIV: { - Spring.Expressions.OpDIVIDE tmp27_AST = null; - tmp27_AST = (Spring.Expressions.OpDIVIDE) astFactory.create(LT(1), "Spring.Expressions.OpDIVIDE"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp27_AST); + Spring.Expressions.OpDIVIDE tmp28_AST = null; + tmp28_AST = (Spring.Expressions.OpDIVIDE) astFactory.create(LT(1), "Spring.Expressions.OpDIVIDE"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp28_AST); match(DIV); break; } case MOD: { - Spring.Expressions.OpMODULUS tmp28_AST = null; - tmp28_AST = (Spring.Expressions.OpMODULUS) astFactory.create(LT(1), "Spring.Expressions.OpMODULUS"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp28_AST); + Spring.Expressions.OpMODULUS tmp29_AST = null; + tmp29_AST = (Spring.Expressions.OpMODULUS) astFactory.create(LT(1), "Spring.Expressions.OpMODULUS"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp29_AST); match(MOD); break; } @@ -822,11 +876,11 @@ _loop22_breakloop: ; } else { - goto _loop26_breakloop; + goto _loop29_breakloop; } } -_loop26_breakloop: ; +_loop29_breakloop: ; } // ( ... )* prodExpr_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -835,7 +889,7 @@ _loop26_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_9_); + recover(ex,tokenSet_10_); } else { @@ -861,9 +915,9 @@ _loop26_breakloop: ; { if ((LA(1)==POWER)) { - Spring.Expressions.OpPOWER tmp29_AST = null; - tmp29_AST = (Spring.Expressions.OpPOWER) astFactory.create(LT(1), "Spring.Expressions.OpPOWER"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp29_AST); + Spring.Expressions.OpPOWER tmp30_AST = null; + tmp30_AST = (Spring.Expressions.OpPOWER) astFactory.create(LT(1), "Spring.Expressions.OpPOWER"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp30_AST); match(POWER); unaryExpression(); if (0 == inputState.guessing) @@ -871,7 +925,7 @@ _loop26_breakloop: ; astFactory.addASTChild(ref currentAST, (AST)returnAST); } } - else if ((tokenSet_10_.member(LA(1)))) { + else if ((tokenSet_11_.member(LA(1)))) { } else { @@ -886,7 +940,7 @@ _loop26_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_10_); + recover(ex,tokenSet_11_); } else { @@ -911,25 +965,25 @@ _loop26_breakloop: ; { case PLUS: { - Spring.Expressions.OpUnaryPlus tmp30_AST = null; - tmp30_AST = (Spring.Expressions.OpUnaryPlus) astFactory.create(LT(1), "Spring.Expressions.OpUnaryPlus"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp30_AST); + Spring.Expressions.OpUnaryPlus tmp31_AST = null; + tmp31_AST = (Spring.Expressions.OpUnaryPlus) astFactory.create(LT(1), "Spring.Expressions.OpUnaryPlus"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp31_AST); match(PLUS); break; } case MINUS: { - Spring.Expressions.OpUnaryMinus tmp31_AST = null; - tmp31_AST = (Spring.Expressions.OpUnaryMinus) astFactory.create(LT(1), "Spring.Expressions.OpUnaryMinus"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp31_AST); + Spring.Expressions.OpUnaryMinus tmp32_AST = null; + tmp32_AST = (Spring.Expressions.OpUnaryMinus) astFactory.create(LT(1), "Spring.Expressions.OpUnaryMinus"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp32_AST); match(MINUS); break; } case BANG: { - Spring.Expressions.OpNOT tmp32_AST = null; - tmp32_AST = (Spring.Expressions.OpNOT) astFactory.create(LT(1), "Spring.Expressions.OpNOT"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp32_AST); + Spring.Expressions.OpNOT tmp33_AST = null; + tmp33_AST = (Spring.Expressions.OpNOT) astFactory.create(LT(1), "Spring.Expressions.OpNOT"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp33_AST); match(BANG); break; } @@ -946,7 +1000,7 @@ _loop26_breakloop: ; } unaryExpression_AST = (Spring.Expressions.SpringAST)currentAST.root; } - else if ((tokenSet_11_.member(LA(1)))) { + else if ((tokenSet_12_.member(LA(1)))) { primaryExpression(); if (0 == inputState.guessing) { @@ -965,7 +1019,7 @@ _loop26_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_12_); + recover(ex,tokenSet_13_); } else { @@ -989,7 +1043,7 @@ _loop26_breakloop: ; astFactory.addASTChild(ref currentAST, (AST)returnAST); } { - if ((tokenSet_13_.member(LA(1)))) + if ((tokenSet_14_.member(LA(1)))) { node(); if (0 == inputState.guessing) @@ -997,7 +1051,7 @@ _loop26_breakloop: ; astFactory.addASTChild(ref currentAST, (AST)returnAST); } } - else if ((tokenSet_12_.member(LA(1)))) { + else if ((tokenSet_13_.member(LA(1)))) { } else { @@ -1023,7 +1077,7 @@ _loop26_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_12_); + recover(ex,tokenSet_13_); } else { @@ -1045,27 +1099,27 @@ _loop26_breakloop: ; { case PLUS: { - Spring.Expressions.SpringAST tmp33_AST = null; - tmp33_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp33_AST); + Spring.Expressions.SpringAST tmp34_AST = null; + tmp34_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp34_AST); match(PLUS); unaryOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case MINUS: { - Spring.Expressions.SpringAST tmp34_AST = null; - tmp34_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp34_AST); + Spring.Expressions.SpringAST tmp35_AST = null; + tmp35_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp35_AST); match(MINUS); unaryOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case BANG: { - Spring.Expressions.SpringAST tmp35_AST = null; - tmp35_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp35_AST); + Spring.Expressions.SpringAST tmp36_AST = null; + tmp36_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp36_AST); match(BANG); unaryOperator_AST = (Spring.Expressions.SpringAST)currentAST.root; break; @@ -1218,11 +1272,11 @@ _loop26_breakloop: ; break; } default: - bool synPredMatched37 = false; - if (((LA(1)==LPAREN) && (tokenSet_8_.member(LA(2))))) + bool synPredMatched40 = false; + if (((LA(1)==LPAREN) && (tokenSet_9_.member(LA(2))))) { - int _m37 = mark(); - synPredMatched37 = true; + int _m40 = mark(); + synPredMatched40 = true; inputState.guessing++; try { { @@ -1233,12 +1287,12 @@ _loop26_breakloop: ; } catch (RecognitionException) { - synPredMatched37 = false; + synPredMatched40 = false; } - rewind(_m37); + rewind(_m40); inputState.guessing--; } - if ( synPredMatched37 ) + if ( synPredMatched40 ) { exprList(); if (0 == inputState.guessing) @@ -1246,7 +1300,7 @@ _loop26_breakloop: ; astFactory.addASTChild(ref currentAST, (AST)returnAST); } } - else if ((LA(1)==LPAREN) && (tokenSet_8_.member(LA(2)))) { + else if ((LA(1)==LPAREN) && (tokenSet_9_.member(LA(2)))) { parenExpr(); if (0 == inputState.guessing) { @@ -1313,7 +1367,7 @@ _loop26_breakloop: ; try { // for error handling { // ( ... )+ - int _cnt40=0; + int _cnt43=0; for (;;) { switch ( LA(1) ) @@ -1388,12 +1442,12 @@ _loop26_breakloop: ; } default: { - if (_cnt40 >= 1) { goto _loop40_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; } + if (_cnt43 >= 1) { goto _loop43_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; } } break; } - _cnt40++; + _cnt43++; } -_loop40_breakloop: ; +_loop43_breakloop: ; } // ( ... )+ node_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -1402,7 +1456,7 @@ _loop40_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_12_); + recover(ex,tokenSet_13_); } else { @@ -1420,11 +1474,11 @@ _loop40_breakloop: ; Spring.Expressions.SpringAST methodOrProperty_AST = null; try { // for error handling - bool synPredMatched53 = false; + bool synPredMatched56 = false; if (((LA(1)==ID) && (LA(2)==LPAREN))) { - int _m53 = mark(); - synPredMatched53 = true; + int _m56 = mark(); + synPredMatched56 = true; inputState.guessing++; try { { @@ -1434,16 +1488,16 @@ _loop40_breakloop: ; } catch (RecognitionException) { - synPredMatched53 = false; + synPredMatched56 = false; } - rewind(_m53); + rewind(_m56); inputState.guessing--; } - if ( synPredMatched53 ) + if ( synPredMatched56 ) { - Spring.Expressions.MethodNode tmp37_AST = null; - tmp37_AST = (Spring.Expressions.MethodNode) astFactory.create(LT(1), "Spring.Expressions.MethodNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp37_AST); + Spring.Expressions.MethodNode tmp38_AST = null; + tmp38_AST = (Spring.Expressions.MethodNode) astFactory.create(LT(1), "Spring.Expressions.MethodNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp38_AST); match(ID); methodArgs(); if (0 == inputState.guessing) @@ -1489,11 +1543,11 @@ _loop40_breakloop: ; Spring.Expressions.SpringAST functionOrVar_AST = null; try { // for error handling - bool synPredMatched43 = false; + bool synPredMatched46 = false; if (((LA(1)==POUND) && (LA(2)==ID))) { - int _m43 = mark(); - synPredMatched43 = true; + int _m46 = mark(); + synPredMatched46 = true; inputState.guessing++; try { { @@ -1504,12 +1558,12 @@ _loop40_breakloop: ; } catch (RecognitionException) { - synPredMatched43 = false; + synPredMatched46 = false; } - rewind(_m43); + rewind(_m46); inputState.guessing--; } - if ( synPredMatched43 ) + if ( synPredMatched46 ) { function(); if (0 == inputState.guessing) @@ -1555,11 +1609,11 @@ _loop40_breakloop: ; Spring.Expressions.SpringAST localFunctionOrVar_AST = null; try { // for error handling - bool synPredMatched48 = false; + bool synPredMatched51 = false; if (((LA(1)==DOLLAR) && (LA(2)==ID))) { - int _m48 = mark(); - synPredMatched48 = true; + int _m51 = mark(); + synPredMatched51 = true; inputState.guessing++; try { { @@ -1570,12 +1624,12 @@ _loop40_breakloop: ; } catch (RecognitionException) { - synPredMatched48 = false; + synPredMatched51 = false; } - rewind(_m48); + rewind(_m51); inputState.guessing--; } - if ( synPredMatched48 ) + if ( synPredMatched51 ) { localFunction(); if (0 == inputState.guessing) @@ -1624,11 +1678,11 @@ _loop40_breakloop: ; Spring.Expressions.SpringAST localid_AST = null; try { // for error handling - bool synPredMatched61 = false; + bool synPredMatched64 = false; if (((LA(1)==AT) && (LA(2)==LPAREN))) { - int _m61 = mark(); - synPredMatched61 = true; + int _m64 = mark(); + synPredMatched64 = true; inputState.guessing++; try { { @@ -1640,12 +1694,12 @@ _loop40_breakloop: ; } catch (RecognitionException) { - synPredMatched61 = false; + synPredMatched64 = false; } - rewind(_m61); + rewind(_m64); inputState.guessing--; } - if ( synPredMatched61 ) + if ( synPredMatched64 ) { match(AT); match(LPAREN); @@ -1725,9 +1779,9 @@ _loop40_breakloop: ; Spring.Expressions.SpringAST indexer_AST = null; try { // for error handling - Spring.Expressions.IndexerNode tmp45_AST = null; - tmp45_AST = (Spring.Expressions.IndexerNode) astFactory.create(LT(1), "Spring.Expressions.IndexerNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp45_AST); + Spring.Expressions.IndexerNode tmp46_AST = null; + tmp46_AST = (Spring.Expressions.IndexerNode) astFactory.create(LT(1), "Spring.Expressions.IndexerNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp46_AST); match(LBRACKET); argument(); if (0 == inputState.guessing) @@ -1748,11 +1802,11 @@ _loop40_breakloop: ; } else { - goto _loop64_breakloop; + goto _loop67_breakloop; } } -_loop64_breakloop: ; +_loop67_breakloop: ; } // ( ... )* match(RBRACKET); indexer_AST = (Spring.Expressions.SpringAST)currentAST.root; @@ -1784,45 +1838,45 @@ _loop64_breakloop: ; { case NULL_LITERAL: { - Spring.Expressions.NullLiteralNode tmp48_AST = null; - tmp48_AST = (Spring.Expressions.NullLiteralNode) astFactory.create(LT(1), "Spring.Expressions.NullLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp48_AST); + Spring.Expressions.NullLiteralNode tmp49_AST = null; + tmp49_AST = (Spring.Expressions.NullLiteralNode) astFactory.create(LT(1), "Spring.Expressions.NullLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp49_AST); match(NULL_LITERAL); literal_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case INTEGER_LITERAL: { - Spring.Expressions.IntLiteralNode tmp49_AST = null; - tmp49_AST = (Spring.Expressions.IntLiteralNode) astFactory.create(LT(1), "Spring.Expressions.IntLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp49_AST); + Spring.Expressions.IntLiteralNode tmp50_AST = null; + tmp50_AST = (Spring.Expressions.IntLiteralNode) astFactory.create(LT(1), "Spring.Expressions.IntLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp50_AST); match(INTEGER_LITERAL); literal_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case HEXADECIMAL_INTEGER_LITERAL: { - Spring.Expressions.HexLiteralNode tmp50_AST = null; - tmp50_AST = (Spring.Expressions.HexLiteralNode) astFactory.create(LT(1), "Spring.Expressions.HexLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp50_AST); + Spring.Expressions.HexLiteralNode tmp51_AST = null; + tmp51_AST = (Spring.Expressions.HexLiteralNode) astFactory.create(LT(1), "Spring.Expressions.HexLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp51_AST); match(HEXADECIMAL_INTEGER_LITERAL); literal_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case REAL_LITERAL: { - Spring.Expressions.RealLiteralNode tmp51_AST = null; - tmp51_AST = (Spring.Expressions.RealLiteralNode) astFactory.create(LT(1), "Spring.Expressions.RealLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp51_AST); + Spring.Expressions.RealLiteralNode tmp52_AST = null; + tmp52_AST = (Spring.Expressions.RealLiteralNode) astFactory.create(LT(1), "Spring.Expressions.RealLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp52_AST); match(REAL_LITERAL); literal_AST = (Spring.Expressions.SpringAST)currentAST.root; break; } case STRING_LITERAL: { - Spring.Expressions.StringLiteralNode tmp52_AST = null; - tmp52_AST = (Spring.Expressions.StringLiteralNode) astFactory.create(LT(1), "Spring.Expressions.StringLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp52_AST); + Spring.Expressions.StringLiteralNode tmp53_AST = null; + tmp53_AST = (Spring.Expressions.StringLiteralNode) astFactory.create(LT(1), "Spring.Expressions.StringLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp53_AST); match(STRING_LITERAL); literal_AST = (Spring.Expressions.SpringAST)currentAST.root; break; @@ -1922,11 +1976,11 @@ _loop64_breakloop: ; Spring.Expressions.SpringAST type_AST = null; try { // for error handling - bool synPredMatched87 = false; + bool synPredMatched90 = false; if (((LA(1)==LITERAL_new) && (LA(2)==ID))) { - int _m87 = mark(); - synPredMatched87 = true; + int _m90 = mark(); + synPredMatched90 = true; inputState.guessing++; try { { @@ -1937,12 +1991,12 @@ _loop64_breakloop: ; } catch (RecognitionException) { - synPredMatched87 = false; + synPredMatched90 = false; } - rewind(_m87); + rewind(_m90); inputState.guessing--; } - if ( synPredMatched87 ) + if ( synPredMatched90 ) { match(LITERAL_new); qualifiedId(); @@ -2005,9 +2059,9 @@ _loop64_breakloop: ; Spring.Expressions.SpringAST projection_AST = null; try { // for error handling - Spring.Expressions.ProjectionNode tmp56_AST = null; - tmp56_AST = (Spring.Expressions.ProjectionNode) astFactory.create(LT(1), "Spring.Expressions.ProjectionNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp56_AST); + Spring.Expressions.ProjectionNode tmp57_AST = null; + tmp57_AST = (Spring.Expressions.ProjectionNode) astFactory.create(LT(1), "Spring.Expressions.ProjectionNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp57_AST); match(PROJECT); expression(); if (0 == inputState.guessing) @@ -2040,9 +2094,9 @@ _loop64_breakloop: ; Spring.Expressions.SpringAST selection_AST = null; try { // for error handling - Spring.Expressions.SelectionNode tmp58_AST = null; - tmp58_AST = (Spring.Expressions.SelectionNode) astFactory.create(LT(1), "Spring.Expressions.SelectionNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp58_AST); + Spring.Expressions.SelectionNode tmp59_AST = null; + tmp59_AST = (Spring.Expressions.SelectionNode) astFactory.create(LT(1), "Spring.Expressions.SelectionNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp59_AST); match(SELECT); expression(); if (0 == inputState.guessing) @@ -2063,11 +2117,11 @@ _loop64_breakloop: ; } else { - goto _loop68_breakloop; + goto _loop71_breakloop; } } -_loop68_breakloop: ; +_loop71_breakloop: ; } // ( ... )* match(RCURLY); selection_AST = (Spring.Expressions.SpringAST)currentAST.root; @@ -2095,9 +2149,9 @@ _loop68_breakloop: ; Spring.Expressions.SpringAST firstSelection_AST = null; try { // for error handling - Spring.Expressions.SelectionFirstNode tmp61_AST = null; - tmp61_AST = (Spring.Expressions.SelectionFirstNode) astFactory.create(LT(1), "Spring.Expressions.SelectionFirstNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp61_AST); + Spring.Expressions.SelectionFirstNode tmp62_AST = null; + tmp62_AST = (Spring.Expressions.SelectionFirstNode) astFactory.create(LT(1), "Spring.Expressions.SelectionFirstNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp62_AST); match(SELECT_FIRST); expression(); if (0 == inputState.guessing) @@ -2130,9 +2184,9 @@ _loop68_breakloop: ; Spring.Expressions.SpringAST lastSelection_AST = null; try { // for error handling - Spring.Expressions.SelectionLastNode tmp63_AST = null; - tmp63_AST = (Spring.Expressions.SelectionLastNode) astFactory.create(LT(1), "Spring.Expressions.SelectionLastNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp63_AST); + Spring.Expressions.SelectionLastNode tmp64_AST = null; + tmp64_AST = (Spring.Expressions.SelectionLastNode) astFactory.create(LT(1), "Spring.Expressions.SelectionLastNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp64_AST); match(SELECT_LAST); expression(); if (0 == inputState.guessing) @@ -2165,9 +2219,9 @@ _loop68_breakloop: ; Spring.Expressions.SpringAST listInitializer_AST = null; try { // for error handling - Spring.Expressions.ListInitializerNode tmp65_AST = null; - tmp65_AST = (Spring.Expressions.ListInitializerNode) astFactory.create(LT(1), "Spring.Expressions.ListInitializerNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp65_AST); + Spring.Expressions.ListInitializerNode tmp66_AST = null; + tmp66_AST = (Spring.Expressions.ListInitializerNode) astFactory.create(LT(1), "Spring.Expressions.ListInitializerNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp66_AST); match(LCURLY); expression(); if (0 == inputState.guessing) @@ -2188,11 +2242,11 @@ _loop68_breakloop: ; } else { - goto _loop96_breakloop; + goto _loop99_breakloop; } } -_loop96_breakloop: ; +_loop99_breakloop: ; } // ( ... )* match(RCURLY); listInitializer_AST = (Spring.Expressions.SpringAST)currentAST.root; @@ -2221,9 +2275,9 @@ _loop96_breakloop: ; try { // for error handling match(POUND); - Spring.Expressions.MapInitializerNode tmp69_AST = null; - tmp69_AST = (Spring.Expressions.MapInitializerNode) astFactory.create(LT(1), "Spring.Expressions.MapInitializerNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp69_AST); + Spring.Expressions.MapInitializerNode tmp70_AST = null; + tmp70_AST = (Spring.Expressions.MapInitializerNode) astFactory.create(LT(1), "Spring.Expressions.MapInitializerNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp70_AST); match(LCURLY); mapEntry(); if (0 == inputState.guessing) @@ -2244,11 +2298,11 @@ _loop96_breakloop: ; } else { - goto _loop99_breakloop; + goto _loop102_breakloop; } } -_loop99_breakloop: ; +_loop102_breakloop: ; } // ( ... )* match(RCURLY); mapInitializer_AST = (Spring.Expressions.SpringAST)currentAST.root; @@ -2400,9 +2454,9 @@ _loop99_breakloop: ; try { // for error handling match(POUND); - Spring.Expressions.FunctionNode tmp79_AST = null; - tmp79_AST = (Spring.Expressions.FunctionNode) astFactory.create(LT(1), "Spring.Expressions.FunctionNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp79_AST); + Spring.Expressions.FunctionNode tmp80_AST = null; + tmp80_AST = (Spring.Expressions.FunctionNode) astFactory.create(LT(1), "Spring.Expressions.FunctionNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp80_AST); match(ID); methodArgs(); if (0 == inputState.guessing) @@ -2435,9 +2489,9 @@ _loop99_breakloop: ; try { // for error handling match(POUND); - Spring.Expressions.VariableNode tmp81_AST = null; - tmp81_AST = (Spring.Expressions.VariableNode) astFactory.create(LT(1), "Spring.Expressions.VariableNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp81_AST); + Spring.Expressions.VariableNode tmp82_AST = null; + tmp82_AST = (Spring.Expressions.VariableNode) astFactory.create(LT(1), "Spring.Expressions.VariableNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp82_AST); match(ID); var_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -2466,7 +2520,7 @@ _loop99_breakloop: ; try { // for error handling match(LPAREN); { - if ((tokenSet_8_.member(LA(1)))) + if ((tokenSet_9_.member(LA(1)))) { argument(); if (0 == inputState.guessing) @@ -2487,11 +2541,11 @@ _loop99_breakloop: ; } else { - goto _loop57_breakloop; + goto _loop60_breakloop; } } -_loop57_breakloop: ; +_loop60_breakloop: ; } // ( ... )* } else if ((LA(1)==RPAREN)) { @@ -2529,9 +2583,9 @@ _loop57_breakloop: ; try { // for error handling match(DOLLAR); - Spring.Expressions.LocalFunctionNode tmp86_AST = null; - tmp86_AST = (Spring.Expressions.LocalFunctionNode) astFactory.create(LT(1), "Spring.Expressions.LocalFunctionNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp86_AST); + Spring.Expressions.LocalFunctionNode tmp87_AST = null; + tmp87_AST = (Spring.Expressions.LocalFunctionNode) astFactory.create(LT(1), "Spring.Expressions.LocalFunctionNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp87_AST); match(ID); methodArgs(); if (0 == inputState.guessing) @@ -2564,9 +2618,9 @@ _loop57_breakloop: ; try { // for error handling match(DOLLAR); - Spring.Expressions.LocalVariableNode tmp88_AST = null; - tmp88_AST = (Spring.Expressions.LocalVariableNode) astFactory.create(LT(1), "Spring.Expressions.LocalVariableNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp88_AST); + Spring.Expressions.LocalVariableNode tmp89_AST = null; + tmp89_AST = (Spring.Expressions.LocalVariableNode) astFactory.create(LT(1), "Spring.Expressions.LocalVariableNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp89_AST); match(ID); localVar_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -2593,9 +2647,9 @@ _loop57_breakloop: ; Spring.Expressions.SpringAST property_AST = null; try { // for error handling - Spring.Expressions.PropertyOrFieldNode tmp89_AST = null; - tmp89_AST = (Spring.Expressions.PropertyOrFieldNode) astFactory.create(LT(1), "Spring.Expressions.PropertyOrFieldNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp89_AST); + Spring.Expressions.PropertyOrFieldNode tmp90_AST = null; + tmp90_AST = (Spring.Expressions.PropertyOrFieldNode) astFactory.create(LT(1), "Spring.Expressions.PropertyOrFieldNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp90_AST); match(ID); property_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -2634,7 +2688,7 @@ _loop57_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_14_); + recover(ex,tokenSet_15_); } else { @@ -2654,9 +2708,9 @@ _loop57_breakloop: ; try { // for error handling if ((LA(1)==STRING_LITERAL)) { - Spring.Expressions.QualifiedIdentifier tmp90_AST = null; - tmp90_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp90_AST); + Spring.Expressions.QualifiedIdentifier tmp91_AST = null; + tmp91_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp91_AST); match(STRING_LITERAL); quotableName_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -2679,7 +2733,7 @@ _loop57_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_15_); + recover(ex,tokenSet_16_); } else { @@ -2697,29 +2751,29 @@ _loop57_breakloop: ; Spring.Expressions.SpringAST name_AST = null; try { // for error handling - Spring.Expressions.QualifiedIdentifier tmp91_AST = null; - tmp91_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp91_AST); + Spring.Expressions.QualifiedIdentifier tmp92_AST = null; + tmp92_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp92_AST); match(ID); { // ( ... )* for (;;) { - if ((tokenSet_16_.member(LA(1)))) + if ((tokenSet_17_.member(LA(1)))) { { - Spring.Expressions.SpringAST tmp92_AST = null; - tmp92_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp92_AST); - match(tokenSet_16_); + Spring.Expressions.SpringAST tmp93_AST = null; + tmp93_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp93_AST); + match(tokenSet_17_); } } else { - goto _loop75_breakloop; + goto _loop78_breakloop; } } -_loop75_breakloop: ; +_loop78_breakloop: ; } // ( ... )* name_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -2728,7 +2782,7 @@ _loop75_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_15_); + recover(ex,tokenSet_16_); } else { @@ -2746,31 +2800,31 @@ _loop75_breakloop: ; Spring.Expressions.SpringAST qualifiedId_AST = null; try { // for error handling - Spring.Expressions.QualifiedIdentifier tmp93_AST = null; - tmp93_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp93_AST); + Spring.Expressions.QualifiedIdentifier tmp94_AST = null; + tmp94_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp94_AST); match(ID); { // ( ... )* for (;;) { if ((LA(1)==DOT)) { - Spring.Expressions.SpringAST tmp94_AST = null; - tmp94_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp94_AST); - match(DOT); Spring.Expressions.SpringAST tmp95_AST = null; tmp95_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp95_AST); + match(DOT); + Spring.Expressions.SpringAST tmp96_AST = null; + tmp96_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp96_AST); match(ID); } else { - goto _loop111_breakloop; + goto _loop114_breakloop; } } -_loop111_breakloop: ; +_loop114_breakloop: ; } // ( ... )* qualifiedId_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -2779,7 +2833,7 @@ _loop111_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_17_); + recover(ex,tokenSet_18_); } else { @@ -2799,7 +2853,7 @@ _loop111_breakloop: ; try { // for error handling match(LPAREN); { - if ((tokenSet_8_.member(LA(1)))) + if ((tokenSet_9_.member(LA(1)))) { namedArgument(); if (0 == inputState.guessing) @@ -2820,11 +2874,11 @@ _loop111_breakloop: ; } else { - goto _loop104_breakloop; + goto _loop107_breakloop; } } -_loop104_breakloop: ; +_loop107_breakloop: ; } // ( ... )* } else if ((LA(1)==RPAREN)) { @@ -2862,9 +2916,9 @@ _loop104_breakloop: ; try { // for error handling { - Spring.Expressions.SpringAST tmp99_AST = null; - tmp99_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp99_AST); + Spring.Expressions.SpringAST tmp100_AST = null; + tmp100_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp100_AST); match(ID); { // ( ... )* for (;;) @@ -2872,18 +2926,18 @@ _loop104_breakloop: ; if ((LA(1)==COMMA)) { match(COMMA); - Spring.Expressions.SpringAST tmp101_AST = null; - tmp101_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp101_AST); + Spring.Expressions.SpringAST tmp102_AST = null; + tmp102_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp102_AST); match(ID); } else { - goto _loop84_breakloop; + goto _loop87_breakloop; } } -_loop84_breakloop: ; +_loop87_breakloop: ; } // ( ... )* } if (0==inputState.guessing) @@ -2904,7 +2958,7 @@ _loop84_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_18_); + recover(ex,tokenSet_19_); } else { @@ -2987,12 +3041,12 @@ _loop84_breakloop: ; Spring.Expressions.SpringAST arrayRank_AST = null; try { // for error handling - Spring.Expressions.SpringAST tmp103_AST = null; - tmp103_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.makeASTRoot(ref currentAST, (AST)tmp103_AST); + Spring.Expressions.SpringAST tmp104_AST = null; + tmp104_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.makeASTRoot(ref currentAST, (AST)tmp104_AST); match(LBRACKET); { - if ((tokenSet_8_.member(LA(1)))) + if ((tokenSet_9_.member(LA(1)))) { expression(); if (0 == inputState.guessing) @@ -3013,11 +3067,11 @@ _loop84_breakloop: ; } else { - goto _loop93_breakloop; + goto _loop96_breakloop; } } -_loop93_breakloop: ; +_loop96_breakloop: ; } // ( ... )* } else if ((LA(1)==RBRACKET)) { @@ -3036,7 +3090,7 @@ _loop93_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_19_); + recover(ex,tokenSet_20_); } else { @@ -3083,7 +3137,7 @@ _loop93_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_20_); + recover(ex,tokenSet_21_); } else { @@ -3101,11 +3155,11 @@ _loop93_breakloop: ; Spring.Expressions.SpringAST namedArgument_AST = null; try { // for error handling - bool synPredMatched108 = false; + bool synPredMatched111 = false; if (((LA(1)==ID) && (LA(2)==ASSIGN))) { - int _m108 = mark(); - synPredMatched108 = true; + int _m111 = mark(); + synPredMatched111 = true; inputState.guessing++; try { { @@ -3115,16 +3169,16 @@ _loop93_breakloop: ; } catch (RecognitionException) { - synPredMatched108 = false; + synPredMatched111 = false; } - rewind(_m108); + rewind(_m111); inputState.guessing--; } - if ( synPredMatched108 ) + if ( synPredMatched111 ) { - Spring.Expressions.NamedArgumentNode tmp107_AST = null; - tmp107_AST = (Spring.Expressions.NamedArgumentNode) astFactory.create(LT(1), "Spring.Expressions.NamedArgumentNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp107_AST); + Spring.Expressions.NamedArgumentNode tmp108_AST = null; + tmp108_AST = (Spring.Expressions.NamedArgumentNode) astFactory.create(LT(1), "Spring.Expressions.NamedArgumentNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp108_AST); match(ID); match(ASSIGN); expression(); @@ -3134,7 +3188,7 @@ _loop93_breakloop: ; } namedArgument_AST = (Spring.Expressions.SpringAST)currentAST.root; } - else if ((tokenSet_8_.member(LA(1))) && (tokenSet_21_.member(LA(2)))) { + else if ((tokenSet_9_.member(LA(1))) && (tokenSet_22_.member(LA(2)))) { argument(); if (0 == inputState.guessing) { @@ -3153,7 +3207,7 @@ _loop93_breakloop: ; if (0 == inputState.guessing) { reportError(ex); - recover(ex,tokenSet_22_); + recover(ex,tokenSet_23_); } else { @@ -3173,16 +3227,16 @@ _loop93_breakloop: ; try { // for error handling if ((LA(1)==TRUE)) { - Spring.Expressions.BooleanLiteralNode tmp109_AST = null; - tmp109_AST = (Spring.Expressions.BooleanLiteralNode) astFactory.create(LT(1), "Spring.Expressions.BooleanLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp109_AST); + Spring.Expressions.BooleanLiteralNode tmp110_AST = null; + tmp110_AST = (Spring.Expressions.BooleanLiteralNode) astFactory.create(LT(1), "Spring.Expressions.BooleanLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp110_AST); match(TRUE); boolLiteral_AST = (Spring.Expressions.SpringAST)currentAST.root; } else if ((LA(1)==FALSE)) { - Spring.Expressions.BooleanLiteralNode tmp110_AST = null; - tmp110_AST = (Spring.Expressions.BooleanLiteralNode) astFactory.create(LT(1), "Spring.Expressions.BooleanLiteralNode"); - astFactory.addASTChild(ref currentAST, (AST)tmp110_AST); + Spring.Expressions.BooleanLiteralNode tmp111_AST = null; + tmp111_AST = (Spring.Expressions.BooleanLiteralNode) astFactory.create(LT(1), "Spring.Expressions.BooleanLiteralNode"); + astFactory.addASTChild(ref currentAST, (AST)tmp111_AST); match(FALSE); boolLiteral_AST = (Spring.Expressions.SpringAST)currentAST.root; } @@ -3215,22 +3269,22 @@ _loop93_breakloop: ; Spring.Expressions.SpringAST dateLiteral_AST = null; try { // for error handling - Spring.Expressions.DateLiteralNode tmp111_AST = null; - tmp111_AST = (Spring.Expressions.DateLiteralNode) astFactory.create(LT(1), "Spring.Expressions.DateLiteralNode"); - astFactory.makeASTRoot(ref currentAST, (AST)tmp111_AST); + Spring.Expressions.DateLiteralNode tmp112_AST = null; + tmp112_AST = (Spring.Expressions.DateLiteralNode) astFactory.create(LT(1), "Spring.Expressions.DateLiteralNode"); + astFactory.makeASTRoot(ref currentAST, (AST)tmp112_AST); match(LITERAL_date); match(LPAREN); - Spring.Expressions.SpringAST tmp113_AST = null; - tmp113_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp113_AST); + Spring.Expressions.SpringAST tmp114_AST = null; + tmp114_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp114_AST); match(STRING_LITERAL); { if ((LA(1)==COMMA)) { match(COMMA); - Spring.Expressions.SpringAST tmp115_AST = null; - tmp115_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); - astFactory.addASTChild(ref currentAST, (AST)tmp115_AST); + Spring.Expressions.SpringAST tmp116_AST = null; + tmp116_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1)); + astFactory.addASTChild(ref currentAST, (AST)tmp116_AST); match(STRING_LITERAL); } else if ((LA(1)==RPAREN)) { @@ -3274,7 +3328,7 @@ _loop93_breakloop: ; } static public void initializeASTFactory( ASTFactory factory ) { - factory.setMaxNodeType(71); + factory.setMaxNodeType(72); } public static readonly string[] tokenNames_ = new string[] { @@ -3288,6 +3342,7 @@ _loop93_breakloop: ; @"""true""", @"""and""", @"""or""", + @"""xor""", @"""in""", @"""is""", @"""between""", @@ -3360,136 +3415,142 @@ _loop93_breakloop: ; public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_()); private static long[] mk_tokenSet_1_() { - long[] data = { 704379224066L, 0L}; + long[] data = { 1408758448130L, 0L}; return data; } public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_()); private static long[] mk_tokenSet_2_() { - long[] data = { 1134915856556326658L, 0L}; + long[] data = { 2269831713112653570L, 0L}; return data; } public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_()); private static long[] mk_tokenSet_3_() { - long[] data = { 704382894082L, 0L}; + long[] data = { 1408765788162L, 0L}; return data; } public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_()); private static long[] mk_tokenSet_4_() { - long[] data = { 704382894594L, 0L}; + long[] data = { 1408765788674L, 0L}; return data; } public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_()); private static long[] mk_tokenSet_5_() { - long[] data = { 1134907106097396736L, 0L}; + long[] data = { 1408765789698L, 0L}; return data; } public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_()); private static long[] mk_tokenSet_6_() { - long[] data = { 704382894850L, 0L}; + long[] data = { 2269814212194793472L, 0L}; return data; } public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_()); private static long[] mk_tokenSet_7_() { - long[] data = { 1134907810480291586L, 0L}; + long[] data = { 1408765789954L, 0L}; return data; } public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_()); private static long[] mk_tokenSet_8_() { - long[] data = { 17855362875097280L, 0L}; + long[] data = { 2269815620960583426L, 0L}; return data; } public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_()); private static long[] mk_tokenSet_9_() { - long[] data = { 1134907810505457410L, 0L}; + long[] data = { 35710725750194368L, 0L}; return data; } public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_()); private static long[] mk_tokenSet_10_() { - long[] data = { 1134907810740338434L, 0L}; + long[] data = { 2269815621010915074L, 0L}; return data; } public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_()); private static long[] mk_tokenSet_11_() { - long[] data = { 17855362313060544L, 0L}; + long[] data = { 2269815621480677122L, 0L}; return data; } public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_()); private static long[] mk_tokenSet_12_() { - long[] data = { 1134907811008773890L, 0L}; + long[] data = { 35710724626120896L, 0L}; return data; } public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_()); private static long[] mk_tokenSet_13_() { - long[] data = { 8045547552768L, 0L}; + long[] data = { 2269815622017548034L, 0L}; return data; } public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_()); private static long[] mk_tokenSet_14_() { - long[] data = { 154619084800L, 0L}; + long[] data = { 16091095105536L, 0L}; return data; } public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_()); private static long[] mk_tokenSet_15_() { - long[] data = { 4456448L, 0L}; + long[] data = { 309238169600L, 0L}; return data; } public static readonly BitSet tokenSet_15_ = new BitSet(mk_tokenSet_15_()); private static long[] mk_tokenSet_16_() { - long[] data = { -17592190500880L, 255L, 0L, 0L}; + long[] data = { 8912896L, 0L}; return data; } public static readonly BitSet tokenSet_16_ = new BitSet(mk_tokenSet_16_()); private static long[] mk_tokenSet_17_() { - long[] data = { 206158495744L, 0L}; + long[] data = { -35184381001744L, 511L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_17_ = new BitSet(mk_tokenSet_17_()); private static long[] mk_tokenSet_18_() { - long[] data = { 140737488355328L, 0L}; + long[] data = { 412316991488L, 0L}; return data; } public static readonly BitSet tokenSet_18_ = new BitSet(mk_tokenSet_18_()); private static long[] mk_tokenSet_19_() { - long[] data = { 1135478806509747970L, 0L}; + long[] data = { 281474976710656L, 0L}; return data; } public static readonly BitSet tokenSet_19_ = new BitSet(mk_tokenSet_19_()); private static long[] mk_tokenSet_20_() { - long[] data = { 566935683072L, 0L}; + long[] data = { 2270957613019496194L, 0L}; return data; } public static readonly BitSet tokenSet_20_ = new BitSet(mk_tokenSet_20_()); private static long[] mk_tokenSet_21_() { - long[] data = { 1152903225221709760L, 0L}; + long[] data = { 1133871366144L, 0L}; return data; } public static readonly BitSet tokenSet_21_ = new BitSet(mk_tokenSet_21_()); private static long[] mk_tokenSet_22_() { - long[] data = { 17180131328L, 0L}; + long[] data = { 2305806450443419584L, 0L}; return data; } public static readonly BitSet tokenSet_22_ = new BitSet(mk_tokenSet_22_()); + private static long[] mk_tokenSet_23_() + { + long[] data = { 34360262656L, 0L}; + return data; + } + public static readonly BitSet tokenSet_23_ = new BitSet(mk_tokenSet_23_()); } } diff --git a/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.cs b/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.cs index 52ff890c..b4f2328a 100644 --- a/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.cs +++ b/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.cs @@ -12,68 +12,69 @@ namespace Spring.Expressions public const int TRUE = 7; public const int AND = 8; public const int OR = 9; - public const int IN = 10; - public const int IS = 11; - public const int BETWEEN = 12; - public const int LIKE = 13; - public const int MATCHES = 14; - public const int NULL_LITERAL = 15; - public const int LPAREN = 16; - public const int SEMI = 17; - public const int RPAREN = 18; - public const int ASSIGN = 19; - public const int DEFAULT = 20; - public const int QMARK = 21; - public const int COLON = 22; - public const int PLUS = 23; - public const int MINUS = 24; - public const int STAR = 25; - public const int DIV = 26; - public const int MOD = 27; - public const int POWER = 28; - public const int BANG = 29; - public const int DOT = 30; - public const int POUND = 31; - public const int ID = 32; - public const int DOLLAR = 33; - public const int COMMA = 34; - public const int AT = 35; - public const int LBRACKET = 36; - public const int RBRACKET = 37; - public const int PROJECT = 38; - public const int RCURLY = 39; - public const int SELECT = 40; - public const int SELECT_FIRST = 41; - public const int SELECT_LAST = 42; - public const int TYPE = 43; - public const int QUOTE = 44; - public const int STRING_LITERAL = 45; - public const int LAMBDA = 46; - public const int PIPE = 47; - public const int LITERAL_new = 48; - public const int LCURLY = 49; - public const int INTEGER_LITERAL = 50; - public const int HEXADECIMAL_INTEGER_LITERAL = 51; - public const int REAL_LITERAL = 52; - public const int LITERAL_date = 53; - public const int EQUAL = 54; - public const int NOT_EQUAL = 55; - public const int LESS_THAN = 56; - public const int LESS_THAN_OR_EQUAL = 57; - public const int GREATER_THAN = 58; - public const int GREATER_THAN_OR_EQUAL = 59; - public const int WS = 60; - public const int BACKTICK = 61; - public const int BACKSLASH = 62; - public const int DOT_ESCAPED = 63; - public const int APOS = 64; - public const int NUMERIC_LITERAL = 65; - public const int DECIMAL_DIGIT = 66; - public const int INTEGER_TYPE_SUFFIX = 67; - public const int HEX_DIGIT = 68; - public const int EXPONENT_PART = 69; - public const int SIGN = 70; - public const int REAL_TYPE_SUFFIX = 71; + public const int XOR = 10; + public const int IN = 11; + public const int IS = 12; + public const int BETWEEN = 13; + public const int LIKE = 14; + public const int MATCHES = 15; + public const int NULL_LITERAL = 16; + public const int LPAREN = 17; + public const int SEMI = 18; + public const int RPAREN = 19; + public const int ASSIGN = 20; + public const int DEFAULT = 21; + public const int QMARK = 22; + public const int COLON = 23; + public const int PLUS = 24; + public const int MINUS = 25; + public const int STAR = 26; + public const int DIV = 27; + public const int MOD = 28; + public const int POWER = 29; + public const int BANG = 30; + public const int DOT = 31; + public const int POUND = 32; + public const int ID = 33; + public const int DOLLAR = 34; + public const int COMMA = 35; + public const int AT = 36; + public const int LBRACKET = 37; + public const int RBRACKET = 38; + public const int PROJECT = 39; + public const int RCURLY = 40; + public const int SELECT = 41; + public const int SELECT_FIRST = 42; + public const int SELECT_LAST = 43; + public const int TYPE = 44; + public const int QUOTE = 45; + public const int STRING_LITERAL = 46; + public const int LAMBDA = 47; + public const int PIPE = 48; + public const int LITERAL_new = 49; + public const int LCURLY = 50; + public const int INTEGER_LITERAL = 51; + public const int HEXADECIMAL_INTEGER_LITERAL = 52; + public const int REAL_LITERAL = 53; + public const int LITERAL_date = 54; + public const int EQUAL = 55; + public const int NOT_EQUAL = 56; + public const int LESS_THAN = 57; + public const int LESS_THAN_OR_EQUAL = 58; + public const int GREATER_THAN = 59; + public const int GREATER_THAN_OR_EQUAL = 60; + public const int WS = 61; + public const int BACKTICK = 62; + public const int BACKSLASH = 63; + public const int DOT_ESCAPED = 64; + public const int APOS = 65; + public const int NUMERIC_LITERAL = 66; + public const int DECIMAL_DIGIT = 67; + public const int INTEGER_TYPE_SUFFIX = 68; + public const int HEX_DIGIT = 69; + public const int EXPONENT_PART = 70; + public const int SIGN = 71; + public const int REAL_TYPE_SUFFIX = 72; } } diff --git a/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.txt b/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.txt index 1c98f8cd..5af0bd5e 100644 --- a/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.txt +++ b/src/Spring/Spring.Core/Expressions/Parser/ExpressionParserTokenTypes.txt @@ -6,65 +6,66 @@ FALSE="false"=6 TRUE="true"=7 AND="and"=8 OR="or"=9 -IN="in"=10 -IS="is"=11 -BETWEEN="between"=12 -LIKE="like"=13 -MATCHES="matches"=14 -NULL_LITERAL="null"=15 -LPAREN=16 -SEMI=17 -RPAREN=18 -ASSIGN=19 -DEFAULT=20 -QMARK=21 -COLON=22 -PLUS=23 -MINUS=24 -STAR=25 -DIV=26 -MOD=27 -POWER=28 -BANG=29 -DOT=30 -POUND=31 -ID=32 -DOLLAR=33 -COMMA=34 -AT=35 -LBRACKET=36 -RBRACKET=37 -PROJECT=38 -RCURLY=39 -SELECT=40 -SELECT_FIRST=41 -SELECT_LAST=42 -TYPE=43 -QUOTE=44 -STRING_LITERAL=45 -LAMBDA=46 -PIPE=47 -LITERAL_new="new"=48 -LCURLY=49 -INTEGER_LITERAL=50 -HEXADECIMAL_INTEGER_LITERAL=51 -REAL_LITERAL=52 -LITERAL_date="date"=53 -EQUAL=54 -NOT_EQUAL=55 -LESS_THAN=56 -LESS_THAN_OR_EQUAL=57 -GREATER_THAN=58 -GREATER_THAN_OR_EQUAL=59 -WS=60 -BACKTICK=61 -BACKSLASH=62 -DOT_ESCAPED=63 -APOS=64 -NUMERIC_LITERAL=65 -DECIMAL_DIGIT=66 -INTEGER_TYPE_SUFFIX=67 -HEX_DIGIT=68 -EXPONENT_PART=69 -SIGN=70 -REAL_TYPE_SUFFIX=71 +XOR="xor"=10 +IN="in"=11 +IS="is"=12 +BETWEEN="between"=13 +LIKE="like"=14 +MATCHES="matches"=15 +NULL_LITERAL="null"=16 +LPAREN=17 +SEMI=18 +RPAREN=19 +ASSIGN=20 +DEFAULT=21 +QMARK=22 +COLON=23 +PLUS=24 +MINUS=25 +STAR=26 +DIV=27 +MOD=28 +POWER=29 +BANG=30 +DOT=31 +POUND=32 +ID=33 +DOLLAR=34 +COMMA=35 +AT=36 +LBRACKET=37 +RBRACKET=38 +PROJECT=39 +RCURLY=40 +SELECT=41 +SELECT_FIRST=42 +SELECT_LAST=43 +TYPE=44 +QUOTE=45 +STRING_LITERAL=46 +LAMBDA=47 +PIPE=48 +LITERAL_new="new"=49 +LCURLY=50 +INTEGER_LITERAL=51 +HEXADECIMAL_INTEGER_LITERAL=52 +REAL_LITERAL=53 +LITERAL_date="date"=54 +EQUAL=55 +NOT_EQUAL=56 +LESS_THAN=57 +LESS_THAN_OR_EQUAL=58 +GREATER_THAN=59 +GREATER_THAN_OR_EQUAL=60 +WS=61 +BACKTICK=62 +BACKSLASH=63 +DOT_ESCAPED=64 +APOS=65 +NUMERIC_LITERAL=66 +DECIMAL_DIGIT=67 +INTEGER_TYPE_SUFFIX=68 +HEX_DIGIT=69 +EXPONENT_PART=70 +SIGN=71 +REAL_TYPE_SUFFIX=72 diff --git a/src/Spring/Spring.Core/Expressions/StringLiteralNode.cs b/src/Spring/Spring.Core/Expressions/StringLiteralNode.cs index bae9e633..7c9faf3c 100644 --- a/src/Spring/Spring.Core/Expressions/StringLiteralNode.cs +++ b/src/Spring/Spring.Core/Expressions/StringLiteralNode.cs @@ -37,6 +37,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public StringLiteralNode(string text):base() + { + this.Text = text; + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Expressions/UnaryOperator.cs b/src/Spring/Spring.Core/Expressions/UnaryOperator.cs index 6040f429..62fdaaea 100644 --- a/src/Spring/Spring.Core/Expressions/UnaryOperator.cs +++ b/src/Spring/Spring.Core/Expressions/UnaryOperator.cs @@ -36,6 +36,14 @@ namespace Spring.Expressions { } + /// + /// Create a new instance + /// + public UnaryOperator(BaseNode operand) + { + this.addChild(operand); + } + /// /// Create a new instance from SerializationInfo /// diff --git a/src/Spring/Spring.Core/Spring.Core.2008.csproj b/src/Spring/Spring.Core/Spring.Core.2008.csproj index f74c5215..3b3c7ae5 100644 --- a/src/Spring/Spring.Core/Spring.Core.2008.csproj +++ b/src/Spring/Spring.Core/Spring.Core.2008.csproj @@ -1,7 +1,7 @@  Local - 9.0.21022 + 9.0.30729 2.0 {710961A3-0DF4-49E4-A26E-F5B9C044AC84} Debug @@ -362,6 +362,7 @@ + diff --git a/src/Spring/Spring.Core/Util/NumberUtils.cs b/src/Spring/Spring.Core/Util/NumberUtils.cs index 694615e0..c8116e40 100644 --- a/src/Spring/Spring.Core/Util/NumberUtils.cs +++ b/src/Spring/Spring.Core/Util/NumberUtils.cs @@ -175,6 +175,112 @@ namespace Spring.Util } } + /// + /// Returns the bitwise not (~) of the supplied . + /// + /// The number. + /// The value of ~. + /// + /// If the supplied is not a supported numeric type. + /// + public static object BitwiseNot(object number) + { + if (number is bool) return !((bool) number); + else if (number is Int32) return ~((Int32) number); + else if (number is Int16) return ~((Int16) number); + else if (number is Int64) return ~((Int64) number); + else if (number is UInt16) return ~((UInt16) number); + else if (number is UInt32) return ~((UInt32) number); + else if (number is UInt64) return ~((UInt64)number); + else if (number is Byte) return ~((Byte) number); + else if (number is SByte) return ~((SByte) number); + else + { + throw new ArgumentException(string.Format("'{0}' is not one of the supported integer types.", number)); + } + } + + /// + /// Bitwise ANDs (&) the specified integral values. + /// + /// The first number. + /// The second number. + /// + /// If one of the supplied arguments is not a supported integral types. + /// + public static object BitwiseAnd(object m, object n) + { + CoerceTypes(ref m, ref n); + + if (n is bool) return (bool)m & (bool)n; + else if (n is Int32) return (Int32)m & (Int32)n; + else if (n is Int16) return (Int16)m & (Int16)n; + else if (n is Int64) return (Int64)m & (Int64)n; + else if (n is UInt16) return (UInt16)m & (UInt16)n; + else if (n is UInt32) return (UInt32)m & (UInt32)n; + else if (n is UInt64) return (UInt64)m & (UInt64)n; + else if (n is Byte) return (Byte)m & (Byte)n; + else if (n is SByte) return (SByte)m & (SByte)n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported integral types.", m, n)); + } + } + + /// + /// Bitwise ORs (|) the specified integral values. + /// + /// The first number. + /// The second number. + /// + /// If one of the supplied arguments is not a supported integral types. + /// + public static object BitwiseOr(object m, object n) + { + CoerceTypes(ref m, ref n); + + if (n is bool) return (bool)m | (bool)n; + else if (n is Int32) return (Int32)m | (Int32)n; + else if (n is Int16) return (Int16)m | (Int16)n; + else if (n is Int64) return (Int64)m | (Int64)n; + else if (n is UInt16) return (UInt16)m | (UInt16)n; + else if (n is UInt32) return (UInt32)m | (UInt32)n; + else if (n is UInt64) return (UInt64)m | (UInt64)n; + else if (n is Byte) return (Byte)m | (Byte)n; + else if (n is SByte) return (SByte)m | (SByte)n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported integral types.", m, n)); + } + } + + /// + /// Bitwise XORs (^) the specified integral values. + /// + /// The first number. + /// The second number. + /// + /// If one of the supplied arguments is not a supported integral types. + /// + public static object BitwiseXor(object m, object n) + { + CoerceTypes(ref m, ref n); + + if (n is bool) return (bool)m ^ (bool)n; + else if (n is Int32) return (Int32)m ^ (Int32)n; + else if (n is Int16) return (Int16)m ^ (Int16)n; + else if (n is Int64) return (Int64)m ^ (Int64)n; + else if (n is UInt16) return (UInt16)m ^ (UInt16)n; + else if (n is UInt32) return (UInt32)m ^ (UInt32)n; + else if (n is UInt64) return (UInt64)m ^ (UInt64)n; + else if (n is Byte) return (Byte)m ^ (Byte)n; + else if (n is SByte) return (SByte)m ^ (SByte)n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported integral types.", m, n)); + } + } + /// /// Adds the specified numbers. /// @@ -194,9 +300,11 @@ namespace Spring.Util else if (n is SByte) return (SByte) m + (SByte) n; else if (n is Single) return (Single) m + (Single) n; else if (n is Double) return (Double) m + (Double) n; - else if (n is Decimal) return (Decimal) m + (Decimal) n; - - return null; + else if (n is Decimal) return (Decimal) m + (Decimal) n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported numeric types.", m, n)); + } } /// @@ -218,9 +326,11 @@ namespace Spring.Util else if (n is SByte) return (SByte) m - (SByte) n; else if (n is Single) return (Single) m - (Single) n; else if (n is Double) return (Double) m - (Double) n; - else if (n is Decimal) return (Decimal) m - (Decimal) n; - - return null; + else if (n is Decimal) return (Decimal) m - (Decimal) n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported numeric types.", m, n)); + } } /// @@ -242,10 +352,12 @@ namespace Spring.Util else if (n is SByte) return (SByte) m*(SByte) n; else if (n is Single) return (Single) m*(Single) n; else if (n is Double) return (Double) m*(Double) n; - else if (n is Decimal) return (Decimal) m*(Decimal) n; - - return null; - } + else if (n is Decimal) return (Decimal) m*(Decimal) n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported numeric types.", m, n)); + } + } /// /// Divides the specified numbers. @@ -266,10 +378,12 @@ namespace Spring.Util else if (n is SByte) return (SByte) m/(SByte) n; else if (n is Single) return (Single) m/(Single) n; else if (n is Double) return (Double) m/(Double) n; - else if (n is Decimal) return (Decimal) m/(Decimal) n; - - return null; - } + else if (n is Decimal) return (Decimal) m/(Decimal) n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported numeric types.", m, n)); + } + } /// /// Calculates remainder for the specified numbers. @@ -290,10 +404,12 @@ namespace Spring.Util else if (n is SByte) return (SByte) m%(SByte) n; else if (n is Single) return (Single) m%(Single) n; else if (n is Double) return (Double) m%(Double) n; - else if (n is Decimal) return (Decimal) m%(Decimal) n; - - return null; - } + else if (n is Decimal) return (Decimal) m%(Decimal) n; + else + { + throw new ArgumentException(string.Format("'{0}' and/or '{1}' are not one of the supported numeric types.", m, n)); + } + } /// /// Raises first number to the power of the second one. diff --git a/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs b/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs index 41094963..eb69650f 100644 --- a/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs +++ b/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs @@ -64,11 +64,9 @@ namespace Spring.Expressions [Test] public void CanCreatePublicInstance() { - ConstructorNode ctorNode = new ConstructorNode(); - ctorNode.Text=typeof(PublicTestClass).FullName; - StringLiteralNode sNode = new StringLiteralNode(); - sNode.Text = "theValue"; - ctorNode.addChild(sNode); + ConstructorNode ctorNode = new ConstructorNode(typeof(PublicTestClass)); + StringLiteralNode sNode = new StringLiteralNode("theValue"); + ctorNode.AddArgument(sNode); PublicTestClass instance = (PublicTestClass) ((IExpression)ctorNode).GetValue(); Assert.AreEqual( sNode.Text, instance._s ); diff --git a/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs b/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs index ea060900..c6a4cbe7 100644 --- a/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs +++ b/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs @@ -272,11 +272,18 @@ namespace Spring.Expressions #endregion Serialization Tests + [Test] + public void TestBitwiseXOR() + { + object value = ExpressionEvaluator.GetValue(null, "'123' + 1"); + Assert.AreEqual("1231", value); + } + [Test] public void TestMixedAddition() { object value = ExpressionEvaluator.GetValue(null, "'123' + 1"); - Console.WriteLine(value); + Assert.AreEqual("1231", value); } [Test(Description="SPRNET-944")] @@ -942,6 +949,16 @@ namespace Spring.Expressions Assert.IsTrue((bool)ExpressionEvaluator.GetValue(ieee, expression)); } + /// + /// Tests bitwise OR operator + /// + [Test] + public void TestBitwiseOrOperator() + { + Assert.AreEqual( 1 | 2, ExpressionEvaluator.GetValue(null, "1 or 2")); + Assert.AreEqual( 1 | -2, ExpressionEvaluator.GetValue(null, "1 or -2")); + } + /// /// Tests logical AND operator /// @@ -956,6 +973,16 @@ namespace Spring.Expressions Assert.IsTrue((bool)ExpressionEvaluator.GetValue(ieee, expression)); } + /// + /// Tests bitwise OR operator + /// + [Test] + public void TestBitwiseAndOperator() + { + Assert.AreEqual(1 & 3, ExpressionEvaluator.GetValue(null, "1 and 3")); + Assert.AreEqual(1 & -1, ExpressionEvaluator.GetValue(null, "1 and -1")); + } + /// /// Tests logical NOT operator /// @@ -968,6 +995,18 @@ namespace Spring.Expressions Assert.IsFalse((bool)ExpressionEvaluator.GetValue(ieee, expression)); } + /// + /// Tests bitwise OR operator + /// + [Test] + public void TestXorOperator() + { + Assert.AreEqual(1 ^ 3, ExpressionEvaluator.GetValue(null, "1 xor 3")); + Assert.AreEqual(1 ^ -1, ExpressionEvaluator.GetValue(null, "1 xor -1")); + Assert.AreEqual(true ^ false, ExpressionEvaluator.GetValue(null, "true xor false")); + Assert.AreEqual(true ^ true, ExpressionEvaluator.GetValue(null, "true xor true")); + } + /// /// Tests logical operator presedance /// diff --git a/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs b/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs new file mode 100644 index 00000000..6043dd60 --- /dev/null +++ b/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs @@ -0,0 +1,51 @@ +#region License + +/* + * Copyright 2002-2009 the original author or authors. + * + * Licensed 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. + */ + +#endregion + +using System; +using NUnit.Framework; + +namespace Spring.Expressions +{ + /// + /// + /// Erich Eichinger + [TestFixture] + public class OpADDTests + { + [Test] + public void CanAddStrings() + { + OpADD add = new OpADD(); + add.addChild( new StringLiteralNode("20")); + add.addChild( new StringLiteralNode("30")); + object result = add.GetValue(null, null); + Assert.AreEqual("2030", result); + } + [Test] + public void CanAddNumbers() + { + OpADD add = new OpADD(); + add.addChild( new IntLiteralNode("20")); + add.addChild( new IntLiteralNode("30")); + object result = add.GetValue(null, null); + Assert.AreEqual(50, result); + } + } +} \ No newline at end of file diff --git a/test/Spring/Spring.Core.Tests/Expressions/OpANDTests.cs b/test/Spring/Spring.Core.Tests/Expressions/OpANDTests.cs new file mode 100644 index 00000000..53e5550a --- /dev/null +++ b/test/Spring/Spring.Core.Tests/Expressions/OpANDTests.cs @@ -0,0 +1,38 @@ +#region License + +/* + * Copyright 2002-2009 the original author or authors. + * + * Licensed 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. + */ + +#endregion + +using NUnit.Framework; + +namespace Spring.Expressions +{ + /// + /// + /// Erich Eichinger + [TestFixture] + public class OpANDTests + { + [Test] + public void AndsNumbers() + { + OpAND band = new OpAND(new IntLiteralNode("2"), new IntLiteralNode("3")); + Assert.AreEqual( 2 & 3, band.GetValue(null,null) ); + } + } +} \ No newline at end of file diff --git a/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs b/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs new file mode 100644 index 00000000..7b2aaae3 --- /dev/null +++ b/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs @@ -0,0 +1,46 @@ +#region License + +/* + * Copyright 2002-2009 the original author or authors. + * + * Licensed 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. + */ + +#endregion + +using System; +using NUnit.Framework; + +namespace Spring.Expressions +{ + /// + /// + /// Erich Eichinger + [TestFixture] + public class OpORTests + { + [Test] + public void OrsNumbers() + { + OpOR bor = new OpOR(new IntLiteralNode("2"), new IntLiteralNode("3")); + Assert.AreEqual(2 | 3, bor.GetValue(null, null)); + } + + [Test] + public void OrsBooleans() + { + OpOR bor = new OpOR(new BooleanLiteralNode("false"), new BooleanLiteralNode("true")); + Assert.AreEqual(false || true , bor.GetValue(null, null)); + } + } +} \ No newline at end of file diff --git a/test/Spring/Spring.Core.Tests/Expressions/OpXORTests.cs b/test/Spring/Spring.Core.Tests/Expressions/OpXORTests.cs new file mode 100644 index 00000000..f4eb948e --- /dev/null +++ b/test/Spring/Spring.Core.Tests/Expressions/OpXORTests.cs @@ -0,0 +1,40 @@ +#region License + +/* + * Copyright 2002-2009 the original author or authors. + * + * Licensed 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. + */ + +#endregion + +using NUnit.Framework; + +namespace Spring.Expressions +{ + /// + /// + /// Erich Eichinger + [TestFixture] + public class OpXORTests + { + [Test] + public void XorsNumbers() + { + OpXOR bxor = new OpXOR(new IntLiteralNode("2"), new IntLiteralNode("3")); + Assert.AreEqual(2 ^ 3, bxor.GetValue(null, null)); + bxor = new OpXOR(new BooleanLiteralNode("true"), new BooleanLiteralNode("false")); + Assert.AreEqual(true ^ false, bxor.GetValue(null, null)); + } + } +} \ No newline at end of file diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj index f5c39f7f..0e367bc8 100644 --- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj +++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj @@ -1,7 +1,7 @@  Local - 9.0.21022 + 9.0.30729 2.0 {44B16BAA-6DF8-447C-9D7F-3AD3D854D904} Debug @@ -285,6 +285,10 @@ + + + + diff --git a/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs index 2fd967ba..81d3d8ac 100644 --- a/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs +++ b/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs @@ -98,5 +98,119 @@ namespace Spring.Util { Assert.AreEqual(-10, NumberUtils.Negate(10)); } + + [Test] + public void CoercesTypes() + { + object x = (int)1; + object y = (double)2; + NumberUtils.CoerceTypes(ref x, ref y); + Assert.AreEqual(typeof(double), x.GetType()); + } + + [Test] + public void Add() + { + Assert.AreEqual(5, NumberUtils.Add(2, 3)); + try + { + NumberUtils.Add(2, "3"); + Assert.Fail(); + } + catch(ArgumentException) + {} + } + + [Test] + public void BitwiseNot() + { + Assert.AreEqual( ~((Byte)2), NumberUtils.BitwiseNot((Byte)2) ); + Assert.AreEqual(~((SByte)2), NumberUtils.BitwiseNot((SByte)2)); + Assert.AreEqual(~((Int16)2), NumberUtils.BitwiseNot((Int16)2)); + Assert.AreEqual(~((UInt16)2), NumberUtils.BitwiseNot((UInt16)2)); + Assert.AreEqual(~((Int32)2), NumberUtils.BitwiseNot((Int32)2)); + Assert.AreEqual(~((UInt32)2), NumberUtils.BitwiseNot((UInt32)2)); + Assert.AreEqual(~((Int64)2), NumberUtils.BitwiseNot((Int64)2)); + Assert.AreEqual(~((UInt64)2), NumberUtils.BitwiseNot((UInt64)2)); + Assert.AreEqual( false, NumberUtils.BitwiseNot(true) ); + try + { + NumberUtils.BitwiseNot((double)2.0); + Assert.Fail(); + } + catch(ArgumentException) + {} + } + + [Test] + public void BitwiseAnd() + { + Assert.AreEqual( ((Byte)2)&((Byte)3), NumberUtils.BitwiseAnd((Byte)2, (Byte)3)); + Assert.AreEqual(((SByte)2) & ((SByte)3), NumberUtils.BitwiseAnd((SByte)2, (SByte)3)); + Assert.AreEqual(((Int16)2) & ((Int16)3), NumberUtils.BitwiseAnd((Int16)2, (Int16)3)); + Assert.AreEqual(((UInt16)2) & ((UInt16)3), NumberUtils.BitwiseAnd((UInt16)2, (UInt16)3)); + Assert.AreEqual(((Int32)2) & ((Int32)3), NumberUtils.BitwiseAnd((Int32)2, (Int32)3)); + Assert.AreEqual(((UInt32)2) & ((UInt32)3), NumberUtils.BitwiseAnd((UInt32)2, (UInt32)3)); + Assert.AreEqual(((Int64)2) & ((Int64)3), NumberUtils.BitwiseAnd((Int64)2, (Int64)3)); + Assert.AreEqual(((UInt64)2) & ((UInt64)3), NumberUtils.BitwiseAnd((UInt64)2, (UInt64)3)); + Assert.AreEqual(((UInt64)2) & ((Byte)3), NumberUtils.BitwiseAnd((UInt64)2, (Byte)3)); + Assert.AreEqual(true, NumberUtils.BitwiseAnd(true, true)); + Assert.AreEqual( false, NumberUtils.BitwiseAnd(false, true) ); + try + { + NumberUtils.BitwiseAnd((double)2.0, 3); + Assert.Fail(); + } + catch(ArgumentException) + {} + } + + [Test] + public void BitwiseOr() + { + Assert.AreEqual( ((Byte)2) | ((Byte)3), NumberUtils.BitwiseOr((Byte)2, (Byte)3)); + Assert.AreEqual(((SByte)2) | ((SByte)3), NumberUtils.BitwiseOr((SByte)2, (SByte)3)); + Assert.AreEqual(((Int16)2) | ((Int16)3), NumberUtils.BitwiseOr((Int16)2, (Int16)3)); + Assert.AreEqual(((UInt16)2) | ((UInt16)3), NumberUtils.BitwiseOr((UInt16)2, (UInt16)3)); + Assert.AreEqual(((Int32)2) | ((Int32)3), NumberUtils.BitwiseOr((Int32)2, (Int32)3)); + Assert.AreEqual(((UInt32)2) | ((UInt32)3), NumberUtils.BitwiseOr((UInt32)2, (UInt32)3)); + Assert.AreEqual(((Int64)2) | ((Int64)3), NumberUtils.BitwiseOr((Int64)2, (Int64)3)); + Assert.AreEqual(((UInt64)2) | ((UInt64)3), NumberUtils.BitwiseOr((UInt64)2, (UInt64)3)); + Assert.AreEqual(((UInt64)2) | ((Byte)3), NumberUtils.BitwiseOr((UInt64)2, (Byte)3)); + Assert.AreEqual(false, NumberUtils.BitwiseOr(false, false)); + Assert.AreEqual(true, NumberUtils.BitwiseOr(false, true)); + try + { + NumberUtils.BitwiseAnd((double)2.0, 3); + Assert.Fail(); + } + catch(ArgumentException) + {} + } + + [Test] + public void BitwiseXor() + { + Assert.AreEqual( ((Byte)2) ^ ((Byte)3), NumberUtils.BitwiseXor((Byte)2, (Byte)3)); + Assert.AreEqual(((SByte)2) ^ ((SByte)3), NumberUtils.BitwiseXor((SByte)2, (SByte)3)); + Assert.AreEqual(((Int16)2) ^ ((Int16)3), NumberUtils.BitwiseXor((Int16)2, (Int16)3)); + Assert.AreEqual(((UInt16)2) ^ ((UInt16)3), NumberUtils.BitwiseXor((UInt16)2, (UInt16)3)); + Assert.AreEqual(((Int32)2) ^ ((Int32)3), NumberUtils.BitwiseXor((Int32)2, (Int32)3)); + Assert.AreEqual(((UInt32)2) ^ ((UInt32)3), NumberUtils.BitwiseXor((UInt32)2, (UInt32)3)); + Assert.AreEqual(((Int64)2) ^ ((Int64)3), NumberUtils.BitwiseXor((Int64)2, (Int64)3)); + Assert.AreEqual(((UInt64)2) ^ ((UInt64)3), NumberUtils.BitwiseXor((UInt64)2, (UInt64)3)); + Assert.AreEqual(((UInt64)2) ^ ((Byte)3), NumberUtils.BitwiseXor((UInt64)2, (Byte)3)); + Assert.AreEqual(false, NumberUtils.BitwiseXor(false, false)); + Assert.AreEqual(false, NumberUtils.BitwiseXor(true, true)); + Assert.AreEqual(true, NumberUtils.BitwiseXor(false, true)); + Assert.AreEqual(true, NumberUtils.BitwiseXor(true, false)); + try + { + NumberUtils.BitwiseAnd((double)2.0, 3); + Assert.Fail(); + } + catch(ArgumentException) + {} + } } } \ No newline at end of file