public Rule(ParseResult original) : base(original) { Options = GetChildren <RuleOption>(0, ChildCount - 2) .ToArray(); Identifier = GetChild <Identifier>(ChildCount - 2).Value; Expression = GetChild <Expression>(ChildCount - 1); GeneratedParser = Parser.LateDefined(Identifier, Options.Any(x => x.Option == "collapse") ? LateDefinedType.Collapse : Options.Any(x => x.Option == "omit-from-hierarchy") ? LateDefinedType.OmitFromHierarchy : LateDefinedType.Default); }
public Rule(ParseResult original) : base(original) { Options = GetChildren<RuleOption>(0, ChildCount - 2) .Select(x => x.Option) .ToArray(); Identifier = GetChild<Identifier>(ChildCount - 2).Value; Expression = GetChild<Expression>(ChildCount - 1); GeneratedParser = Parser.LateDefined(Identifier, Options.Contains("collapse") ? LateDefinedType.Collapse : Options.Contains("omit-from-hierarchy") ? LateDefinedType.OmitFromHierarchy : LateDefinedType.Default); }