Пример #1
0
 // Cell affinity //
 public static CellAffinity GetAffinity(HScriptParser.TypeContext context)
 {
     string t = context.GetText().Split('.').First();
     return CellAffinityHelper.Parse(t);
 }
Пример #2
0
        internal bool RenderCommand(HScriptParser.CommandContext Context, CommandVisitor Processor)
        {

            // Consume //
            CommandPlan plan;
            try
            {
                plan = Processor.Visit(Context);
            }
            catch (HScriptCompileException hce)
            {
                this.Home.IO.Communicate(string.Format("Compile Error for statement {0}", this._CompileCount));
                this.Home.IO.Communicate(Context.GetText());
                this.Home.IO.Communicate(hce.Message);
                return false;
            }

            // Add the header to the plan buffer //
            if (!this.Home.SupressIO)
                this.Home.IO.Communicate();

            // Execute //
            try
            {
                plan.Execute();
            }
            catch (HorseDataException hde)
            {

                this.Home.IO.Communicate(string.Format("Compile Error for statement {0}", this._CompileCount));
                this.Home.IO.Communicate(hde.Message);
                return false;

            }

            // Communicate //
            if (!this.Home.SupressIO)
            {

                // Append the write stack //
                this.Home.IO.Communicate(plan.MessageText());

                // Dump the buffer //
                this.Home.IO.FlushStringBuffer();
                this.Home.IO.FlushRecordBuffer();

            }

            return true;

        }