A source code translating method includes the steps of representing a particular source code in the form of an abstract syntax tree without using nodes representing expression statements, and converting such abstract syntax tree into a character string, wherein as the type of the root node in the abstract syntax tree being processed is if-statement (T71), a branch is taken to invoke the "procedure for producing if-statement" where a character string "if (" is first produced, and then, to produce "x==0" contained in the first occurrence of the subtree, the "procedure for outputting the abstract syntax tree as an expression" is recursively invoked, then a character string ")" is produced; to produce "y=0;" contained in the second occurrence of the subtree, the "procedure for outputting the abstract syntax tree as a statement" is recursively invoked, then a character string "else" is produced; and to produce "y=1;" contained in the third occurrence of the subtree (T72), the "procedure for outputting the abstract syntax tree as a statement" is recursively invoked, whereby a character string "if (x==0) y=0; else y=1;" is finally produced.

Un code source traduisant la méthode inclut les étapes de représenter un code source particulier sous forme d'arbre de abstract syntax sans employer des noeuds représentant des rapports d'expression, et convertissant un tel arbre de abstract syntax en chaîne de caractères, où car le type du noeud de racine dans l'arbre de abstract syntax étant traité est le si-rapport (T71), une branche est prise pour appeler la "procédure pour produire le si-rapport" où une chaîne de caractères "si ("est d'abord produit, et puis, pour produire "x==0" contenu dans la première occurrence du sous-arbre, la "procédure pour produire l'arbre de abstract syntax comme une expression" est périodiquement appelée, alors une chaîne de caractères")" est produite ; pour produire "y=0;" contenu dans la deuxième occurrence du sous-arbre, la "procédure pour produire l'arbre de abstract syntax comme rapport" est périodiquement appelée, puis une chaîne de caractères est produite "autrement" ; et pour produire "y=1;" contenu dans la troisième occurrence du sous-arbre (T72), la "procédure pour produire l'arbre de abstract syntax comme rapport" est périodiquement appelée, par lequel une chaîne de caractères "si (x==0) y=0 ; y=1 d'autre;" est finalement produit.

 
Web www.patentalert.com

< (none)

< Data sharing method and system between information processing systems with variable length block format to fixed length block format conversion

> System and method for interactive EDI transactions

> (none)

~ 00059