Exemple #1
0
        // Get the data //
        public static DataSet GetData(Workspace Enviro, HScriptParser.Full_table_nameContext context)
        {

            // Get the name //
            string t_name = context.table_name().IDENTIFIER().GetText();

            // Global context //
            if (context.K_GLOBAL() != null)
            {
                if (Enviro.ChunkHeap.Exists(t_name))
                    return Enviro.ChunkHeap[t_name];
                throw new HScriptCompileException("Global chunk '{0}' does not exist", t_name);
            }

            // Table context //
            if (context.database_name() != null)
            {
                string d_base = context.database_name().IDENTIFIER().GetText();
                if (Enviro.Exists(d_base, t_name))
                    return Enviro.GetStaticTable(d_base, t_name);
                throw new HScriptCompileException("Table '{0}' does not exist", t_name);
            }

            throw new HScriptCompileException("Data '{0}' does not exist in memory or on disk", t_name);

        }