SPRNET-444

SPRNET-1140
This commit is contained in:
eeichinger
2008-12-20 01:21:02 +00:00
parent 75e2f997bd
commit 044e8af105
17 changed files with 1885 additions and 1355 deletions

View File

@@ -19,6 +19,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Services.2008", "..\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Services.Tests.2008", "..\..\test\Spring\Spring.Services.Tests\Spring.Services.Tests.2008.csproj", "{4374F018-9738-46BF-A399-4594CEE75B21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.2008", "..\..\src\Spring\Spring.Data\Spring.Data.2008.csproj", "{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.Tests.2008", "..\..\test\Spring\Spring.Data.Tests\Spring.Data.Tests.2008.csproj", "{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
@@ -119,6 +123,26 @@ Global
{4374F018-9738-46BF-A399-4594CEE75B21}.Release|Any CPU.Build.0 = Release|Any CPU
{4374F018-9738-46BF-A399-4594CEE75B21}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{4374F018-9738-46BF-A399-4594CEE75B21}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Debug|.NET.ActiveCfg = Debug|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|.NET.ActiveCfg = Release|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Any CPU.Build.0 = Release|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|.NET.ActiveCfg = Debug|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|.NET.ActiveCfg = Release|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Any CPU.Build.0 = Release|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -1,5 +1,5 @@
#region License
#region License
/*
* Copyright <20> 2002-2005 the original author or authors.
*
@@ -14,210 +14,353 @@
* 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
#if NET_2_0
#region Imports
using System.Collections;
using Spring.Util;
#endregion
namespace Spring.Core.TypeResolution
{
/// <summary>
/// Holder for the generic arguments when using type parameters.
/// </summary>
/// <remarks>
/// <p>
/// Type parameters can be applied to classes, interfaces,
/// structures, methods, delegates, etc...
/// </p>
/// </remarks>
public class GenericArgumentsHolder
{
#region Constants
/// <summary>
/// The generic arguments prefix.
/// </summary>
public const char GenericArgumentsPrefix = '<';
/// <summary>
/// The generic arguments suffix.
/// </summary>
public const char GenericArgumentsSuffix = '>';
/// <summary>
/// The character that separates a list of generic arguments.
/// </summary>
public const char GenericArgumentsSeparator = ',';
#endregion
#region Fields
private string unresolvedGenericTypeName;
private string unresolvedGenericMethodName;
private string[] unresolvedGenericArguments;
#endregion
#region Constructor (s) / Destructor
/// <summary>
/// Creates a new instance of the GenericArgumentsHolder class.
/// </summary>
/// <param name="value">
/// The string value to parse looking for a generic definition
/// and retrieving its generic arguments.
/// </param>
public GenericArgumentsHolder(string value)
{
ParseGenericArguments(value);
}
#endregion
#region Properties
/// <summary>
/// The (unresolved) generic type name portion
/// of the original value when parsing a generic type.
/// </summary>
public string GenericTypeName
{
get { return unresolvedGenericTypeName; }
}
/// <summary>
/// The (unresolved) generic method name portion
/// of the original value when parsing a generic method.
/// </summary>
public string GenericMethodName
{
get { return unresolvedGenericMethodName; }
}
/// <summary>
/// Is the string value contains generic arguments ?
/// </summary>
/// <remarks>
/// <p>
/// A generic argument can be a type parameter or a type argument.
/// </p>
/// </remarks>
public bool ContainsGenericArguments
{
get
{
return (unresolvedGenericArguments != null &&
unresolvedGenericArguments.Length > 0);
}
}
/// <summary>
/// Is generic arguments only contains type parameters ?
/// </summary>
public bool IsGenericDefinition
{
get
{
if (unresolvedGenericArguments == null)
return false;
foreach (string arg in unresolvedGenericArguments)
{
if (arg.Length > 0)
return false;
}
return true;
}
}
#endregion
#region Methods
/// <summary>
/// Returns an array of unresolved generic arguments types.
/// </summary>
/// <remarks>
/// <p>
/// A empty string represents a type parameter that
/// did not have been substituted by a specific type.
/// </p>
/// </remarks>
/// <returns>
/// An array of strings that represents the unresolved generic
/// arguments types or an empty array if not generic.
/// </returns>
public string[] GetGenericArguments()
{
if (unresolvedGenericArguments == null)
return StringUtils.EmptyStrings;
return unresolvedGenericArguments;
}
private void ParseGenericArguments(string originalString)
{
int argsStartIndex
= originalString.IndexOf(GenericArgumentsPrefix);
if (argsStartIndex < 0)
{
unresolvedGenericTypeName = originalString;
unresolvedGenericMethodName = originalString;
}
else
{
int argsEndIndex =
originalString.LastIndexOf(GenericArgumentsSuffix);
if (argsEndIndex != -1)
{
unresolvedGenericMethodName = originalString.Remove(
argsStartIndex, argsEndIndex - argsStartIndex + 1);
SplitGenericArguments(originalString.Substring(
argsStartIndex + 1, argsEndIndex - argsStartIndex - 1));
unresolvedGenericTypeName = originalString.Replace(
originalString.Substring(argsStartIndex, argsEndIndex - argsStartIndex + 1),
"`" + unresolvedGenericArguments.Length);
}
}
}
private void SplitGenericArguments(string originalArgs)
{
IList args = new ArrayList();
int index = 0;
int cursor = originalArgs.IndexOf(GenericArgumentsSeparator, index);
while (cursor != -1)
{
string arg = originalArgs.Substring(index, cursor - index);
if (arg.Split(GenericArgumentsPrefix).Length ==
arg.Split(GenericArgumentsSuffix).Length)
{
args.Add(arg.Trim());
index = cursor + 1;
}
cursor = originalArgs.IndexOf(GenericArgumentsSeparator, cursor + 1);
}
args.Add(originalArgs.Substring(index, originalArgs.Length - index).Trim());
unresolvedGenericArguments = new string[args.Count];
args.CopyTo(unresolvedGenericArguments, 0);
}
#endregion
}
}
#endif
*/
#endregion
#if NET_2_0
#region Imports
using System.Collections;
using System.Text.RegularExpressions;
using Spring.Util;
#endregion
namespace Spring.Core.TypeResolution
{
/// <summary>
/// Holder for the generic arguments when using type parameters.
/// </summary>
/// <remarks>
/// <p>
/// Type parameters can be applied to classes, interfaces,
/// structures, methods, delegates, etc...
/// </p>
/// </remarks>
public class GenericArgumentsHolder
{
#region Constants
private static readonly Regex ClrPattern = new Regex(
"^"
+ @"(?'name'\w[\w\d\.]+)"
+ @"`\d+\s*\["
+ @"(?'args'(?>[^\[\]]+|\[(?<DEPTH>)|\](?<-DEPTH>))*(?(DEPTH)(?!)))"
+ @"\]"
+ @"(?'remainder'.*)"
+ @"$"
, RegexOptions.CultureInvariant | RegexOptions.Compiled
);
private static readonly Regex CSharpPattern = new Regex(
"^"
+ @"(?'name'\w[\w\d\.]+)"
+ @"<"
+ @"(?'args'.*)"
+ @">"
+ @"(?'remainder'.*)"
+ @"$"
, RegexOptions.CultureInvariant | RegexOptions.Compiled
);
private static Regex GenericArgumentListPattern = new Regex(
@",("
+ @"(\[(?>[^\[\]]+|\[(?<DEPTH>)|\](?<-DEPTH>))*(?(DEPTH)(?!))\])" // capture anything between matching brackets
+ @"|"
+ @"([^,\[\]]*)" // alternatively capture any string that doesn't contain brackets and commas
+ @")+"
);
/// <summary>
/// The generic arguments prefix.
/// </summary>
public const char GenericArgumentsQuotePrefix = '[';
/// <summary>
/// The generic arguments suffix.
/// </summary>
public const char GenericArgumentsQuoteSuffix = ']';
/// <summary>
/// The generic arguments prefix.
/// </summary>
public const char GenericArgumentsPrefix = '<';
/// <summary>
/// The generic arguments suffix.
/// </summary>
public const char GenericArgumentsSuffix = '>';
/// <summary>
/// The character that separates a list of generic arguments.
/// </summary>
public const char GenericArgumentsSeparator = ',';
#endregion
#region Fields
private string unresolvedGenericTypeName;
private string unresolvedGenericMethodName;
private string[] unresolvedGenericArguments;
private string arrayDeclaration;
#endregion
#region Constructor (s) / Destructor
/// <summary>
/// Creates a new instance of the GenericArgumentsHolder class.
/// </summary>
/// <param name="value">
/// The string value to parse looking for a generic definition
/// and retrieving its generic arguments.
/// </param>
public GenericArgumentsHolder(string value)
{
ParseGenericTypeDeclaration(value);
}
#endregion
#region Properties
/// <summary>
/// The (unresolved) generic type name portion
/// of the original value when parsing a generic type.
/// </summary>
public string GenericTypeName
{
get { return unresolvedGenericTypeName; }
}
/// <summary>
/// The (unresolved) generic method name portion
/// of the original value when parsing a generic method.
/// </summary>
public string GenericMethodName
{
get { return unresolvedGenericMethodName; }
}
/// <summary>
/// Is the string value contains generic arguments ?
/// </summary>
/// <remarks>
/// <p>
/// A generic argument can be a type parameter or a type argument.
/// </p>
/// </remarks>
public bool ContainsGenericArguments
{
get
{
return (unresolvedGenericArguments != null &&
unresolvedGenericArguments.Length > 0);
}
}
/// <summary>
/// Is generic arguments only contains type parameters ?
/// </summary>
public bool IsGenericDefinition
{
get
{
if (unresolvedGenericArguments == null)
return false;
foreach (string arg in unresolvedGenericArguments)
{
if (arg.Length > 0)
return false;
}
return true;
}
}
/// <summary>
/// Returns the array declaration portion of the definition, e.g. "[,]"
/// </summary>
/// <returns></returns>
public string GetArrayDeclaration()
{
return arrayDeclaration;
}
/// <summary>
/// Is this an array type definition?
/// </summary>
public bool IsArrayDeclaration
{
get { return arrayDeclaration != null; }
}
#endregion
#region Methods
/// <summary>
/// Returns an array of unresolved generic arguments types.
/// </summary>
/// <remarks>
/// <p>
/// A empty string represents a type parameter that
/// did not have been substituted by a specific type.
/// </p>
/// </remarks>
/// <returns>
/// An array of strings that represents the unresolved generic
/// arguments types or an empty array if not generic.
/// </returns>
public string[] GetGenericArguments()
{
if (unresolvedGenericArguments == null)
return StringUtils.EmptyStrings;
return unresolvedGenericArguments;
}
private void ParseGenericTypeDeclaration(string originalString)
{
if (originalString.IndexOf('[') == -1 && originalString.IndexOf('<') == -1)
{
// nothing to do
unresolvedGenericTypeName = originalString;
unresolvedGenericMethodName = originalString;
return;
}
originalString = originalString.Trim();
bool isClrStyleNotation = originalString.IndexOf('`') > -1;
Match m = (isClrStyleNotation)
? ClrPattern.Match(originalString)
: CSharpPattern.Match(originalString);
if (m == null || !m.Success)
{
unresolvedGenericTypeName = originalString;
unresolvedGenericMethodName = originalString;
return;
}
Group g = m.Groups["args"];
unresolvedGenericArguments = ParseGenericArgumentList(g.Value);
string name = m.Groups["name"].Value;
string remainder = m.Groups["remainder"].Value.Trim();
// check, if we're dealing with an array type declaration
if (remainder.Length > 0 && remainder.IndexOf('[') > -1)
{
string[] remainderParts = StringUtils.Split(remainder, ",", false, false, "[]");
string arrayPart = remainderParts[0].Trim();
if (arrayPart[0] == '[' && arrayPart[arrayPart.Length-1] == ']')
{
arrayDeclaration = arrayPart;
remainder = ", " + string.Join(",", remainderParts, 1, remainderParts.Length - 1);
}
}
unresolvedGenericMethodName = name + remainder;
unresolvedGenericTypeName = name + "`" + unresolvedGenericArguments.Length + remainder;
// char lBoundary = isClrStyleNotation ? '[' : GenericArgumentsPrefix;
// char rBoundary = isClrStyleNotation ? ']' : GenericArgumentsSuffix;
//
// int argsStartIndex = originalString.IndexOf(lBoundary);
// if (argsStartIndex < 0)
// {
// unresolvedGenericTypeName = originalString;
// unresolvedGenericMethodName = originalString;
// }
// else
// {
// int argsEndIndex = originalString.LastIndexOf(rBoundary);
// if (argsEndIndex != -1)
// {
// unresolvedGenericMethodName = originalString.Remove(
// argsStartIndex, argsEndIndex - argsStartIndex + 1);
//
// unresolvedGenericArguments = ParseGenericArgumentList(originalString.Substring(
// argsStartIndex + 1, argsEndIndex - argsStartIndex - 1));
//
// unresolvedGenericTypeName = originalString.Replace(
// originalString.Substring(argsStartIndex, argsEndIndex - argsStartIndex + 1),
// "`" + unresolvedGenericArguments.Length);
// }
// }
}
private static string[] ParseGenericArgumentList(string originalArgs)
{
string[] args = StringUtils.Split(originalArgs, ",", true, false, "[]<>" );
// remove quotes if necessary
for(int i=0;i<args.Length;i++)
{
string arg = args[i];
if (arg.Length > 1 && arg[0] == '[')
{
args[i] = arg.Substring(1, arg.Length - 2);
}
}
return args;
// ArrayList args = new ArrayList();
// originalArgs = originalArgs.Trim();
// if (originalArgs.Length == 0)
// {
// return new string[0];
// }
//
// if (originalArgs.IndexOf(',') == -1)
// {
// return new string[] { originalArgs };
// }
//
// // pattern assumes "(,<argname>)+"
// originalArgs = "," + originalArgs;
//
// foreach (Match match in GenericArgumentListPattern.Matches(originalArgs))
// {
// string arg = match.Groups["args"].Value.Trim(' ', '\t', '[', ']');
// args.Add(arg);
// }
// Match m = GenericArgumentListPattern.Match(originalArgs);
// if (m != null && m.Success)
// {
// Group g = m.Groups[0];
// foreach (Capture capture in g.Captures)
// {
// string arg = capture.Value.Trim(' ', '\t', '[', ']');
// args.Add(arg);
// }
// }
// int index = 0;
// int cursor = originalArgs.IndexOf(GenericArgumentsSeparator, index);
// while (cursor != -1)
// {
// string arg = originalArgs.Substring(index, cursor - index);
// if (arg.Split(GenericArgumentsPrefix).Length ==
// arg.Split(GenericArgumentsSuffix).Length)
// {
// args.Add(arg.Trim());
// index = cursor + 1;
// }
// cursor = originalArgs.IndexOf(GenericArgumentsSeparator, cursor + 1);
// }
// args.Add(originalArgs.Substring(index, originalArgs.Length - index).Trim());
// return (string[])args.ToArray(typeof(string));
}
#endregion
}
}
#endif

View File

@@ -75,6 +75,11 @@ namespace Spring.Core.TypeResolution
genericArgs[i] = TypeResolutionUtils.ResolveType(unresolvedGenericArgs[i]);
}
type = type.MakeGenericType(genericArgs);
}
if (genericInfo.IsArrayDeclaration)
{
typeName = string.Format("{0}{1},{2}", type.FullName, genericInfo.GetArrayDeclaration(), type.Assembly.FullName);
type = null;
}
}
}

View File

@@ -190,13 +190,17 @@ property
;
reference
: AT! LPAREN! (cn:contextName! COLON!)? id:qualifiedId! RPAREN!
: AT! LPAREN! (cn:contextName! COLON!)? id:qualifiedId! RPAREN!
{ #reference = #([EXPR, "ref", "Spring.Context.Support.ReferenceNode"], #cn, #id); }
;
;
contextName
: STRING_LITERAL
| qualifiedId (DIV qualifiedId)*
;
indexer
:
LBRACKET^ <AST = Spring.Expressions.IndexerNode> argument (COMMA! argument)* RBRACKET!
: LBRACKET^ <AST = Spring.Expressions.IndexerNode> argument (COMMA! argument)* RBRACKET!
;
projection
@@ -220,10 +224,14 @@ lastSelection
;
type
: TYPE! tn:qualifiedId! (LBRACKET RBRACKET)? (COMMA qualifiedId)? RPAREN!
{ #type = #([EXPR, tn_AST.getText(), "Spring.Expressions.TypeNode"], #type); }
: TYPE! tn:typename! RPAREN!
{ #type = #([EXPR, tn_AST.getText(), "Spring.Expressions.TypeNode"], #type); }
;
typename
: ID^ <AST = Spring.Expressions.QualifiedIdentifier> (~RPAREN)*
;
attribute
: AT! LBRACKET! tn:qualifiedId! (ctorArgs)? RBRACKET!
{ #attribute = #([EXPR, tn_AST.getText(), "Spring.Expressions.AttributeNode"], #attribute); }
@@ -278,9 +286,6 @@ namedArgument
qualifiedId : ID^ <AST = Spring.Expressions.QualifiedIdentifier> (DOT ID)*
;
contextName : ID^ <AST = Spring.Expressions.QualifiedIdentifier> (DIV ID)*
;
literal
: NULL_LITERAL <AST = Spring.Expressions.NullLiteralNode>
| INTEGER_LITERAL <AST = Spring.Expressions.IntLiteralNode>
@@ -339,6 +344,12 @@ WS : (' '
AT: '@'
;
BACKTICK: '`'
;
BACKSLASH: '\\'
;
PIPE: '|'
;
@@ -444,12 +455,15 @@ LAMBDA: "{|"
DOT_ESCAPED: "\\."
;
QUOTE: '\''
;
STRING_LITERAL
: '\''! (APOS|~'\'')* '\''!
: QUOTE! (APOS|~'\'')* QUOTE!
;
protected
APOS : '\''! '\''
protected
APOS : QUOTE! QUOTE
;
ID
@@ -495,6 +509,7 @@ protected
DECIMAL_DIGIT
: '0'..'9'
;
protected
INTEGER_TYPE_SUFFIX
:

View File

@@ -54,7 +54,8 @@ namespace Spring.Expressions
/// <returns>Value of the last node in the expression.</returns>
public static object GetValue(object root, string expression)
{
return Expression.Parse(expression).GetValue(root, null);
IExpression exp = Expression.Parse(expression);
return exp.GetValue(root, null);
}
/// <summary>
@@ -66,7 +67,8 @@ namespace Spring.Expressions
/// <returns>Value of the last node in the expression.</returns>
public static object GetValue(object root, string expression, IDictionary variables)
{
return Expression.Parse(expression).GetValue(root, variables);
IExpression exp = Expression.Parse(expression);
return exp.GetValue(root, variables);
}
/// <summary>
@@ -78,7 +80,8 @@ namespace Spring.Expressions
/// <param name="newValue">Value to set last node to.</param>
public static void SetValue(object root, string expression, object newValue)
{
Expression.Parse(expression).SetValue(root, null, newValue);
IExpression exp = Expression.Parse(expression);
exp.SetValue(root, null, newValue);
}
/// <summary>
@@ -91,7 +94,8 @@ namespace Spring.Expressions
/// <param name="newValue">Value to set last node to.</param>
public static void SetValue(object root, string expression, IDictionary variables, object newValue)
{
Expression.Parse(expression).SetValue(root, variables, newValue);
IExpression exp = Expression.Parse(expression);
exp.SetValue(root, variables, newValue);
}
}
}

View File

@@ -66,22 +66,22 @@ namespace Spring.Expressions
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 LAMBDA = 44;
public const int PIPE = 45;
public const int LITERAL_new = 46;
public const int LCURLY = 47;
public const int INTEGER_LITERAL = 48;
public const int HEXADECIMAL_INTEGER_LITERAL = 49;
public const int REAL_LITERAL = 50;
public const int STRING_LITERAL = 51;
public const int STRING_LITERAL = 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 LAMBDA = 45;
public const int PIPE = 46;
public const int LITERAL_new = 47;
public const int LCURLY = 48;
public const int INTEGER_LITERAL = 49;
public const int HEXADECIMAL_INTEGER_LITERAL = 50;
public const int REAL_LITERAL = 51;
public const int LITERAL_date = 52;
public const int EQUAL = 53;
public const int NOT_EQUAL = 54;
@@ -90,15 +90,18 @@ namespace Spring.Expressions
public const int GREATER_THAN = 57;
public const int GREATER_THAN_OR_EQUAL = 58;
public const int WS = 59;
public const int DOT_ESCAPED = 60;
public const int APOS = 61;
public const int NUMERIC_LITERAL = 62;
public const int DECIMAL_DIGIT = 63;
public const int INTEGER_TYPE_SUFFIX = 64;
public const int HEX_DIGIT = 65;
public const int EXPONENT_PART = 66;
public const int SIGN = 67;
public const int REAL_TYPE_SUFFIX = 68;
public const int BACKTICK = 60;
public const int BACKSLASH = 61;
public const int DOT_ESCAPED = 62;
public const int QUOTE = 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;
// CLOVER:OFF
@@ -132,7 +135,7 @@ namespace Spring.Expressions
literals.Add("or", 9);
literals.Add("is", 11);
literals.Add("like", 13);
literals.Add("new", 46);
literals.Add("new", 47);
literals.Add("date", 52);
literals.Add("false", 6);
}
@@ -164,6 +167,12 @@ tryAgain:
theRetToken = returnToken_;
break;
}
case '`':
{
mBACKTICK(true);
theRetToken = returnToken_;
break;
}
case '|':
{
mPIPE(true);
@@ -254,18 +263,6 @@ tryAgain:
theRetToken = returnToken_;
break;
}
case '\\':
{
mDOT_ESCAPED(true);
theRetToken = returnToken_;
break;
}
case '\'':
{
mSTRING_LITERAL(true);
theRetToken = returnToken_;
break;
}
default:
if ((cached_LA1=='?') && (cached_LA2=='?'))
{
@@ -312,10 +309,22 @@ tryAgain:
mLAMBDA(true);
theRetToken = returnToken_;
}
else if ((cached_LA1=='\\') && (cached_LA2=='.')) {
mDOT_ESCAPED(true);
theRetToken = returnToken_;
}
else if ((cached_LA1=='\'') && ((cached_LA2 >= '\u0000' && cached_LA2 <= '\ufffe'))) {
mSTRING_LITERAL(true);
theRetToken = returnToken_;
}
else if ((cached_LA1=='0') && (cached_LA2=='x')) {
mHEXADECIMAL_INTEGER_LITERAL(true);
theRetToken = returnToken_;
}
else if ((cached_LA1=='\\') && (true)) {
mBACKSLASH(true);
theRetToken = returnToken_;
}
else if ((cached_LA1=='!') && (true)) {
mBANG(true);
theRetToken = returnToken_;
@@ -348,6 +357,10 @@ tryAgain:
mGREATER_THAN(true);
theRetToken = returnToken_;
}
else if ((cached_LA1=='\'') && (true)) {
mQUOTE(true);
theRetToken = returnToken_;
}
else if ((tokenSet_0_.member(cached_LA1)) && (true)) {
mID(true);
theRetToken = returnToken_;
@@ -442,6 +455,34 @@ tryAgain:
returnToken_ = _token;
}
public void mBACKTICK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; IToken _token=null; int _begin=text.Length;
_ttype = BACKTICK;
match('`');
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mBACKSLASH(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; IToken _token=null; int _begin=text.Length;
_ttype = BACKSLASH;
match('\\');
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mPIPE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; IToken _token=null; int _begin=text.Length;
@@ -932,6 +973,20 @@ tryAgain:
returnToken_ = _token;
}
public void mQUOTE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; IToken _token=null; int _begin=text.Length;
_ttype = QUOTE;
match('\'');
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mSTRING_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; IToken _token=null; int _begin=text.Length;
@@ -939,7 +994,7 @@ tryAgain:
int _saveIndex = 0;
_saveIndex = text.Length;
match('\'');
mQUOTE(false);
text.Length = _saveIndex;
{ // ( ... )*
for (;;)
@@ -953,14 +1008,14 @@ tryAgain:
}
else
{
goto _loop156_breakloop;
goto _loop160_breakloop;
}
}
_loop156_breakloop: ;
_loop160_breakloop: ;
} // ( ... )*
_saveIndex = text.Length;
match('\'');
mQUOTE(false);
text.Length = _saveIndex;
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
@@ -977,9 +1032,9 @@ _loop156_breakloop: ;
int _saveIndex = 0;
_saveIndex = text.Length;
match('\'');
mQUOTE(false);
text.Length = _saveIndex;
match('\'');
mQUOTE(false);
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
@@ -1075,11 +1130,11 @@ _loop156_breakloop: ;
}
default:
{
goto _loop161_breakloop;
goto _loop165_breakloop;
}
}
}
_loop161_breakloop: ;
_loop165_breakloop: ;
} // ( ... )*
_ttype = testLiteralsTable(_ttype);
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
@@ -1095,11 +1150,11 @@ _loop161_breakloop: ;
int _ttype; IToken _token=null; int _begin=text.Length;
_ttype = NUMERIC_LITERAL;
bool synPredMatched164 = false;
bool synPredMatched168 = false;
if (((cached_LA1=='.') && ((cached_LA2 >= '0' && cached_LA2 <= '9'))))
{
int _m164 = mark();
synPredMatched164 = true;
int _m168 = mark();
synPredMatched168 = true;
inputState.guessing++;
try {
{
@@ -1109,16 +1164,16 @@ _loop161_breakloop: ;
}
catch (RecognitionException)
{
synPredMatched164 = false;
synPredMatched168 = false;
}
rewind(_m164);
rewind(_m168);
inputState.guessing--;
}
if ( synPredMatched164 )
if ( synPredMatched168 )
{
match('.');
{ // ( ... )+
int _cnt166=0;
int _cnt170=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1127,12 +1182,12 @@ _loop161_breakloop: ;
}
else
{
if (_cnt166 >= 1) { goto _loop166_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt170 >= 1) { goto _loop170_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt166++;
_cnt170++;
}
_loop166_breakloop: ;
_loop170_breakloop: ;
} // ( ... )+
{
if ((cached_LA1=='E'||cached_LA1=='e'))
@@ -1158,16 +1213,16 @@ _loop166_breakloop: ;
}
}
else {
bool synPredMatched172 = false;
bool synPredMatched176 = false;
if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_1_.member(cached_LA2))))
{
int _m172 = mark();
synPredMatched172 = true;
int _m176 = mark();
synPredMatched176 = true;
inputState.guessing++;
try {
{
{ // ( ... )+
int _cnt171=0;
int _cnt175=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1176,12 +1231,12 @@ _loop166_breakloop: ;
}
else
{
if (_cnt171 >= 1) { goto _loop171_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt175 >= 1) { goto _loop175_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt171++;
_cnt175++;
}
_loop171_breakloop: ;
_loop175_breakloop: ;
} // ( ... )+
match('.');
mDECIMAL_DIGIT(false);
@@ -1189,15 +1244,15 @@ _loop171_breakloop: ;
}
catch (RecognitionException)
{
synPredMatched172 = false;
synPredMatched176 = false;
}
rewind(_m172);
rewind(_m176);
inputState.guessing--;
}
if ( synPredMatched172 )
if ( synPredMatched176 )
{
{ // ( ... )+
int _cnt174=0;
int _cnt178=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1206,16 +1261,16 @@ _loop171_breakloop: ;
}
else
{
if (_cnt174 >= 1) { goto _loop174_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());; }
}
_cnt174++;
_cnt178++;
}
_loop174_breakloop: ;
_loop178_breakloop: ;
} // ( ... )+
match('.');
{ // ( ... )+
int _cnt176=0;
int _cnt180=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1224,12 +1279,12 @@ _loop174_breakloop: ;
}
else
{
if (_cnt176 >= 1) { goto _loop176_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt180 >= 1) { goto _loop180_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt176++;
_cnt180++;
}
_loop176_breakloop: ;
_loop180_breakloop: ;
} // ( ... )+
{
if ((cached_LA1=='E'||cached_LA1=='e'))
@@ -1255,16 +1310,16 @@ _loop176_breakloop: ;
}
}
else {
bool synPredMatched183 = false;
bool synPredMatched187 = false;
if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_4_.member(cached_LA2))))
{
int _m183 = mark();
synPredMatched183 = true;
int _m187 = mark();
synPredMatched187 = true;
inputState.guessing++;
try {
{
{ // ( ... )+
int _cnt181=0;
int _cnt185=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1273,12 +1328,12 @@ _loop176_breakloop: ;
}
else
{
if (_cnt181 >= 1) { goto _loop181_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt185 >= 1) { goto _loop185_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt181++;
_cnt185++;
}
_loop181_breakloop: ;
_loop185_breakloop: ;
} // ( ... )+
{
mEXPONENT_PART(false);
@@ -1287,15 +1342,15 @@ _loop181_breakloop: ;
}
catch (RecognitionException)
{
synPredMatched183 = false;
synPredMatched187 = false;
}
rewind(_m183);
rewind(_m187);
inputState.guessing--;
}
if ( synPredMatched183 )
if ( synPredMatched187 )
{
{ // ( ... )+
int _cnt185=0;
int _cnt189=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1304,12 +1359,12 @@ _loop181_breakloop: ;
}
else
{
if (_cnt185 >= 1) { goto _loop185_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt189 >= 1) { goto _loop189_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt185++;
_cnt189++;
}
_loop185_breakloop: ;
_loop189_breakloop: ;
} // ( ... )+
{
mEXPONENT_PART(false);
@@ -1329,16 +1384,16 @@ _loop185_breakloop: ;
}
}
else {
bool synPredMatched192 = false;
bool synPredMatched196 = false;
if ((((cached_LA1 >= '0' && cached_LA1 <= '9')) && (tokenSet_5_.member(cached_LA2))))
{
int _m192 = mark();
synPredMatched192 = true;
int _m196 = mark();
synPredMatched196 = true;
inputState.guessing++;
try {
{
{ // ( ... )+
int _cnt190=0;
int _cnt194=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1347,12 +1402,12 @@ _loop185_breakloop: ;
}
else
{
if (_cnt190 >= 1) { goto _loop190_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt194 >= 1) { goto _loop194_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt190++;
_cnt194++;
}
_loop190_breakloop: ;
_loop194_breakloop: ;
} // ( ... )+
{
mREAL_TYPE_SUFFIX(false);
@@ -1361,15 +1416,15 @@ _loop190_breakloop: ;
}
catch (RecognitionException)
{
synPredMatched192 = false;
synPredMatched196 = false;
}
rewind(_m192);
rewind(_m196);
inputState.guessing--;
}
if ( synPredMatched192 )
if ( synPredMatched196 )
{
{ // ( ... )+
int _cnt194=0;
int _cnt198=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1378,12 +1433,12 @@ _loop190_breakloop: ;
}
else
{
if (_cnt194 >= 1) { goto _loop194_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt198 >= 1) { goto _loop198_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt194++;
_cnt198++;
}
_loop194_breakloop: ;
_loop198_breakloop: ;
} // ( ... )+
{
mREAL_TYPE_SUFFIX(false);
@@ -1395,7 +1450,7 @@ _loop194_breakloop: ;
}
else if (((cached_LA1 >= '0' && cached_LA1 <= '9')) && (true)) {
{ // ( ... )+
int _cnt197=0;
int _cnt201=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
@@ -1404,12 +1459,12 @@ _loop194_breakloop: ;
}
else
{
if (_cnt197 >= 1) { goto _loop197_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt201 >= 1) { goto _loop201_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt197++;
_cnt201++;
}
_loop197_breakloop: ;
_loop201_breakloop: ;
} // ( ... )+
{
if ((tokenSet_6_.member(cached_LA1)))
@@ -1469,43 +1524,6 @@ _loop197_breakloop: ;
case 'e':
{
match("e");
{ // ( ... )*
for (;;)
{
if ((cached_LA1=='+'||cached_LA1=='-'))
{
mSIGN(false);
}
else
{
goto _loop209_breakloop;
}
}
_loop209_breakloop: ;
} // ( ... )*
{ // ( ... )+
int _cnt211=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
{
mDECIMAL_DIGIT(false);
}
else
{
if (_cnt211 >= 1) { goto _loop211_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt211++;
}
_loop211_breakloop: ;
} // ( ... )+
break;
}
case 'E':
{
match("E");
{ // ( ... )*
for (;;)
{
@@ -1540,6 +1558,43 @@ _loop215_breakloop: ;
} // ( ... )+
break;
}
case 'E':
{
match("E");
{ // ( ... )*
for (;;)
{
if ((cached_LA1=='+'||cached_LA1=='-'))
{
mSIGN(false);
}
else
{
goto _loop217_breakloop;
}
}
_loop217_breakloop: ;
} // ( ... )*
{ // ( ... )+
int _cnt219=0;
for (;;)
{
if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
{
mDECIMAL_DIGIT(false);
}
else
{
if (_cnt219 >= 1) { goto _loop219_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt219++;
}
_loop219_breakloop: ;
} // ( ... )+
break;
}
default:
{
throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
@@ -1667,7 +1722,7 @@ _loop215_breakloop: ;
match("0x");
{ // ( ... )+
int _cnt201=0;
int _cnt205=0;
for (;;)
{
if ((tokenSet_7_.member(cached_LA1)))
@@ -1676,12 +1731,12 @@ _loop215_breakloop: ;
}
else
{
if (_cnt201 >= 1) { goto _loop201_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
if (_cnt205 >= 1) { goto _loop205_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
}
_cnt201++;
_cnt205++;
}
_loop201_breakloop: ;
_loop205_breakloop: ;
} // ( ... )+
{
if ((tokenSet_6_.member(cached_LA1)))

View File

@@ -60,22 +60,22 @@ namespace Spring.Expressions
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 LAMBDA = 44;
public const int PIPE = 45;
public const int LITERAL_new = 46;
public const int LCURLY = 47;
public const int INTEGER_LITERAL = 48;
public const int HEXADECIMAL_INTEGER_LITERAL = 49;
public const int REAL_LITERAL = 50;
public const int STRING_LITERAL = 51;
public const int STRING_LITERAL = 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 LAMBDA = 45;
public const int PIPE = 46;
public const int LITERAL_new = 47;
public const int LCURLY = 48;
public const int INTEGER_LITERAL = 49;
public const int HEXADECIMAL_INTEGER_LITERAL = 50;
public const int REAL_LITERAL = 51;
public const int LITERAL_date = 52;
public const int EQUAL = 53;
public const int NOT_EQUAL = 54;
@@ -84,15 +84,18 @@ namespace Spring.Expressions
public const int GREATER_THAN = 57;
public const int GREATER_THAN_OR_EQUAL = 58;
public const int WS = 59;
public const int DOT_ESCAPED = 60;
public const int APOS = 61;
public const int NUMERIC_LITERAL = 62;
public const int DECIMAL_DIGIT = 63;
public const int INTEGER_TYPE_SUFFIX = 64;
public const int HEX_DIGIT = 65;
public const int EXPONENT_PART = 66;
public const int SIGN = 67;
public const int REAL_TYPE_SUFFIX = 68;
public const int BACKTICK = 60;
public const int BACKSLASH = 61;
public const int DOT_ESCAPED = 62;
public const int QUOTE = 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;
// CLOVER:OFF
@@ -1129,10 +1132,10 @@ _loop26_breakloop: ;
case FALSE:
case TRUE:
case NULL_LITERAL:
case STRING_LITERAL:
case INTEGER_LITERAL:
case HEXADECIMAL_INTEGER_LITERAL:
case REAL_LITERAL:
case STRING_LITERAL:
case LITERAL_date:
{
literal();
@@ -1623,7 +1626,7 @@ _loop40_breakloop: ;
match(AT);
match(LPAREN);
{
if ((LA(1)==ID) && (LA(2)==COLON||LA(2)==DIV))
if ((LA(1)==ID||LA(1)==STRING_LITERAL) && (LA(2)==COLON||LA(2)==DIV||LA(2)==DOT))
{
contextName();
if (0 == inputState.guessing)
@@ -1705,11 +1708,11 @@ _loop40_breakloop: ;
}
else
{
goto _loop63_breakloop;
goto _loop66_breakloop;
}
}
_loop63_breakloop: ;
_loop66_breakloop: ;
} // ( ... )*
match(RBRACKET);
indexer_AST = (Spring.Expressions.SpringAST)currentAST.root;
@@ -1836,52 +1839,11 @@ _loop63_breakloop: ;
try { // for error handling
match(TYPE);
qualifiedId();
typename();
if (0 == inputState.guessing)
{
tn_AST = (Spring.Expressions.SpringAST)returnAST;
}
{
if ((LA(1)==LBRACKET))
{
Spring.Expressions.SpringAST tmp51_AST = null;
tmp51_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp51_AST);
match(LBRACKET);
Spring.Expressions.SpringAST tmp52_AST = null;
tmp52_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp52_AST);
match(RBRACKET);
}
else if ((LA(1)==RPAREN||LA(1)==COMMA)) {
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
{
if ((LA(1)==COMMA))
{
Spring.Expressions.SpringAST tmp53_AST = null;
tmp53_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp53_AST);
match(COMMA);
qualifiedId();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, (AST)returnAST);
}
}
else if ((LA(1)==RPAREN)) {
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
match(RPAREN);
if (0==inputState.guessing)
{
@@ -1920,11 +1882,11 @@ _loop63_breakloop: ;
Spring.Expressions.SpringAST type_AST = null;
try { // for error handling
bool synPredMatched83 = false;
bool synPredMatched87 = false;
if (((LA(1)==LITERAL_new) && (LA(2)==ID)))
{
int _m83 = mark();
synPredMatched83 = true;
int _m87 = mark();
synPredMatched87 = true;
inputState.guessing++;
try {
{
@@ -1935,12 +1897,12 @@ _loop63_breakloop: ;
}
catch (RecognitionException)
{
synPredMatched83 = false;
synPredMatched87 = false;
}
rewind(_m83);
rewind(_m87);
inputState.guessing--;
}
if ( synPredMatched83 )
if ( synPredMatched87 )
{
match(LITERAL_new);
qualifiedId();
@@ -2003,9 +1965,9 @@ _loop63_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 tmp53_AST = null;
tmp53_AST = (Spring.Expressions.ProjectionNode) astFactory.create(LT(1), "Spring.Expressions.ProjectionNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp53_AST);
match(PROJECT);
expression();
if (0 == inputState.guessing)
@@ -2038,9 +2000,9 @@ _loop63_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 tmp55_AST = null;
tmp55_AST = (Spring.Expressions.SelectionNode) astFactory.create(LT(1), "Spring.Expressions.SelectionNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp55_AST);
match(SELECT);
expression();
if (0 == inputState.guessing)
@@ -2061,11 +2023,11 @@ _loop63_breakloop: ;
}
else
{
goto _loop67_breakloop;
goto _loop70_breakloop;
}
}
_loop67_breakloop: ;
_loop70_breakloop: ;
} // ( ... )*
match(RCURLY);
selection_AST = (Spring.Expressions.SpringAST)currentAST.root;
@@ -2093,9 +2055,9 @@ _loop67_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 tmp58_AST = null;
tmp58_AST = (Spring.Expressions.SelectionFirstNode) astFactory.create(LT(1), "Spring.Expressions.SelectionFirstNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp58_AST);
match(SELECT_FIRST);
expression();
if (0 == inputState.guessing)
@@ -2128,9 +2090,9 @@ _loop67_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 tmp60_AST = null;
tmp60_AST = (Spring.Expressions.SelectionLastNode) astFactory.create(LT(1), "Spring.Expressions.SelectionLastNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp60_AST);
match(SELECT_LAST);
expression();
if (0 == inputState.guessing)
@@ -2163,9 +2125,9 @@ _loop67_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 tmp62_AST = null;
tmp62_AST = (Spring.Expressions.ListInitializerNode) astFactory.create(LT(1), "Spring.Expressions.ListInitializerNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp62_AST);
match(LCURLY);
expression();
if (0 == inputState.guessing)
@@ -2186,11 +2148,11 @@ _loop67_breakloop: ;
}
else
{
goto _loop92_breakloop;
goto _loop96_breakloop;
}
}
_loop92_breakloop: ;
_loop96_breakloop: ;
} // ( ... )*
match(RCURLY);
listInitializer_AST = (Spring.Expressions.SpringAST)currentAST.root;
@@ -2219,9 +2181,9 @@ _loop92_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 tmp66_AST = null;
tmp66_AST = (Spring.Expressions.MapInitializerNode) astFactory.create(LT(1), "Spring.Expressions.MapInitializerNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp66_AST);
match(LCURLY);
mapEntry();
if (0 == inputState.guessing)
@@ -2242,11 +2204,11 @@ _loop92_breakloop: ;
}
else
{
goto _loop95_breakloop;
goto _loop99_breakloop;
}
}
_loop95_breakloop: ;
_loop99_breakloop: ;
} // ( ... )*
match(RCURLY);
mapInitializer_AST = (Spring.Expressions.SpringAST)currentAST.root;
@@ -2398,9 +2360,9 @@ _loop95_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 tmp76_AST = null;
tmp76_AST = (Spring.Expressions.FunctionNode) astFactory.create(LT(1), "Spring.Expressions.FunctionNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp76_AST);
match(ID);
methodArgs();
if (0 == inputState.guessing)
@@ -2433,9 +2395,9 @@ _loop95_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 tmp78_AST = null;
tmp78_AST = (Spring.Expressions.VariableNode) astFactory.create(LT(1), "Spring.Expressions.VariableNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp78_AST);
match(ID);
var_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
@@ -2527,9 +2489,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 tmp83_AST = null;
tmp83_AST = (Spring.Expressions.LocalFunctionNode) astFactory.create(LT(1), "Spring.Expressions.LocalFunctionNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp83_AST);
match(ID);
methodArgs();
if (0 == inputState.guessing)
@@ -2562,9 +2524,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 tmp85_AST = null;
tmp85_AST = (Spring.Expressions.LocalVariableNode) astFactory.create(LT(1), "Spring.Expressions.LocalVariableNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp85_AST);
match(ID);
localVar_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
@@ -2591,9 +2553,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 tmp86_AST = null;
tmp86_AST = (Spring.Expressions.PropertyOrFieldNode) astFactory.create(LT(1), "Spring.Expressions.PropertyOrFieldNode");
astFactory.addASTChild(ref currentAST, (AST)tmp86_AST);
match(ID);
property_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
@@ -2650,33 +2612,50 @@ _loop57_breakloop: ;
Spring.Expressions.SpringAST contextName_AST = null;
try { // for error handling
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);
match(ID);
{ // ( ... )*
for (;;)
if ((LA(1)==STRING_LITERAL))
{
Spring.Expressions.SpringAST tmp87_AST = null;
tmp87_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp87_AST);
match(STRING_LITERAL);
contextName_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
else if ((LA(1)==ID)) {
qualifiedId();
if (0 == inputState.guessing)
{
if ((LA(1)==DIV))
{
Spring.Expressions.SpringAST tmp91_AST = null;
tmp91_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp91_AST);
match(DIV);
Spring.Expressions.SpringAST tmp92_AST = null;
tmp92_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp92_AST);
match(ID);
}
else
{
goto _loop110_breakloop;
}
astFactory.addASTChild(ref currentAST, (AST)returnAST);
}
_loop110_breakloop: ;
} // ( ... )*
contextName_AST = (Spring.Expressions.SpringAST)currentAST.root;
{ // ( ... )*
for (;;)
{
if ((LA(1)==DIV))
{
Spring.Expressions.SpringAST tmp88_AST = null;
tmp88_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp88_AST);
match(DIV);
qualifiedId();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, (AST)returnAST);
}
}
else
{
goto _loop63_breakloop;
}
}
_loop63_breakloop: ;
} // ( ... )*
contextName_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
catch (RecognitionException ex)
{
@@ -2701,31 +2680,31 @@ _loop110_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 tmp89_AST = null;
tmp89_AST = (Spring.Expressions.QualifiedIdentifier) astFactory.create(LT(1), "Spring.Expressions.QualifiedIdentifier");
astFactory.makeASTRoot(ref currentAST, (AST)tmp89_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);
Spring.Expressions.SpringAST tmp90_AST = null;
tmp90_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp90_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);
Spring.Expressions.SpringAST tmp91_AST = null;
tmp91_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp91_AST);
match(ID);
}
else
{
goto _loop107_breakloop;
goto _loop111_breakloop;
}
}
_loop107_breakloop: ;
_loop111_breakloop: ;
} // ( ... )*
qualifiedId_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
@@ -2744,6 +2723,53 @@ _loop107_breakloop: ;
returnAST = qualifiedId_AST;
}
public void typename() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
Spring.Expressions.SpringAST typename_AST = null;
try { // for error handling
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_17_.member(LA(1))))
{
Spring.Expressions.SpringAST tmp93_AST = null;
tmp93_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp93_AST);
matchNot(RPAREN);
}
else
{
goto _loop76_breakloop;
}
}
_loop76_breakloop: ;
} // ( ... )*
typename_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_18_);
}
else
{
throw ex;
}
}
returnAST = typename_AST;
}
public void ctorArgs() //throws RecognitionException, TokenStreamException
{
@@ -2775,11 +2801,11 @@ _loop107_breakloop: ;
}
else
{
goto _loop100_breakloop;
goto _loop104_breakloop;
}
}
_loop100_breakloop: ;
_loop104_breakloop: ;
} // ( ... )*
}
else if ((LA(1)==RPAREN)) {
@@ -2817,9 +2843,9 @@ _loop100_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 tmp97_AST = null;
tmp97_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp97_AST);
match(ID);
{ // ( ... )*
for (;;)
@@ -2827,18 +2853,18 @@ _loop100_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 tmp99_AST = null;
tmp99_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp99_AST);
match(ID);
}
else
{
goto _loop80_breakloop;
goto _loop84_breakloop;
}
}
_loop80_breakloop: ;
_loop84_breakloop: ;
} // ( ... )*
}
if (0==inputState.guessing)
@@ -2859,7 +2885,7 @@ _loop80_breakloop: ;
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_17_);
recover(ex,tokenSet_19_);
}
else
{
@@ -2942,9 +2968,9 @@ _loop80_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 tmp101_AST = null;
tmp101_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.makeASTRoot(ref currentAST, (AST)tmp101_AST);
match(LBRACKET);
{
if ((tokenSet_8_.member(LA(1))))
@@ -2968,11 +2994,11 @@ _loop80_breakloop: ;
}
else
{
goto _loop89_breakloop;
goto _loop93_breakloop;
}
}
_loop89_breakloop: ;
_loop93_breakloop: ;
} // ( ... )*
}
else if ((LA(1)==RBRACKET)) {
@@ -2991,7 +3017,7 @@ _loop89_breakloop: ;
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_18_);
recover(ex,tokenSet_20_);
}
else
{
@@ -3038,7 +3064,7 @@ _loop89_breakloop: ;
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_19_);
recover(ex,tokenSet_21_);
}
else
{
@@ -3056,11 +3082,11 @@ _loop89_breakloop: ;
Spring.Expressions.SpringAST namedArgument_AST = null;
try { // for error handling
bool synPredMatched104 = false;
bool synPredMatched108 = false;
if (((LA(1)==ID) && (LA(2)==ASSIGN)))
{
int _m104 = mark();
synPredMatched104 = true;
int _m108 = mark();
synPredMatched108 = true;
inputState.guessing++;
try {
{
@@ -3070,16 +3096,16 @@ _loop89_breakloop: ;
}
catch (RecognitionException)
{
synPredMatched104 = false;
synPredMatched108 = false;
}
rewind(_m104);
rewind(_m108);
inputState.guessing--;
}
if ( synPredMatched104 )
if ( synPredMatched108 )
{
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 tmp105_AST = null;
tmp105_AST = (Spring.Expressions.NamedArgumentNode) astFactory.create(LT(1), "Spring.Expressions.NamedArgumentNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp105_AST);
match(ID);
match(ASSIGN);
expression();
@@ -3089,7 +3115,7 @@ _loop89_breakloop: ;
}
namedArgument_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
else if ((tokenSet_8_.member(LA(1))) && (tokenSet_20_.member(LA(2)))) {
else if ((tokenSet_8_.member(LA(1))) && (tokenSet_22_.member(LA(2)))) {
argument();
if (0 == inputState.guessing)
{
@@ -3108,7 +3134,7 @@ _loop89_breakloop: ;
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_21_);
recover(ex,tokenSet_23_);
}
else
{
@@ -3128,16 +3154,16 @@ _loop89_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 tmp107_AST = null;
tmp107_AST = (Spring.Expressions.BooleanLiteralNode) astFactory.create(LT(1), "Spring.Expressions.BooleanLiteralNode");
astFactory.addASTChild(ref currentAST, (AST)tmp107_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 tmp108_AST = null;
tmp108_AST = (Spring.Expressions.BooleanLiteralNode) astFactory.create(LT(1), "Spring.Expressions.BooleanLiteralNode");
astFactory.addASTChild(ref currentAST, (AST)tmp108_AST);
match(FALSE);
boolLiteral_AST = (Spring.Expressions.SpringAST)currentAST.root;
}
@@ -3170,22 +3196,22 @@ _loop89_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 tmp109_AST = null;
tmp109_AST = (Spring.Expressions.DateLiteralNode) astFactory.create(LT(1), "Spring.Expressions.DateLiteralNode");
astFactory.makeASTRoot(ref currentAST, (AST)tmp109_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 tmp111_AST = null;
tmp111_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp111_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 tmp113_AST = null;
tmp113_AST = (Spring.Expressions.SpringAST) astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, (AST)tmp113_AST);
match(STRING_LITERAL);
}
else if ((LA(1)==RPAREN)) {
@@ -3229,7 +3255,7 @@ _loop89_breakloop: ;
}
static public void initializeASTFactory( ASTFactory factory )
{
factory.setMaxNodeType(68);
factory.setMaxNodeType(71);
}
public static readonly string[] tokenNames_ = new string[] {
@@ -3269,6 +3295,7 @@ _loop89_breakloop: ;
@"""DOLLAR""",
@"""COMMA""",
@"""AT""",
@"""STRING_LITERAL""",
@"""LBRACKET""",
@"""RBRACKET""",
@"""PROJECT""",
@@ -3284,7 +3311,6 @@ _loop89_breakloop: ;
@"""INTEGER_LITERAL""",
@"""HEXADECIMAL_INTEGER_LITERAL""",
@"""REAL_LITERAL""",
@"""STRING_LITERAL""",
@"""date""",
@"""EQUAL""",
@"""NOT_EQUAL""",
@@ -3293,7 +3319,10 @@ _loop89_breakloop: ;
@"""GREATER_THAN""",
@"""GREATER_THAN_OR_EQUAL""",
@"""WS""",
@"""BACKTICK""",
@"""BACKSLASH""",
@"""DOT_ESCAPED""",
@"""QUOTE""",
@"""APOS""",
@"""NUMERIC_LITERAL""",
@"""DECIMAL_DIGIT""",
@@ -3312,25 +3341,25 @@ _loop89_breakloop: ;
public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_());
private static long[] mk_tokenSet_1_()
{
long[] data = { 704379224066L, 0L};
long[] data = { 1391573991426L, 0L};
return data;
}
public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_());
private static long[] mk_tokenSet_2_()
{
long[] data = { 567462303507644162L, 0L};
long[] data = { 567471030881189634L, 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 = { 1391577661442L, 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 = { 1391577661954L, 0L};
return data;
}
public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_());
@@ -3342,55 +3371,55 @@ _loop89_breakloop: ;
public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_());
private static long[] mk_tokenSet_6_()
{
long[] data = { 704382894850L, 0L};
long[] data = { 1391577662210L, 0L};
return data;
}
public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_());
private static long[] mk_tokenSet_7_()
{
long[] data = { 567454257431609090L, 0L};
long[] data = { 567454944626376450L, 0L};
return data;
}
public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_());
private static long[] mk_tokenSet_8_()
{
long[] data = { 8971308922667200L, 0L};
long[] data = { 8935437355811008L, 0L};
return data;
}
public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_());
private static long[] mk_tokenSet_9_()
{
long[] data = { 567454257456774914L, 0L};
long[] data = { 567454944651542274L, 0L};
return data;
}
public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_());
private static long[] mk_tokenSet_10_()
{
long[] data = { 567454257691655938L, 0L};
long[] data = { 567454944886423298L, 0L};
return data;
}
public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_());
private static long[] mk_tokenSet_11_()
{
long[] data = { 8971308360630464L, 0L};
long[] data = { 8935436793774272L, 0L};
return data;
}
public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_());
private static long[] mk_tokenSet_12_()
{
long[] data = { 567454257960091394L, 0L};
long[] data = { 567454945154858754L, 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 = { 16085726330880L, 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 = { 292058038272L, 0L};
return data;
}
public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_());
@@ -3402,40 +3431,52 @@ _loop89_breakloop: ;
public static readonly BitSet tokenSet_15_ = new BitSet(mk_tokenSet_15_());
private static long[] mk_tokenSet_16_()
{
long[] data = { 223338627072L, 0L};
long[] data = { 412388491264L, 0L};
return data;
}
public static readonly BitSet tokenSet_16_ = new BitSet(mk_tokenSet_16_());
private static long[] mk_tokenSet_17_()
{
long[] data = { 35184372088832L, 0L};
long[] data = { -262160L, 255L, 0L, 0L};
return data;
}
public static readonly BitSet tokenSet_17_ = new BitSet(mk_tokenSet_17_());
private static long[] mk_tokenSet_18_()
{
long[] data = { 567603040995999490L, 0L};
long[] data = { 262144L, 0L};
return data;
}
public static readonly BitSet tokenSet_18_ = new BitSet(mk_tokenSet_18_());
private static long[] mk_tokenSet_19_()
{
long[] data = { 566935683072L, 0L};
long[] data = { 70368744177664L, 0L};
return data;
}
public static readonly BitSet tokenSet_19_ = new BitSet(mk_tokenSet_19_());
private static long[] mk_tokenSet_20_()
{
long[] data = { 576460065104330688L, 0L};
long[] data = { 567752505857900290L, 0L};
return data;
}
public static readonly BitSet tokenSet_20_ = new BitSet(mk_tokenSet_20_());
private static long[] mk_tokenSet_21_()
{
long[] data = { 17180131328L, 0L};
long[] data = { 1116691496960L, 0L};
return data;
}
public static readonly BitSet tokenSet_21_ = new BitSet(mk_tokenSet_21_());
private static long[] mk_tokenSet_22_()
{
long[] data = { 576459377909563328L, 0L};
return data;
}
public static readonly BitSet tokenSet_22_ = new BitSet(mk_tokenSet_22_());
private static long[] mk_tokenSet_23_()
{
long[] data = { 17180131328L, 0L};
return data;
}
public static readonly BitSet tokenSet_23_ = new BitSet(mk_tokenSet_23_());
}
}

View File

@@ -38,22 +38,22 @@ namespace Spring.Expressions
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 LAMBDA = 44;
public const int PIPE = 45;
public const int LITERAL_new = 46;
public const int LCURLY = 47;
public const int INTEGER_LITERAL = 48;
public const int HEXADECIMAL_INTEGER_LITERAL = 49;
public const int REAL_LITERAL = 50;
public const int STRING_LITERAL = 51;
public const int STRING_LITERAL = 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 LAMBDA = 45;
public const int PIPE = 46;
public const int LITERAL_new = 47;
public const int LCURLY = 48;
public const int INTEGER_LITERAL = 49;
public const int HEXADECIMAL_INTEGER_LITERAL = 50;
public const int REAL_LITERAL = 51;
public const int LITERAL_date = 52;
public const int EQUAL = 53;
public const int NOT_EQUAL = 54;
@@ -62,15 +62,18 @@ namespace Spring.Expressions
public const int GREATER_THAN = 57;
public const int GREATER_THAN_OR_EQUAL = 58;
public const int WS = 59;
public const int DOT_ESCAPED = 60;
public const int APOS = 61;
public const int NUMERIC_LITERAL = 62;
public const int DECIMAL_DIGIT = 63;
public const int INTEGER_TYPE_SUFFIX = 64;
public const int HEX_DIGIT = 65;
public const int EXPONENT_PART = 66;
public const int SIGN = 67;
public const int REAL_TYPE_SUFFIX = 68;
public const int BACKTICK = 60;
public const int BACKSLASH = 61;
public const int DOT_ESCAPED = 62;
public const int QUOTE = 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;
}
}

View File

@@ -32,22 +32,22 @@ 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
LAMBDA=44
PIPE=45
LITERAL_new="new"=46
LCURLY=47
INTEGER_LITERAL=48
HEXADECIMAL_INTEGER_LITERAL=49
REAL_LITERAL=50
STRING_LITERAL=51
STRING_LITERAL=36
LBRACKET=37
RBRACKET=38
PROJECT=39
RCURLY=40
SELECT=41
SELECT_FIRST=42
SELECT_LAST=43
TYPE=44
LAMBDA=45
PIPE=46
LITERAL_new="new"=47
LCURLY=48
INTEGER_LITERAL=49
HEXADECIMAL_INTEGER_LITERAL=50
REAL_LITERAL=51
LITERAL_date="date"=52
EQUAL=53
NOT_EQUAL=54
@@ -56,12 +56,15 @@ LESS_THAN_OR_EQUAL=56
GREATER_THAN=57
GREATER_THAN_OR_EQUAL=58
WS=59
DOT_ESCAPED=60
APOS=61
NUMERIC_LITERAL=62
DECIMAL_DIGIT=63
INTEGER_TYPE_SUFFIX=64
HEX_DIGIT=65
EXPONENT_PART=66
SIGN=67
REAL_TYPE_SUFFIX=68
BACKTICK=60
BACKSLASH=61
DOT_ESCAPED=62
QUOTE=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

View File

@@ -1,5 +1,5 @@
#region License
#region License
/*
* Copyright <20> 2002-2005 the original author or authors.
*
@@ -14,84 +14,86 @@
* 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 antlr.collections;
namespace Spring.Expressions
{
/// <summary>
/// Represents parsed named argument node in the expression.
/// </summary>
/// <author>Aleksandar Seovic</author>
[Serializable]
public class QualifiedIdentifier : BaseNode
{
private const string ESCAPE_CHAR = "\\";
private string identifier;
/// <summary>
/// Create a new instance
/// </summary>
public QualifiedIdentifier():base()
{
}
/// <summary>
/// Create a new instance from SerializationInfo
/// </summary>
protected QualifiedIdentifier(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Returns the value of the named argument defined by this node.
/// </summary>
/// <param name="context">Context to evaluate expressions against.</param>
/// <param name="evalContext">Current expression evaluation context.</param>
/// <returns>Node's value.</returns>
protected override object Get(object context, EvaluationContext evalContext)
{
if (identifier == null)
{
lock (this)
{
if (identifier == null)
{
identifier = base.getText();
if (identifier != null)
{
identifier = identifier.Replace(ESCAPE_CHAR,""); // remove all occurrences of escape char
}
AST node = this.getFirstChild();
while (node != null)
{
identifier += node.getText();
node = node.getNextSibling();
}
}
}
}
return identifier;
}
/// <summary>
/// Overrides getText to allow easy way to get fully
/// qualified identifier.
/// </summary>
/// <returns>
/// Fully qualified identifier as a string.
/// </returns>
public override string getText()
{
return (string) Get(null, null);
}
}
*/
#endregion
using System;
using System.Runtime.Serialization;
using antlr.collections;
namespace Spring.Expressions
{
/// <summary>
/// Represents parsed named argument node in the expression.
/// </summary>
/// <author>Aleksandar Seovic</author>
[Serializable]
public class QualifiedIdentifier : BaseNode
{
private const string ESCAPE_CHAR = "\\";
private string identifier;
/// <summary>
/// Create a new instance
/// </summary>
public QualifiedIdentifier()
: base()
{
}
/// <summary>
/// Create a new instance from SerializationInfo
/// </summary>
protected QualifiedIdentifier(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Returns the value of the named argument defined by this node.
/// </summary>
/// <param name="context">Context to evaluate expressions against.</param>
/// <param name="evalContext">Current expression evaluation context.</param>
/// <returns>Node's value.</returns>
protected override object Get(object context, EvaluationContext evalContext)
{
if (identifier == null)
{
lock (this)
{
if (identifier == null)
{
identifier = this.getText();
}
}
}
return identifier;
}
/// <summary>
/// Overrides getText to allow easy way to get fully
/// qualified identifier.
/// </summary>
/// <returns>
/// Fully qualified identifier as a string.
/// </returns>
public override string getText()
{
string tmp = base.getText();
if (tmp != null)
{
tmp = tmp.Replace(ESCAPE_CHAR, ""); // remove all occurrences of escape char
}
AST node = this.getFirstChild();
while (node != null)
{
tmp = string.Concat(tmp, node.getText());
node = node.getNextSibling();
}
return tmp;
}
}
}

View File

@@ -1,5 +1,5 @@
#region License
#region License
/*
* Copyright <20> 2002-2005 the original author or authors.
*
@@ -14,70 +14,87 @@
* 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 antlr.collections;
using Spring.Core.TypeResolution;
namespace Spring.Expressions
{
/// <summary>
/// Represents parsed type node in the navigation expression.
/// </summary>
/// <author>Aleksandar Seovic</author>
[Serializable]
public class TypeNode : BaseNode
{
private Type type;
/// <summary>
/// Create a new instance
/// </summary>
public TypeNode():base()
{
}
/// <summary>
/// Create a new instance from SerializationInfo
/// </summary>
protected TypeNode(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Returns node's value for the given context.
/// </summary>
/// <param name="context">Context to evaluate expressions against.</param>
/// <param name="evalContext">Current expression evaluation context.</param>
/// <returns>Node's value.</returns>
protected override object Get(object context, EvaluationContext evalContext)
{
if (type == null)
{
lock (this)
{
if (type == null)
{
string typeName = this.getText();
AST node = this.getFirstChild();
while (node != null)
{
typeName += node.getText();
node = node.getNextSibling();
}
type = TypeResolutionUtils.ResolveType(typeName);
}
}
}
return type;
}
}
*/
#endregion
using System;
using System.Runtime.Serialization;
using antlr.collections;
using Spring.Core.TypeResolution;
namespace Spring.Expressions
{
/// <summary>
/// Represents parsed type node in the navigation expression.
/// </summary>
/// <author>Aleksandar Seovic</author>
[Serializable]
public class TypeNode : BaseNode
{
private Type type;
/// <summary>
/// Create a new instance
/// </summary>
public TypeNode()
: base()
{
}
/// <summary>
/// Create a new instance from SerializationInfo
/// </summary>
protected TypeNode(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Returns node's value for the given context.
/// </summary>
/// <param name="context">Context to evaluate expressions against.</param>
/// <param name="evalContext">Current expression evaluation context.</param>
/// <returns>Node's value.</returns>
protected override object Get(object context, EvaluationContext evalContext)
{
if (type == null)
{
lock(this)
{
type = TypeResolutionUtils.ResolveType(getText());
}
}
return type;
}
/// <summary>
/// Overrides getText to allow easy way to get fully
/// qualified typename.
/// </summary>
/// <returns>
/// Fully qualified typename as a string.
/// </returns>
public override string getText()
{
string tmp = base.getText();
// if (tmp != null && TypeRegistry.ContainsAlias(tmp))
// {
// Type type = TypeRegistry.ResolveType(tmp);
// if (type != null)
// {
// tmp = type.AssemblyQualifiedName;
// }
// }
AST node = this.getFirstChild();
while (node != null)
{
tmp += node.getText();
node = node.getNextSibling();
}
return tmp;
}
}
}

View File

@@ -1,7 +1,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{710961A3-0DF4-49E4-A26E-F5B9C044AC84}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -1121,7 +1121,7 @@
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>rem $(ProjectDir)..\..\..\build-support\tools\antlr-2.7.6\antlr-2.7.6.exe -o $(ProjectDir)Expressions\Parser $(ProjectDir)Expressions\Expression.g
<PreBuildEvent>$(ProjectDir)..\..\..\build-support\tools\antlr-2.7.6\antlr-2.7.6.exe -o $(ProjectDir)Expressions\Parser $(ProjectDir)Expressions\Expression.g
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>

File diff suppressed because it is too large Load Diff

View File

@@ -48,7 +48,7 @@ namespace Spring.Core.TypeResolution
public void ResolveLocalAssemblyGenericType()
{
Type t = GetTypeResolver().Resolve("Spring.Objects.TestGenericObject< int, string>");
Assert.AreEqual(typeof(TestGenericObject<int,string>), t);
Assert.AreEqual(typeof(TestGenericObject<int, string>), t);
}
[Test]
@@ -74,6 +74,26 @@ namespace Spring.Core.TypeResolution
Assert.AreEqual(typeof(System.Collections.Generic.Stack<string>), t);
}
[Test]
public void ResolveGenericArrayType()
{
Type t = GetTypeResolver().Resolve("System.Nullable<[System.Int32, mscorlib]>[,]");
Assert.AreEqual(typeof(int?[,]), t);
t = GetTypeResolver().Resolve("System.Nullable`1[int][,]");
Assert.AreEqual(typeof(int?[,]), t);
}
[Test]
public void ResolveGenericArrayTypeWithAssemblyName()
{
Type t = GetTypeResolver().Resolve("System.Nullable<[System.Int32, mscorlib]>[,], mscorlib");
Assert.AreEqual(typeof(int?[,]), t);
t = GetTypeResolver().Resolve("System.Nullable<[System.Int32, mscorlib]>[,], mscorlib");
Assert.AreEqual(typeof(int?[,]), t);
t = GetTypeResolver().Resolve("System.Nullable`1[[System.Int32, mscorlib]][,], mscorlib");
Assert.AreEqual(typeof(int?[,]), t);
}
[Test]
[ExpectedException(typeof(TypeLoadException))]
public void ResolveAmbiguousGenericTypeWithAssemblyName()
@@ -87,6 +107,27 @@ namespace Spring.Core.TypeResolution
{
Type t = GetTypeResolver().Resolve("Spring.Objects.TestGenericObject<int, <string>>");
}
[Test]
public void ResolveNestedGenericTypeWithAssemblyName()
{
Type t = GetTypeResolver().Resolve("System.Collections.Generic.Stack< Spring.Objects.TestGenericObject<int, string> >, System");
Assert.AreEqual(typeof(System.Collections.Generic.Stack<Spring.Objects.TestGenericObject<int, string>>), t);
}
[Test]
public void ResolveClrNotationStyleGenericTypeWithAssemblyName()
{
Type t = GetTypeResolver().Resolve("System.Collections.Generic.Stack`1[ [Spring.Objects.TestGenericObject`2[int, string], Spring.Core.Tests] ], System");
Assert.AreEqual(typeof(System.Collections.Generic.Stack<Spring.Objects.TestGenericObject<int, string>>), t);
}
[Test]
public void ResolveNestedQuotedGenericTypeWithAssemblyName()
{
Type t = GetTypeResolver().Resolve("System.Collections.Generic.Stack< [Spring.Objects.TestGenericObject<int, string>, Spring.Core.Tests] >, System");
Assert.AreEqual(typeof(System.Collections.Generic.Stack<Spring.Objects.TestGenericObject<int, string>>), t);
}
}
}

View File

@@ -703,12 +703,33 @@ namespace Spring.Expressions
/// Tests type node
/// </summary>
[Test]
[Ignore("does not work yet due to parser expecting ID production within T(ID)")]
// [Ignore("does not work yet due to parser expecting ID production within T(ID)")]
public void TestTypeNodeWithAssemblyQualifiedName()
{
Assert.AreEqual(typeof(ExpressionEvaluator), ExpressionEvaluator.GetValue(null, string.Format("T({0})", typeof(ExpressionEvaluator).AssemblyQualifiedName)));
}
#if NET_2_0
/// <summary>
/// Tests type node
/// </summary>
[Test]
public void TestTypeNodeWithGenericAssemblyQualifiedName()
{
// Assert.AreEqual(typeof(int?), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[System.Int32], mscorlib)"));
// Assert.AreEqual(typeof(int?), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[[System.Int32, mscorlib]], mscorlib)"));
Assert.AreEqual(typeof(int?), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[[int]], mscorlib)"));
}
/// <summary>
/// Tests type node
/// </summary>
[Test]
public void TestTypeNodeWithGenericAssemblyQualifiedArrayName()
{
Assert.AreEqual(typeof(int?[,]), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[[System.Int32, mscorlib]][,], mscorlib)"));
}
#endif
/// <summary>
/// Tests constructor node
/// </summary>
@@ -1519,6 +1540,10 @@ namespace Spring.Expressions
Assert.AreEqual(typeof(TestObject),
ExpressionEvaluator.GetValue(null, "@(myContext:goran)").GetType());
// string literals allowed for contextname
Assert.AreEqual(typeof(TestObject),
ExpressionEvaluator.GetValue(null, "@('myContext':goran)").GetType());
}
/// <summary>
@@ -1560,6 +1585,8 @@ namespace Spring.Expressions
ctx.Name = "my.Context";
ContextRegistry.RegisterContext(ctx);
Assert.AreEqual(typeof(TestObject),
ExpressionEvaluator.GetValue(null, "@(my.Context:goran)").GetType());
Assert.AreEqual(typeof(TestObject),
ExpressionEvaluator.GetValue(null, "@(my\\.Context:goran)").GetType());
}

View File

@@ -1,8 +1,7 @@
#if NET_2_0
#region License
/*
* Copyright 2002-2004 the original author or authors.
* Copyright 2002-2008 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.
@@ -19,6 +18,8 @@
#endregion
#if NET_2_0
#region Imports
using System;

View File

@@ -58,6 +58,31 @@ namespace Spring.Util
Assert.IsTrue(ArrayUtils.AreEqual(new string[] {"one"}, res = StringUtils.Split("one", delim, true, true)), "Received '" + String.Join(",", res) + "'");
}
[Test]
public void SplitWithQuotedStrings()
{
string[] expectedParts = new string[] { "a", "[test,<,>>[]]]", "asdf<,<,>,>aa" };
string testString = string.Join(",", expectedParts);
string[] result = StringUtils.Split(testString, ",", false, false, "[]<>");
Assert.AreEqual( expectedParts, result );
}
[Test]
public void SplitAddsEmptyStrings()
{
string testString = ",";
string[] result = StringUtils.Split(testString, ",", true, false, null);
Assert.AreEqual( new string[] { "", "" }, result );
}
[Test]
public void SplitAcceptsWhitespaceDelimiters()
{
string testString = "a\nb\tc d";
string[] result = StringUtils.Split(testString, "\n\t ", true, false, null);
Assert.AreEqual( new string[] { "a", "b", "c", "d" }, result );
}
[Test]
public void HasLengthTests()
{