/// <summary> /// Something is a new definition if it replaces some parent definition. /// </summary> private bool IsNewDefinition(GrammarRule rule, GrammarProperty property) { return(BaseProperties(rule, property.Name).Any()); }
/// <summary> /// A property needs declared under three conditions: /// 1. there is no definition of the property in the parent /// 2. the single parent definition has a different type /// 3. the property is defined in multiple parents, in that case it is /// ambitious unless it is redefined in the current interface. /// </summary> private bool NeedsDeclared(GrammarRule rule, GrammarProperty property) { var baseProperties = BaseProperties(rule, property.Name).ToList(); return(baseProperties.Count != 1 || baseProperties[0].Type != property.Type); }