奇怪的java程式碼
如果有ㄧ檔案 factory.tpl 內容為
# A TPL Program to calculate the factorial of 5
INTEGER myInt
INTEGER factorial
LET myInt=5
CALCULATE factorial=myInt*4
CALCULATE factorial=factorial*3
CALCULATE factorial=factorial*2
PRINT "The factorial of "
PRINT myInt
PRINT " is "
PRINTLN factorial
END
該怎麼寫一個java程式讀取 factory.tpl 後
輸出結果為
The factorial of 5 is 120
已更新項目:
請問要如何寫一個compiler
可以請你舉一個例子嗎??
謝謝
還有問題?馬上發問,尋求解答。