Click here to Skip to main content
15,860,972 members
Articles / Desktop Programming / ATL

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

Rate me:
Please Sign up or sign in to vote.
3.62/5 (113 votes)
28 Apr 2006CPOL22 min read 346.3K   6.8K   104  
How to start programming a parser.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>VisualCalc Parser: CMathematicException Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.5 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<h1>CMathematicException Class Reference</h1><!-- doxytag: class="CMathematicException" --><!-- doxytag: inherits="CVCalcParserException" --><code>#include &lt;<a class="el" href="_v_calc_parser_exception_8h-source.html">VCalcParserException.h</a>&gt;</code>
<p>
<p>Inheritance diagram for CMathematicException:
<p><center><img src="class_c_mathematic_exception.png" usemap="#CMathematicException_map" border="0" alt=""></center>
<map name="CMathematicException_map">
<area href="class_c_v_calc_parser_exception.html" alt="CVCalcParserException" shape="rect" coords="0,0,259,24">
<area href="class_c_division_by_zero_exception.html" alt="CDivisionByZeroException" shape="rect" coords="269,112,528,136">
<area href="class_c_factorial_def_for_positive_ints_exception.html" alt="CFactorialDefForPositiveIntsException" shape="rect" coords="269,168,528,192">
<area href="class_c_math_parameter_must_be_an_integer_exception.html" alt="CMathParameterMustBeAnIntegerException" shape="rect" coords="269,224,528,248">
<area href="class_c_math_parameter_must_be_positive_exception.html" alt="CMathParameterMustBePositiveException" shape="rect" coords="269,280,528,304">
<area href="class_c_n_must_be_positive_exception.html" alt="CNMustBePositiveException" shape="rect" coords="269,336,528,360">
<area href="class_c_parameter_out_of_range_exception.html" alt="CParameterOutOfRangeException" shape="rect" coords="269,392,528,416">
<area href="class_c_p_must_be_positive_exception.html" alt="CPMustBePositiveException" shape="rect" coords="269,448,528,472">
<area href="class_c_p_must_be_smaller_than_n_exception.html" alt="CPMustBeSmallerThanNException" shape="rect" coords="269,504,528,528">
</map>
<a href="class_c_mathematic_exception-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Parent class for VisualCalc Mathematic Exceptions. 
<p>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_v_calc_parser_exception.html">CVCalcParserException</a> <p>
<a class="el" href="class_c_division_by_zero_exception.html">CDivisionByZeroException</a>, <a class="el" href="class_c_n_must_be_positive_exception.html">CNMustBePositiveException</a>, <a class="el" href="class_c_p_must_be_positive_exception.html">CPMustBePositiveException</a>, <a class="el" href="class_c_p_must_be_smaller_than_n_exception.html">CPMustBeSmallerThanNException</a>, <a class="el" href="class_c_factorial_def_for_positive_ints_exception.html">CFactorialDefForPositiveIntsException</a>, <a class="el" href="class_c_parameter_out_of_range_exception.html">CParameterOutOfRangeException</a>, <a class="el" href="class_c_math_parameter_must_be_positive_exception.html">CMathParameterMustBePositiveException</a>, <a class="el" href="class_c_math_parameter_must_be_an_integer_exception.html">CMathParameterMustBeAnIntegerException</a></dd></dl>
This class inherits from <a class="el" href="class_c_v_calc_parser_exception.html">CVCalcParserException</a> but remains abstract as it is a base class for every Mathematic errors.<br>
 Only the derived classes can be instanciated. 
<p>

<p>
Definition at line <a class="el" href="_v_calc_parser_exception_8h-source.html#l00255">255</a> of file <a class="el" href="_v_calc_parser_exception_8h-source.html">VCalcParserException.h</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_mathematic_exception.html#f059608dfc78f0e69cc3ba5b40335747">~CMathematicException</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor of the Mathematic exceptions category.  <a href="#f059608dfc78f0e69cc3ba5b40335747"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_mathematic_exception.html#1559e1dff1d090fd8f29b615a750b542">CMathematicException</a> (<a class="el" href="class_c_v_calc_parser_exception.html#f464e47c732b5e966f9814ce33ef54a2">ExceptionNumbers</a> enExceptionNumber, const std::string &amp;strExceptionMsg, int iErrorPos)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor of the Mathematic errors category.  <a href="#1559e1dff1d090fd8f29b615a750b542"></a><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="1559e1dff1d090fd8f29b615a750b542"></a><!-- doxytag: member="CMathematicException::CMathematicException" ref="1559e1dff1d090fd8f29b615a750b542" args="(ExceptionNumbers enExceptionNumber, const std::string &amp;strExceptionMsg, int iErrorPos)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">CMathematicException::CMathematicException           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="class_c_v_calc_parser_exception.html#f464e47c732b5e966f9814ce33ef54a2">ExceptionNumbers</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>enExceptionNumber</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const std::string &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>strExceptionMsg</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>iErrorPos</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [protected]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor of the Mathematic errors category. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>enExceptionNumber</em>&nbsp;</td><td>The exception code number. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>strExceptionMsg</em>&nbsp;</td><td>The exception description message. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>iErrorPos</em>&nbsp;</td><td>The Position of the error.</td></tr>
  </table>
</dl>
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. 
<p>
Definition at line <a class="el" href="_v_calc_parser_exception_8cpp-source.html#l00197">197</a> of file <a class="el" href="_v_calc_parser_exception_8cpp-source.html">VCalcParserException.cpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="f059608dfc78f0e69cc3ba5b40335747"></a><!-- doxytag: member="CMathematicException::~CMathematicException" ref="f059608dfc78f0e69cc3ba5b40335747" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">CMathematicException::~CMathematicException           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destructor of the Mathematic exceptions category. 
<p>

<p>
Definition at line <a class="el" href="_v_calc_parser_exception_8cpp-source.html#l00204">204</a> of file <a class="el" href="_v_calc_parser_exception_8cpp-source.html">VCalcParserException.cpp</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_v_calc_parser_exception_8h-source.html">VCalcParserException.h</a><li><a class="el" href="_v_calc_parser_exception_8cpp-source.html">VCalcParserException.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Feb 6 23:55:56 2006 for VisualCalc Parser by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address>
</body>
</html>

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)


Written By
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.



Comments and Discussions