首页> 外国专利> Method and apparatus for dynamic configuration of a lexical analysis parser

Method and apparatus for dynamic configuration of a lexical analysis parser

机译:动态配置词法分析解析器的方法和装置

摘要

The present invention provides a method and apparatus for the lexical analysis of computer source code. The lexical analyzer is dynamically configured at runtime to recognize a one or more reserved words or operators. Thus, the analyzer has the ability to interact with multiple languages. In one or more embodiments of the present invention, the analyzer is instantiated by a host application, for example, the parser of a compiler. The host application adds a list of tokens to the analyzer that must be recognized. These tokens comprise at least a subset of the reserved words and operators of the computer language. In one embodiment, the host application then queries the analyzer for the next token in the source code. In another embodiment, tokens are added during the query phase as needed. In a separate embodiment, tokens are dynamically removed from the analyzer as the needs of the host application change.
机译:本发明提供了一种用于计算机源代码的词法分析的方法和装置。词法分析器在运行时被动态配置为识别一个或多个保留字或运算符。因此,分析仪具有与多种语言进行交互的能力。在本发明的一个或多个实施例中,分析器由主机应用程序,例如编译器的解析器实例化。主机应用程序将必须识别的令牌列表添加到分析器。这些令牌至少包括保留字的子集和计算机语言的运算符。在一个实施例中,主机应用然后在分析器中查询源代码中的下一个令牌。在另一个实施例中,根据需要在查询阶段添加令牌。在一个单独的实施例中,随着主机应用程序需求的变化,令牌被动态地从分析器中移除。

著录项

  • 公开/公告号US7003764B2

    专利类型

  • 公开/公告日2006-02-21

    原文格式PDF

  • 申请/专利权人 DAVID S. ALLISON;

    申请/专利号US20010977526

  • 发明设计人 DAVID S. ALLISON;

    申请日2001-10-12

  • 分类号G06F9/45;

  • 国家 US

  • 入库时间 2022-08-21 21:41:50

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号