Example #1
0
        static void WriteElement()
        {
            int    expType;
            string str;

            if (la.kind == stringLit_Sym)
            {
                StringConst(out str);
                CodeGen.WriteString(str);
            }
            else if (StartOf(11))
            {
                Expression(out expType);
                if (!(IsArith(expType) || expType == Types.boolType))
                {
                    SemError("cannot write this type");
                }
                switch (expType)
                {
                case Types.intType:
                case Types.boolType:
                    CodeGen.Write(expType); break;

                default:
                    break;
                }
            }
            else
            {
                SynErr(54);
            }
        }