public void visit(ChoiceLineV choiceLineV)
        {
            List<UserControl> children = new List<UserControl>();

            foreach (GrammarNodeV child in choiceLineV.Children)
            {
                child.accept(this);
            }
        }
コード例 #2
0
        public void Collapse()
        {
            if (!IsExpanded)
                throw new Exception("Cannot collapse a collapsed nonterminal tail V.");

            rule.Dispose();

            rule = null;

            // reset to default. Need to use visitor pattern to create visual from definitive, see log book.
            Direction = false;
        }
        public void visit(ChoiceLineV choiceLineV)
        {
            List<UserControl> children = new List<UserControl>();

            foreach (GrammarNodeV child in choiceLineV.Children)
            {
                child.accept(this);
                children.Add(drawnItem);
            }

            drawnItem = new Concatenation(children, choiceLineV.Direction);
            children = null;
        }
コード例 #4
0
        public void Expand()
        {
            if (IsExpanded)
                throw new Exception("Cannot expand an expanded nonterminal tail V.");

            GrammarNodeDCreateVisualVisitor visitor = new GrammarNodeDCreateVisualVisitor(level);
            Reference.Reference.Rule.accept(visitor);

            if (visitor.CurrentNodeV as ChoiceLineV == null)
                throw new Exception("The node created in the visitor pattern returned null or is not of type ChoiceLineV");
            else
                rule = (ChoiceLineV)visitor.CurrentNodeV;
            //rule = (ChoiceLineV)reference.Reference.Rule.CreateVisual(updateRef)
        }
        public void visit(ChoiceLineD choiceLineD)
        {
            List<GrammarNodeV> children = new List<GrammarNodeV>();

            foreach (GrammarNodeD child in choiceLineD.Children)
            {
                // make children
                child.accept(this);
                children.Add(current);
            }

            ChoiceLineV choiceLineV = new ChoiceLineV(children, choiceLineD);
            choiceLineD.AddReference(choiceLineV);

            current = choiceLineV;
        }
 public void visit(ChoiceLineV choiceLineV)
 {
     foreach (GrammarNodeV child in choiceLineV.Children)
     {
         child.accept(this);
     }
 }
コード例 #7
0
 public void AddReference(ChoiceLineV choiceLineV)
 {
     references.Add(choiceLineV);
 }