C#: 196 consecutive else if statements cause StackOverflow

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 9 years ago by Marina
Version: 4.0.0285
Platform: .NET 4.0
Environment: Windows 7 (32-bit)
Avatar
Hello,

In our app we use generated code and show it in SyntaxEditor. As a result of generation many else if statements can appear. 196 else if statements (tried other usual statements and it was ok)result in StackOverflow exception in SyntaxEditor. I have also tried to insert breaks between statements and sometimes exception was not thrown, but i couldn't find a pattern.

Example (large code):
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
using System.Linq.Expressions;


namespace N
{
    public class Cla
    {
       
        public override object Get(string elementName)
        {
            if (string.IsNullOrEmpty(elementName))
                throw new ArgumentNullException("Element name can't be empty.");

            string currentName;
            string childName;
            bool hasDot;
            bool hasIndex;
            int index;
            bool isValue = false;
            bool isArray = false;
            bool checkClassElements = true;

            object element = null;
            if (string.Equals(currentName, "Ameropt", StringComparison.InvariantCulture)) { element = Ameropt; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
            else if(string.Equals(currentName, "AmerOptDelta", StringComparison.InvariantCulture)) { element = AmerOptDelta; isValue = true; }
          
            else
            {
                checkClassElements = false;
                element = base.Get(elementName);
            }

            return element;
        }



    }

 
}
Thanks in advance.

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marina,

Hmm... I don't believe we've run into this before. It seems to be caused because our parser is a recursive descent parser (one method for each non-terminal) and with 'if' statements, the 'true' and 'false' statement portions recurse to look for embedded statements. Thus in your scenario you end up with ~200 recursive MatchEmbeddedStatement calls, and .NET thinks it's a stack overflow, even though it's not one.

We refactored the code that builds the 'if' AST node to iterate through 'else if's instead of recurse. That works around this issue. The change will be in the next maintenance release.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.