![]() |
BadScript 2
|
Exposes the BadScript Runtime Functionality to Consumers. More...
Public Member Functions | |
BadRuntime (BadExecutionContextOptions options) | |
Creates a new BadScript Runtime with the specified options. | |
BadRuntime () | |
Creates a new BadScript Runtime with the default options. | |
void | Dispose () |
Disposes all Disposables. | |
BadRuntime | Clone () |
Clone this Runtime. | |
BadRuntime | UseExecutor (Func< BadExecutionContext, IEnumerable< BadExpression >, BadObject > executor) |
Configures the Runtime to use the specified Executor. | |
BadRuntime | UseLogMask (params BadLogMask[] mask) |
Configures the Runtime to use the specified log masks. | |
BadRuntime | UseLogMask (params string[] mask) |
Configures the Runtime to use the specified log masks. | |
BadRuntime | UseConsole (IBadConsole console) |
Configures the Runtime to use the specified console implementation. | |
BadRuntime | UseLogWriter (BadLogWriter writer) |
Configures the Runtime to use the specified logwriter implementation. | |
BadRuntime | UseConsoleLogWriter () |
Configures the Runtime to use the default log writer implementation(log to console) | |
BadRuntime | UseFileLogWriter (string path) |
Configures the Runtime to use the file log writer implementation. | |
BadRuntime | LoadSettings (string settingsFile, IFileSystem? fileSystem=null) |
Loads the specified settings file. | |
BadRuntime | UseCompilerApi () |
Configures the Runtime to expose the CompilerAPI to the Scripts. | |
BadRuntime | UseDebugger (IBadDebugger debugger) |
Configures the Runtime to use the specified Debugger. | |
BadExecutionContext | CreateContext (string workingDirectory) |
Creates a new Context with the configured Options. | |
BadRuntimeExecutionResult | Execute (IEnumerable< BadExpression > expressions, string workingDirectory) |
Executes the specified expressions. | |
BadRuntimeExecutionResult | Execute (string source) |
Executes the specified script. | |
BadRuntimeExecutionResult | Execute (string source, string file) |
Executes the specified script. | |
BadRuntimeExecutionResult | ExecuteFile (string file, IFileSystem? fileSystem=null) |
Executes the specified script file. | |
BadRuntime | UseLocalModules (IFileSystem? fs=null) |
Registers the Local Path Handler to the Module Importer. | |
BadRuntime | ConfigureContextOptions (params Action< BadExecutionContextOptions >[] action) |
Adds the specified Option Configuration Actions. | |
BadRuntime | UseApi (BadInteropApi api, bool replace=false) |
Adds or Replaces a specified API. | |
BadRuntime | UseApis (IEnumerable< BadInteropApi > apis, bool replace=false) |
Adds or Replaces a specified APIs. | |
BadRuntime | UseExtension< T > () |
Uses a specified Extension. | |
BadRuntime | UseImportHandler (Func< BadExecutionContext, string, BadModuleImporter, BadImportHandler > f) |
Configures a Module Importer to use the specified Import Handler. | |
BadRuntime | UseImportHandler (Func< BadExecutionContext, BadModuleImporter, BadImportHandler > f) |
Configures a Module Importer to use the specified Import Handler. | |
BadRuntime | UseImportHandler (Func< BadModuleImporter, BadImportHandler > f) |
Configures a Module Importer to use the specified Import Handler. | |
BadRuntime | UseImportHandler (Func< string, BadModuleImporter, BadImportHandler > f) |
Configures a Module Importer to use the specified Import Handler. | |
BadRuntime | UseImportHandler (BadImportHandler handler) |
Configures a Module Importer to use the specified Import Handler. | |
BadRuntime | ConfigureModuleImporter (Action< BadExecutionContext, string, BadModuleImporter > action) |
Configures the Module Importer. | |
BadRuntime | ConfigureModuleImporter (Action< BadExecutionContext, BadModuleImporter > action) |
Configures the Module Importer. | |
BadRuntime | ConfigureModuleImporter (Action< BadModuleImporter > action) |
Configures the Module Importer. | |
BadRuntime | ConfigureModuleImporter (Action< string, BadModuleImporter > action) |
Configures the Module Importer. | |
BadRuntime | UseSingleton< T > (T obj) |
Uses the specified Singleton Object. | |
BadRuntime | ConfigureContext (params Action< BadExecutionContext >[] action) |
Adds the specified Context Configuration Actions. | |
Static Public Member Functions | |
static IEnumerable< BadExpression > | Parse (string source) |
Parses the specified source. | |
static IEnumerable< BadExpression > | Parse (string source, string file) |
Parses the specified source. | |
static IEnumerable< BadExpression > | ParseFile (string file, IFileSystem? fileSystem=null) |
Parses the specified script file. | |
Properties | |
BadModuleStore | ModuleStore = new BadModuleStore() [get] |
BadModuleImporter? | Importer [get, set] |
Private Member Functions | |
BadExecutionContextOptions | CreateOptions () |
Creates and configures the Options for the Context. | |
Static Private Member Functions | |
static BadObject | Executor (BadExecutionContext ctx, IEnumerable< BadExpression > exprs) |
The Default Executor Function. | |
Private Attributes | |
readonly List< Action< BadExecutionContext > > | m_ConfigureContext = new List<Action<BadExecutionContext>>() |
Configuration Actions for the Context. | |
readonly List< Action< BadExecutionContext, string, BadModuleImporter > > | m_ConfigureModuleImporter = new List<Action<BadExecutionContext, string, BadModuleImporter>>() |
readonly List< Action< BadExecutionContextOptions > > | m_ConfigureOptions |
Configuration Actions for the Options. | |
readonly List< IDisposable > | m_Disposables = new List<IDisposable>() |
List of Disposables. | |
readonly BadExecutionContextOptions | m_Options |
The Options for the Context. | |
Func< BadExecutionContext, IEnumerable< BadExpression >, BadObject > | m_Executor = Executor |
The Executor Function used to Execute a list of Expressions. | |
Exposes the BadScript Runtime Functionality to Consumers.
Definition at line 27 of file BadRuntime.cs.
BadScript2.BadRuntime.BadRuntime | ( | BadExecutionContextOptions | options | ) |
Creates a new BadScript Runtime with the specified options.
options | The Options to use |
Definition at line 61 of file BadRuntime.cs.
BadScript2.BadRuntime.BadRuntime | ( | ) |
Creates a new BadScript Runtime with the default options.
Definition at line 74 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.Clone | ( | ) |
Clone this Runtime.
Definition at line 96 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureContext | ( | params Action< BadExecutionContext >[] | action | ) |
Adds the specified Context Configuration Actions.
action | The Configuration Actions |
Definition at line 568 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureContextOptions | ( | params Action< BadExecutionContextOptions >[] | action | ) |
Adds the specified Option Configuration Actions.
action | The Configuration Actions |
Definition at line 407 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< BadExecutionContext, BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 527 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< BadExecutionContext, string, BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 515 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 537 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< string, BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 547 of file BadRuntime.cs.
BadExecutionContext BadScript2.BadRuntime.CreateContext | ( | string | workingDirectory | ) |
Creates a new Context with the configured Options.
Definition at line 266 of file BadRuntime.cs.
|
private |
Creates and configures the Options for the Context.
Definition at line 250 of file BadRuntime.cs.
void BadScript2.BadRuntime.Dispose | ( | ) |
Disposes all Disposables.
Definition at line 84 of file BadRuntime.cs.
BadRuntimeExecutionResult BadScript2.BadRuntime.Execute | ( | IEnumerable< BadExpression > | expressions, |
string | workingDirectory | ||
) |
Executes the specified expressions.
expressions | The Expressions to execute |
Definition at line 301 of file BadRuntime.cs.
BadRuntimeExecutionResult BadScript2.BadRuntime.Execute | ( | string | source | ) |
Executes the specified script.
source | The Script Source to execute |
Definition at line 317 of file BadRuntime.cs.
BadRuntimeExecutionResult BadScript2.BadRuntime.Execute | ( | string | source, |
string | file | ||
) |
Executes the specified script.
source | The Script Source to execute |
file | The File Path of the Script |
Definition at line 328 of file BadRuntime.cs.
BadRuntimeExecutionResult BadScript2.BadRuntime.ExecuteFile | ( | string | file, |
IFileSystem? | fileSystem = null |
||
) |
Executes the specified script file.
file | The File Path of the Script |
fileSystem | The (optional) Filesystem Instance to use |
Definition at line 339 of file BadRuntime.cs.
|
staticprivate |
The Default Executor Function.
ctx | The Context to use |
exprs | The Expressions to execute |
Definition at line 126 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.LoadSettings | ( | string | settingsFile, |
IFileSystem? | fileSystem = null |
||
) |
Loads the specified settings file.
settingsFile | The path to the settings file |
Definition at line 203 of file BadRuntime.cs.
|
static |
Parses the specified source.
source | The Source to parse |
Definition at line 350 of file BadRuntime.cs.
|
static |
Parses the specified source.
source | The Source to parse |
file | The File Path of the Script |
Definition at line 361 of file BadRuntime.cs.
|
static |
Parses the specified script file.
file | The File Path of the Script |
fileSystem | The (optional) Filesystem Instance to use |
Definition at line 386 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseApi | ( | BadInteropApi | api, |
bool | replace = false |
||
) |
Adds or Replaces a specified API.
api | The API to add or replace |
replace | If the API should be replaced if it already exists |
Definition at line 420 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseApis | ( | IEnumerable< BadInteropApi > | apis, |
bool | replace = false |
||
) |
Adds or Replaces a specified APIs.
api | The APIs to add or replace |
replace | If the APIs should be replaced if they already exist |
Definition at line 437 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseCompilerApi | ( | ) |
Configures the Runtime to expose the CompilerAPI to the Scripts.
Definition at line 222 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseConsole | ( | IBadConsole | console | ) |
Configures the Runtime to use the specified console implementation.
console | The Console to use |
Definition at line 158 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseConsoleLogWriter | ( | ) |
Configures the Runtime to use the default log writer implementation(log to console)
Definition at line 183 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseDebugger | ( | IBadDebugger | debugger | ) |
Configures the Runtime to use the specified Debugger.
debugger | The Debugger to use |
Definition at line 234 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseExecutor | ( | Func< BadExecutionContext, IEnumerable< BadExpression >, BadObject > | executor | ) |
Configures the Runtime to use the specified Executor.
executor | The Executor to use |
Definition at line 113 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseExtension< T > | ( | ) |
Uses a specified Extension.
T | The Extension Type |
T | : | BadInteropExtension | |
T | : | new() |
Definition at line 453 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseFileLogWriter | ( | string | path | ) |
Configures the Runtime to use the file log writer implementation.
path | The path to the log file |
Definition at line 193 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseImportHandler | ( | BadImportHandler | handler | ) |
Configures a Module Importer to use the specified Import Handler.
handler | The Import Handler to use |
Definition at line 504 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseImportHandler | ( | Func< BadExecutionContext, BadModuleImporter, BadImportHandler > | f | ) |
Configures a Module Importer to use the specified Import Handler.
f | Handler Factory |
Definition at line 474 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseImportHandler | ( | Func< BadExecutionContext, string, BadModuleImporter, BadImportHandler > | f | ) |
Configures a Module Importer to use the specified Import Handler.
f | Handler Factory |
Definition at line 464 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseImportHandler | ( | Func< BadModuleImporter, BadImportHandler > | f | ) |
Configures a Module Importer to use the specified Import Handler.
f | Handler Factory |
Definition at line 484 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseImportHandler | ( | Func< string, BadModuleImporter, BadImportHandler > | f | ) |
Configures a Module Importer to use the specified Import Handler.
f | Handler Factory |
Definition at line 494 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseLocalModules | ( | IFileSystem? | fs = null | ) |
Registers the Local Path Handler to the Module Importer.
Definition at line 397 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseLogMask | ( | params BadLogMask[] | mask | ) |
Configures the Runtime to use the specified log masks.
mask | The Log Masks to use |
Definition at line 136 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseLogMask | ( | params string[] | mask | ) |
Configures the Runtime to use the specified log masks.
mask | The Log Masks to use |
Definition at line 148 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseLogWriter | ( | BadLogWriter | writer | ) |
Configures the Runtime to use the specified logwriter implementation.
writer | The LogWriter to use |
Definition at line 170 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseSingleton< T > | ( | T | obj | ) |
Uses the specified Singleton Object.
obj | The Object to use |
T | Type of the Object |
T | : | class |
Definition at line 558 of file BadRuntime.cs.
|
private |
Configuration Actions for the Context.
Definition at line 32 of file BadRuntime.cs.
|
private |
Definition at line 34 of file BadRuntime.cs.
|
private |
Configuration Actions for the Options.
Definition at line 39 of file BadRuntime.cs.
|
private |
List of Disposables.
Definition at line 45 of file BadRuntime.cs.
|
private |
The Executor Function used to Execute a list of Expressions.
Definition at line 55 of file BadRuntime.cs.
|
private |
The Options for the Context.
Definition at line 50 of file BadRuntime.cs.
|
getsetprivate |
Definition at line 77 of file BadRuntime.cs.
|
getprivate |
Definition at line 76 of file BadRuntime.cs.