Esempio n. 1
0
        public override void GenCode(StringBuilder sb)
        {
            // if the variable is an argument as opposed to a variable
            // use the ldarg instruction rather than the ldloc instruction
            FormalParam fp = declarationRef as FormalParam;

            if (fp != null)
            {
                cg.emit(sb, "\tldarg.s {0}\n", fp.GetNumber());
            }
            else
            {
                cg.emit(sb, "\tldloc.s {0}\n", declarationRef.GetNumber());
            }
        }