Beispiel #1
0
 public factor_sequence(infix_operator_type2 _infix_operator_type2, factor _factor, factor_sequence _factor_sequence)
 {
     infix_operator_type2 = _infix_operator_type2;
     factor = _factor;
     self_factor_sequence = _factor_sequence;
     expression           = self_factor_sequence?.expression + infix_operator_type2.expression + factor.expression;
 }
Beispiel #2
0
        private factor Parse_factor()
        {
            if (_index >= _tokens.Count())
            {
                return(null);
            }


            factor _self = null;

            var _number = new NumberParser(_tokens, ref _index);// this picks up negative numbers but.....

            if (_number.number != null)
            {
                _self = new factor(_number.number); return(_self);
            }

            var _iterator = Parse_iterator();// this picks up negative numbers but.....

            if (_iterator != null)
            {
                _self = new factor(_iterator); return(_self);
            }


            var _conditional = Parse_conditional();

            if (_conditional != null)
            {
                _self = new factor(_conditional); return(_self);
            }


            var _function           = Parse_signed_function();
            var _function_parameter = Parse_function_parameter();

            if (_function_parameter != null)
            {
                _self = new factor(_function, _function_parameter);
                return(_self);
            }


            return(_self);
        }
Beispiel #3
0
 public factor_sequence(infix_operator_type2 _infix_operator_type2, factor _factor)
 {
     infix_operator_type2 = _infix_operator_type2;
     factor     = _factor;
     expression = infix_operator_type2.expression + factor.expression;
 }
Beispiel #4
0
 public term(factor _factor, factor_sequence _factor_sequence)
 {
     factor          = _factor;
     factor_sequence = _factor_sequence;
     expression      = factor.expression + factor_sequence.expression;
 }
Beispiel #5
0
 public term(factor _factor)
 {
     factor     = _factor;
     expression = factor.expression;
 }