Click here to Skip to main content
15,886,689 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 352.6K   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: VCalcParserTypes.h File 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><a href="annotated.html"><span>Classes</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
  </ul></div>
<h1>VCalcParserTypes.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
VisualCalc Parser Types. 
<p>
Defines some types used by the VisualCalc Parser. 
<p>
Definition in file <a class="el" href="_v_calc_parser_types_8h-source.html">VCalcParserTypes.h</a>.
<p>
<code>#include &quot;<a class="el" href="_v_calc_parser_exception_8h-source.html">VCalcParserException.h</a>&quot;</code><br>

<p>
<a href="_v_calc_parser_types_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_answer_item.html">AnswerItem</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type for an entry in the answers history.  <a href="struct_answer_item.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_v_calc_parser_types_8h.html#220d60bc2d35592fc080ea0476950ccd">__AFX_VCALCPARSERTYPES_H_INCLUDED__</a></td></tr>

<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef long double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_v_calc_parser_types_8h.html#4f8f973df1d3250e3882077b1a157e12">VALUES_TYPE</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of the results.  <a href="#4f8f973df1d3250e3882077b1a157e12"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b">TokenValue</a> { <br>
&nbsp;&nbsp;<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b887a188d6195a91e82411893afbdff24">TV_NUMBER</a>, 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b4e0c2f8ef0750e35c5f47bd6a36391e2">TV_IDENTIFIER</a>, 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b3bca2c7b3b6a043183c50e11e7f4b534">TV_END</a>, 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b3ff810da13056b98fb924eaa920960c7">TV_SEQ</a> =  ',', 
<br>
&nbsp;&nbsp;<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1bc8f8b372c1d21fc00b409b33069100e1">TV_PLUS</a> =  '+', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b08d7669a85850cf530299aa995e470c3">TV_MINUS</a> =  '-', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b95a48dda0851ef4be2c51aae6e2d4efc">TV_MUL</a> =  '*', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1bf4b308ef5ba5a98a84ac3bdb126d690e">TV_DIV</a> =  '/', 
<br>
&nbsp;&nbsp;<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b4a32865f8ffb066f80da04d3da26e393">TV_POW</a> =  '^', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b38c8eed39f1ca29ef23333f3de8c9ca7">TV_MOD</a> =  '', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b1fa99afdfbdb0df8e7818b483b7f132e">TV_FACT</a> =  '!', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1bab51e45caf0ee25d915cef9f61d0be89">TV_DEG</a> =  '�', 
<br>
&nbsp;&nbsp;<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b2ee4d22532f74dca90d62588fe798ac3">TV_LP</a> =  '(', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b6f101ce61dce4e614442df82e7e9acd1">TV_RP</a> =  ')', 
<a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b309e5d1b3885dd47b57d0bf8282b6dd1">TV_ASSIGN</a> =  '='
<br>
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of the Tokens.  <a href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b">More...</a><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="220d60bc2d35592fc080ea0476950ccd"></a><!-- doxytag: member="VCalcParserTypes.h::__AFX_VCALCPARSERTYPES_H_INCLUDED__" ref="220d60bc2d35592fc080ea0476950ccd" 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">#define __AFX_VCALCPARSERTYPES_H_INCLUDED__          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="_v_calc_parser_types_8h-source.html#l00009">9</a> of file <a class="el" href="_v_calc_parser_types_8h-source.html">VCalcParserTypes.h</a>.    </td>
  </tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="4f8f973df1d3250e3882077b1a157e12"></a><!-- doxytag: member="VCalcParserTypes.h::VALUES_TYPE" ref="4f8f973df1d3250e3882077b1a157e12" 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"><a class="el" href="_v_calc_parser_types_8h.html#4f8f973df1d3250e3882077b1a157e12">VALUES_TYPE</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Type of the results. 
<p>
Type defined to handle operands and results. 
<p>
Definition at line <a class="el" href="_v_calc_parser_types_8h-source.html#l00025">25</a> of file <a class="el" href="_v_calc_parser_types_8h-source.html">VCalcParserTypes.h</a>.    </td>
  </tr>
</table>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="0266b1a639975838e174584238b9bf1b"></a><!-- doxytag: member="VCalcParserTypes.h::TokenValue" ref="0266b1a639975838e174584238b9bf1b" 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">enum <a class="el" href="_v_calc_parser_types_8h.html#0266b1a639975838e174584238b9bf1b">TokenValue</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Type of the Tokens. 
<p>
Type defined for recognized separation tokens on the input stream. <dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b887a188d6195a91e82411893afbdff24"></a><!-- doxytag: member="TV_NUMBER" ref="0266b1a639975838e174584238b9bf1b887a188d6195a91e82411893afbdff24" args="" -->TV_NUMBER</em>&nbsp;</td><td>
If a number is read (integer of floating point) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b4e0c2f8ef0750e35c5f47bd6a36391e2"></a><!-- doxytag: member="TV_IDENTIFIER" ref="0266b1a639975838e174584238b9bf1b4e0c2f8ef0750e35c5f47bd6a36391e2" args="" -->TV_IDENTIFIER</em>&nbsp;</td><td>
If an identifier is read (variable or function) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b3bca2c7b3b6a043183c50e11e7f4b534"></a><!-- doxytag: member="TV_END" ref="0266b1a639975838e174584238b9bf1b3bca2c7b3b6a043183c50e11e7f4b534" args="" -->TV_END</em>&nbsp;</td><td>
If the end of the expression was reached </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b3ff810da13056b98fb924eaa920960c7"></a><!-- doxytag: member="TV_SEQ" ref="0266b1a639975838e174584238b9bf1b3ff810da13056b98fb924eaa920960c7" args="" -->TV_SEQ</em>&nbsp;</td><td>
If a '<b>,</b>' is read (function parameters list) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1bc8f8b372c1d21fc00b409b33069100e1"></a><!-- doxytag: member="TV_PLUS" ref="0266b1a639975838e174584238b9bf1bc8f8b372c1d21fc00b409b33069100e1" args="" -->TV_PLUS</em>&nbsp;</td><td>
If a '<b>+</b>' is read (Addition or unary plus) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b08d7669a85850cf530299aa995e470c3"></a><!-- doxytag: member="TV_MINUS" ref="0266b1a639975838e174584238b9bf1b08d7669a85850cf530299aa995e470c3" args="" -->TV_MINUS</em>&nbsp;</td><td>
If a '<b>-</b>' is read (Subtraction or unary minus) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b95a48dda0851ef4be2c51aae6e2d4efc"></a><!-- doxytag: member="TV_MUL" ref="0266b1a639975838e174584238b9bf1b95a48dda0851ef4be2c51aae6e2d4efc" args="" -->TV_MUL</em>&nbsp;</td><td>
If a '<b>*</b>' is read (multiplication) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1bf4b308ef5ba5a98a84ac3bdb126d690e"></a><!-- doxytag: member="TV_DIV" ref="0266b1a639975838e174584238b9bf1bf4b308ef5ba5a98a84ac3bdb126d690e" args="" -->TV_DIV</em>&nbsp;</td><td>
If a '<b>/</b>' is read (Division) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b4a32865f8ffb066f80da04d3da26e393"></a><!-- doxytag: member="TV_POW" ref="0266b1a639975838e174584238b9bf1b4a32865f8ffb066f80da04d3da26e393" args="" -->TV_POW</em>&nbsp;</td><td>
If a '<b>^</b>' is read (Power) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b38c8eed39f1ca29ef23333f3de8c9ca7"></a><!-- doxytag: member="TV_MOD" ref="0266b1a639975838e174584238b9bf1b38c8eed39f1ca29ef23333f3de8c9ca7" args="" -->TV_MOD</em>&nbsp;</td><td>
If a '<b>%</b>' is read (Modulus) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b1fa99afdfbdb0df8e7818b483b7f132e"></a><!-- doxytag: member="TV_FACT" ref="0266b1a639975838e174584238b9bf1b1fa99afdfbdb0df8e7818b483b7f132e" args="" -->TV_FACT</em>&nbsp;</td><td>
If a '<b>!</b>' is read (Factorial) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1bab51e45caf0ee25d915cef9f61d0be89"></a><!-- doxytag: member="TV_DEG" ref="0266b1a639975838e174584238b9bf1bab51e45caf0ee25d915cef9f61d0be89" args="" -->TV_DEG</em>&nbsp;</td><td>
If a '<b>�</b>' is read (degrees to radians) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b2ee4d22532f74dca90d62588fe798ac3"></a><!-- doxytag: member="TV_LP" ref="0266b1a639975838e174584238b9bf1b2ee4d22532f74dca90d62588fe798ac3" args="" -->TV_LP</em>&nbsp;</td><td>
If a '<b>(</b>' is read (opening parenthesis) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b6f101ce61dce4e614442df82e7e9acd1"></a><!-- doxytag: member="TV_RP" ref="0266b1a639975838e174584238b9bf1b6f101ce61dce4e614442df82e7e9acd1" args="" -->TV_RP</em>&nbsp;</td><td>
If a '<b>)</b>' is read (closing parenthesis) </td></tr>
<tr><td valign="top"><em><a class="anchor" name="0266b1a639975838e174584238b9bf1b309e5d1b3885dd47b57d0bf8282b6dd1"></a><!-- doxytag: member="TV_ASSIGN" ref="0266b1a639975838e174584238b9bf1b309e5d1b3885dd47b57d0bf8282b6dd1" args="" -->TV_ASSIGN</em>&nbsp;</td><td>
If a '<b>=</b>' is read (Assignation) </td></tr>
</table>
</dl>

<p>
Definition at line <a class="el" href="_v_calc_parser_types_8h-source.html#l00034">34</a> of file <a class="el" href="_v_calc_parser_types_8h-source.html">VCalcParserTypes.h</a>.    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Mon Feb 6 23:55:55 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