Esempio n. 1
0
        /// <summary>Prepares to adapt a command entry to CIL.</summary>
        /// <param name="values">The adaptation-relevant values.</param>
        /// <param name="entry">The present entry ID.</param>
        public override void PreAdaptToCIL(CILAdaptationValues values, int entry)
        {
            CommandEntry cent = values.Entry.Entries[entry];

            if (cent.IsCallback)
            {
                values.PopVarSet();
                return;
            }
            string arg = cent.Arguments[0].ToString();

            if (arg == "next" || arg == "stop")
            {
                return;
            }
            values.PushVarSet();
            string sn = cent.GetSaveNameNoParse("while_index");

            if (values.LocalVariableLocation(sn) >= 0)
            {
                throw new ErrorInducedException("Already have a while_index var (labeled '" + sn + "')?!");
            }
            TagType type = cent.TagSystem.Types.Type_Integer;

            values.AddVariable(sn, type);
        }
        /// <summary>Prepares to adapt a command entry to CIL.</summary>
        /// <param name="values">The adaptation-relevant values.</param>
        /// <param name="entry">The present entry ID.</param>
        public override void PreAdaptToCIL(CILAdaptationValues values, int entry)
        {
            CommandEntry cent = values.Entry.Entries[entry];

            if (cent.IsCallback)
            {
                values.PopVarSet();
                return;
            }
            string arg = cent.Arguments[0].ToString();

            if (arg == "next" || arg == "stop")
            {
                return;
            }
            values.PushVarSet();
            // TODO: scope properly!
            PreAdaptSaveMode(values, entry, false, cent.System.TagSystem.Types.Type_Dynamic, true);
        }
Esempio n. 3
0
        /// <summary>Prepares to adapt a command entry to CIL.</summary>
        /// <param name="values">The adaptation-relevant values.</param>
        /// <param name="entry">The present entry ID.</param>
        public override void PreAdaptToCIL(CILAdaptationValues values, int entry)
        {
            CommandEntry cent = values.Entry.Entries[entry];

            if (cent.IsCallback)
            {
                values.PopVarSet();
                return;
            }
            string arg0 = cent.Arguments[0].ToString();

            if (arg0 == "define")
            {
                values.PushVarSet();
                // TODO: Forcibly compress the block to an argument, instead of compiling the sub-block
            }
            else if (arg0 != "undefine" && arg0 != "stop")
            {
                throw new ErrorInducedException("First argument must be 'define', 'undefine', or 'stop'.");
            }
        }