Exemplo n.º 1
0
 public static PegNode FindNodeInParents(PegNode node, EPegGrammar id)
 {
     for(; node!=null;node=node.parent_)
     {
         if( node.id_ == (int) id ) return node;
     }
     return null;
 }
Exemplo n.º 2
0
 public static PegNode FindNode(PegNode node, EPegGrammar id, int nodeDistance)
 {
     if (node == null || nodeDistance<=0) return null;
     if (node.id_ == (int)id) return node;
     PegNode foundNode = FindNode(node.child_, id, nodeDistance - 1);
     if (foundNode!=null) return foundNode;
     foundNode = FindNode(node.next_, id, nodeDistance - 1);
     if (foundNode != null) return foundNode;
     return null;
 }
Exemplo n.º 3
0
 public static PegNode FindNodeNext(PegNode node, EPegGrammar id)
 {
     for (node = node.next_; node != null; node = node.next_)
     {
         if (node.id_ == (int)id) return node;
     }
     return null;
 }
Exemplo n.º 4
0
 public static PegNode FindNode(PegNode node, EPegGrammar id)
 {
     return FindNode(node, id, 8);
 }
Exemplo n.º 5
0
 internal TRepetition(int nLowerLimit, int nUpperLimit, EPegGrammar id, PegBegEnd begEnd)
     : base(null, (int)id)
 {
     base.match_ = begEnd;
     lower = nLowerLimit;
     upper = nUpperLimit;
 }
Exemplo n.º 6
0
 PegNode NewNode(
                     EPegGrammar id,
                     PegBegEnd match,
                     PegNode child)
 {
     return NewNode(id, match, child, null);
 }
Exemplo n.º 7
0
 PegNode NewNode(
                     EPegGrammar id,
                     PegBegEnd match)
 {
     return NewNode(id, match, null, null);
 }
Exemplo n.º 8
0
 PegNode NewNode(
                     EPegGrammar id,
                     PegBegEnd match,
                     PegNode child,
                     PegNode next)
 {
     PegNode n = new PegNode(null, (int)id);
     n.match_ = match;
     n.child_ = child;
     n.next_ = next;
     for (PegNode node = n.child_; node != null; node = node.next_) node.parent_ = n;
     return n;
 }