⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cppdyer.cpp.htm

📁 这是一个很不错的词法语法分析器! 很适合计算机专业的大学生学习参考
💻 HTM
📖 第 1 页 / 共 5 页
字号:
0126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">throw</FONT>&nbsp;<FONT COLOR="RED"><I>1</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>getBaseSettings</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>&amp;</B></FONT><FONT COLOR="BLACK"><I>fullPath</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="RED"><I>0</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>getSpecialSettings</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>&amp;</B></FONT><FONT COLOR="BLACK"><I>fullPath</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="RED"><I>0</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0129&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0130&nbsp;&nbsp;&nbsp;&nbsp;<br>
0131&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">void</FONT>&nbsp;<FONT COLOR="BLACK"><I>CppDyer</I></FONT><FONT COLOR="BLUE"><B>::</B></FONT><FONT COLOR="BLACK"><I>processFile</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE">string</FONT>&nbsp;<FONT COLOR="BLACK"><I>cppFileName</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0132&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mPositionInLine</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="RED"><I>0</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0134&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mLineNumber</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="RED"><I>0</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>resize</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="RED"><I>1024</I></FONT><FONT COLOR="BLUE"><B>*</B></FONT><FONT COLOR="RED"><I>1024</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="BLACK"><I>mPrefix</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>INVALID</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>mLineNumberChars</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">char</FONT>&nbsp;<FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="RED"><I>64</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>sprintf</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>,</B></FONT><FONT COLOR="RED"><U>&quot;%d&quot;</U></FONT><FONT COLOR="BLUE"><B>,</B></FONT><FONT COLOR="BLACK"><I>mLineNumber</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="BLACK"><I>mLineNumberPrefix</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>strlen</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>&lt;</B></FONT><FONT COLOR="BLACK"><I>mLineNumberChars</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">for</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE">string</FONT><FONT COLOR="BLUE"><B>::</B></FONT><FONT COLOR="BLACK"><I>size_type</I></FONT>&nbsp;<FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="RED"><I>0</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>&lt;</B></FONT><FONT COLOR="BLACK"><I>mLineNumberChars</I></FONT><FONT COLOR="BLUE"><B>-</B></FONT><FONT COLOR="BLACK"><I>strlen</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><FONT COLOR="BLUE"><B>++</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0146&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="RED"><U>'0'</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">for</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE">string</FONT><FONT COLOR="BLUE"><B>::</B></FONT><FONT COLOR="BLACK"><I>size_type</I></FONT>&nbsp;<FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="BLACK"><I>mLineNumberChars</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>&lt;</B></FONT><FONT COLOR="BLACK"><I>mLineNumberIndent</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><FONT COLOR="BLUE"><B>++</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="RED"><U>&quot;&amp;nbsp;&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="BLACK"><I>mLineNumberSuffix</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mPositionInLine</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="RED"><I>0</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>++</B></FONT><FONT COLOR="BLACK"><I>mLineNumber</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>ifstream</I></FONT>&nbsp;<FONT COLOR="BLACK"><I>ifs</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>cppFileName</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>c_str</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>StreamContextHelper</I></FONT><FONT COLOR="BLUE"><B>::</B></FONT><FONT COLOR="BLACK"><I>InputStreamHelper</I></FONT>&nbsp;<FONT COLOR="BLACK"><I>helper</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>ifs</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0160&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>StreamContextHelper</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>helper</I></FONT><FONT COLOR="BLUE"><B>,</B></FONT><FONT COLOR="BLUE"><B>*</B></FONT><FONT COLOR="BLUE">this</FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>run</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="BLACK"><I>mSuffix</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>INVALID</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>ofstream</I></FONT>&nbsp;<FONT COLOR="BLACK"><I>ofs</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>cppFileName</I></FONT><FONT COLOR="BLUE"><B>+</B></FONT><FONT COLOR="RED"><U>&quot;.htm&quot;</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>c_str</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>ofs</I></FONT><FONT COLOR="BLUE"><B>&lt;&lt;</B></FONT><FONT COLOR="BLACK"><I>mConvertingText</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0164&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0165&nbsp;&nbsp;&nbsp;&nbsp;<br>
0166&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">void</FONT>&nbsp;<FONT COLOR="BLACK"><I>CppDyer</I></FONT><FONT COLOR="BLUE"><B>::</B></FONT><FONT COLOR="BLACK"><I>parse</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE">Type</FONT>&nbsp;<FONT COLOR="BLACK"><I>t</I></FONT><FONT COLOR="BLUE"><B>,</B></FONT><FONT COLOR="BLUE">const</FONT>&nbsp;<FONT COLOR="BLUE">string</FONT><FONT COLOR="BLUE"><B>&amp;</B></FONT>&nbsp;<FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>,</B></FONT><FONT COLOR="BLUE">const</FONT>&nbsp;<FONT COLOR="BLACK"><I>Context</I></FONT><FONT COLOR="BLUE"><B>&amp;</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0167&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -