//this class is used by "Rules" for checking rules' correctness

public class Non_Terminals{

  protected int how_many_nonterm=0;
  protected String[] checked_const=new String[50];;


//put tnis non-terminal constituent on the list

   protected void new_non_term(String constituent){                                    
            
             checked_const[how_many_nonterm]=constituent;
             how_many_nonterm++;                 
   } 

//check whether this non_term (left) constituent is already processed
  
   protected boolean is_new_non_term(String constituent){
             
             int position=0;
             boolean is_new=true;
             
             for(int i=0; i<how_many_nonterm; i++){
                 if(checked_const[i].equals(constituent)){
                    is_new=false;
                 } 
             }       
        
             return is_new;
   } 
              
}