Example #1
0
 public void Rebalance()
 {
     if (_Right != null)
     {
         if (_Right._Operator != null && _Right._Operator.Priority <= _Operator.Priority)
         {
             RebalanceLeft();
             _Parent.Rebalance();
         }
         else if (_Right._Operator != null)
         {
             _Right.Rebalance();
         }
     }
 }
Example #2
0
 public ParseTree(string Source, List <Operator <T> > Operators, Dictionary <string, Generator <T> > Sets)
 {
     _Head = new ParseNode <T>(Source, Operators, Sets);
     _Head.Rebalance();
     _Head = _Head.GetRoot();
 }