首页> 外国专利> Obtaining correct compile results by absorbing mismatches between data types representations

Obtaining correct compile results by absorbing mismatches between data types representations

机译:通过吸收数据类型表示之间的不匹配来获得正确的编译结果

摘要

Methods and a system are provided. A method includes implementing a function, which a compiler for a first language does not have, using a compiler for a second language. The implementing step includes generating, by the compiler for the first language, a first abstract syntax tree. The implementing step further includes converting, by a converter, the first abstract syntax tree to a second abstract syntax tree of the compiler for the second language using a conversion table from data representation types in the first language to data representation types in the second language. When a compilation error occurs, the implementing step also includes generating a special node for error processing in the second abstract syntax tree and storing an error token in the special node. When unparsing, the implementing step additionally includes outputting the error token, in the form of source code written in the first language.
机译:提供了方法和系统。一种方法包括使用用于第二语言的编译器来实现针对第一语言的编译器所不具有的功能。实现步骤包括由编译器为第一语言生成第一抽象语法树。该实现步骤还包括:通过转换器,使用从第一语言的数据表示类型到第二语言的数据表示类型的转换表,将第一抽象语法树转换为第二语言的编译器的第二抽象语法树。当发生编译错误时,实现步骤还包括在第二抽象语法树中生成用于错误处理的特殊节点,并将错误令牌存储在特殊节点中。当进行解析时,实现步骤还包括以第一语言编写的源代码形式输出错误令牌。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号