发明名称 METHOD AND APPARATUS FOR CODE CONVERSION
摘要 The present invention relates to the field of computer programming, in particular, to a method and apparatus for code conversion in which the codes in the code file to be converted or the code tree to be converted is read and stored into the stack and popped up in the last-in first-out sequence of the stack, and then the code line or the child node currently popped up is resolved into the file to be converted, and lastly the natural semantics comparison table is traversed, and the inter-conversion between the codes and the natural language is automatically carried out, so as to avoid the programmers from manually adding the marks and notes for the codes, which greatly decreases workload of the programmers, and can intuitively display the direct logical relationship of the codes, and at the same time, depending on different situations, the codes can be represented selectively in different forms, facilitating the creating, searching and maintaining of the codes.
申请公布号 US2015363176(A1) 申请公布日期 2015.12.17
申请号 US201414763795 申请日期 2014.01.24
申请人 SHENG Jie 发明人 SHENG Jie
分类号 G06F9/45 主分类号 G06F9/45
代理机构 代理人
主权项 1. A method for code conversion, comprising: reading all code lines of a code file to be converted, and recording a total number of lines; creating an original stack of the code lines and a syntax phrase stack according to the total number of lines, and pushing line by line all of the code lines into the original stack of the code lines; popping-up line by line the code lines according to a sequence of the original stack, from the original stack of the code lines; resolving the currently popped-up code line into a phrase to be converted; storing into the syntax phrase stack the phrase to be converted, and popping-up the phase to be converted according to a sequence of the syntax phrase stack; traversing a preset comparison table of reference phrases and natural languages, wherein if the comparison table has a reference phrase same as the phrase to be converted, then the phrase to be converted is converted into the natural language corresponding to the reference phrase in the comparison table; and resolving and converting the next code line when the syntax phrase stack is empty, and ending the conversion when both the original stack of the code lines and the syntax phrase stack are empty.
地址 Shenzhen City CN