Beispiel #1
0
 protected bool Equals(MatchRecordRule other)
 {
     return(Equals(Identifier, other.Identifier) && FieldRules.SequenceEqual(other.FieldRules));
 }
Beispiel #2
0
        /// <summary>
        /// rule_record                                 = identifier "(" rule_record_var { ";" rule_record_var } ")"
        /// </summary>
        private MatchRecordRule parseRuleRecord()
        {
            if (!peek(LexemType.Identifier, LexemType.ParenOpen))
                return null;

            var identifier = parseType();
            skip();

            var node = new MatchRecordRule { Identifier = identifier };
            node.FieldRules.Add(ensure(parseRuleRecordVar, ParserMessages.MatchRuleExpected));
            while(check(LexemType.Semicolon))
                node.FieldRules.Add(ensure(parseRuleRecordVar, ParserMessages.MatchRuleExpected));

            ensure(LexemType.ParenClose, ParserMessages.SymbolExpected, ")");

            return node;
        }