ScriptStack 1.0.4
Loading...
Searching...
No Matches
ScriptStack.Runtime.Function Class Reference

A function, forward declared in a script. More...

Public Member Functions

 Function (Executable executable, string name, List< string > parameters, Instruction entryPoint)
override string ToString ()

Properties

Executable Executable [get]
string Name [get]
uint ParameterCount [get]
ReadOnlyCollection< string > Parameters [get]
Instruction EntryPoint [get, set]

Detailed Description

A function, forward declared in a script.

Definition at line 14 of file Function.cs.

Constructor & Destructor Documentation

◆ Function()

ScriptStack.Runtime.Function.Function ( Executable executable,
string name,
List< string > parameters,
Instruction entryPoint )

Definition at line 28 of file Function.cs.

29 {
30
31 this.executable = executable;
32
33 this.name = name;
34
35 this.parameters = new List<string>(parameters);
36
37 this.entryPoint = entryPoint;
38
39 }

References Executable.

Member Function Documentation

◆ ToString()

override string ScriptStack.Runtime.Function.ToString ( )

Definition at line 41 of file Function.cs.

42 {
43
44 StringBuilder sb = new StringBuilder();
45
46 sb.Append(name + "@" + entryPoint.Address.ToString("X8"));
47
48 sb.Append("(");
49
50 for (int i = 0; i < parameters.Count; i++)
51 {
52
53 if (i > 0)
54 sb.Append(", ");
55
56 sb.Append(parameters[i]);
57
58 }
59
60 sb.Append(") ");
61
62 return sb.ToString();
63
64 }

Property Documentation

◆ EntryPoint

Instruction ScriptStack.Runtime.Function.EntryPoint
getset

Definition at line 86 of file Function.cs.

87 {
88 get { return entryPoint; }
89 set { entryPoint = value; }
90 }

Referenced by ScriptStack.Runtime.Operand.ToString().

◆ Executable

Executable ScriptStack.Runtime.Function.Executable
get

Definition at line 66 of file Function.cs.

67 {
68 get { return executable; }
69 }

Referenced by Function().

◆ Name

string ScriptStack.Runtime.Function.Name
get

Definition at line 71 of file Function.cs.

72 {
73 get { return name; }
74 }

◆ ParameterCount

uint ScriptStack.Runtime.Function.ParameterCount
get

Definition at line 76 of file Function.cs.

77 {
78 get { return (uint) parameters.Count; }
79 }

◆ Parameters

ReadOnlyCollection<string> ScriptStack.Runtime.Function.Parameters
get

Definition at line 81 of file Function.cs.

82 {
83 get { return parameters.AsReadOnly(); }
84 }

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