Generates bytecode for the Interpreter.
Generates bytecode for the Interpreter.
Inheritance: Icode
Example #1
0
		public object Compile(CompilerEnvirons compilerEnv, ScriptNode tree, string encodedSource, bool returnFunction)
		{
			CodeGenerator cgen = new CodeGenerator();
			itsData = cgen.Compile(compilerEnv, tree, encodedSource, returnFunction);
			return itsData;
		}
Example #2
0
		private void GenerateNestedFunctions()
		{
			int functionCount = scriptOrFn.GetFunctionCount();
			if (functionCount == 0)
			{
				return;
			}
			InterpreterData[] array = new InterpreterData[functionCount];
			for (int i = 0; i != functionCount; i++)
			{
				FunctionNode fn = scriptOrFn.GetFunctionNode(i);
				CodeGenerator gen = new CodeGenerator();
				gen.compilerEnv = compilerEnv;
				gen.scriptOrFn = fn;
				gen.itsData = new InterpreterData(itsData);
				gen.GenerateFunctionICode();
				array[i] = gen.itsData;
			}
			itsData.itsNestedFunctions = array;
		}