示例#1
0
        public override TreeNode ToTreeNode()
        {
            TreeNode tree = new TreeNode("Exp :");

            tree.Nodes.Add(exp.ToTreeNode());
            return(tree);
        }
示例#2
0
        public override TreeNode ToTreeNode()
        {
            TreeNode tree = new TreeNode("Const :");

            tree.Nodes.Add("let");
            tree.Nodes.Add(ID.lexeme);
            tree.Nodes.Add("=");
            var expn = tree.Nodes.Add("exp :");

            expn.Nodes.Add(exp.ToTreeNode());
            return(tree);
        }
示例#3
0
        public override TreeNode ToTreeNode()
        {
            TreeNode tree = new TreeNode(OP.lexeme);

            if (left != null)
            {
                tree.Nodes.Add(left.ToTreeNode());
            }
            if (right != null)
            {
                tree.Nodes.Add(right.ToTreeNode());
            }
            return(tree);
        }
示例#4
0
        public override TreeNode ToTreeNode()
        {
            TreeNode tree = new TreeNode("Func :");

            tree.Nodes.Add("fnc");
            tree.Nodes.Add("id = " + ID.lexeme);
            tree.Nodes.Add("(");
            var prms = tree.Nodes.Add("Prms :");

            foreach (var prm in paramList)
            {
                prms.Nodes.Add("id = " + prm.lexeme);
            }
            tree.Nodes.Add(")");
            tree.Nodes.Add("=");
            var expn = tree.Nodes.Add("exp :");

            expn.Nodes.Add(exp.ToTreeNode());
            return(tree);
        }