Browse Source

Update scan-build report

tags/1.6.3
Carsten Larsen 3 years ago
parent
commit
fc9e506cfc

+ 39
- 44
scan-build/index.html View File

@@ -58,24 +58,22 @@ function ToggleDisplay(CheckButton, ClassName) {
<h1>amath - scan-build results</h1>

<table>
<tr><th>User:</th><td>cs@innolan.net</td></tr>
<tr><th>User:</th><td>carsten@kingster</td></tr>
<tr><th>Working Directory:</th><td>/home/carsten/amath</td></tr>
<tr><th>Command Line:</th><td>make</td></tr>
<tr><th>Clang Version:</th><td>clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
</td></tr>
<tr><th>Date:</th><td>Wed Jan 11 20:50:46 2017</td></tr>
<tr><th>Date:</th><td>Sat Jan 28 22:08:32 2017</td></tr>
</table>
<h2>Bug Summary</h2><table>
<thead><tr><td>Bug Type</td><td>Quantity</td><td class="sorttable_nosort">Display?</td></tr></thead>
<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">19</td><td><center><input type="checkbox" id="AllBugsCheck" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr>
<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">18</td><td><center><input type="checkbox" id="AllBugsCheck" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr>
<tr><th>Dead store</th><th colspan=2></th></tr>
<tr><td class="SUMM_DESC">Dead assignment</td><td class="Q">3</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_dead_store_dead_assignment');" checked/></center></td></tr>
<tr><td class="SUMM_DESC">Dead increment</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_dead_store_dead_increment');" checked/></center></td></tr>
<tr><th>Logic error</th><th colspan=2></th></tr>
<tr><td class="SUMM_DESC">Assigned value is garbage or undefined</td><td class="Q">6</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_assigned_value_is_garbage_or_undefined');" checked/></center></td></tr>
<tr><td class="SUMM_DESC">Result of operation is garbage or undefined</td><td class="Q">8</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_result_of_operation_is_garbage_or_undefined');" checked/></center></td></tr>
<tr><th>Memory Error</th><th colspan=2></th></tr>
<tr><td class="SUMM_DESC">Memory leak</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_memory_error_memory_leak');" checked/></center></td></tr>
</table>
<h2>Reports</h2>

@@ -91,62 +89,59 @@ function ToggleDisplay(CheckButton, ClassName) {
<!-- REPORTBUGCOL -->
</tr></thead>
<tbody>
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">347</td><td class="Q">27</td><td><a href="report-e39bf1.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-e39bf1.html" -->
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">346</td><td class="Q">25</td><td><a href="report-831a75.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-831a75.html" -->
</tr>
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">346</td><td class="Q">25</td><td><a href="report-d645c4.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-d645c4.html" -->
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">347</td><td class="Q">27</td><td><a href="report-f61e62.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-f61e62.html" -->
</tr>
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">271</td><td class="Q">33</td><td><a href="report-75dc7f.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-75dc7f.html" -->
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">271</td><td class="Q">33</td><td><a href="report-fcf014.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-fcf014.html" -->
</tr>
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">350</td><td class="Q">41</td><td><a href="report-a0ecbd.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-a0ecbd.html" -->
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">351</td><td class="Q">44</td><td><a href="report-cc9ed8.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-cc9ed8.html" -->
</tr>
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">351</td><td class="Q">44</td><td><a href="report-d9685e.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-d9685e.html" -->
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">350</td><td class="Q">41</td><td><a href="report-27428e.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-27428e.html" -->
</tr>
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>lib/dconv/dragon4.cpp</td><td class="DESC">BigInt_ShiftLeft</td><td class="Q">702</td><td class="Q">24</td><td><a href="report-1eae93.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-1eae93.html" -->
<tr class="bt_logic_error_assigned_value_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Assigned value is garbage or undefined</td><td>dconv/dragon4.cpp</td><td class="DESC">BigInt_ShiftLeft</td><td class="Q">702</td><td class="Q">24</td><td><a href="report-a2ee02.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-a2ee02.html" -->
</tr>
<tr class="bt_dead_store_dead_assignment"><td class="DESC">Dead store</td><td class="DESC">Dead assignment</td><td>lib/real/expm1.c</td><td class="DESC">expm1</td><td class="Q">167</td><td class="Q">1</td><td><a href="report-4c2709.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-4c2709.html" -->
<tr class="bt_dead_store_dead_assignment"><td class="DESC">Dead store</td><td class="DESC">Dead assignment</td><td>real/expm1.c</td><td class="DESC">expm1</td><td class="Q">166</td><td class="Q">1</td><td><a href="report-e79f68.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-e79f68.html" -->
</tr>
<tr class="bt_dead_store_dead_assignment"><td class="DESC">Dead store</td><td class="DESC">Dead assignment</td><td>lib/real/expm1.c</td><td class="DESC">expm1</td><td class="Q">166</td><td class="Q">1</td><td><a href="report-0fbb45.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-0fbb45.html" -->
<tr class="bt_dead_store_dead_assignment"><td class="DESC">Dead store</td><td class="DESC">Dead assignment</td><td>real/expm1.c</td><td class="DESC">expm1</td><td class="Q">167</td><td class="Q">1</td><td><a href="report-273e84.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-273e84.html" -->
</tr>
<tr class="bt_dead_store_dead_assignment"><td class="DESC">Dead store</td><td class="DESC">Dead assignment</td><td>lib/real/pow.c</td><td class="DESC">pow</td><td class="Q">148</td><td class="Q">1</td><td><a href="report-db6763.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-db6763.html" -->
<tr class="bt_dead_store_dead_assignment"><td class="DESC">Dead store</td><td class="DESC">Dead assignment</td><td>real/pow.c</td><td class="DESC">pow</td><td class="Q">148</td><td class="Q">1</td><td><a href="report-3a56cc.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-3a56cc.html" -->
</tr>
<tr class="bt_dead_store_dead_increment"><td class="DESC">Dead store</td><td class="DESC">Dead increment</td><td>lib/dconv/dprint.cpp</td><td class="DESC">FormatScientific</td><td class="Q">385</td><td class="Q">1</td><td><a href="report-87283b.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-87283b.html" -->
<tr class="bt_dead_store_dead_increment"><td class="DESC">Dead store</td><td class="DESC">Dead increment</td><td>dconv/dprint.cpp</td><td class="DESC">FormatScientific</td><td class="Q">385</td><td class="Q">1</td><td><a href="report-40d42f.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-40d42f.html" -->
</tr>
<tr class="bt_memory_error_memory_leak"><td class="DESC">Memory Error</td><td class="DESC">Memory leak</td><td>app/main/parser.cpp</td><td class="DESC">Parse</td><td class="Q">61</td><td class="Q">6</td><td><a href="report-d82713.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-d82713.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">307</td><td class="Q">20</td><td><a href="report-4b20f3.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-4b20f3.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/dconv/dragon4.cpp</td><td class="DESC">BigInt_DivideWithRemainder_MaxQuotient9</td><td class="Q">631</td><td class="Q">38</td><td><a href="report-2088b3.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-2088b3.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>dconv/dragon4.cpp</td><td class="DESC">BigInt_DivideWithRemainder_MaxQuotient9</td><td class="Q">631</td><td class="Q">38</td><td><a href="report-262893.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-262893.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/dconv/dragon4.cpp</td><td class="DESC">BigInt_DivideWithRemainder_MaxQuotient9</td><td class="Q">660</td><td class="Q">39</td><td><a href="report-c9a3b1.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-c9a3b1.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>real/remp2.c</td><td class="DESC">rempio2</td><td class="Q">202</td><td class="Q">15</td><td><a href="report-e85ac2.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-e85ac2.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/real/remp2.c</td><td class="DESC">rempio2</td><td class="Q">202</td><td class="Q">15</td><td><a href="report-d27033.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-d27033.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">289</td><td class="Q">33</td><td><a href="report-020199.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-020199.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">307</td><td class="Q">20</td><td><a href="report-e9ab87.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-e9ab87.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>dconv/dragon4.cpp</td><td class="DESC">BigInt_DivideWithRemainder_MaxQuotient9</td><td class="Q">660</td><td class="Q">39</td><td><a href="report-b77ae8.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-b77ae8.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/dconv/dragon4.cpp</td><td class="DESC">BigInt_Multiply10</td><td class="Q">403</td><td class="Q">42</td><td><a href="report-d01db6.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-d01db6.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>dconv/dragon4.cpp</td><td class="DESC">BigInt_Multiply10</td><td class="Q">403</td><td class="Q">42</td><td><a href="report-27e74a.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-27e74a.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">222</td><td class="Q">23</td><td><a href="report-9786f8.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-9786f8.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">222</td><td class="Q">23</td><td><a href="report-762445.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-762445.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">329</td><td class="Q">23</td><td><a href="report-7ef7cd.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-7ef7cd.html" -->
</tr>
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>lib/real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">289</td><td class="Q">33</td><td><a href="report-0d2bf1.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-0d2bf1.html" -->
<tr class="bt_logic_error_result_of_operation_is_garbage_or_undefined"><td class="DESC">Logic error</td><td class="DESC">Result of operation is garbage or undefined</td><td>real/kremp2.c</td><td class="DESC">__kernel_rem_pio2</td><td class="Q">329</td><td class="Q">23</td><td><a href="report-4fd7ba.html#EndPath">View Report</a></td>
<!-- REPORTBUG id="report-4fd7ba.html" -->
</tr>
</tbody>
</table>

scan-build/report-0d2bf1.html → scan-build/report-020199.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 289, column 21</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '==' is a garbage value</td></tr>
</table>

scan-build/report-2088b3.html → scan-build/report-262893.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">File:</td><td>dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 631, column 51</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '-' is a garbage value</td></tr>
</table>

scan-build/report-4c2709.html → scan-build/report-273e84.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/expm1.c</td></tr>
<tr><td class="rowname">File:</td><td>real/expm1.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 167, column 10</a></td></tr>
<tr><td class="rowname">Description:</td><td>Value stored to 'y' is never read</td></tr>
</table>

scan-build/report-a0ecbd.html → scan-build/report-27428e.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 350, column 18</a></td></tr>
<tr><td class="rowname">Description:</td><td>Assigned value is garbage or undefined</td></tr>
</table>

scan-build/report-d01db6.html → scan-build/report-27e74a.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">File:</td><td>dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 403, column 38</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '*' is a garbage value</td></tr>
</table>

scan-build/report-db6763.html → scan-build/report-3a56cc.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/pow.c</td></tr>
<tr><td class="rowname">File:</td><td>real/pow.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 148, column 5</a></td></tr>
<tr><td class="rowname">Description:</td><td>Value stored to 'i1' is never read</td></tr>
</table>

scan-build/report-87283b.html → scan-build/report-40d42f.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/dconv/dprint.cpp</td></tr>
<tr><td class="rowname">File:</td><td>dconv/dprint.cpp</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 385, column 9</a></td></tr>
<tr><td class="rowname">Description:</td><td>Value stored to 'bufferSize' is never read</td></tr>
</table>

scan-build/report-e9ab87.html → scan-build/report-4b20f3.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 307, column 18</a></td></tr>
<tr><td class="rowname">Description:</td><td>The right operand of '*' is a garbage value</td></tr>
</table>

scan-build/report-7ef7cd.html → scan-build/report-4fd7ba.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 329, column 19</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '-' is a garbage value</td></tr>
</table>

scan-build/report-9786f8.html → scan-build/report-762445.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 222, column 24</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '+' is a garbage value</td></tr>
</table>

scan-build/report-d645c4.html → scan-build/report-831a75.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 346, column 18</a></td></tr>
<tr><td class="rowname">Description:</td><td>Assigned value is garbage or undefined</td></tr>
</table>

scan-build/report-1eae93.html → scan-build/report-a2ee02.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">File:</td><td>dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 702, column 22</a></td></tr>
<tr><td class="rowname">Description:</td><td>Assigned value is garbage or undefined</td></tr>
</table>

scan-build/report-c9a3b1.html → scan-build/report-b77ae8.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">File:</td><td>dconv/dragon4.cpp</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 660, column 51</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '-' is a garbage value</td></tr>
</table>

scan-build/report-d9685e.html → scan-build/report-cc9ed8.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 351, column 18</a></td></tr>
<tr><td class="rowname">Description:</td><td>Assigned value is garbage or undefined</td></tr>
</table>

+ 0
- 750
scan-build/report-d82713.html View File

@@ -1,750 +0,0 @@
<!doctype html>
<html>
<head>
<title>app/main/parser.cpp</title>
<style type="text/css">
body { color:#000000; background-color:#ffffff }
body { font-family:Helvetica, sans-serif; font-size:10pt }
h1 { font-size:14pt }
.code { border-collapse:collapse; width:100%; }
.code { font-family: "Monospace", monospace; font-size:10pt }
.code { line-height: 1.2em }
.comment { color: green; font-style: oblique }
.keyword { color: blue }
.string_literal { color: red }
.directive { color: darkmagenta }
.expansion { display: none; }
.macro:hover .expansion { display: block; border: 2px solid #FF0000; padding: 2px; background-color:#FFF0F0; font-weight: normal; -webkit-border-radius:5px; -webkit-box-shadow:1px 1px 7px #000; position: absolute; top: -1em; left:10em; z-index: 1 }
.macro { color: darkmagenta; background-color:LemonChiffon; position: relative }
.num { width:2.5em; padding-right:2ex; background-color:#eeeeee }
.num { text-align:right; font-size:8pt }
.num { color:#444444 }
.line { padding-left: 1ex; border-left: 3px solid #ccc }
.line { white-space: pre }
.msg { -webkit-box-shadow:1px 1px 7px #000 }
.msg { -webkit-border-radius:5px }
.msg { font-family:Helvetica, sans-serif; font-size:8pt }
.msg { float:left }
.msg { padding:0.25em 1ex 0.25em 1ex }
.msg { margin-top:10px; margin-bottom:10px }
.msg { font-weight:bold }
.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap }
.msgT { padding:0x; spacing:0x }
.msgEvent { background-color:#fff8b4; color:#000000 }
.msgControl { background-color:#bbbbbb; color:#000000 }
.mrange { background-color:#dfddf3 }
.mrange { border-bottom:1px solid #6F9DBE }
.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; }
.PathIndex { -webkit-border-radius:8px }
.PathIndexEvent { background-color:#bfba87 }
.PathIndexControl { background-color:#8c8c8c }
.PathNav a { text-decoration:none; font-size: larger }
.CodeInsertionHint { font-weight: bold; background-color: #10dd10 }
.CodeRemovalHint { background-color:#de1010 }
.CodeRemovalHint { border-bottom:1px solid #6F9DBE }
table.simpletable {
padding: 5px;
font-size:12pt;
margin:20px;
border-collapse: collapse; border-spacing: 0px;
}
td.rowname {
text-align:right; font-weight:bold; color:#444444;
padding-right:2ex; }
</style>
</head>
<body>
<!-- BUGDESC Potential leak of memory pointed to by 'result' -->

<!-- BUGTYPE Memory leak -->

<!-- BUGCATEGORY Memory Error -->

<!-- BUGFILE /home/carsten/amath/app/main/parser.cpp -->

<!-- FILENAME parser.cpp -->

<!-- FUNCTIONNAME Parse -->

<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 497c17486bc0dfd5d2e32d82e8b72b54 -->

<!-- BUGLINE 61 -->

<!-- BUGCOLUMN 9 -->

<!-- BUGPATHLENGTH 6 -->

<!-- BUGMETAEND -->
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>app/main/parser.cpp</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 61, column 9</a></td></tr>
<tr><td class="rowname">Description:</td><td>Potential leak of memory pointed to by 'result'</td></tr>
</table>
<!-- REPORTSUMMARYEXTRA -->
<h3>Annotated Source Code</h3>
<table class="code">
<tr><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr>
<tr><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (c) 2015-2017 Carsten Sonne Larsen &lt;cs@innolan.dk&gt;</span></td></tr>
<tr><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* All rights reserved.</span></td></tr>
<tr><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr>
<tr><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Redistribution and use in source and binary forms, with or without</span></td></tr>
<tr><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* modification, are permitted provided that the following conditions</span></td></tr>
<tr><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* are met:</span></td></tr>
<tr><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* 1. Redistributions of source code must retain the above copyright</span></td></tr>
<tr><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* notice, this list of conditions and the following disclaimer.</span></td></tr>
<tr><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* 2. Redistributions in binary form must reproduce the above copyright</span></td></tr>
<tr><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* notice, this list of conditions and the following disclaimer in the</span></td></tr>
<tr><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* documentation and/or other materials provided with the distribution.</span></td></tr>
<tr><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>*</span></td></tr>
<tr><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR</span></td></tr>
<tr><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span></td></tr>
<tr><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span></td></tr>
<tr><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,</span></td></tr>
<tr><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT</span></td></tr>
<tr><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></td></tr>
<tr><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></td></tr>
<tr><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></td></tr>
<tr><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF</span></td></tr>
<tr><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></td></tr>
<tr><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>*</span></td></tr>
<tr><td class="num" id="LN25">25</td><td class="line"> <span class='comment'>*/</span></td></tr>
<tr><td class="num" id="LN26">26</td><td class="line"> </td></tr>
<tr><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include "clib.h"</span></td></tr>
<tr><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include "lib/numb.h"</span></td></tr>
<tr><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include "lib/real.h"</span></td></tr>
<tr><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include "lib/cplex.h"</span></td></tr>
<tr><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include "main/parser.h"</span></td></tr>
<tr><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include "main/values.h"</span></td></tr>
<tr><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include "main/operators.h"</span></td></tr>
<tr><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include "main/functions.h"</span></td></tr>
<tr><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include "main/statements.h"</span></td></tr>
<tr><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include "localize/text.h"</span></td></tr>
<tr><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include "system/program.h"</span></td></tr>
<tr><td class="num" id="LN38">38</td><td class="line"> </td></tr>
<tr><td class="num" id="LN39">39</td><td class="line">Parser::Parser(<span class='keyword'>const</span> <span class='keyword'>char</span> *input)</td></tr>
<tr><td class="num" id="LN40">40</td><td class="line">{</td></tr>
<tr><td class="num" id="LN41">41</td><td class="line"> lexer = <span class='keyword'>new</span> Lexer(input);</td></tr>
<tr><td class="num" id="LN42">42</td><td class="line">}</td></tr>
<tr><td class="num" id="LN43">43</td><td class="line"> </td></tr>
<tr><td class="num" id="LN44">44</td><td class="line">Parser::~Parser()</td></tr>
<tr><td class="num" id="LN45">45</td><td class="line">{</td></tr>
<tr><td class="num" id="LN46">46</td><td class="line"> <span class='keyword'>delete</span> lexer;</td></tr>
<tr><td class="num" id="LN47">47</td><td class="line">}</td></tr>
<tr><td class="num" id="LN48">48</td><td class="line"> </td></tr>
<tr><td class="num" id="LN49">49</td><td class="line">SyntaxNode* Parser::Parse()</td></tr>
<tr><td class="num" id="LN50">50</td><td class="line">{</td></tr>
<tr><td class="num" id="LN51">51</td><td class="line"> lexer-&gt;Tokenize();</td></tr>
<tr><td class="num" id="LN52">52</td><td class="line"> token = <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN53">53</td><td class="line"> </td></tr>
<tr><td class="num" id="LN54">54</td><td class="line"> StatementBlockNode *block = <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN55">55</td><td class="line"> SyntaxNode *result;</td></tr>
<tr><td class="num" id="LN56">56</td><td class="line"> Token *current;</td></tr>
<tr><td class="num" id="LN57">57</td><td class="line"> </td></tr>
<tr><td class="num" id="LN58">58</td><td class="line"> <span class='keyword'>do</span> {</td></tr>
<tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">&#x2190;</a></div></td></td><td>Loop condition is true. Execution continues on line 59</td><td><div class="PathNav"><a href="#EndPath" title="Next event (6)">&#x2192;</a></div></td></tr></table></div></td></tr>
<tr><td class="num" id="LN59">59</td><td class="line"> result = TryParseStatement();</td></tr>
<tr><td class="num" id="LN60">60</td><td class="line"> </td></tr>
<tr><td class="num" id="LN61">61</td><td class="line"> GetToken();</td></tr>
<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">&#x2190;</a></div></td></td><td>Potential leak of memory pointed to by 'result'</td></tr></table></div></td></tr>
<tr><td class="num" id="LN62">62</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symdelimiter || (token-&gt;symbol == symend &amp;&amp; block != <span class='macro'>NOMEM<span class='expansion'>0</span></span>)) {</td></tr>
<tr><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>if</span> (block == <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num" id="LN64">64</td><td class="line"> block = <span class='keyword'>new</span> StatementBlockNode();</td></tr>
<tr><td class="num" id="LN65">65</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN66">66</td><td class="line"> </td></tr>
<tr><td class="num" id="LN67">67</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num" id="LN68">68</td><td class="line"> block-&gt;Add(result);</td></tr>
<tr><td class="num" id="LN69">69</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN70">70</td><td class="line"> </td></tr>
<tr><td class="num" id="LN71">71</td><td class="line"> <span class='keyword'>while</span> (token-&gt;symbol == symdelimiter) {</td></tr>
<tr><td class="num" id="LN72">72</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN73">73</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN74">74</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol != symend) {</td></tr>
<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgControl" style="margin-left:16ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">1</div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">&#x2192;</a></div></td></tr></table></div></td></tr>
<tr><td class="num" id="LN75">75</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgControl" style="margin-left:13ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">&#x2190;</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">&#x2192;</a></div></td></tr></table></div></td></tr>
<tr><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>delete</span> result;</td></tr>
<tr><td class="num" id="LN77">77</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN78">78</td><td class="line"> </td></tr>
<tr><td class="num" id="LN79">79</td><td class="line"> result = <span class="mrange"><span class='keyword'>new</span> ErrorNode(lexer-&gt;GetInput(), token-&gt;GetPos())</span>;</td></tr>
<tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgEvent" style="margin-left:22ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">&#x2190;</a></div></td></td><td>Memory is allocated</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">&#x2192;</a></div></td></tr></table></div></td></tr>
<tr><td class="num" id="LN80">80</td><td class="line"> <span class='keyword'>if</span> (block != <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgControl" style="margin-left:13ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">&#x2192;</a></div></td></tr></table></div></td></tr>
<tr><td class="num" id="LN81">81</td><td class="line"> block-&gt;Add(result);</td></tr>
<tr><td class="num" id="LN82">82</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN83">83</td><td class="line"> </td></tr>
<tr><td class="num" id="LN84">84</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN85">85</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN86">86</td><td class="line"> </td></tr>
<tr><td class="num" id="LN87">87</td><td class="line"> current = token;</td></tr>
<tr><td class="num" id="LN88">88</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN89">89</td><td class="line"> } <span class='keyword'>while</span> (current-&gt;symbol != symend);</td></tr>
<tr><td class="num" id="LN90">90</td><td class="line"> </td></tr>
<tr><td class="num" id="LN91">91</td><td class="line"> <span class='keyword'>return</span> block != <span class='macro'>NOMEM<span class='expansion'>0</span></span> ? block :</td></tr>
<tr><td class="num" id="LN92">92</td><td class="line"> result != <span class='macro'>NOMEM<span class='expansion'>0</span></span> ? result : <span class='keyword'>new</span> EmptyStatement();;</td></tr>
<tr><td class="num" id="LN93">93</td><td class="line">}</td></tr>
<tr><td class="num" id="LN94">94</td><td class="line"> </td></tr>
<tr><td class="num" id="LN95">95</td><td class="line">SyntaxNode* Parser::TryParseStatement()</td></tr>
<tr><td class="num" id="LN96">96</td><td class="line">{</td></tr>
<tr><td class="num" id="LN97">97</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN98">98</td><td class="line"> <span class='keyword'>if</span>(token-&gt;symbol == symend || token-&gt;symbol == symdelimiter) {</td></tr>
<tr><td class="num" id="LN99">99</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN100">100</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN101">101</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN102">102</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN103">103</td><td class="line"> </td></tr>
<tr><td class="num" id="LN104">104</td><td class="line"> errorNode = <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN105">105</td><td class="line"> syntaxError = -1;</td></tr>
<tr><td class="num" id="LN106">106</td><td class="line"> SyntaxNode *result = ParseStatement();</td></tr>
<tr><td class="num" id="LN107">107</td><td class="line"> </td></tr>
<tr><td class="num" id="LN108">108</td><td class="line"> <span class='keyword'>if</span> (errorNode == <span class='macro'>NOMEM<span class='expansion'>0</span></span> &amp;&amp; syntaxError != -1) {</td></tr>
<tr><td class="num" id="LN109">109</td><td class="line"> errorNode = <span class='keyword'>new</span> ErrorNode(lexer-&gt;GetInput(), syntaxError);</td></tr>
<tr><td class="num" id="LN110">110</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN111">111</td><td class="line"> </td></tr>
<tr><td class="num" id="LN112">112</td><td class="line"> <span class='keyword'>if</span> (errorNode != <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num" id="LN113">113</td><td class="line"> <span class='keyword'>delete</span> result;</td></tr>
<tr><td class="num" id="LN114">114</td><td class="line"> result = errorNode;</td></tr>
<tr><td class="num" id="LN115">115</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN116">116</td><td class="line"> </td></tr>
<tr><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
<tr><td class="num" id="LN118">118</td><td class="line">}</td></tr>
<tr><td class="num" id="LN119">119</td><td class="line"> </td></tr>
<tr><td class="num" id="LN120">120</td><td class="line"><span class='comment'>// -----------------------------------------------------</span></td></tr>
<tr><td class="num" id="LN121">121</td><td class="line"><span class='comment'>// -------------- Recursive-descent logic --------------</span></td></tr>
<tr><td class="num" id="LN122">122</td><td class="line"><span class='comment'>// -----------------------------------------------------</span></td></tr>
<tr><td class="num" id="LN123">123</td><td class="line"> </td></tr>
<tr><td class="num" id="LN124">124</td><td class="line">SyntaxNode* Parser::ParseStatement()</td></tr>
<tr><td class="num" id="LN125">125</td><td class="line">{</td></tr>
<tr><td class="num" id="LN126">126</td><td class="line"> SyntaxNode* res = <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN127">127</td><td class="line"> </td></tr>
<tr><td class="num" id="LN128">128</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN129">129</td><td class="line"> <span class='keyword'>switch</span> (token-&gt;symbol) {</td></tr>
<tr><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>case</span> symhelp:</td></tr>
<tr><td class="num" id="LN131">131</td><td class="line"> res = ParseHelpStatement();</td></tr>
<tr><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN133">133</td><td class="line"> <span class='keyword'>case</span> symdelete:</td></tr>
<tr><td class="num" id="LN134">134</td><td class="line"> res = ParseDeleteStatement();</td></tr>
<tr><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN136">136</td><td class="line"> <span class='keyword'>case</span> symdef:</td></tr>
<tr><td class="num" id="LN137">137</td><td class="line"> res = ParseFunctionDef();</td></tr>
<tr><td class="num" id="LN138">138</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN139">139</td><td class="line"> <span class='keyword'>case</span> symlist:</td></tr>
<tr><td class="num" id="LN140">140</td><td class="line"> res = ParseListStatement();</td></tr>
<tr><td class="num" id="LN141">141</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN142">142</td><td class="line"> <span class='keyword'>case</span> symshow:</td></tr>
<tr><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>case</span> symload:</td></tr>
<tr><td class="num" id="LN144">144</td><td class="line"> <span class='keyword'>case</span> symsave:</td></tr>
<tr><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>case</span> symexecute:</td></tr>
<tr><td class="num" id="LN146">146</td><td class="line"> res = ParseFileStatement();</td></tr>
<tr><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN148">148</td><td class="line"> <span class='keyword'>case</span> syminput:</td></tr>
<tr><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>case</span> symoutput:</td></tr>
<tr><td class="num" id="LN150">150</td><td class="line"> res = ParseNumeralStatement();</td></tr>
<tr><td class="num" id="LN151">151</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN152">152</td><td class="line"> <span class='keyword'>case</span> symprompt:</td></tr>
<tr><td class="num" id="LN153">153</td><td class="line"> res = ParsePromptStatement();</td></tr>
<tr><td class="num" id="LN154">154</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>case</span> symprefs:</td></tr>
<tr><td class="num" id="LN156">156</td><td class="line"> res = ParsePrefsStatement();</td></tr>
<tr><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>case</span> symdigits:</td></tr>
<tr><td class="num" id="LN159">159</td><td class="line"> res = ParseDigistStatement();</td></tr>
<tr><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>case</span> symdraw:</td></tr>
<tr><td class="num" id="LN162">162</td><td class="line"> <span class='keyword'>case</span> symplot:</td></tr>
<tr><td class="num" id="LN163">163</td><td class="line"> res = ParseDrawStatement();</td></tr>
<tr><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>case</span> symversion:</td></tr>
<tr><td class="num" id="LN166">166</td><td class="line"> res = <span class='keyword'>new</span> VersionStatement();</td></tr>
<tr><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN168">168</td><td class="line"> <span class='keyword'>case</span> symexit:</td></tr>
<tr><td class="num" id="LN169">169</td><td class="line"> res = <span class='keyword'>new</span> ExitStatement();</td></tr>
<tr><td class="num" id="LN170">170</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>case</span> symclear:</td></tr>
<tr><td class="num" id="LN172">172</td><td class="line"> res = <span class='keyword'>new</span> ClearStatement();</td></tr>
<tr><td class="num" id="LN173">173</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>case</span> symmem:</td></tr>
<tr><td class="num" id="LN175">175</td><td class="line"> res = <span class='keyword'>new</span> MemoryStatement();</td></tr>
<tr><td class="num" id="LN176">176</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>case</span> symvariable:</td></tr>
<tr><td class="num" id="LN178">178</td><td class="line"> res = <span class='keyword'>new</span> ListVariablesStatement();</td></tr>
<tr><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>case</span> symfunction:</td></tr>
<tr><td class="num" id="LN181">181</td><td class="line"> res = <span class='keyword'>new</span> ListFunctionsStatement();</td></tr>
<tr><td class="num" id="LN182">182</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN183">183</td><td class="line"> <span class='keyword'>case</span> symeval:</td></tr>
<tr><td class="num" id="LN184">184</td><td class="line"> res = <span class='keyword'>new</span> EvalStatement(ParseExpression());</td></tr>
<tr><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>default</span>:</td></tr>
<tr><td class="num" id="LN187">187</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN188">188</td><td class="line"> res = ParseDefault();</td></tr>
<tr><td class="num" id="LN189">189</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN190">190</td><td class="line"> </td></tr>
<tr><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> res;</td></tr>
<tr><td class="num" id="LN192">192</td><td class="line">}</td></tr>
<tr><td class="num" id="LN193">193</td><td class="line"> </td></tr>
<tr><td class="num" id="LN194">194</td><td class="line">SyntaxNode* Parser::ParseDefault()</td></tr>
<tr><td class="num" id="LN195">195</td><td class="line">{</td></tr>
<tr><td class="num" id="LN196">196</td><td class="line"> Token *temp = token;</td></tr>
<tr><td class="num" id="LN197">197</td><td class="line"> </td></tr>
<tr><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>// Peek tokens</span></td></tr>
<tr><td class="num" id="LN199">199</td><td class="line"> <span class='keyword'>bool</span> funcdef = Expect(symident);</td></tr>
<tr><td class="num" id="LN200">200</td><td class="line"> funcdef = funcdef &amp;&amp; Expect(symlparen);</td></tr>
<tr><td class="num" id="LN201">201</td><td class="line"> funcdef = funcdef &amp;&amp; Expect(symident);</td></tr>
<tr><td class="num" id="LN202">202</td><td class="line"> funcdef = funcdef &amp;&amp; Expect(symrparen);</td></tr>
<tr><td class="num" id="LN203">203</td><td class="line"> funcdef = funcdef &amp;&amp; Expect(symassign);</td></tr>
<tr><td class="num" id="LN204">204</td><td class="line"> </td></tr>
<tr><td class="num" id="LN205">205</td><td class="line"> <span class='comment'>// Restart parsing</span></td></tr>
<tr><td class="num" id="LN206">206</td><td class="line"> syntaxError = -1;</td></tr>
<tr><td class="num" id="LN207">207</td><td class="line"> errorNode = <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN208">208</td><td class="line"> token = temp;</td></tr>
<tr><td class="num" id="LN209">209</td><td class="line"> </td></tr>
<tr><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>if</span> (funcdef) {</td></tr>
<tr><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>return</span> ParseFunctionDef();</td></tr>
<tr><td class="num" id="LN212">212</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>return</span> ParseEvaluation();</td></tr>
<tr><td class="num" id="LN214">214</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN215">215</td><td class="line">}</td></tr>
<tr><td class="num" id="LN216">216</td><td class="line"> </td></tr>
<tr><td class="num" id="LN217">217</td><td class="line">SyntaxNode* Parser::ParseEvaluation()</td></tr>
<tr><td class="num" id="LN218">218</td><td class="line">{</td></tr>
<tr><td class="num" id="LN219">219</td><td class="line"> ExpressionNode *exp = ParseExpression();</td></tr>
<tr><td class="num" id="LN220">220</td><td class="line"> <span class='keyword'>if</span> (exp == <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN222">222</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN223">223</td><td class="line"> </td></tr>
<tr><td class="num" id="LN224">224</td><td class="line"> StatementNode *sta = <span class='keyword'>new</span> EvalStatement(exp);</td></tr>
<tr><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>if</span> (exp-&gt;IsSilent()) {</td></tr>
<tr><td class="num" id="LN226">226</td><td class="line"> sta = <span class='keyword'>new</span> SilentStatement(sta);</td></tr>
<tr><td class="num" id="LN227">227</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN228">228</td><td class="line"> </td></tr>
<tr><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>return</span> sta;</td></tr>
<tr><td class="num" id="LN230">230</td><td class="line">}</td></tr>
<tr><td class="num" id="LN231">231</td><td class="line"> </td></tr>
<tr><td class="num" id="LN232">232</td><td class="line">ExpressionNode* Parser::ParseExpression ()</td></tr>
<tr><td class="num" id="LN233">233</td><td class="line">{</td></tr>
<tr><td class="num" id="LN234">234</td><td class="line"> <span class='keyword'>return</span> ParseAddSubstract();</td></tr>
<tr><td class="num" id="LN235">235</td><td class="line">}</td></tr>
<tr><td class="num" id="LN236">236</td><td class="line"> </td></tr>
<tr><td class="num" id="LN237">237</td><td class="line">ExpressionNode* Parser::ParseAddSubstract ()</td></tr>
<tr><td class="num" id="LN238">238</td><td class="line">{</td></tr>
<tr><td class="num" id="LN239">239</td><td class="line"> ExpressionNode* node = ParseFactor ();</td></tr>
<tr><td class="num" id="LN240">240</td><td class="line"> </td></tr>
<tr><td class="num" id="LN241">241</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>while</span> (token-&gt;symbol == symplus || token-&gt;symbol == symminus) {</td></tr>
<tr><td class="num" id="LN243">243</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symplus) {</td></tr>
<tr><td class="num" id="LN244">244</td><td class="line"> node = <span class='keyword'>new</span> AdditionNode (node, ParseFactor ());</td></tr>
<tr><td class="num" id="LN245">245</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symminus) {</td></tr>
<tr><td class="num" id="LN246">246</td><td class="line"> node = <span class='keyword'>new</span> SubtractionNode (node, ParseFactor ());</td></tr>
<tr><td class="num" id="LN247">247</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN248">248</td><td class="line"> </td></tr>
<tr><td class="num" id="LN249">249</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN250">250</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN251">251</td><td class="line"> </td></tr>
<tr><td class="num" id="LN252">252</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>return</span> node;</td></tr>
<tr><td class="num" id="LN254">254</td><td class="line">}</td></tr>
<tr><td class="num" id="LN255">255</td><td class="line"> </td></tr>
<tr><td class="num" id="LN256">256</td><td class="line">ExpressionNode* Parser::ParseFactor ()</td></tr>
<tr><td class="num" id="LN257">257</td><td class="line">{</td></tr>
<tr><td class="num" id="LN258">258</td><td class="line"> ExpressionNode* node = ParsePower ();</td></tr>
<tr><td class="num" id="LN259">259</td><td class="line"> </td></tr>
<tr><td class="num" id="LN260">260</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>while</span> (token-&gt;symbol == symtimes || token-&gt;symbol == symslash) {</td></tr>
<tr><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symtimes) {</td></tr>
<tr><td class="num" id="LN263">263</td><td class="line"> node = <span class='keyword'>new</span> MultiplicationNode (node, ParsePower ());</td></tr>
<tr><td class="num" id="LN264">264</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symslash) {</td></tr>
<tr><td class="num" id="LN265">265</td><td class="line"> node = <span class='keyword'>new</span> DivisionNode (node, ParsePower ());</td></tr>
<tr><td class="num" id="LN266">266</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN267">267</td><td class="line"> </td></tr>
<tr><td class="num" id="LN268">268</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN269">269</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN270">270</td><td class="line"> </td></tr>
<tr><td class="num" id="LN271">271</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN272">272</td><td class="line"> <span class='keyword'>return</span> node;</td></tr>
<tr><td class="num" id="LN273">273</td><td class="line">}</td></tr>
<tr><td class="num" id="LN274">274</td><td class="line"> </td></tr>
<tr><td class="num" id="LN275">275</td><td class="line">ExpressionNode* Parser::ParsePower()</td></tr>
<tr><td class="num" id="LN276">276</td><td class="line">{</td></tr>
<tr><td class="num" id="LN277">277</td><td class="line"> ExpressionNode* node = ParseUnary ();</td></tr>
<tr><td class="num" id="LN278">278</td><td class="line"> </td></tr>
<tr><td class="num" id="LN279">279</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN280">280</td><td class="line"> <span class='keyword'>while</span> (token-&gt;symbol == sympower) {</td></tr>
<tr><td class="num" id="LN281">281</td><td class="line"> node = <span class='keyword'>new</span> PowerNode (node, ParseUnary ());</td></tr>
<tr><td class="num" id="LN282">282</td><td class="line"> GetToken ();</td></tr>
<tr><td class="num" id="LN283">283</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN284">284</td><td class="line"> </td></tr>
<tr><td class="num" id="LN285">285</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> node;</td></tr>
<tr><td class="num" id="LN287">287</td><td class="line">}</td></tr>
<tr><td class="num" id="LN288">288</td><td class="line"> </td></tr>
<tr><td class="num" id="LN289">289</td><td class="line">ExpressionNode* Parser::ParseUnary()</td></tr>
<tr><td class="num" id="LN290">290</td><td class="line">{</td></tr>
<tr><td class="num" id="LN291">291</td><td class="line"> ExpressionNode* node;</td></tr>
<tr><td class="num" id="LN292">292</td><td class="line"> </td></tr>
<tr><td class="num" id="LN293">293</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symminus) {</td></tr>
<tr><td class="num" id="LN295">295</td><td class="line"> node = <span class='keyword'>new</span> UnaryNode(ParseAtomic ());</td></tr>
<tr><td class="num" id="LN296">296</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN297">297</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN298">298</td><td class="line"> node = ParseAtomic();</td></tr>
<tr><td class="num" id="LN299">299</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN300">300</td><td class="line"> </td></tr>
<tr><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>return</span> node;</td></tr>
<tr><td class="num" id="LN302">302</td><td class="line">}</td></tr>
<tr><td class="num" id="LN303">303</td><td class="line"> </td></tr>
<tr><td class="num" id="LN304">304</td><td class="line">ExpressionNode* Parser::ParseAtomic ()</td></tr>
<tr><td class="num" id="LN305">305</td><td class="line">{</td></tr>
<tr><td class="num" id="LN306">306</td><td class="line"> ExpressionNode* node;</td></tr>
<tr><td class="num" id="LN307">307</td><td class="line"> </td></tr>
<tr><td class="num" id="LN308">308</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symlparen) {</td></tr>
<tr><td class="num" id="LN310">310</td><td class="line"> node = ParseExpression();</td></tr>
<tr><td class="num" id="LN311">311</td><td class="line"> Expect(symrparen);</td></tr>
<tr><td class="num" id="LN312">312</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symabsolute) {</td></tr>
<tr><td class="num" id="LN313">313</td><td class="line"> node = <span class='keyword'>new</span> AbsoluteNode(ParseExpression());</td></tr>
<tr><td class="num" id="LN314">314</td><td class="line"> Expect(symabsolute);</td></tr>
<tr><td class="num" id="LN315">315</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symident) {</td></tr>
<tr><td class="num" id="LN316">316</td><td class="line"> node = ParseIdent();</td></tr>
<tr><td class="num" id="LN317">317</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == sympi) {</td></tr>
<tr><td class="num" id="LN318">318</td><td class="line"> node = <span class='keyword'>new</span> PiNode();</td></tr>
<tr><td class="num" id="LN319">319</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == syme) {</td></tr>
<tr><td class="num" id="LN320">320</td><td class="line"> node = <span class='keyword'>new</span> EulersNumberNode();</td></tr>
<tr><td class="num" id="LN321">321</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symi) {</td></tr>
<tr><td class="num" id="LN322">322</td><td class="line"> node = <span class='keyword'>new</span> ComplexiNode();</td></tr>
<tr><td class="num" id="LN323">323</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symins) {</td></tr>
<tr><td class="num" id="LN324">324</td><td class="line"> node = <span class='keyword'>new</span> InsVariableNode();</td></tr>
<tr><td class="num" id="LN325">325</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symnumber) {</td></tr>
<tr><td class="num" id="LN326">326</td><td class="line"> node = ParseNumber();</td></tr>
<tr><td class="num" id="LN327">327</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN328">328</td><td class="line"> node = <span class='keyword'>new</span> NumericValueNode();</td></tr>
<tr><td class="num" id="LN329">329</td><td class="line"> syntaxError = token-&gt;GetPos();</td></tr>
<tr><td class="num" id="LN330">330</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN331">331</td><td class="line"> </td></tr>
<tr><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>return</span> node;</td></tr>
<tr><td class="num" id="LN333">333</td><td class="line">}</td></tr>
<tr><td class="num" id="LN334">334</td><td class="line"> </td></tr>
<tr><td class="num" id="LN335">335</td><td class="line">ExpressionNode* Parser::ParseIdent()</td></tr>
<tr><td class="num" id="LN336">336</td><td class="line">{</td></tr>
<tr><td class="num" id="LN337">337</td><td class="line"> ExpressionNode *node;</td></tr>
<tr><td class="num" id="LN338">338</td><td class="line"> Token *identToken = token;</td></tr>
<tr><td class="num" id="LN339">339</td><td class="line"> </td></tr>
<tr><td class="num" id="LN340">340</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN341">341</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symlparen) {</td></tr>
<tr><td class="num" id="LN342">342</td><td class="line"> ExpressionNode* parameter = ParseExpression();</td></tr>
<tr><td class="num" id="LN343">343</td><td class="line"> Expect(symrparen);</td></tr>
<tr><td class="num" id="LN344">344</td><td class="line"> node = Program-&gt;Functions-&gt;GetFunctionCall(identToken-&gt;GetText(), parameter);</td></tr>
<tr><td class="num" id="LN345">345</td><td class="line"> </td></tr>
<tr><td class="num" id="LN346">346</td><td class="line"> <span class='keyword'>if</span> (node == <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num" id="LN347">347</td><td class="line"> errorNode = <span class='keyword'>new</span> ErrorNode(</td></tr>
<tr><td class="num" id="LN348">348</td><td class="line"> lexer-&gt;GetInput(),</td></tr>
<tr><td class="num" id="LN349">349</td><td class="line"> <span class='macro'>HELPFUNNDEF<span class='expansion'>Program-&gt;Language-&gt;GetText(12)</span></span>,</td></tr>
<tr><td class="num" id="LN350">350</td><td class="line"> identToken-&gt;GetText(),</td></tr>
<tr><td class="num" id="LN351">351</td><td class="line"> identToken-&gt;GetPos());</td></tr>
<tr><td class="num" id="LN352">352</td><td class="line"> </td></tr>
<tr><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>delete</span> parameter;</td></tr>
<tr><td class="num" id="LN354">354</td><td class="line"> node = <span class='keyword'>new</span> NumericValueNode();</td></tr>
<tr><td class="num" id="LN355">355</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN356">356</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symassign) {</td></tr>
<tr><td class="num" id="LN357">357</td><td class="line"> Variable* var = Program-&gt;Variables-&gt;CreateVariable(identToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN358">358</td><td class="line"> node = <span class='keyword'>new</span> AssignmentNode(<span class='keyword'>new</span> VariableNode(var), ParseExpression());</td></tr>
<tr><td class="num" id="LN359">359</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN360">360</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN361">361</td><td class="line"> Variable* var = Program-&gt;Variables-&gt;GetVariable(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN362">362</td><td class="line"> </td></tr>
<tr><td class="num" id="LN363">363</td><td class="line"> <span class='keyword'>if</span> (var == <span class='macro'>NOMEM<span class='expansion'>0</span></span>) {</td></tr>
<tr><td class="num" id="LN364">364</td><td class="line"> errorNode = <span class='keyword'>new</span> ErrorNode(</td></tr>
<tr><td class="num" id="LN365">365</td><td class="line"> lexer-&gt;GetInput(),</td></tr>
<tr><td class="num" id="LN366">366</td><td class="line"> <span class='macro'>HELPVARNDEF<span class='expansion'>Program-&gt;Language-&gt;GetText(11)</span></span>,</td></tr>
<tr><td class="num" id="LN367">367</td><td class="line"> identToken-&gt;GetText(),</td></tr>
<tr><td class="num" id="LN368">368</td><td class="line"> identToken-&gt;GetPos());</td></tr>
<tr><td class="num" id="LN369">369</td><td class="line"> </td></tr>
<tr><td class="num" id="LN370">370</td><td class="line"> node = <span class='keyword'>new</span> NumericValueNode();</td></tr>
<tr><td class="num" id="LN371">371</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN372">372</td><td class="line"> node = <span class='keyword'>new</span> VariableNode(var);</td></tr>
<tr><td class="num" id="LN373">373</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN374">374</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN375">375</td><td class="line"> </td></tr>
<tr><td class="num" id="LN376">376</td><td class="line"> <span class='keyword'>return</span> node;</td></tr>
<tr><td class="num" id="LN377">377</td><td class="line">}</td></tr>
<tr><td class="num" id="LN378">378</td><td class="line"> </td></tr>
<tr><td class="num" id="LN379">379</td><td class="line">ExpressionNode* Parser::ParseNumber()</td></tr>
<tr><td class="num" id="LN380">380</td><td class="line">{</td></tr>
<tr><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *a = token-&gt;GetText();</td></tr>
<tr><td class="num" id="LN382">382</td><td class="line"> Number *number = <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN383">383</td><td class="line"> </td></tr>
<tr><td class="num" id="LN384">384</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symi) {</td></tr>
<tr><td class="num" id="LN386">386</td><td class="line"> Number *imag = Program-&gt;Input-&gt;Parse(a);</td></tr>
<tr><td class="num" id="LN387">387</td><td class="line"> number = <span class='keyword'>new</span> ComplexNumber(0.0, imag-&gt;GetRealValue());</td></tr>
<tr><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>delete</span> imag;</td></tr>
<tr><td class="num" id="LN389">389</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN390">390</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN391">391</td><td class="line"> number = Program-&gt;Input-&gt;Parse(a);</td></tr>
<tr><td class="num" id="LN392">392</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN393">393</td><td class="line"> </td></tr>
<tr><td class="num" id="LN394">394</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> NumericValueNode (number);</td></tr>
<tr><td class="num" id="LN395">395</td><td class="line">}</td></tr>
<tr><td class="num" id="LN396">396</td><td class="line"> </td></tr>
<tr><td class="num" id="LN397">397</td><td class="line"><span class='comment'>// -----------------------------------------------------</span></td></tr>
<tr><td class="num" id="LN398">398</td><td class="line"><span class='comment'>// ------------------- Token logic ---------------------</span></td></tr>
<tr><td class="num" id="LN399">399</td><td class="line"><span class='comment'>// -----------------------------------------------------</span></td></tr>
<tr><td class="num" id="LN400">400</td><td class="line"> </td></tr>
<tr><td class="num" id="LN401">401</td><td class="line"><span class='keyword'>void</span> Parser::GetToken ()</td></tr>
<tr><td class="num" id="LN402">402</td><td class="line">{</td></tr>
<tr><td class="num" id="LN403">403</td><td class="line"> token = (token == <span class='macro'>NOMEM<span class='expansion'>0</span></span> ? lexer-&gt;GetFirstToken() : token-&gt;GetNextToken());</td></tr>
<tr><td class="num" id="LN404">404</td><td class="line">}</td></tr>
<tr><td class="num" id="LN405">405</td><td class="line"> </td></tr>
<tr><td class="num" id="LN406">406</td><td class="line"><span class='keyword'>void</span> Parser::PutToken()</td></tr>
<tr><td class="num" id="LN407">407</td><td class="line">{</td></tr>
<tr><td class="num" id="LN408">408</td><td class="line"> token = token-&gt;GetLastToken();</td></tr>
<tr><td class="num" id="LN409">409</td><td class="line">}</td></tr>
<tr><td class="num" id="LN410">410</td><td class="line"> </td></tr>
<tr><td class="num" id="LN411">411</td><td class="line"><span class='keyword'>bool</span> Parser::Expect(Symbol symbol)</td></tr>
<tr><td class="num" id="LN412">412</td><td class="line">{</td></tr>
<tr><td class="num" id="LN413">413</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol != symbol) {</td></tr>
<tr><td class="num" id="LN415">415</td><td class="line"> syntaxError = token-&gt;GetPos();</td></tr>
<tr><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>false</span>;</td></tr>
<tr><td class="num" id="LN417">417</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN418">418</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>true</span>;</td></tr>
<tr><td class="num" id="LN419">419</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN420">420</td><td class="line">}</td></tr>
<tr><td class="num" id="LN421">421</td><td class="line"> </td></tr>
<tr><td class="num" id="LN422">422</td><td class="line"><span class='comment'>// -----------------------------------------------------</span></td></tr>
<tr><td class="num" id="LN423">423</td><td class="line"><span class='comment'>// ----------------- Statement logic -------------------</span></td></tr>
<tr><td class="num" id="LN424">424</td><td class="line"><span class='comment'>// -----------------------------------------------------</span></td></tr>
<tr><td class="num" id="LN425">425</td><td class="line"> </td></tr>
<tr><td class="num" id="LN426">426</td><td class="line">SyntaxNode* Parser::ParseFunctionDef()</td></tr>
<tr><td class="num" id="LN427">427</td><td class="line">{</td></tr>
<tr><td class="num" id="LN428">428</td><td class="line"> Expect(symident);</td></tr>
<tr><td class="num" id="LN429">429</td><td class="line"> Token* funcToken = token;</td></tr>
<tr><td class="num" id="LN430">430</td><td class="line"> Expect(symlparen);</td></tr>
<tr><td class="num" id="LN431">431</td><td class="line"> Expect(symident);</td></tr>
<tr><td class="num" id="LN432">432</td><td class="line"> Token* funcVariable = token;</td></tr>
<tr><td class="num" id="LN433">433</td><td class="line"> Expect(symrparen);</td></tr>
<tr><td class="num" id="LN434">434</td><td class="line"> Expect(symassign);</td></tr>
<tr><td class="num" id="LN435">435</td><td class="line"> </td></tr>
<tr><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (Program-&gt;Functions-&gt;IsSystemFunction(funcToken-&gt;GetText())) {</td></tr>
<tr><td class="num" id="LN437">437</td><td class="line"> errorNode = <span class='keyword'>new</span> ErrorNode(</td></tr>
<tr><td class="num" id="LN438">438</td><td class="line"> lexer-&gt;GetInput(),</td></tr>
<tr><td class="num" id="LN439">439</td><td class="line"> <span class='macro'>HELPFUNRDEF<span class='expansion'>Program-&gt;Language-&gt;GetText(13)</span></span>,</td></tr>
<tr><td class="num" id="LN440">440</td><td class="line"> funcToken-&gt;GetText(),</td></tr>
<tr><td class="num" id="LN441">441</td><td class="line"> funcToken-&gt;GetPos());</td></tr>
<tr><td class="num" id="LN442">442</td><td class="line"> </td></tr>
<tr><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN444">444</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN445">445</td><td class="line"> </td></tr>
<tr><td class="num" id="LN446">446</td><td class="line"> UserFunction* function = Program-&gt;Functions-&gt;GetFunctionDef(funcToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN447">447</td><td class="line"> Variable* variable = function-&gt;CreateVariable(funcVariable-&gt;GetText());</td></tr>
<tr><td class="num" id="LN448">448</td><td class="line"> Program-&gt;Variables-&gt;InsertTemporaryVariable(variable);</td></tr>
<tr><td class="num" id="LN449">449</td><td class="line"> function-&gt;SetExpression(ParseExpression());</td></tr>
<tr><td class="num" id="LN450">450</td><td class="line"> Program-&gt;Variables-&gt;RemoveTemporaryVariable();</td></tr>
<tr><td class="num" id="LN451">451</td><td class="line"> </td></tr>
<tr><td class="num" id="LN452">452</td><td class="line"> <span class='comment'>// TODO: Move logic to FunctionDefinitionNode</span></td></tr>
<tr><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> FunctionDefinitionNode();</td></tr>
<tr><td class="num" id="LN454">454</td><td class="line">}</td></tr>
<tr><td class="num" id="LN455">455</td><td class="line"> </td></tr>
<tr><td class="num" id="LN456">456</td><td class="line">SyntaxNode* Parser::ParseHelpStatement()</td></tr>
<tr><td class="num" id="LN457">457</td><td class="line">{</td></tr>
<tr><td class="num" id="LN458">458</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN459">459</td><td class="line"> </td></tr>
<tr><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symdelimiter || token-&gt;symbol == symend) {</td></tr>
<tr><td class="num" id="LN461">461</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN462">462</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> HelpStatement();</td></tr>
<tr><td class="num" id="LN463">463</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symident) {</td></tr>
<tr><td class="num" id="LN464">464</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> HelpStatement(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN465">465</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN466">466</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> HelpStatement(token-&gt;symbol);</td></tr>
<tr><td class="num" id="LN467">467</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN468">468</td><td class="line">}</td></tr>
<tr><td class="num" id="LN469">469</td><td class="line"> </td></tr>
<tr><td class="num" id="LN470">470</td><td class="line">SyntaxNode* Parser::ParseDeleteStatement()</td></tr>
<tr><td class="num" id="LN471">471</td><td class="line">{</td></tr>
<tr><td class="num" id="LN472">472</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symvariable || token-&gt;symbol == symfunction) {</td></tr>
<tr><td class="num" id="LN474">474</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> DeleteStatement(token-&gt;symbol);</td></tr>
<tr><td class="num" id="LN475">475</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol != symident) {</td></tr>
<tr><td class="num" id="LN476">476</td><td class="line"> syntaxError = token-&gt;GetPos();</td></tr>
<tr><td class="num" id="LN477">477</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN478">478</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN479">479</td><td class="line"> </td></tr>
<tr><td class="num" id="LN480">480</td><td class="line"> Token *identToken = token;</td></tr>
<tr><td class="num" id="LN481">481</td><td class="line"> </td></tr>
<tr><td class="num" id="LN482">482</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symlparen) {</td></tr>
<tr><td class="num" id="LN484">484</td><td class="line"> Expect(symident);</td></tr>
<tr><td class="num" id="LN485">485</td><td class="line"> Token *parameter = token;</td></tr>
<tr><td class="num" id="LN486">486</td><td class="line"> Expect(symrparen);</td></tr>
<tr><td class="num" id="LN487">487</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> DeleteStatement(identToken-&gt;GetText(), parameter-&gt;GetText());</td></tr>
<tr><td class="num" id="LN488">488</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN489">489</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> DeleteStatement(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN491">491</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN492">492</td><td class="line">}</td></tr>
<tr><td class="num" id="LN493">493</td><td class="line"> </td></tr>
<tr><td class="num" id="LN494">494</td><td class="line">SyntaxNode* Parser::ParseListStatement()</td></tr>
<tr><td class="num" id="LN495">495</td><td class="line">{</td></tr>
<tr><td class="num" id="LN496">496</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symqident)</td></tr>
<tr><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> ListStatement(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol == symend || symdelimiter) {</td></tr>
<tr><td class="num" id="LN500">500</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN501">501</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> ListStatement();</td></tr>
<tr><td class="num" id="LN502">502</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN503">503</td><td class="line"> syntaxError = token-&gt;GetPos();</td></tr>
<tr><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN505">505</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN506">506</td><td class="line">}</td></tr>
<tr><td class="num" id="LN507">507</td><td class="line"> </td></tr>
<tr><td class="num" id="LN508">508</td><td class="line">SyntaxNode* Parser::ParseFileStatement()</td></tr>
<tr><td class="num" id="LN509">509</td><td class="line">{</td></tr>
<tr><td class="num" id="LN510">510</td><td class="line"> Token *statement = token;</td></tr>
<tr><td class="num" id="LN511">511</td><td class="line"> </td></tr>
<tr><td class="num" id="LN512">512</td><td class="line"> Expect(symqident);</td></tr>
<tr><td class="num" id="LN513">513</td><td class="line"> Token *identToken = token;</td></tr>
<tr><td class="num" id="LN514">514</td><td class="line"> </td></tr>
<tr><td class="num" id="LN515">515</td><td class="line"> <span class='keyword'>if</span> (statement-&gt;symbol == symload) {</td></tr>
<tr><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> LoadStatement(identToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN517">517</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (statement-&gt;symbol == symsave) {</td></tr>
<tr><td class="num" id="LN518">518</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> SaveStatement(identToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN519">519</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (statement-&gt;symbol == symexecute) {</td></tr>
<tr><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> ExecuteStatement(identToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN521">521</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (statement-&gt;symbol == symshow) {</td></tr>
<tr><td class="num" id="LN522">522</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> ShowStatement(identToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN523">523</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> ErrorNode(</td></tr>
<tr><td class="num" id="LN525">525</td><td class="line"> lexer-&gt;GetInput(),</td></tr>
<tr><td class="num" id="LN526">526</td><td class="line"> <span class='macro'>HELPUERROR<span class='expansion'>Program-&gt;Language-&gt;GetText(10)</span></span>, <span class='macro'>EMPTYSTRING<span class='expansion'>""</span></span>,</td></tr>
<tr><td class="num" id="LN527">527</td><td class="line"> statement-&gt;GetPos());</td></tr>
<tr><td class="num" id="LN528">528</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN529">529</td><td class="line">}</td></tr>
<tr><td class="num" id="LN530">530</td><td class="line"> </td></tr>
<tr><td class="num" id="LN531">531</td><td class="line">SyntaxNode* Parser::ParseNumeralStatement()</td></tr>
<tr><td class="num" id="LN532">532</td><td class="line">{</td></tr>
<tr><td class="num" id="LN533">533</td><td class="line"> Token *statement = token;</td></tr>
<tr><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>int</span> base;</td></tr>
<tr><td class="num" id="LN535">535</td><td class="line"> </td></tr>
<tr><td class="num" id="LN536">536</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN537">537</td><td class="line"> <span class='keyword'>switch</span> (token-&gt;symbol) {</td></tr>
<tr><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>case</span> symend:</td></tr>
<tr><td class="num" id="LN539">539</td><td class="line"> <span class='keyword'>case</span> symdelimiter:</td></tr>
<tr><td class="num" id="LN540">540</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN541">541</td><td class="line"> <span class='keyword'>return</span> (statement-&gt;symbol == syminput) ?</td></tr>
<tr><td class="num" id="LN542">542</td><td class="line"> (SyntaxNode*)<span class='keyword'>new</span> InputStatement() :</td></tr>
<tr><td class="num" id="LN543">543</td><td class="line"> (SyntaxNode*)<span class='keyword'>new</span> OutputStatement();</td></tr>
<tr><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>case</span> symbin:</td></tr>
<tr><td class="num" id="LN545">545</td><td class="line"> base = 2;</td></tr>
<tr><td class="num" id="LN546">546</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN547">547</td><td class="line"> <span class='keyword'>case</span> symoct:</td></tr>
<tr><td class="num" id="LN548">548</td><td class="line"> base = 8;</td></tr>
<tr><td class="num" id="LN549">549</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN550">550</td><td class="line"> <span class='keyword'>case</span> symdec:</td></tr>
<tr><td class="num" id="LN551">551</td><td class="line"> base = 10;</td></tr>
<tr><td class="num" id="LN552">552</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>case</span> symhex:</td></tr>
<tr><td class="num" id="LN554">554</td><td class="line"> base = 16;</td></tr>
<tr><td class="num" id="LN555">555</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
<tr><td class="num" id="LN556">556</td><td class="line"> <span class='keyword'>default</span>:</td></tr>
<tr><td class="num" id="LN557">557</td><td class="line"> base = 0;</td></tr>
<tr><td class="num" id="LN558">558</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN559">559</td><td class="line"> </td></tr>
<tr><td class="num" id="LN560">560</td><td class="line"> <span class='keyword'>if</span> (base == 0 &amp;&amp; token-&gt;symbol != symnumber) {</td></tr>
<tr><td class="num" id="LN561">561</td><td class="line"> syntaxError = token-&gt;GetPos();</td></tr>
<tr><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN563">563</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN564">564</td><td class="line"> </td></tr>
<tr><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>if</span> (base == 0) {</td></tr>
<tr><td class="num" id="LN566">566</td><td class="line"> NumeralSystem *nsys = <span class='keyword'>new</span> DecimalSystem(0);</td></tr>
<tr><td class="num" id="LN567">567</td><td class="line"> Number *number = nsys-&gt;Parse(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN568">568</td><td class="line"> base = number-&gt;GetIntegerValue();</td></tr>
<tr><td class="num" id="LN569">569</td><td class="line"> <span class='keyword'>delete</span> number;</td></tr>
<tr><td class="num" id="LN570">570</td><td class="line"> <span class='keyword'>delete</span> nsys;</td></tr>
<tr><td class="num" id="LN571">571</td><td class="line"> </td></tr>
<tr><td class="num" id="LN572">572</td><td class="line"> <span class='keyword'>if</span> (base &lt; 2 || base &gt; 32) {</td></tr>
<tr><td class="num" id="LN573">573</td><td class="line"> errorNode = <span class='keyword'>new</span> ErrorNode(</td></tr>
<tr><td class="num" id="LN574">574</td><td class="line"> lexer-&gt;GetInput(),</td></tr>
<tr><td class="num" id="LN575">575</td><td class="line"> <span class='macro'>HELPPNUMERA<span class='expansion'>Program-&gt;Language-&gt;GetText(14)</span></span>,</td></tr>
<tr><td class="num" id="LN576">576</td><td class="line"> token-&gt;GetText(),</td></tr>
<tr><td class="num" id="LN577">577</td><td class="line"> token-&gt;GetPos());</td></tr>
<tr><td class="num" id="LN578">578</td><td class="line"> </td></tr>
<tr><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN580">580</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN581">581</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN582">582</td><td class="line"> </td></tr>
<tr><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>return</span> (statement-&gt;symbol == syminput) ?</td></tr>
<tr><td class="num" id="LN584">584</td><td class="line"> (SyntaxNode*)<span class='keyword'>new</span> InputStatement(base) :</td></tr>
<tr><td class="num" id="LN585">585</td><td class="line"> (SyntaxNode*)<span class='keyword'>new</span> OutputStatement(base);</td></tr>
<tr><td class="num" id="LN586">586</td><td class="line">}</td></tr>
<tr><td class="num" id="LN587">587</td><td class="line"> </td></tr>
<tr><td class="num" id="LN588">588</td><td class="line">SyntaxNode* Parser::ParseDigistStatement()</td></tr>
<tr><td class="num" id="LN589">589</td><td class="line">{</td></tr>
<tr><td class="num" id="LN590">590</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symdelimiter || token-&gt;symbol == symend) {</td></tr>
<tr><td class="num" id="LN592">592</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN593">593</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> DigitsStatement();</td></tr>
<tr><td class="num" id="LN594">594</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (token-&gt;symbol != symnumber) {</td></tr>
<tr><td class="num" id="LN595">595</td><td class="line"> syntaxError = token-&gt;GetPos();</td></tr>
<tr><td class="num" id="LN596">596</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN597">597</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN598">598</td><td class="line"> </td></tr>
<tr><td class="num" id="LN599">599</td><td class="line"> NumeralSystem *nsys = <span class='keyword'>new</span> DecimalSystem(0);</td></tr>
<tr><td class="num" id="LN600">600</td><td class="line"> Number *number = nsys-&gt;Parse(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN601">601</td><td class="line"> <span class='keyword'>int</span> digits = number-&gt;GetIntegerValue();</td></tr>
<tr><td class="num" id="LN602">602</td><td class="line"> <span class='keyword'>delete</span> number;</td></tr>
<tr><td class="num" id="LN603">603</td><td class="line"> <span class='keyword'>delete</span> nsys;</td></tr>
<tr><td class="num" id="LN604">604</td><td class="line"> </td></tr>
<tr><td class="num" id="LN605">605</td><td class="line"> <span class='keyword'>if</span> (digits &lt; 0 || digits &gt; 15) {</td></tr>
<tr><td class="num" id="LN606">606</td><td class="line"> errorNode = <span class='keyword'>new</span> ErrorNode(</td></tr>
<tr><td class="num" id="LN607">607</td><td class="line"> lexer-&gt;GetInput(),</td></tr>
<tr><td class="num" id="LN608">608</td><td class="line"> <span class='macro'>HELPPDIGITS<span class='expansion'>Program-&gt;Language-&gt;GetText(15)</span></span>,</td></tr>
<tr><td class="num" id="LN609">609</td><td class="line"> token-&gt;GetText(),</td></tr>
<tr><td class="num" id="LN610">610</td><td class="line"> token-&gt;GetPos());</td></tr>
<tr><td class="num" id="LN611">611</td><td class="line"> </td></tr>
<tr><td class="num" id="LN612">612</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN613">613</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN614">614</td><td class="line"> </td></tr>
<tr><td class="num" id="LN615">615</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> DigitsStatement(digits);</td></tr>
<tr><td class="num" id="LN616">616</td><td class="line">}</td></tr>
<tr><td class="num" id="LN617">617</td><td class="line"> </td></tr>
<tr><td class="num" id="LN618">618</td><td class="line">SyntaxNode* Parser::ParsePromptStatement()</td></tr>
<tr><td class="num" id="LN619">619</td><td class="line">{</td></tr>
<tr><td class="num" id="LN620">620</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN621">621</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symqident) {</td></tr>
<tr><td class="num" id="LN622">622</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> PromptStatement(token-&gt;GetText());</td></tr>
<tr><td class="num" id="LN623">623</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN624">624</td><td class="line"> </td></tr>
<tr><td class="num" id="LN625">625</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN626">626</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NOMEM<span class='expansion'>0</span></span>;</td></tr>
<tr><td class="num" id="LN627">627</td><td class="line">}</td></tr>
<tr><td class="num" id="LN628">628</td><td class="line"> </td></tr>
<tr><td class="num" id="LN629">629</td><td class="line">SyntaxNode* Parser::ParsePrefsStatement()</td></tr>
<tr><td class="num" id="LN630">630</td><td class="line">{</td></tr>
<tr><td class="num" id="LN631">631</td><td class="line"> GetToken();</td></tr>
<tr><td class="num" id="LN632">632</td><td class="line"> <span class='keyword'>if</span> (token-&gt;symbol == symload || token-&gt;symbol == symsave) {</td></tr>
<tr><td class="num" id="LN633">633</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> PrefsStatement(token-&gt;symbol);</td></tr>
<tr><td class="num" id="LN634">634</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN635">635</td><td class="line"> </td></tr>
<tr><td class="num" id="LN636">636</td><td class="line"> PutToken();</td></tr>
<tr><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> PrefsStatement();;</td></tr>
<tr><td class="num" id="LN638">638</td><td class="line">}</td></tr>
<tr><td class="num" id="LN639">639</td><td class="line"> </td></tr>
<tr><td class="num" id="LN640">640</td><td class="line">SyntaxNode* Parser::ParseDrawStatement()</td></tr>
<tr><td class="num" id="LN641">641</td><td class="line">{</td></tr>
<tr><td class="num" id="LN642">642</td><td class="line"> Token *statement = token;</td></tr>
<tr><td class="num" id="LN643">643</td><td class="line"> </td></tr>
<tr><td class="num" id="LN644">644</td><td class="line"> Expect(symident);</td></tr>
<tr><td class="num" id="LN645">645</td><td class="line"> Token *identToken = token;</td></tr>
<tr><td class="num" id="LN646">646</td><td class="line"> Expect(symlparen);</td></tr>
<tr><td class="num" id="LN647">647</td><td class="line"> Expect(symident);</td></tr>
<tr><td class="num" id="LN648">648</td><td class="line"> Token *paramToken = token;</td></tr>
<tr><td class="num" id="LN649">649</td><td class="line"> Expect(symrparen);</td></tr>
<tr><td class="num" id="LN650">650</td><td class="line"> </td></tr>
<tr><td class="num" id="LN651">651</td><td class="line"> <span class='keyword'>if</span> (statement-&gt;symbol == symplot) {</td></tr>
<tr><td class="num" id="LN652">652</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> PlotStatement(identToken-&gt;GetText(), paramToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN653">653</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
<tr><td class="num" id="LN654">654</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> DrawStatement(identToken-&gt;GetText(), paramToken-&gt;GetText());</td></tr>
<tr><td class="num" id="LN655">655</td><td class="line"> }</td></tr>
<tr><td class="num" id="LN656">656</td><td class="line">}</td></tr>
</table></body></html>

scan-build/report-0fbb45.html → scan-build/report-e79f68.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/expm1.c</td></tr>
<tr><td class="rowname">File:</td><td>real/expm1.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 166, column 16</a></td></tr>
<tr><td class="rowname">Description:</td><td>Value stored to 'y' is never read</td></tr>
</table>

scan-build/report-d27033.html → scan-build/report-e85ac2.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/remp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/remp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 202, column 19</a></td></tr>
<tr><td class="rowname">Description:</td><td>The left operand of '==' is a garbage value</td></tr>
</table>

scan-build/report-e39bf1.html → scan-build/report-f61e62.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 347, column 18</a></td></tr>
<tr><td class="rowname">Description:</td><td>Assigned value is garbage or undefined</td></tr>
</table>

scan-build/report-75dc7f.html → scan-build/report-fcf014.html View File

@@ -78,7 +78,7 @@
<!-- REPORTHEADER -->
<h3>Bug Summary</h3>
<table class="simpletable">
<tr><td class="rowname">File:</td><td>lib/real/kremp2.c</td></tr>
<tr><td class="rowname">File:</td><td>real/kremp2.c</td></tr>
<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 271, column 36</a></td></tr>
<tr><td class="rowname">Description:</td><td>Assigned value is garbage or undefined</td></tr>
</table>

Loading…
Cancel
Save