示例#1
0
        private void Parsing(ArrayDeclNode node, StringBuilder sb, ref int lineNum)
        {
            //PrintCommand(sb, "array go", ref lineNum);
            string length = node.GetChild(2).GetChild(0).Text;

            PrintCommand(sb, String.Format("ldc.i4 {0}", length), ref lineNum);
            PrintCommand(sb, "newarr int32", ref lineNum);
            string id      = node.GetChild(1).GetChild(1).Text;
            string command = String.Format("stloc {0}", id);

            if (globalVars.IsContains(node.Name))
            {
                command = String.Format("stsfld int32[] Program::{0}", node.Name);
            }

            PrintCommand(sb, command, ref lineNum);
            //(sb, "array stop", ref lineNum);
        }