public TermNonTermList()
 {
     first = null;
     count = -1;
     countTerminal=0;
     countNonTerminal=0;
 }
 public TermNonTermNode(string str,bool isTerm,int Number)
 {
     this.item.elemStr = str;
     this.item.isTerminal = isTerm;
     this.item.number = Number;
     this.next = null;
 }
 public void add(string str,bool isTerm)
 {
     TermNonTermNode temp =first;
     this.count++;
     if(isTerm)
         this.countTerminal++;
     else
         this.countNonTerminal++;
     if(first == null)
     {
         first = new TermNonTermNode(str,isTerm,count);
     }
     else
     {
         while(temp.next != null)
         {
             temp= temp.next;
         }
         temp.next = new TermNonTermNode(str,isTerm,count);
     }
 }