Beispiel #1
0
 public ESScriptCode(SourceUnit sourceUnit, ESObjectSpace objectSpace, ESCompilerOptions esCompilerOptions, ErrorSink errorSink) : base(sourceUnit)
 {
     this.sourceUnit        = sourceUnit;
     this.objectSpace       = objectSpace;
     this.esCompilerOptions = esCompilerOptions;
     this.errorSink         = errorSink;
     bindingNamespace       = esCompilerOptions.getEnvironment(objectSpace);
     if (bindingNamespace == null)
     {
         bindingNamespace = objectSpace.SmalltalkNamespace;
     }
 }
Beispiel #2
0
        public override CompilerOptions GetCompilerOptions(Scope scope)
        {
            Assert.NotNull(scope);

            ESCompilerOptions options = (ESCompilerOptions)GetCompilerOptions();

            ScopeExtension scopeBoundParameters = scope.GetExtension(ContextId);

            if (scopeBoundParameters != null)
            {
                // Combine scope parameters with compiler options
            }

            return(options);
        }
Beispiel #3
0
        protected override Object runScript(ScriptEngine engine, ESCompilerOptions compilationOptions, NamespaceObject environment)
        {
            var script = engine.CreateScriptSourceFromPathSuffix(pathnameSuffix);

            if (script == null)
            {
                var message = "Script not found: " + pathnameSuffix;
                Console.WriteLine(message);
                return(message);
            }
            else
            {
                try {
                    return(script.Execute(compilationOptions, scriptArgs, out durationToRun));
                } catch (InvalidFunctionCallException ex) {
                    var message = "Script argument mismatch: " + pathnameSuffix;
                    Console.WriteLine(message);
                    return(message);
                }
            }
        }
Beispiel #4
0
        protected override Object runScript(ScriptEngine engine, ESCompilerOptions compilationOptions, NamespaceObject environment)
        {
            var script = engine.CreateScriptSourceFromString(text);

            return(script.Execute(compilationOptions, scriptArgs, out durationToRun));
        }
Beispiel #5
0
 protected abstract Object runScript(ScriptEngine engine, ESCompilerOptions compilationOptions, NamespaceObject environment);
Beispiel #6
0
 public ESMethodScriptCode(SourceUnit sourceUnit, ESObjectSpace objectSpace, ESCompilerOptions esCompilerOptions, ErrorSink errorSink) : base(sourceUnit, objectSpace, esCompilerOptions, errorSink)
 {
     messageReceiver = esCompilerOptions.Receiver;
 }
Beispiel #7
0
 public ESBlockScriptCode(SourceUnit sourceUnit, ESObjectSpace objectSpace, ESCompilerOptions esCompilerOptions, ErrorSink errorSink) : base(sourceUnit, objectSpace, esCompilerOptions, errorSink)
 {
 }