BadScript 2
Loading...
Searching...
No Matches
BadScript2.Interactive.BadInteractiveConsoleApi Class Reference

Implements the Interactive Console API. More...

Inheritance diagram for BadScript2.Interactive.BadInteractiveConsoleApi:
BadScript2.Runtime.Interop.BadInteropApi

Public Member Functions

 BadInteractiveConsoleApi (BadInteractiveConsole console)
 Constructs a new BadInteractiveConsoleApi instance.
 
- Public Member Functions inherited from BadScript2.Runtime.Interop.BadInteropApi
void LoadRawApi (BadTable target)
 Loads the API into the given Table.
 
void Load (BadExecutionContext ctx, BadTable table)
 Loads the API into the given Table.
 

Protected Member Functions

override void LoadApi (BadTable target)
 
- Protected Member Functions inherited from BadScript2.Runtime.Interop.BadInteropApi
 BadInteropApi (string name)
 Creates a new Interop API.
 
void LoadApi (BadTable target)
 Loads the API into the given Table.
 

Private Member Functions

void SetCatchError (bool enable)
 Sets the Catch Error Flag.
 
void SetPreParse (bool enable)
 Sets the Pre Parse Flag.
 
BadObject GetScope ()
 Returns the Current Scope.
 

Private Attributes

readonly BadInteractiveConsole m_Console
 The Console Instance.
 

Additional Inherited Members

- Properties inherited from BadScript2.Runtime.Interop.BadInteropApi
string Name [get]
 Name of the API.
 
virtual Version Version [get]
 The Version of the API.
 

Detailed Description

Implements the Interactive Console API.

Definition at line 12 of file BadInteractiveConsoleApi.cs.

Constructor & Destructor Documentation

◆ BadInteractiveConsoleApi()

BadScript2.Interactive.BadInteractiveConsoleApi.BadInteractiveConsoleApi ( BadInteractiveConsole  console)

Constructs a new BadInteractiveConsoleApi instance.

Parameters
consoleThe Console Instance

Definition at line 23 of file BadInteractiveConsoleApi.cs.

23 : base("Interactive")
24 {
25 m_Console = console;
26 }
readonly BadInteractiveConsole m_Console
The Console Instance.

Member Function Documentation

◆ GetScope()

BadObject BadScript2.Interactive.BadInteractiveConsoleApi.GetScope ( )
private

Returns the Current Scope.

Returns
Scope

Definition at line 63 of file BadInteractiveConsoleApi.cs.

64 {
65 return m_Console.CurrentScope ?? BadObject.Null;
66 }
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28

◆ LoadApi()

override void BadScript2.Interactive.BadInteractiveConsoleApi.LoadApi ( BadTable  target)
protected

Definition at line 29 of file BadInteractiveConsoleApi.cs.

30 {
31 target.SetFunction("Reset", m_Console.Reset);
32 target.SetFunction<string>("Run", m_Console.Run);
33 target.SetFunction<string>("Load", m_Console.Load);
34 target.SetFunction<string>("RunIsolated", m_Console.RunIsolated, BadAnyPrototype.Instance);
35 target.SetFunction<string>("LoadIsolated", m_Console.LoadIsolated, BadAnyPrototype.Instance);
36 target.SetFunction("GetScope", GetScope, BadScope.Prototype);
37 target.SetFunction<bool>("SetCatchError", SetCatchError);
38 target.SetFunction<bool>("SetPreParse", SetPreParse);
39 }
void SetPreParse(bool enable)
Sets the Pre Parse Flag.
void SetCatchError(bool enable)
Sets the Catch Error Flag.
void Load(string file)
Loads a File into the Interactive Session.
BadObject RunIsolated(string code)
Runs a set of Expressions isolated from the Interactive Session.
void Run(IEnumerable< BadExpression > expressions)
Runs a set of Expressions.
BadObject LoadIsolated(string file)
Loads a File isolated from the Interactive Session.
Implements the Scope for the Script Engine.
Definition BadScope.cs:238
static BadClassPrototype Prototype
A Class Prototype for the Scope.
Definition BadScope.cs:420
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.

◆ SetCatchError()

void BadScript2.Interactive.BadInteractiveConsoleApi.SetCatchError ( bool  enable)
private

Sets the Catch Error Flag.

Parameters
enableState

Definition at line 45 of file BadInteractiveConsoleApi.cs.

46 {
47 m_Console.CatchErrors = enable;
48 }

◆ SetPreParse()

void BadScript2.Interactive.BadInteractiveConsoleApi.SetPreParse ( bool  enable)
private

Sets the Pre Parse Flag.

Parameters
enableState

Definition at line 54 of file BadInteractiveConsoleApi.cs.

55 {
56 m_Console.PreParse = enable;
57 }

Member Data Documentation

◆ m_Console

readonly BadInteractiveConsole BadScript2.Interactive.BadInteractiveConsoleApi.m_Console
private

The Console Instance.

Definition at line 17 of file BadInteractiveConsoleApi.cs.


The documentation for this class was generated from the following file: