Exemple #1
0
 public Alternative(Nonterminal b, int index, List<Symbol> value)
 {
     _base = new Nonterminal(b);
     _index = index;
     _value = new List<Symbol>(value);
     _strValue = String.Format("{0}{1}", _base.Sym, index);
 }
Exemple #2
0
 public Alternative()
 {
     _base = new Nonterminal();
     _index = 0;
     _value = new List<Symbol>();
     _strValue = "";
 }
Exemple #3
0
 public Grammar(Grammar g)
 {
     _nonterminals = new List<Nonterminal>(g.Nonterminals);
     _terminals = new List<Terminal>(g.Terminals);
     _rules = new List<Rule>(g.Rules);
     _distinguishedSymbol = new Nonterminal(g.DistinguishedSymbol);
     _vanishingSymbols = new List<Nonterminal>(g.VanishingSymbols);
 }
Exemple #4
0
 public Grammar(List<Nonterminal> nonterminals, List<Terminal> terminals, List<Rule> rules, Nonterminal distinguishedSymbol)
 {
     _nonterminals = new List<Nonterminal>(nonterminals);
     _terminals = new List<Terminal>(terminals);
     _rules = new List<Rule>(rules);
     _distinguishedSymbol = distinguishedSymbol;
     //findVanishingSymbols();
 }
Exemple #5
0
 public Rule(Rule r)
 {
     _left = new Nonterminal(r.Left);
     _right = new List<Symbol>(r.Right);
 }
Exemple #6
0
 public Rule(Nonterminal left, List<Symbol> right)
 {
     _left = new Nonterminal(left);
     _right = new List<Symbol>(right);
 }
Exemple #7
0
 public Rule()
 {
     _left = new Nonterminal();
     _right = new List<Symbol>();
 }
Exemple #8
0
 public Nonterminal(Nonterminal nt)
 {
     _sym = nt.Sym;
 }