57 foreach (
string file
in files)
122 return current.Scope.ReturnValue ?? current.
Scope.
GetTable();
141 private IEnumerable<object?>
RunRoutine(IEnumerable<BadExpression> expressions)
143 IEnumerable<BadExpression> exprs = expressions;
147 exprs = exprs.ToArray();
182 private void Run(IEnumerable<BadExpression> expressions)
184 IEnumerable<BadExpression> exprs = expressions;
188 exprs = exprs.ToArray();
245 foreach (
object? o
in RunRoutine(parser.Parse()))
273 return current.Scope.ReturnValue ?? current.
Scope.
GetTable();
280 public void Run(
string code)
Exposes the BadScript Runtime Functionality to Consumers.
BadExecutionContext CreateContext(string workingDirectory)
Creates a new Context with the configured Options.
Wrapper class for the console abstraction.
static void WriteLine(string str)
Writes a string to the console and appends a newline.
Public interface for the filesystem abstraction of the BadScript Engine.
static string ReadAllText(this IFileSystem fileSystem, string path)
static IFileSystem Instance
File System implementation.
Implements the Interactive Console API.
Implements an Interactive Console for the BadScript Language.
BadExecutionContext? m_Context
The Execution Context.
readonly BadTaskRunner m_Runner
The Task runner.
void Load(string file)
Loads a File into the Interactive Session.
bool CatchErrors
If true, the Interactive Console will catch and print errors.
BadObject RunIsolated(string code)
Runs a set of Expressions isolated from the Interactive Session.
void Run(IEnumerable< BadExpression > expressions)
Runs a set of Expressions.
BadExecutionContext CreateContext()
Creates a new Execution Context with the Interactive Console Api.
BadScope? CurrentScope
The Current Scope of the Interactive Console.
IEnumerable< object?> RunRoutine(IEnumerable< BadExpression > expressions)
The Routine that is used to execute the Interactive Session.
IEnumerable< object?> RunIsolatedRoutine(string code)
Runs a set of Expressions isolated from the Interactive Session.
BadInteractiveConsole(BadRuntime runtime, BadTaskRunner runner, IEnumerable< string > files)
Constructs a new BadInteractiveConsole instance.
readonly BadInteractiveConsoleApi m_Api
The Interactive API.
void Reset()
Resets the Current Context.
void Run(string code)
Runs a set of Expressions.
BadObject LoadIsolated(string file)
Loads a File isolated from the Interactive Session.
readonly BadRuntime m_Runtime
The Execution Context Options.
bool PreParse
If true, the Interactive Console will pre-parse the input before executing it.
Implements a Runnable Object.
static BadRunnable Create(IEnumerable< BadObject > e)
Creates a Runnable from an Enumeration.
Implements a Task Object.
The BadScript Task Runner.
void RunStep()
Runs a single step of the Task Runner.
void AddTask(BadTask task, bool runImmediately=false)
Adds a Task to the Task Runner.
bool IsIdle
Is true if there are no tasks to run.
Implements a simple constant folding optimization.
static BadExpression Optimize(BadExpression expr)
Optimizes the given expression.
Contains the Implementation of the Constant Substitution Optimization This optimization replaces expr...
static IEnumerable< BadExpression > Optimize(BadConstantSubstitutionOptimizerScope scope, IEnumerable< BadExpression > expressions)
Substitutes all variables in the expressions with their constant value.
The Parser of the Language. It turns Source Code into an Expression Tree.
static BadSourceParser Create(string fileName, string source)
Creates a BadSourceParser Instance based on the source and filename provided.
static IEnumerable< BadExpression > Parse(string fileName, string source)
Parses a BadExpression from the Source Reader.
The Execution Context. Every execution of a script needs a context the script is running in....
IEnumerable< BadObject > Execute(IEnumerable< BadExpression > expressions)
Executes an enumeration of expressions.
BadScope Scope
The Root Scope of the Context.
Implements the Scope for the Script Engine.
BadTable GetTable()
Returns the Variable Table of the current scope.
void DefineVariable(string name, BadObject value, BadScope? caller=null, BadPropertyInfo? info=null, BadObject[]? attributes=null)
Defines a new Variable in the current scope.
Gets thrown by the runtime.
void Load(BadExecutionContext ctx, BadTable table)
Loads the API into the given Table.
string Name
Name of the API.
The Base Class for all BadScript Objects.
Implements a Table Structure for the BadScript Language.
Defines Settings for Native Optimizations.
static T Instance
Returns the Instance of the Settings Provider.
string GetCurrentDirectory()
Returns the Current Directory.
Contains a Console Abstraction Layer to be able to Simulate Console Input/Output over the Network.
Contains IO Implementation for the BadScript2 Runtime.
Contains the interactive console Implementation.
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
Contains the BadScript2 Constant Folding Optimizations.
Contains the BadScript2 Constant Substitution Optimizations.
Contains the Expressions for the BadScript2 Language.
Contains the Parser for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains the Runtime Objects.
Contains Runtime Settings Objects.
Contains the Runtime Implementation.