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

📄 virtual_syntaxtree.xml

📁 这是一个用java语言编写的小型C语言的语法分析器。
💻 XML
字号:
<?xml version="1.0"?>
<root>
    <tree line="1" nodetype="ClassDecl" nodestring="Pet">
        <child>
            <tree line="3" nodetype="VarDecl" nodestring="pname" vartype="int" modifier="private" isArray="0" />
            <tree line="4" nodetype="VarDecl" nodestring="a" vartype="int" modifier="private" isArray="0" />
            <tree line="5" nodetype="FunDecl" nodestring="Pet" rettype="void" modifier="constructor">
                <child>
                    <tree line="5" nodetype="Para" nodestring="x" vartype="int" isArray="0" />
                    <tree line="5" nodetype="Para" nodestring="y" vartype="int" isArray="0" />
                </child>
                <child>
                    <tree line="7" nodetype="AssignStm" nodestring="=">
                        <child>
                            <tree line="7" nodetype="ThisStm" nodestring="this">
                                <child>
                                    <tree line="7" nodetype="VarID" nodestring="pname" />
                                </child>
                            </tree>
                        </child>
                        <child>
                            <tree line="7" nodetype="VarID" nodestring="x" isArray="0" />
                        </child>
                    </tree>
                    <tree line="8" nodetype="AssignStm" nodestring="=">
                        <child>
                            <tree line="8" nodetype="ThisStm" nodestring="this">
                                <child>
                                    <tree line="8" nodetype="VarID" nodestring="a" />
                                </child>
                            </tree>
                        </child>
                        <child>
                            <tree line="8" nodetype="VarID" nodestring="y" isArray="0" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="10" nodetype="FunDecl" nodestring="Name" rettype="int" modifier="public" isVirtual="1">
                <child>
                    <tree line="12" nodetype="ReturnStm" nodestring="return">
                        <child>
                            <tree line="12" nodetype="VarID" nodestring="pname" isArray="0" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="14" nodetype="FunDecl" nodestring="Increase" rettype="int" modifier="public" isVirtual="1">
                <child>
                    <tree line="16" nodetype="AssignStm" nodestring="=">
                        <child>
                            <tree line="16" nodetype="ThisStm" nodestring="this">
                                <child>
                                    <tree line="16" nodetype="VarID" nodestring="a" />
                                </child>
                            </tree>
                        </child>
                        <child>
                            <tree line="16" nodetype="ADD" nodestring="+">
                                <child>
                                    <tree line="16" nodetype="ThisStm" nodestring="this">
                                        <child>
                                            <tree line="16" nodetype="VarID" nodestring="a" />
                                        </child>
                                    </tree>
                                </child>
                                <child>
                                    <tree line="16" nodetype="ConstID" nodestring="1" />
                                </child>
                            </tree>
                        </child>
                    </tree>
                    <tree line="17" nodetype="ReturnStm" nodestring="return">
                        <child>
                            <tree line="17" nodetype="VarID" nodestring="a" isArray="0" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="19" nodetype="FunDecl" nodestring="~Pet" rettype="void" modifier="destructor" />
        </child>
    </tree>
    <tree line="23" nodetype="ClassDecl" nodestring="Dog">
        <child>
            <tree line="23" nodetype="BaseClsID" nodestring="Pet" modifier="public" />
        </child>
        <child>
            <tree line="25" nodetype="VarDecl" nodestring="dname" vartype="int" modifier="private" isArray="0" />
            <tree line="26" nodetype="FunDecl" nodestring="Dog" rettype="void" modifier="constructor">
                <child>
                    <tree line="26" nodetype="Para" nodestring="x" vartype="int" isArray="0" />
                    <tree line="26" nodetype="Para" nodestring="y" vartype="int" isArray="0" />
                    <tree line="26" nodetype="Para" nodestring="z" vartype="int" isArray="0" />
                </child>
                <child>
                    <tree line="28" nodetype="AssignStm" nodestring="=">
                        <child>
                            <tree line="28" nodetype="VarID" nodestring="pname" isArray="0" />
                        </child>
                        <child>
                            <tree line="28" nodetype="VarID" nodestring="x" isArray="0" />
                        </child>
                    </tree>
                    <tree line="29" nodetype="AssignStm" nodestring="=">
                        <child>
                            <tree line="29" nodetype="VarID" nodestring="a" isArray="0" />
                        </child>
                        <child>
                            <tree line="29" nodetype="VarID" nodestring="y" isArray="0" />
                        </child>
                    </tree>
                    <tree line="30" nodetype="AssignStm" nodestring="=">
                        <child>
                            <tree line="30" nodetype="VarID" nodestring="dname" isArray="0" />
                        </child>
                        <child>
                            <tree line="30" nodetype="VarID" nodestring="z" isArray="0" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="32" nodetype="FunDecl" nodestring="Name" rettype="int" modifier="public">
                <child>
                    <tree line="34" nodetype="ReturnStm" nodestring="return">
                        <child>
                            <tree line="34" nodetype="VarID" nodestring="dname" isArray="0" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="36" nodetype="FunDecl" nodestring="~Dog" rettype="void" modifier="destructor" />
        </child>
    </tree>
    <tree line="41" nodetype="FunDecl" nodestring="main" rettype="void">
        <child>
            <tree line="43" nodetype="VarDecl" nodestring="result1" vartype="int" modifier="" isArray="0" />
            <tree line="43" nodetype="VarDecl" nodestring="result2" vartype="int" modifier="" isArray="0" />
            <tree line="43" nodetype="VarDecl" nodestring="result3" vartype="int" modifier="" isArray="0" />
            <tree line="44" nodetype="VarDecl" nodestring="name" vartype="int" modifier="" isArray="0" />
            <tree line="45" nodetype="VarDecl" nodestring="pet" vartype="Pet" modifier="" isArray="0" />
            <tree line="46" nodetype="AssignStm" nodestring="=">
                <child>
                    <tree line="46" nodetype="VarID" nodestring="pet" isArray="0" />
                </child>
                <child>
                    <tree line="46" nodetype="NewStm" nodestring="new">
                        <child>
                            <tree line="46" nodetype="FunCall" nodestring="Pet">
                                <child>
                                    <tree line="46" nodetype="ConstID" nodestring="1" />
                                    <tree line="46" nodetype="ConstID" nodestring="2" />
                                </child>
                            </tree>
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="47" nodetype="AssignStm" nodestring="=">
                <child>
                    <tree line="47" nodetype="VarID" nodestring="result1" isArray="0" />
                </child>
                <child>
                    <tree line="47" nodetype="ObjectVar" nodestring="pet">
                        <child>
                            <tree line="47" nodetype="FunCall" nodestring="Increase" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="49" nodetype="VarDecl" nodestring="dog1" vartype="Dog" modifier="" isArray="0" />
            <tree line="50" nodetype="AssignStm" nodestring="=">
                <child>
                    <tree line="50" nodetype="VarID" nodestring="dog1" isArray="0" />
                </child>
                <child>
                    <tree line="50" nodetype="NewStm" nodestring="new">
                        <child>
                            <tree line="50" nodetype="FunCall" nodestring="Dog">
                                <child>
                                    <tree line="50" nodetype="ConstID" nodestring="3" />
                                    <tree line="50" nodetype="ConstID" nodestring="4" />
                                </child>
                            </tree>
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="51" nodetype="AssignStm" nodestring="=">
                <child>
                    <tree line="51" nodetype="VarID" nodestring="result2" isArray="0" />
                </child>
                <child>
                    <tree line="51" nodetype="ObjectVar" nodestring="dog1">
                        <child>
                            <tree line="51" nodetype="FunCall" nodestring="Increase" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="53" nodetype="VarDecl" nodestring="dog2" vartype="Pet" modifier="" isArray="0" />
            <tree line="54" nodetype="AssignStm" nodestring="=">
                <child>
                    <tree line="54" nodetype="VarID" nodestring="dog2" isArray="0" />
                </child>
                <child>
                    <tree line="54" nodetype="NewStm" nodestring="new">
                        <child>
                            <tree line="54" nodetype="FunCall" nodestring="Dog">
                                <child>
                                    <tree line="54" nodetype="ConstID" nodestring="3" />
                                    <tree line="54" nodetype="ConstID" nodestring="4" />
                                    <tree line="54" nodetype="ConstID" nodestring="5" />
                                </child>
                            </tree>
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="55" nodetype="AssignStm" nodestring="=">
                <child>
                    <tree line="55" nodetype="VarID" nodestring="name" isArray="0" />
                </child>
                <child>
                    <tree line="55" nodetype="ObjectVar" nodestring="dog2">
                        <child>
                            <tree line="55" nodetype="FunCall" nodestring="Name" />
                        </child>
                    </tree>
                </child>
            </tree>
            <tree line="57" nodetype="DeleteStm" nodestring="delete">
                <child>
                    <tree line="57" nodetype="VarID" nodestring="pet" isArray="0" />
                </child>
            </tree>
            <tree line="58" nodetype="DeleteStm" nodestring="delete">
                <child>
                    <tree line="58" nodetype="VarID" nodestring="dog1" isArray="0" />
                </child>
            </tree>
            <tree line="59" nodetype="DeleteStm" nodestring="delete">
                <child>
                    <tree line="59" nodetype="VarID" nodestring="dog2" isArray="0" />
                </child>
            </tree>
            <tree line="60" nodetype="ReturnStm" nodestring="return" />
        </child>
    </tree>
</root>

⌨️ 快捷键说明

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