Esempio n. 1
0
        private void AnalysisClassificationTag(ABnfElement element, List <ALanguageClassifierInfo> list, bool blur)
        {
            if (element is ABnfErrorElement)
            {
                return;
            }

            var type = element.GetReference().QueryClassificationTag(out bool blur_temp);

            if (type != null)
            {
                for (int line = element.GetStartLine(); line <= element.GetEndLine(); ++line)
                {
                    var info = new ALanguageClassifierInfo();
                    info.line  = line;
                    info.start = element.GetStart();
                    info.end   = element.GetEnd();
                    info.blur  = blur || blur_temp;
                    info.type  = type;
                    list.Add(info);
                }
                return;
            }

            var node = element as ABnfNodeElement;

            if (node != null)
            {
                foreach (var child in node.GetChilds())
                {
                    AnalysisClassificationTag(child, list, blur || blur_temp);
                }
            }
        }