Beispiel #1
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteStartAttribute("TimeInNode");
            writer.WriteValue(TimeInNode.ToString("N") + " usec");
            writer.WriteEndAttribute();

            writer.WriteStartAttribute("IsAMatch");
            writer.WriteValue(IsAMatch);
            writer.WriteEndAttribute();

            writer.WriteStartAttribute("Lexemes");
            if (Lexemes.Any())
            {
                writer.WriteValue(Lexemes.Aggregate((workingOutput, next) => workingOutput + " " + next));
            }
            writer.WriteEndAttribute();

            writer.WriteStartAttribute("Goal");
            writer.WriteValue(TheGoal.Symbol.TheSymbol);
            writer.WriteEndAttribute();

            writer.WriteStartAttribute("GoalRange");
            writer.WriteValue(TheGoal.InputPos + "-" + (TheGoal.InputPos + TheGoal.Length - 1));
            writer.WriteEndAttribute();

            writer.WriteStartAttribute("Rule");
            writer.WriteValue(TheRuleRange == null ? String.Empty : TheRuleRange.TheRule.ToString());
            writer.WriteEndAttribute();

            writer.WriteStartAttribute("RuleRange");
            writer.WriteValue(TheRuleRange == null ? String.Empty : String.Format(" {0}-{1}", TheRuleRange.InputPos, TheRuleRange.InputPos + TheRuleRange.Length - 1));
            writer.WriteEndAttribute();
        }