Пример #1
0
        private Production_Rule Parse_Production_Rule()
        {
            var             _backtrack = _scanResult.CurrentReadIndex;
            Production_Rule _self      = null;

            var _production_name           = Parse_Production_Name();;
            var _opt_whitespace_sequence_1 = Parse_Whitespace_Sequence();
            var _rule_name_sequence        = Parse_Rule_Name_Sequence();
            var _opt_whitespace_sequence_2 = Parse_Whitespace_Sequence();
            var _semi_colon = Parse_Semi_Colon();
            var _opt_whitespace_sequence_3 = Parse_Whitespace_Sequence();

            if (_production_name != null && _rule_name_sequence != null && _semi_colon != null)
            {
                _self = new Production_Rule(_production_name, _opt_whitespace_sequence_1, _rule_name_sequence, _opt_whitespace_sequence_2, _semi_colon, _opt_whitespace_sequence_3);
            }
            else
            {
                _self = null;
            }


            UpdateBacktrackIndex(_self, _backtrack);


            return(_self);
        }
        public Production_Rule_Sequence(Production_Rule _production_rule, Production_Rule_Sequence _self_production_rule_sequence = null)
        {
            // set values
            production_rule = _production_rule;

            // add to dictionary
            Add(production_rule);
            Add(self_production_rule_sequence);

            // set properties
            UpdateProperties("Production-Rule-Sequence", RecursiveProperty.Right);
        }
        public Production_Rule_Sequence(Whitespace_Sequence _opt_whitespace_sequence_1, Production_Rule _production_rule, Production_Rule_Sequence _self_production_rule_sequence = null)
        {
            // set values
            opt_whitespace_sequence_1     = _opt_whitespace_sequence_1;
            production_rule               = _production_rule;
            self_production_rule_sequence = _self_production_rule_sequence;

            // add to dictionary
            Add(opt_whitespace_sequence_1);
            Add(production_rule);
            Add(self_production_rule_sequence);

            // set properties
            UpdateProperties("Production-Rule-Sequence", RecursiveProperty.Right);
        }