![]() |
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. | |
BadRuntime | UseCulture (CultureInfo culture) |
BadRuntime | UseCulture (string culture) |
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 | |
CultureInfo | Culture = CultureInfo.InvariantCulture [get, private set] |
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 |
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 29 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 64 of file BadRuntime.cs.
BadScript2.BadRuntime.BadRuntime | ( | ) |
Creates a new BadScript Runtime with the default options.
Definition at line 77 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.Clone | ( | ) |
Clone this Runtime.
Definition at line 106 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 592 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 430 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< BadExecutionContext, BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 551 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 539 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 561 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.ConfigureModuleImporter | ( | Action< string, BadModuleImporter > | action | ) |
Configures the Module Importer.
action | Module Importer Configuration Action |
Definition at line 571 of file BadRuntime.cs.
BadExecutionContext BadScript2.BadRuntime.CreateContext | ( | string | workingDirectory | ) |
Creates a new Context with the configured Options.
Definition at line 278 of file BadRuntime.cs.
|
private |
Creates and configures the Options for the Context.
Definition at line 262 of file BadRuntime.cs.
void BadScript2.BadRuntime.Dispose | ( | ) |
Disposes all Disposables.
Definition at line 92 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 315 of file BadRuntime.cs.
BadRuntimeExecutionResult BadScript2.BadRuntime.Execute | ( | string | source | ) |
Executes the specified script.
source | The Script Source to execute |
Definition at line 331 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 342 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 356 of file BadRuntime.cs.
|
staticprivate |
The Default Executor Function.
ctx | The Context to use |
exprs | The Expressions to execute |
Definition at line 136 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 215 of file BadRuntime.cs.
|
static |
Parses the specified source.
source | The Source to parse |
Definition at line 370 of file BadRuntime.cs.
|
static |
Parses the specified source.
source | The Source to parse |
file | The File Path of the Script |
Definition at line 381 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 406 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 443 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 460 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseCompilerApi | ( | ) |
Configures the Runtime to expose the CompilerAPI to the Scripts.
Definition at line 234 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 170 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseConsoleLogWriter | ( | ) |
Configures the Runtime to use the default log writer implementation(log to console)
Definition at line 195 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseCulture | ( | CultureInfo | culture | ) |
Definition at line 599 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseCulture | ( | string | culture | ) |
Definition at line 606 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 246 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 123 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseExtension< T > | ( | ) |
Uses a specified Extension.
T | The Extension Type |
T | : | BadInteropExtension | |
T | : | new() |
Definition at line 476 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 205 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 528 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 498 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 487 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 508 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 518 of file BadRuntime.cs.
BadRuntime BadScript2.BadRuntime.UseLocalModules | ( | IFileSystem? | fs = null | ) |
Registers the Local Path Handler to the Module Importer.
Definition at line 418 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 146 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 158 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 182 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 582 of file BadRuntime.cs.
|
private |
Configuration Actions for the Context.
Definition at line 34 of file BadRuntime.cs.
|
private |
Definition at line 36 of file BadRuntime.cs.
|
private |
Configuration Actions for the Options.
Definition at line 42 of file BadRuntime.cs.
|
private |
List of Disposables.
Definition at line 48 of file BadRuntime.cs.
|
private |
The Executor Function used to Execute a list of Expressions.
Definition at line 58 of file BadRuntime.cs.
|
private |
The Options for the Context.
Definition at line 53 of file BadRuntime.cs.
|
getprivate set |
Definition at line 79 of file BadRuntime.cs.
|
getsetprivate |
Definition at line 83 of file BadRuntime.cs.
|
getprivate |
Definition at line 81 of file BadRuntime.cs.