Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (scriptTable.Variables != null)
- {
- generator.WriteComment("VARIABLES", code);
- foreach (ScriptGlobal variable in scriptTable.Variables)
- {
- code.Write("(variable {0} {1} ", opcodes.GetTypeInfo((ushort)variable.Type).Name, variable.Name);
- generator.WriteExpression(variable.ExpressionIndex, code);
- if (_showInfo)
- code.WriteLine(")\t\t; Index: {0}, EXP: {1}", counter.ToString(), variable.ExpressionIndex.Index.ToString());
- else
- code.WriteLine(")");
- counter++;
- }
- code.WriteLine();
- counter = 0;
- }
- generator.WriteComment("GLOBALS", code);
- foreach (ScriptGlobal global in scriptTable.Globals)
- {
- code.Write("(global {0} {1} ", opcodes.GetTypeInfo((ushort) global.Type).Name, global.Name);
- generator.WriteExpression(global.ExpressionIndex, code);
- if (_showInfo)
- code.WriteLine(")\t\t; Index: {0}, EXP: {1}", counter.ToString(), global.ExpressionIndex.Index.ToString());
- else
- code.WriteLine(")");
- counter++;
- }
- code.WriteLine();
- counter = 0;
- generator.WriteComment("SCRIPTS", code);
- foreach (Script script in scriptTable.Scripts)
- {
- if (_showInfo)
- {
- generator.WriteComment(string.Format("Index: {0}, EXP: {1}", counter.ToString(), script.RootExpressionIndex.Index.ToString()), code);
- }
- code.Write("(script {0} {1} ", opcodes.GetScriptTypeName((ushort) script.ExecutionType),
- opcodes.GetTypeInfo((ushort) script.ReturnType).Name);
- if (script.Parameters.Count > 0)
- {
- code.Write("({0} (", script.Name);
- bool firstParam = true;
- foreach (ScriptParameter param in script.Parameters)
- {
- if (!firstParam)
- code.Write(", ");
- code.Write("{1} {0}", param.Name, opcodes.GetTypeInfo((ushort) param.Type).Name);
- firstParam = false;
- }
- code.Write("))");
- }
- else
- {
- code.Write(script.Name);
- }
- code.Indent++;
- code.WriteLine();
- generator.WriteExpression(script.RootExpressionIndex, code, _buildInfo.HeaderSize == 0x1E000);
- code.Indent--;
- code.WriteLine();
- code.WriteLine(")");
- code.WriteLine();
- counter++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement