首页> 外国专利> 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.
机译:例如,将代码片段的一般化和/或专业化描述为软件开发人员工具的一部分。在一个实施例中,开发人员将表达编程任务的自然语言插入他或她在集成开发环境中正在开发的代码中。程序合成器为任务获取相关的(可能是非编译的)代码片段,将这些代码片段合并在一起以形成代码片段,针对代码的上下文对代码片段进行专用,然后将专用的代码片段插入代码中。例如,一对代码片段是从搜索引擎中获得的,并通过舍弃每个对都不通用的语句来合并。在示例中,使用搜索引擎等级,用户输入或频率来选择成对的代码片段。在实施例中,占位符替换合并的片段中的变量名。一个示例采用正在开发的代码的语法树,并使用它来专门化代码段。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号