示例#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);
 }
示例#2
0
 public Alternative()
 {
     _base = new Nonterminal();
     _index = 0;
     _value = new List<Symbol>();
     _strValue = "";
 }
示例#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);
 }
示例#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();
 }
示例#5
0
文件: Rule.cs 项目: sunny-hell/bmstu
 public Rule(Rule r)
 {
     _left = new Nonterminal(r.Left);
     _right = new List<Symbol>(r.Right);
 }
示例#6
0
文件: Rule.cs 项目: sunny-hell/bmstu
 public Rule(Nonterminal left, List<Symbol> right)
 {
     _left = new Nonterminal(left);
     _right = new List<Symbol>(right);
 }
示例#7
0
文件: Rule.cs 项目: sunny-hell/bmstu
 public Rule()
 {
     _left = new Nonterminal();
     _right = new List<Symbol>();
 }
示例#8
0
 public Nonterminal(Nonterminal nt)
 {
     _sym = nt.Sym;
 }