예제 #1
0
        private static IEnumerable<Node> ParseChances(Node parentNode, string text)
        {
            string[] chances = chanceRx.Split(text);

            if(chances.Length < 2)
                return ParseTries(parentNode, text);

            ChanceNode chanceNode = new ChanceNode(parentNode,
                new Atts("Type", "Even"));

            foreach(string cur in chances) {
                CaseNode caseNode = new CaseNode(chanceNode, null);

                chanceNode.AddChild(caseNode);

                caseNode.AddChildren(ParseSingle(caseNode, cur));
            }

            return Enumerations.One<Node>(chanceNode);
        }
예제 #2
0
파일: ChanceNode.cs 프로젝트: wrmsr/xdc
 public ChanceContext(NodeContext parent, ChanceNode node)
     : base(parent, node)
 {
 }