Пример #1
0
        public Block( Command[] commands )
        {
            List<Command> cmds = new List<Command>();

            int i = 0;
            while ( i < commands.Length )
            {
                Command cmd = commands[ i++ ];
                cmds.Add( cmd );

                if ( cmd.CommandType.BlockOpen )
                {
                    List<Command> block = new List<Command>();
                    int depth = 0;
                    while ( i < commands.Length )
                    {
                        Command bcmd = commands[ i++ ];
                        if ( bcmd.CommandType.BlockClose )
                        {
                            --depth;

                            if ( depth == -1 )
                            {
                                if ( bcmd.CommandType.BlockOpen )
                                    --i;

                                break;
                            }
                        }

                        if ( bcmd.CommandType.BlockOpen )
                            ++depth;

                        block.Add( bcmd );
                    }

                    cmd.InnerBlock = new Block( block.ToArray() );
                }
            }

            Commands = cmds.ToArray();
        }
Пример #2
0
 internal ParameterParseException( Command command )
     : base("Error when parsing parameters for \"" + command.Identifier
         + "\" at line " + command.LineNumber + ".")
 {
 }
Пример #3
0
 internal ParameterParseException( Command command, String message )
     : base("Error when parsing parameters for \"" + command.Identifier
         + "\" at line " + command.LineNumber + ":\n" + message)
 {
 }
Пример #4
0
 public virtual void ExitInnerBlock( Command command, Thread thread, Scope scope )
 {
 }
Пример #5
0
 public virtual void Execute( Command command, Thread thread, Scope scope )
 {
 }