C# 클래스 Nexus.Client.ModManagement.Scripting.ModScript.ModScriptInterpreter

Interpets and executes the given Mod Script script.
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5 1 사용 예제들

공개 메소드들

메소드 설명
Compile ( ) : bool

Tries to compile the script.

CreateLexer ( string p_strCode, ErrorTracker p_ertErrorTracker ) : AntlrLexerBase

Creates a Mod Script lexer for the given code, using the given error tracker.

CreateParser ( string p_strCode, ErrorTracker p_ertErrorTracker ) : AntlrParserBase

Creates a Mod Script parser for the given code, using the given error tracker.

Execute ( ) : bool

Executes the script.

ModScriptInterpreter ( Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy p_msfFunctions, string p_strScript ) : System

A simple construtor that initializes the object with the given values.

ModScriptInterpreter ( string p_strScript ) : System

A simple construtor that initializes the object with the given values.

보호된 메소드들

메소드 설명
CreateInterpreterContext ( Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy p_msfFunctions ) : ModScriptInterpreterContext

Creates the context object that tracks the state of the script being executed.

Run ( ITree p_astScript ) : object

Runs the script represented by the given abstract syntax tree.

Run ( ITree p_astScript, bool p_booTreatKeywordsAsLiterals ) : object

Runs the script represented by the given abstract syntax tree.

비공개 메소드들

메소드 설명
ExpandVariables ( ITree p_astLiteral ) : string

Expands the variables in the given literal, and strips the enclosing quotes from quoted literals.

Expanding variables replaces the variables with the values the variables represent.

GenerateAst ( string p_strModScriptCode, bool p_booCompileTest ) : ITree

Parses the given Mod Script into an AST.

HandleConditionalStatement ( ITree p_astConditional ) : void

Handles the IF statements.

HandleForLoop ( ITree p_astForLoop ) : void

Hanldes FOR loops.

HandleFunction ( ITree p_astFunction ) : object

Calss the function represented by the given abstract syntax tree.

HandleSelect ( ITree p_astSelect ) : void

Handles the GUI SELECT-type statements.

This methods presents a selection form to the user, and acts on the selection.

HandleSelectString ( ITree p_astSelect ) : void

Handles the C# switch-type SELECT-type statements.

This methods processes the SELECT-type statements that behave like if...elseif statements.

메소드 상세

Compile() 공개 메소드

Tries to compile the script.
public Compile ( ) : bool
리턴 bool

CreateInterpreterContext() 보호된 메소드

Creates the context object that tracks the state of the script being executed.
protected CreateInterpreterContext ( Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy p_msfFunctions ) : ModScriptInterpreterContext
p_msfFunctions Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy The object that implements the script functions.
리턴 ModScriptInterpreterContext

CreateLexer() 공개 메소드

Creates a Mod Script lexer for the given code, using the given error tracker.
public CreateLexer ( string p_strCode, ErrorTracker p_ertErrorTracker ) : AntlrLexerBase
p_strCode string The code be lexed.
p_ertErrorTracker Nexus.Client.Util.Antlr.ErrorTracker The error tracker to use to log /// lexing errors.
리턴 Nexus.Client.Util.Antlr.AntlrLexerBase

CreateParser() 공개 메소드

Creates a Mod Script parser for the given code, using the given error tracker.
public CreateParser ( string p_strCode, ErrorTracker p_ertErrorTracker ) : AntlrParserBase
p_strCode string The code be parsed.
p_ertErrorTracker Nexus.Client.Util.Antlr.ErrorTracker The error tracker to use to log /// parsing errors.
리턴 Nexus.Client.Util.Antlr.AntlrParserBase

Execute() 공개 메소드

Executes the script.
public Execute ( ) : bool
리턴 bool

ModScriptInterpreter() 공개 메소드

A simple construtor that initializes the object with the given values.
public ModScriptInterpreter ( Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy p_msfFunctions, string p_strScript ) : System
p_msfFunctions Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy The object that implements the script functions.
p_strScript string The script to execute.
리턴 System

ModScriptInterpreter() 공개 메소드

A simple construtor that initializes the object with the given values.
public ModScriptInterpreter ( string p_strScript ) : System
p_strScript string The script to execute.
리턴 System

Run() 보호된 메소드

Runs the script represented by the given abstract syntax tree.
protected Run ( ITree p_astScript ) : object
p_astScript ITree The abstract syntax tree representation of the script to execute.
리턴 object

Run() 보호된 메소드

Runs the script represented by the given abstract syntax tree.
protected Run ( ITree p_astScript, bool p_booTreatKeywordsAsLiterals ) : object
p_astScript ITree The abstract syntax tree representation of the script to execute.
p_booTreatKeywordsAsLiterals bool Whether keywords should be treated as literals instead of keywords.
리턴 object