Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Visual Calc v3.0 - A new dimension for the desktop calculator

, 28 Apr 2006 CPOL
How to start programming a parser.
visualcalc224_bin_20060206.zip
Visual Calc.exe
visualcalc224_lib_20060206.zip
mfc42.dll
msvcrt.dll
msvcp60.dll
visualcalc224_src_20060206.zip
res
About.ico
AboutFrame.bmp
CodeProject.ico
Doxygen.ico
function.ico
Help.ico
ico00001.ico
operator.ico
switch.ico
Visual Calc.ico
visualst.ico
WinXP.ico
Visual Calc.dsw
Visual Calc.dsp
visualcalc300_bin_20060418.zip
VisualCalc.exe
VCalcParser.dll
visualcalc300_lib_20060418.zip
msvcrt.dll
msvcp71.dll
msvcr71.dll
MFC71.dll
visualcalc300_parser-doc_20060418.zip
html
class_c_answer_requested_not_found_exception.png
class_c_closing_parenthesis_expected_exception.png
class_c_constant_assignation_exception.png
class_c_division_by_zero_exception.png
class_c_domain_exception.png
class_c_dom_parameters_must_be_integers_exception.png
class_c_dom_parameters_must_be_positive_exception.png
class_c_dom_parameter_must_be_an_integer_exception.png
class_c_dom_parameter_must_be_positive_exception.png
class_c_factorial_def_for_positive_ints_exception.png
class_c_function_exception.png
class_c_function_not_supported_exception.png
class_c_illegal_use_of_fonction_name_exception.png
class_c_implicit_multiplication_exception.png
class_c_literal_assignation_exception.png
class_c_mathematic_exception.png
class_c_mathematic_expression_expected_exception.png
class_c_math_parameter_must_be_an_integer_exception.png
class_c_math_parameter_must_be_positive_exception.png
class_c_n_must_be_positive_exception.png
class_c_parameter_exception.png
class_c_parameter_out_of_range_exception.png
class_c_parser_exception.png
class_c_period_unexpected_exception.png
class_c_p_must_be_positive_exception.png
class_c_p_must_be_smaller_than_n_exception.png
class_c_syntax_exception.png
class_c_too_few_parameters_exception.png
class_c_too_many_parameters_exception.png
class_c_undefined_variable_exception.png
class_c_unexpected_character_exception.png
class_c_unknown_exception.png
class_c_unknown_function_called_exception.png
class_c_variable_exception.png
class_c_v_calc_parser_exception.png
Copie de form_0.png
Copie de form_1.png
Copie de form_10.png
Copie de form_11.png
Copie de form_12.png
Copie de form_2.png
Copie de form_6.png
Copie de form_7.png
Copie de form_8.png
Copie de form_9.png
doxygen.png
form_0.png
form_1.png
form_10.png
form_11.png
form_12.png
form_2.png
form_3.png
form_4.png
form_5.png
form_6.png
form_7.png
form_8.png
form_9.png
tab_b.gif
tab_l.gif
tab_r.gif
_formulas.tex
visualcalc300_parser-src_20060418.zip
VCalcParser.lib
visualcalc300_src_20060418.zip
bin
lib
VCalcParser
doc
Doxygen.cfg
VisualCalc
res
About.ico
AboutFrame.bmp
CodeProject.ico
Doxygen.ico
errcodes.ico
function.ico
Help.ico
operator.ico
switch.ico
VisualCalc.ico
VisualCalc.manifest
visualst.ico
WinXP.ico
VCalcParser.lib
visualcalcparser250_doc_20060206.zip
doc
Doxygen.cfg
html
class_c_answer_requested_not_found_exception.png
class_c_closing_parenthesis_expected_exception.png
class_c_constant_assignation_exception.png
class_c_division_by_zero_exception.png
class_c_domain_exception.png
class_c_dom_parameters_must_be_integers_exception.png
class_c_dom_parameters_must_be_positive_exception.png
class_c_dom_parameter_must_be_an_integer_exception.png
class_c_dom_parameter_must_be_positive_exception.png
class_c_factorial_def_for_positive_ints_exception.png
class_c_function_exception.png
class_c_function_not_supported_exception.png
class_c_illegal_use_of_fonction_name_exception.png
class_c_implicit_multiplication_exception.png
class_c_literal_assignation_exception.png
class_c_mathematic_exception.png
class_c_mathematic_expression_expected_exception.png
class_c_math_parameter_must_be_an_integer_exception.png
class_c_math_parameter_must_be_positive_exception.png
class_c_n_must_be_positive_exception.png
class_c_parameter_exception.png
class_c_parameter_out_of_range_exception.png
class_c_parser_exception.png
class_c_period_unexpected_exception.png
class_c_p_must_be_positive_exception.png
class_c_p_must_be_smaller_than_n_exception.png
class_c_syntax_exception.png
class_c_too_few_parameters_exception.png
class_c_too_many_parameters_exception.png
class_c_undefined_variable_exception.png
class_c_unexpected_character_exception.png
class_c_unknown_exception.png
class_c_unknown_function_called_exception.png
class_c_variable_exception.png
class_c_v_calc_parser_exception.png
Copie de form_0.png
Copie de form_1.png
Copie de form_10.png
Copie de form_11.png
Copie de form_12.png
Copie de form_2.png
Copie de form_6.png
Copie de form_7.png
Copie de form_8.png
Copie de form_9.png
doxygen.png
form_0.png
form_1.png
form_10.png
form_11.png
form_12.png
form_2.png
form_3.png
form_4.png
form_5.png
form_6.png
form_7.png
form_8.png
form_9.png
tab_b.gif
tab_l.gif
tab_r.gif
_formulas.tex
visualcalcparser250_src_20060206.zip
visualcalc_demo.zip
Visual Calc.exe
visualcalc_libs.zip
msvcp60.dll
mfc42.dll
msvcrt.dll
visualcalc_parser.zip
visualcalc_src.zip
About.ico
AboutFrame.bmp
CodeProject.ico
function.ico
Help.ico
ico00001.ico
operator.ico
switch.ico
Visual Calc.ico
visualst.ico
WinXP.ico
Visual Calc.dsp
Visual Calc.dsw
/* VCalcParserException.cpp
 *
 * Copyright (c) 2004-2006 by toxcct. All rights reserved.
 * Consult your license regarding permissions and restrictions.
 */

/**
 * @file VCalcParserException.cpp
 * @brief VisualCalc Parser exceptions implementations.
 *
 * Implements the constructors of the classes defined for the Parser exceptions.
 */

#include "stdafx.h"
#include "VCalcParserException.h"


/**
 * @brief Constructor of the CVCalcParserException class.
 * @param enExceptionNumber The number of the error, according to the ExceptionNumbers enumeration.
 * @param strExceptionMsg The description message of the error.
 * @param iErrorPos The position where the error occured in the formula typed by the user to be parsed.
 *
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class ;
 *   it only provides an interface for the inheritance hierarchy.
 */
CVCalcParserException::CVCalcParserException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos) {
	this->m_enExceptionNumber = enExceptionNumber;
	this->m_strExceptionMsg	  = strExceptionMsg;
	this->m_iErrorPos		  = iErrorPos;
}

/**
 * @brief Destructor of the CVCalcParserException class.
 *
 * As there is no dynamically allocated memory within a parser exception,
 *   the destructor is quite useless here.<BR>
 * Moreover, it is set <I>virtual</I> for an inheritance purpose.
 */
CVCalcParserException::~CVCalcParserException() {
	this->m_enExceptionNumber = ENB_NONE;
	this->m_strExceptionMsg	  = "";
	this->m_iErrorPos		  = -1;
}

/**
 * @brief Returns the code number of an exception.
 * @return the exception code number corresponding to the real exception thrown.
 *
 * This function is from the public interface of the exceptions base class.<BR>
 * It returns the correct ExceptionNumbers value corresponding to the exception that is thrown.<BR>
 * Such a number is no longer hard-coded through a constructor parameter.
 *   Each Exception class constructor now internaly initializes this value.
 */
CVCalcParserException::ExceptionNumbers CVCalcParserException::GetExceptionNumber() {
	return this->m_enExceptionNumber;
}

/**
 * @brief Returns the description message of an exception.
 * @return the exception description message corresponding to the exception thrown.
 *
 * This function is from the public interface of the exceptions base class.<BR>
 * It returns the correct descrption message corresponding to the exception that is thrown.<BR>
 * Such a message is templated, whose text is internaly initialized by each Exception class constructor.
 *   Sometimes, messages may have to insert an additional information to complete the description.
 *   Such an information is passed as parameter to the parameter.
 */
std::string CVCalcParserException::GetMessage() {
	return this->m_strExceptionMsg;
}

/**
 * @brief Returns the error position of an exception.
 * @return the error position for the exception thrown.
 *
 * This function is from the public interface of the exceptions base class.<BR>
 * It returns the error position where the exception occured.<BR>
 * Each Exception class constructor always initializes this value from a received parameter.
 */
long CVCalcParserException::GetErrorPos() {
	return this->m_iErrorPos;
}



/************************************************************************/
/* CSyntaxException derived classes                                     */
/************************************************************************/

/**
 * @brief Constructor of the Syntax errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CSyntaxException::CSyntaxException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Syntax exceptions category.
 */
CSyntaxException::~CSyntaxException() {
}

/**
 * @brief Constructor for an Unexpected Character exception
 * @param cCharacter Character which is unexpected.
 * @param iErrorPos The position of the error.
 *
 * Creates an Unexpected Character exception.
 */
CUnexpectedCharacterException::CUnexpectedCharacterException(char cCharacter, int iErrorPos) 
		: CSyntaxException(ENB_SYN_UNEXPECTED_CHARACTER,
						   std::string("Unexpected character '") + cCharacter + "'",
						   iErrorPos) {
}

/**
 * @brief Destructor of an Unexpected Character exception.
 */
CUnexpectedCharacterException::~CUnexpectedCharacterException() {
}


/**
 * @brief Constructor for a Period Character Unexpected exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Period Character Unexpected exception.
 */
CPeriodUnexpectedException::CPeriodUnexpectedException(int iErrorPos)
		: CSyntaxException(ENB_SYN_DIGIT_EXPECTED,
						   "Period character unexpected ('.')",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Period Character Unexpected exception.
 */
CPeriodUnexpectedException::~CPeriodUnexpectedException() {
}


/**
 * @brief Constructor for a Closing Parenthesis Expected exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Closing Parenthesis Expected exception.
 */
CClosingParenthesisExpectedException::CClosingParenthesisExpectedException(int iErrorPos)
		: CSyntaxException(ENB_SYN_CLOSING_PARENTHESIS_EXPECTED,
						   "')' expected",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Closing Parenthesis Expected exception.
 */
CClosingParenthesisExpectedException::~CClosingParenthesisExpectedException() {
}


/**
 * @brief Constructor for a Mathematic Expression Expected exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Mathematic Expression Expected exception.
 */
CMathematicExpressionExpectedException::CMathematicExpressionExpectedException(int iErrorPos)
		: CSyntaxException(ENB_SYN_MATHEMATIC_EXPRESSION_EXPECTED,
						   "Mathematic expression expected",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Mathematic Expression Expected exception.
 */
CMathematicExpressionExpectedException::~CMathematicExpressionExpectedException() {
}


/************************************************************************/
/* CMathematicException derived classes                                 */
/************************************************************************/

/**
 * @brief Constructor of the Mathematic errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The Position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CMathematicException::CMathematicException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Mathematic exceptions category.
 */
CMathematicException::~CMathematicException() {
}


/**
 * @brief Constructor for a Division by Zero exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Division by Zero exception.
 */
CDivisionByZeroException::CDivisionByZeroException(int iErrorPos)
		: CMathematicException(ENB_MTH_DIVISION_BY_ZERO,
							   "Division by 0",
							   iErrorPos) {
}

/**
 * @brief Destructor of a Division by Zero exception.
 */
CDivisionByZeroException::~CDivisionByZeroException() {
}


/**
 * @brief Constructor for a N Must Be Positive exception
 * @param iErrorPos The position of the error.
 *
 * Creates a N Must Be Positive exception.
 */
CNMustBePositiveException::CNMustBePositiveException(int iErrorPos)
		: CMathematicException(ENB_MTH_N_MUST_BE_POSITIVE,
							   "'n' must be positive",
							   iErrorPos) {
}

/**
 * @brief Destructor of a N Must Be Positive exception.
 */
CNMustBePositiveException::~CNMustBePositiveException() {
}


/**
 * @brief Constructor for a P Must Be Positive exception
 * @param iErrorPos The position of the error.
 *
 * Creates a P Must Be Positive exception.
 */
CPMustBePositiveException::CPMustBePositiveException(int iErrorPos)
		: CMathematicException(ENB_MTH_P_MUST_BE_POSITIVE,
							   "'p' must be positive",
							   iErrorPos) {
}

/**
 * @brief Destructor of a P Must Be Positive exception.
 */
CPMustBePositiveException::~CPMustBePositiveException() {
}


/**
 * @brief Constructor for a P Must Be Smaller than N exception
 * @param iErrorPos The position of the error.
 *
 * Creates a P Must Be Smaller than N exception.
 */
CPMustBeSmallerThanNException::CPMustBeSmallerThanNException(int iErrorPos)
		: CMathematicException(ENB_MTH_P_MUST_BE_SMALLER_THAN_N,
							   "'p' must be smaller than 'n'",
							   iErrorPos) {
}

/**
 * @brief Destructor of a P Must Be Smaller than N exception.
 */
CPMustBeSmallerThanNException::~CPMustBeSmallerThanNException() {
}


/**
 * @brief Constructor for a Factorial Is Defined For Positive Integers exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Factorial Is Defined For Positive Integers exception.
 */
CFactorialDefForPositiveIntsException::CFactorialDefForPositiveIntsException(int iErrorPos)
		: CMathematicException(ENB_MTH_FACTORIAL_DEF_FOR_POSITIVE_INTS,
							   "A factorial is defined for positive integers",
							   iErrorPos) {
}

/**
 * @brief Destructor of a Factorial Is Defined For Positive Integers exception.
 */
CFactorialDefForPositiveIntsException::~CFactorialDefForPositiveIntsException() {
}


/**
 * @brief Constructor for a Parameter Out Of Range exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameter Out Of Range exception.
 */
CParameterOutOfRangeException::CParameterOutOfRangeException(int iErrorPos)
		: CMathematicException(ENB_MTH_PARAMETER_OUT_OF_RANGE,
							   "Parameter out of range",
							   iErrorPos) {
}

/**
 * @brief Destructor of a Parameter Out Of Range exception.
 */
CParameterOutOfRangeException::~CParameterOutOfRangeException() {
}


/**
 * @brief Constructor for a Parameter Must Be Positive exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameter Must Be Positive exception.
 */
CMathParameterMustBePositiveException::CMathParameterMustBePositiveException(int iErrorPos)
		: CMathematicException(ENB_MTH_PARAMETER_MUST_BE_POSITIVE,
							   "Parameter must be positive",
							   iErrorPos) {
}

/**
 * @brief Destructor of a Parameter Must Be Positive exception.
 */
CMathParameterMustBePositiveException::~CMathParameterMustBePositiveException() {
}


/**
 * @brief Constructor for a Parameter Must Be An Integer exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameter Must Be An Integer exception.
 */
CMathParameterMustBeAnIntegerException::CMathParameterMustBeAnIntegerException(int iErrorPos)
		: CMathematicException(ENB_MTH_PARAMETER_MUST_BE_AN_INTEGER,
							   "Parameter must be an integer",
							   iErrorPos) {
}

/**
 * @brief Destructor of a Parameter Must Be An Integer exception.
 */
CMathParameterMustBeAnIntegerException::~CMathParameterMustBeAnIntegerException() {
}



/************************************************************************/
/* CFunctionException derived classes                                   */
/************************************************************************/

/**
 * @brief Constructor of the Functions errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The Position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CFunctionException::CFunctionException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Functions exceptions category.
 */
CFunctionException::~CFunctionException() {
}


/**
 * @brief Constructor for an Unknown Function Called exception
 * @param strFunctionName Name of the function.
 * @param iErrorPos The position of the error.
 *
 * Creates an Unknown Function Called exception.
 */
CUnknownFunctionCalledException::CUnknownFunctionCalledException(const std::string& strFunctionName, int iErrorPos)
		: CFunctionException(ENB_FCT_UNKNOWN_FUNCTION_CALLED,
							 "Unknown function called ('" + strFunctionName + "')",
							 iErrorPos) {
}

/**
 * @brief Destructor of an Unknown Function Called exception.
 */
CUnknownFunctionCalledException::~CUnknownFunctionCalledException() {
}


/**
 * @brief Constructor for an Implicit Multiplication Not Supported exception
 * @param strVariableName Name of the variable.
 * @param iErrorPos The position of the error.
 *
 * Creates an Implicit Multiplication Not Supported exception.
 */
CImplicitMultiplicationException::CImplicitMultiplicationException(const std::string& strVariableName, int iErrorPos)
		: CFunctionException(ENB_FCT_IMPLICIT_MULTIPLICATION,
							 "Implicit multiplication not supported ('" + strVariableName + "')",
							 iErrorPos) {
}

/**
 * @brief Destructor of an Implicit Multiplication Not Supported exception.
 */
CImplicitMultiplicationException::~CImplicitMultiplicationException() {
}


/**
 * @brief Constructor for an Illegal Use Of Function Name exception
 * @param strFunctionName Name of the function.
 * @param iErrorPos The position of the error.
 *
 * Creates an Illegal Use Of Function Name exception.
 */
CIllegalUseOfFonctionNameException::CIllegalUseOfFonctionNameException(const std::string& strFunctionName, int iErrorPos)
		: CFunctionException(ENB_FCT_ILLEGAL_USE_OF_FUNCTION_NAME,
							 "Illegal use of function name ('" + strFunctionName + "')",
							 iErrorPos) {
}

/**
 * @brief Destructor of an Illegal Use Of Function Name exception.
 */
CIllegalUseOfFonctionNameException::~CIllegalUseOfFonctionNameException() {
}



/************************************************************************/
/* CParameterException derived classes                                  */
/************************************************************************/

/**
 * @brief Constructor of the Parameters errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The Position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CParameterException::CParameterException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Parameters exceptions category.
 */
CParameterException::~CParameterException() {
}


/**
 * @brief Constructor for a Too Few Parameters exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Too Few Parameters exception.
 */
CTooFewParametersException::CTooFewParametersException(int iErrorPos)
		: CParameterException(ENB_PRM_TOO_FEW_PARAMETERS,
							  "Too few parameters. ',' expected",
							  iErrorPos) {
}

/**
 * @brief Destructor of a Too Few Parameters exception.
 */
CTooFewParametersException::~CTooFewParametersException() {
}


/**
 * @brief Constructor for a Too Many Parameters exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Too Many Parameters exception.
 */
CTooManyParametersException::CTooManyParametersException(int iErrorPos)
		: CParameterException(ENB_PRM_TOO_MANY_PARAMETERS,
							  "Too many parameters. ')' expected",
							  iErrorPos) {
}

/**
 * @brief Destructor of a Too Many Parameters exception.
 */
CTooManyParametersException::~CTooManyParametersException() {
}



/************************************************************************/
/* CVariableException derived classes                                   */
/************************************************************************/

/**
 * @brief Constructor of the Variables errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The Position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CVariableException::CVariableException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Variables exceptions category.
 */
CVariableException::~CVariableException() {
}


/**
 * @brief Constructor for a Cannot Assign A Constant exception
 * @param strConstantName Name of the constant.
 * @param iErrorPos The position of the error.
 *
 * Creates a Cannot Assign A Constant exception.
 */
CConstantAssignationException::CConstantAssignationException(const std::string& strConstantName, int iErrorPos)
		: CVariableException(ENB_VAR_CONSTANTASSIGNATION,
							 "Cannot assign a constant ('" + strConstantName + "')",
							 iErrorPos) {
}

/**
 * @brief Destructor of a Cannot Assign A Constant exception.
 */
CConstantAssignationException::~CConstantAssignationException() {
}


/**
 * @brief Constructor for a Cannot Assign a Literal exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Cannot Assign a Literal exception.
 */
CLiteralAssignationException::CLiteralAssignationException(int iErrorPos)
		: CVariableException(ENB_VAR_LITERALASSIGNATION,
							 "Cannot assign a literal",
							 iErrorPos) {
}

/**
 * @brief Destructor of a Cannot Assign a Literal exception.
 */
CLiteralAssignationException::~CLiteralAssignationException() {
}


/**
 * @brief Constructor for an Undefined Variable exception
 * @param strVariableName Name of the variable.
 * @param iErrorPos The position of the error.
 *
 * Creates an Undefined Variable exception.
 */
CUndefinedVariableException::CUndefinedVariableException(const std::string& strVariableName, int iErrorPos)
		: CVariableException(ENB_VAR_UNDEFINED_VARIABLE,
							 "Undefined variable '" + strVariableName + "'",
							 iErrorPos) {
}

/**
 * @brief Destructor of an Undefined Variable exception.
 */
CUndefinedVariableException::~CUndefinedVariableException() {
}



/************************************************************************/
/* CDomainException derived classes                                     */
/************************************************************************/

/**
 * @brief Constructor of the Domain errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The Position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CDomainException::CDomainException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Domain errors category.
 */
CDomainException::~CDomainException() {
}


/**
 * @brief Constructor for a The Answer Requested Was Not Found exception
 * @param iErrorPos The position of the error.
 *
 * Creates a The Answer Requested Was Not Found exception.
 */
CAnswerRequestedNotFoundException::CAnswerRequestedNotFoundException(int iErrorPos)
		: CDomainException(ENB_DMN_ANSWER_REQUESTED_NOT_FOUND,
						   "The answer requested was not found",
						   iErrorPos) {
}

/**
 * @brief Destructor of a The Answer Requested Was Not Found exception.
 */
CAnswerRequestedNotFoundException::~CAnswerRequestedNotFoundException() {
}


/**
 * @brief Constructor for a Parameter Must Be Positive exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameter Must Be Positive exception.
 */
CDomParameterMustBePositiveException::CDomParameterMustBePositiveException(int iErrorPos)
		: CDomainException(ENB_DMN_PARAMETER_MUST_BE_POSITIVE,
						   "Parameter must be positive",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Parameter Must Be Positive exception.
 */
CDomParameterMustBePositiveException::~CDomParameterMustBePositiveException() {
}


/**
 * @brief Constructor for a Parameter Must Be An Integer exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameter Must Be An Integer exception.
 */
CDomParameterMustBeAnIntegerException::CDomParameterMustBeAnIntegerException(int iErrorPos)
		: CDomainException(ENB_DMN_PARAMETER_MUST_BE_AN_INTEGER,
						   "Parameter must be an integer",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Parameter Must Be An Integer exception.
 */
CDomParameterMustBeAnIntegerException::~CDomParameterMustBeAnIntegerException() {
}


/**
 * @brief Constructor for a Parameters Must Be Positive exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameters Must Be Positive exception.
 */
CDomParametersMustBePositiveException::CDomParametersMustBePositiveException(int iErrorPos)
		: CDomainException(ENB_DMN_PARAMETERS_MUST_BE_POSITIVE,
						   "Parameters must be positive",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Parameters Must Be Positive exception.
 */
CDomParametersMustBePositiveException::~CDomParametersMustBePositiveException() {
}


/**
 * @brief Constructor for a Parameters Must Be Integers exception
 * @param iErrorPos The position of the error.
 *
 * Creates a Parameters Must Be Integers exception.
 */
CDomParametersMustBeIntegersException::CDomParametersMustBeIntegersException(int iErrorPos)
		: CDomainException(ENB_DMN_PARAMETERS_MUST_BE_INTEGERS,
						   "Parameters must be integers",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Parameters Must Be Integers exception.
 */
CDomParametersMustBeIntegersException::~CDomParametersMustBeIntegersException() {
}



/************************************************************************/
/* CParserException derived classes                                     */
/************************************************************************/

/**
 * @brief Constructor of the Parser errors category.
 * @param enExceptionNumber The exception code number.
 * @param strExceptionMsg The exception description message.
 * @param iErrorPos The Position of the error.
 *
 * The constructor only get the parameters and pass them to the base class constructor through the initializer list.<BR>
 * The constructor is set as a protected member to make the class abstract.<BR>
 * It must not be possible to instantiate the class.
 */
CParserException::CParserException(ExceptionNumbers enExceptionNumber, const std::string& strExceptionMsg, int iErrorPos)
		: CVCalcParserException(enExceptionNumber, strExceptionMsg, iErrorPos) {
}

/**
 * @brief Destructor of the Parser exceptions category.
 */
CParserException::~CParserException() {
}


/**
 * @brief Constructor for a Function Not Supported Yet Warning exception.
 * @param strFunctionName Name of the Function.
 * @param iErrorPos The position of the error.
 *
 * Creates a Function Not Supported Yet Warning exception.
 */
CFunctionNotSupportedException::CFunctionNotSupportedException(const std::string& strFunctionName, int iErrorPos)
		: CParserException(ENB_PRS_FUNCTION_NOT_SUPPORTED,
						   "Warning: Function not supported yet ('" + strFunctionName + "')",
						   iErrorPos) {
}

/**
 * @brief Destructor of a Function Not Supported Yet Warning exception.
 */
CFunctionNotSupportedException::~CFunctionNotSupportedException() {
}


/**
 * @brief Constructor for an Unknown Exception exception
 * @param iErrorPos The position of the error.
 *
 * Creates an Unknown Exception exception.
 */
CUnknownException::CUnknownException(int iErrorPos)
		: CParserException(ENB_PRS_UNKNOWN_EXCEPTION,
						   "Unknown exception",
						   iErrorPos) {
}

/**
 * @brief Destructor of an Unknown Exception exception.
 */
CUnknownException::~CUnknownException() {
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

toxcct
Software Developer (Senior) Accenture Technology Solutions
France France

Toxcct is an electronics guy who felt in love with programming at the age of 10 when he discovered C to play with Texas-Instruments calculators.
 
Few years later, he discovered "The C++ Language" from Bjarne Stroustrup ; a true transformation in his life.
 
Now, toxcct is experiencing the Web by developing Siebel CRM Applications for a living. He also respects very much the Web Standards (YES, a HTML/CSS code MUST validate !), and plays around with HTML/CSS/Javascript/Ajax/PHP and such.
 
_____
 
After four years of services as a Codeproject MVP, toxcct is now taking some distance as he doesn't like how things are going on the forums. he particularly doesn't accept how some totally ignorant people got the MVP Reward by only being arrogant and insulting while replying on the technical forums.
 


| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1411023.1 | Last Updated 28 Apr 2006
Article Copyright 2004 by toxcct
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid