/// <summary> /// Detects the existence of sign operators before a number or variable. /// </summary> /// <returns>CValue object representing an operation.</returns> private CValue Sign() { bool isNegative = false; Token token = null; if (_currentToken == "+" || _currentToken == "-") { token = _currentToken; isNegative = (_currentToken == "-"); NextToken(); } CValue function = Paren(); if (isNegative) { function = new CSignNeg(function); } return(function); }
/// <summary> /// Sign(): This method detects the existence of sign operators before /// a number or variable. /// </summary> /// <returns>CValue object representing an operation.</returns> private CValue Sign() { bool bNeg = false; Parser.Token oToken = null; if (m_currentToken == "+" || m_currentToken == "-") { oToken = m_currentToken; bNeg = (m_currentToken == "-"); PositionNextToken(); } //CValue oFunc = Function(); // sdh: should be function when ready. CValue oFunc = Paren(); if (bNeg) { CheckParms(oToken, oFunc); oFunc = new CSignNeg(oFunc); } return(oFunc); }
/// <summary> /// Sign(): This method detects the existence of sign operators before /// a number or variable. /// </summary> /// <returns>CValue object representing an operation.</returns> private CValue Sign() { bool bNeg = false; Parser.Token oToken = null; if( m_currentToken == "+" || m_currentToken == "-" ) { oToken = m_currentToken; bNeg = (m_currentToken == "-"); PositionNextToken(); } //CValue oFunc = Function(); // sdh: should be function when ready. CValue oFunc = Paren(); if( bNeg ) { CheckParms( oToken, oFunc); oFunc = new CSignNeg( oFunc ); } return oFunc; }