首页>
外国专利>
GENERALIZATION AND/OR SPECIALIZATION OF CODE FRAGMENTS
GENERALIZATION AND/OR SPECIALIZATION OF CODE FRAGMENTS
展开▼
机译:代码片段的广义化和/或专业化
展开▼
页面导航
摘要
著录项
相似文献
摘要
Generalization and/or specialization of code fragments is described, for example, as part of a tool for software developers. In an embodiment, a developer inserts natural language expressing a programming task into code he or she is developing in an integrated development environment; a program synthesizer obtains relevant (possibly non-compiling) code fragments for the task, merges those together to form a snippet, specializes the snippet for the context of the code and inserts the specialized snippet into the code. For example, a pair of code fragments are obtained from a search engine and are merged by discarding statements which are not common to each of the pair. In examples, pairs of code fragments are selected using search engine ranks, user input, or frequency. In embodiments, placeholders replace variable names in the merged fragments. An example takes a syntax tree of the code being developed and uses that to specialize snippets.
展开▼