public void NextGeneration() { Token prevGeneration = _root[_root.Count - 1]; Token start = null; Token last = null; while (prevGeneration != null) { ARule rule = _systemData.Rules.Find(r => r.Sign == prevGeneration.Sign); Token tmp = null; Token end = null; if (rule != null) { int index = 0; string result = rule.Evaluate(prevGeneration); // verifier si ca fonctionne correctement, j'ai un petit doute tmp = GenerateTokens(prevGeneration, result, out end, ref index); } else { tmp = new Token(prevGeneration.Sign, prevGeneration, prevGeneration.BranchId, Depth()); } AddToken(ref start, ref last, tmp); if (end != null) { last = end; } prevGeneration = prevGeneration.Next; } _root.Add(start); }
public void AddRule(ARule rule) { Rules.Add(rule); }