Generates bytecode for the Interpreter.
Generates bytecode for the Interpreter.
Inheritance: Icode
コード例 #1
0
ファイル: Interpreter.cs プロジェクト: hazzik/Rhino.Net
		public object Compile(CompilerEnvirons compilerEnv, ScriptNode tree, string encodedSource, bool returnFunction)
		{
			CodeGenerator cgen = new CodeGenerator();
			itsData = cgen.Compile(compilerEnv, tree, encodedSource, returnFunction);
			return itsData;
		}
コード例 #2
0
ファイル: CodeGenerator.cs プロジェクト: hazzik/Rhino.Net
		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;
		}