首页> 外国专利> System and method for lexing and parsing program annotations

System and method for lexing and parsing program annotations

机译:词汇注释和解析程序注释的系统和方法

摘要

When a source program containing annotations is processed by a user-selected tool, the annotations in the source program are detected by a lexer and passed to an annotation processor corresponding to the selected tool. The system contains a number of annotation processors and a number of program processing tools, and the annotation processor to which the annotations are passed is selected based upon the user-selected tool. The selected annotation processor converts annotations compatible with the user-selected tool into annotation tokens and returns the annotation tokens to the lexer. The lexer generates tokens based upon the programming-language statements in the source program, and passes both the tokens and annotation tokens to a parser. The parser, in turn, assembles the tokens and annotation tokens into an abstract syntax tree, which is then passed to the user-selected tool for further processing.
机译:当包含注释的源程序由用户选择的工具处理时,源程序中的注释将由词法分析器检测并传递到与所选工具相对应的注释处理器。该系统包括多个注释处理器和多个程序处理工具,并且基于用户选择的工具来选择注释被传递到的注释处理器。选定的注释处理器将与用户选择的工具兼容的注释转换为注释令牌,并将注释令牌返回到词法分析器。词法分析器基于源程序中的编程语言语句生成令牌,并将令牌和注释令牌都传递给解析器。反过来,解析器将标记和注释标记组合成一个抽象语法树,然后将其传递给用户选择的工具以进行进一步处理。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号