package osa.attribute.atgrammar.grammar;

import java.util.*;
import osa.attribute.atgrammar.grammar.symbols.*;



/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class Grammar
  {
  protected ArrayList productions_list=new ArrayList();
  protected TreeSet terminal_dictionary=new TreeSet();
  protected TreeSet non_terminal_dictionary=new TreeSet();
  protected NonTerminalSymbol initial_symbol;

  public Grammar()
    {
    }




  public Grammar(osa.Grammar grammar)
    {
    ArrayList[] productions_array=grammar.RT.m_rules;
    int size_of_grammar=grammar.RT.m_size;

    ArrayList temp_production;
    int temp_production_lenghth;
    for(int productions_counter=0;
        productions_counter<size_of_grammar;
        productions_counter++)
       {
       temp_production=productions_array[productions_counter];
       temp_production_lenghth=temp_production.size();

       String left_nonterminal=temp_production.get(0)

       for(int symbols_counter=1;
           symbols_counter<temp_production_lenghth;
           symbols_counter++)
          {

          }
       }
    }



  public GrammarProduction getProductionAt(int index)
    {
    return (GrammarProduction)productions_list.get(index);
    }

  protected void addGrammarProduction(GrammarProduction production)
    {
    productions_list.add(production);
    }

  protected void setGrammarInitialSymbol(NonTerminalSymbol axiom)
    {
    this.initial_symbol=initial_symbol;
    }

  public NonTerminalSymbol getInitialSymbol()
    {
    return initial_symbol;
    }
  }