Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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);
 }