在進行再造工程時,若採用Java 原始碼轉為語法樹結構,可利用語法樹的樹狀運動來完成再造工程。 In the Java environment, source codes are compiled into bytecodes and executed by the Java Virtual Machine. Bytecodes are opcodes for Java Virtual Machine that simulates source codes. There is no significant relationship between Java source codes and bytecodes.
This thesis proposed an interpreting mechanism for Java language. Without compiling source codes into bytecodes, a syntax tree is presented. The source codes are parsed into syntax tree and executed through virtual functions and recursive calls.
The interpreting mechanism executes codes through massive recursive calls. When executing statements such as return, break, or continue, the control flow should be returned to specific ancestor, and it can not be done by simplex recursive call. This problem is solved by adopting try/catch mechanism.
The Syntax tree and interpreting mechanism proposed in the thesis provides an infrastructure for software developing and reengineering.