------------------------------------------------------------------------------ \brief Dump stack content. This function is used for debugging only. */
| 1750 | This function is used for debugging only. |
| 1751 | */ |
| 1752 | void ParserBase::StackDump(const std::stack<token_type>& a_stVal, const std::stack<token_type>& a_stOprt) const |
| 1753 | { |
| 1754 | std::stack<token_type> stOprt(a_stOprt); |
| 1755 | std::stack<token_type> stVal(a_stVal); |
| 1756 | |
| 1757 | mu::console() << _T("\nValue stack:\n"); |
| 1758 | while (!stVal.empty()) |
| 1759 | { |
| 1760 | token_type val = stVal.top(); |
| 1761 | stVal.pop(); |
| 1762 | |
| 1763 | if (val.GetType() == tpSTR) |
| 1764 | mu::console() << _T(" \"") << val.GetAsString() << _T("\" "); |
| 1765 | else |
| 1766 | mu::console() << _T(" ") << val.GetVal() << _T(" "); |
| 1767 | } |
| 1768 | mu::console() << "\nOperator stack:\n"; |
| 1769 | |
| 1770 | while (!stOprt.empty()) |
| 1771 | { |
| 1772 | if (stOprt.top().GetCode() <= cmASSIGN) |
| 1773 | { |
| 1774 | mu::console() << _T("OPRT_INTRNL \"") |
| 1775 | << ParserBase::c_DefaultOprt[stOprt.top().GetCode()] |
| 1776 | << _T("\" \n"); |
| 1777 | } |
| 1778 | else |
| 1779 | { |
| 1780 | switch (stOprt.top().GetCode()) |
| 1781 | { |
| 1782 | case cmVAR: mu::console() << _T("VAR\n"); break; |
| 1783 | case cmVAL: mu::console() << _T("VAL\n"); break; |
| 1784 | case cmFUNC: |
| 1785 | mu::console() |
| 1786 | << _T("FUNC \"") |
| 1787 | << stOprt.top().GetAsString() |
| 1788 | << _T("\"\n"); |
| 1789 | break; |
| 1790 | |
| 1791 | case cmFUNC_BULK: |
| 1792 | mu::console() |
| 1793 | << _T("FUNC_BULK \"") |
| 1794 | << stOprt.top().GetAsString() |
| 1795 | << _T("\"\n"); |
| 1796 | break; |
| 1797 | |
| 1798 | case cmOPRT_INFIX: |
| 1799 | mu::console() << _T("OPRT_INFIX \"") |
| 1800 | << stOprt.top().GetAsString() |
| 1801 | << _T("\"\n"); |
| 1802 | break; |
| 1803 | |
| 1804 | case cmOPRT_BIN: |
| 1805 | mu::console() << _T("OPRT_BIN \"") |
| 1806 | << stOprt.top().GetAsString() |
| 1807 | << _T("\"\n"); |
| 1808 | break; |
| 1809 |