public void PatternChanged(params Pattern[] changed) { List <Pattern> updated = new List <Pattern>(); foreach (Pattern changedPattern in changed) { foreach (Pattern pattern in patterns) { if (updated.Contains(pattern)) { continue; } AbstractPattern abstractPattern = pattern as AbstractPattern; if (abstractPattern == null) { continue; } if (abstractPattern.AltPatterns.Contains(changedPattern)) { abstractPattern.Update(changedPattern); } updated.Add(pattern); trace.PatternChanged(abstractPattern); } } }
public static void SetUp(Module module, Grammar grammar) { if (pattern == null) { pattern = new AbstractPattern(null, "Statement"); pattern.SetType(typeof(Statement)); } module.SetName("Statement", typeof(Statement)); grammar.PatternDefined(pattern); }
public static void SetUp(Module module, Grammar grammar) { if (pattern == null) { pattern = new AbstractPattern(null, "Expression"); pattern.SetType(typeof(Expression)); } module.SetName("Expression", typeof(Expression)); grammar.PatternDefined(pattern); }
public new static void SetUp(Module module, Grammar grammar) { if (pattern == null) { pattern = new AbstractPattern(null, "ComparisonExpression"); pattern.SetType(typeof(ComparisonExpression)); Expression.pattern.AddAltPattern(pattern); } module.SetName("ComparisonExpression", typeof(ComparisonExpression)); grammar.PatternDefined(pattern); }