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

📄 cppdyer.cpp.htm

📁 这是一个很不错的词法语法分析器! 很适合计算机专业的大学生学习参考
💻 HTM
📖 第 1 页 / 共 5 页
字号:
0168&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">string</FONT>&nbsp;<FONT COLOR="BLACK"><I>prefix</I></FONT><FONT COLOR="BLUE"><B>,</B></FONT><FONT COLOR="BLACK"><I>suffix</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>t</I></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="BLACK"><I>IDENTIFIER</I></FONT><FONT COLOR="BLUE"><B>&amp;&amp;</B></FONT><FONT COLOR="BLACK"><I>mExtraKeywords</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>find</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="BLACK"><I>mExtraKeywords</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>end</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>prefix</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>KEYWORD</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>suffix</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>KEYWORD</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>t</I></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="BLACK"><I>IDENTIFIER</I></FONT><FONT COLOR="BLUE"><B>&amp;&amp;</B></FONT><FONT COLOR="BLACK"><I>mSpecialIdentifiers</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>find</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="BLACK"><I>mSpecialIdentifiers</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>end</I></FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0176&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>prefix</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="BLACK"><I>mSpecialIdentifierPrefix</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>mSpecialIdentifiers</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><br>
0177&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>suffix</I></FONT><FONT COLOR="BLUE"><B>=</B></FONT><FONT COLOR="BLACK"><I>mSpecialIdentifierSuffix</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>mSpecialIdentifiers</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><br>
0178&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0179&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT><br>
0180&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0181&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>prefix</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>t</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0182&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>suffix</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>t</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0184&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>prefix</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0185&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>s</I></FONT><FONT COLOR="BLUE"><B>.</B></FONT><FONT COLOR="BLACK"><I>size</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><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0186&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0187&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>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'\&quot;'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0188&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;quot;&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0189&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'&amp;'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0190&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;amp;&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0191&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'&lt;'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0192&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;lt;&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'&gt;'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0194&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;gt;&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0195&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'&nbsp;'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0196&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>
0197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'\t'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0198&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0199&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">int</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>mTabSpaces</I></FONT><FONT COLOR="BLUE"><B>-</B></FONT><FONT COLOR="BLACK"><I>mPositionInLine</I></FONT><FONT COLOR="BLUE"><B>%</B></FONT><FONT COLOR="RED"><I>4</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>
0200&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>&quot;&amp;nbsp;&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0201&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I>mPositionInLine</I></FONT><FONT COLOR="BLUE"><B>+=</B></FONT><FONT COLOR="BLACK"><I>mTabSpaces</I></FONT><FONT COLOR="BLUE"><B>-</B></FONT><FONT COLOR="BLACK"><I>mPositionInLine</I></FONT><FONT COLOR="BLUE"><B>%</B></FONT><FONT COLOR="RED"><I>4</I></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0202&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">continue</FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0203&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>}</B></FONT><br>
0204&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE">else</FONT>&nbsp;<FONT COLOR="BLUE">if</FONT><FONT COLOR="BLUE"><B>(</B></FONT><FONT COLOR="BLACK"><I>s</I></FONT><FONT COLOR="BLUE"><B>[</B></FONT><FONT COLOR="BLACK"><I>i</I></FONT><FONT COLOR="BLUE"><B>]</B></FONT><FONT COLOR="BLUE"><B>==</B></FONT><FONT COLOR="RED"><U>'\n'</U></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0205&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0206&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;&lt;br&gt;\n&quot;</U></FONT><FONT COLOR="BLUE"><B>;</B></FONT><br>
0207&nbsp;&nbsp;&nbsp;&nbsp;&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>mLineNumberChars</I></FONT><FONT COLOR="BLUE"><B>)</B></FONT><br>
0208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLUE"><B>{</B></FONT><br>
0209&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="BLACK"><I

⌨️ 快捷键说明

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