Ejemplo n.º 1
0
        public override ExcutableCommand Create(TokenQueue seq, Token first, CompilerApplication context)
        {
            List <ExcutableCommand> result = context.context.Results;
            int i;

            for (i = result.Count - 1; i >= 0; i--)
            {
                if (result[i].keyword.Type == TokenType.MACRO_COMMAND)
                {
                    break;
                }
            }
            ExcutableCommand[] param = new ExcutableCommand[result.Count - i - 1];
            for (int j = param.Length - 1, k = result.Count - 1; j >= 0; j--, k--)
            {
                param[j] = result[k];
                result.RemoveAt(k);
            }

            MacroCommand macro = (MacroCommand)result[i];

            macro.content = param;
            result.RemoveAt(i);
            macro.CompileMacro();
            return(null);
        }
Ejemplo n.º 2
0
 public override ExcutableCommand Create(TokenQueue seq, Token first, CompilerApplication context)
 {
     if (base.Match(first, context))
     {
         MacroCommand c = (MacroCommand)Clone();
         c.keyword      = seq.Dequeue();
         c.keyword.Type = TokenType.MACRO_COMMAND;
         c.parameters   = seq.DeQueueLine();
         context.SetMacro(c.keyword.Text, c);
         return(c);
     }
     return((MacroCommand)Clone(seq, context.GetMacro(first.Text)));
 }