Aiming at the problem that automatic code generation technology requires a lot of human intervention and cannot produce a lot of source code, a random code generation method based on syntax tree hierarchical model was proposed. In this technique, the syntax elements in the code abstract syntax tree are divided into five layers according to different degrees of refinement by constructing a hierarchical syntax tree model, and the element composition expression is proposed to formally describe the structure of the code at the text level. Based on this approach, an automatic code generation framework is proposed. Supported by a corpus, the framework can generate multiple nested element formation expressions which are finally converted into usable source code by translators. Experiments from the three dimensions of code complexity, control flow and semantic similarity prove that this method can generate a large number of source code randomly, and the generated code has low similarity in control flow diagram and semantics.
Access to the requested content is limited to institutions that have purchased or subscribe to SPIE eBooks.
You are receiving this notice because your organization may not have SPIE eBooks access.*
*Shibboleth/Open Athens users─please
sign in
to access your institution's subscriptions.
To obtain this item, you may purchase the complete book in print or electronic format on
SPIE.org.
INSTITUTIONAL Select your institution to access the SPIE Digital Library.
PERSONAL Sign in with your SPIE account to access your personal subscriptions or to use specific features such as save to my library, sign up for alerts, save searches, etc.