Exemple #1
0
        public ExtensionExample()
        {
            var log_settings = new Script.LogSettings();

            log_settings.print_tokens            = true;
            log_settings.print_intermediate_code = true;
            log_settings.print_statements        = true;

            var script = Script.load_from_file("extension_examples.py", log_settings);

            var run_time = new RunTime(script);

            run_time.add_function("user_add", user_add);
            run_time.add_function("UserSum", UserSum);

            // ---------------------------------------------
            // Variable Initialization
            run_time.symbol_table.store("a", new DynamicValue(1));
            run_time.symbol_table.store("b", new DynamicValue(2));

            Console.WriteLine("\n\n");
            run_time.run();
        }