发明名称 User-extensible rule-based source code modification
摘要 Embodiments of the present invention address deficiencies of the art in respect to parsing for source code porting and provide a novel and non-obvious method, system and computer program product for a user-extensible rule-based source code modification tool. According to an aspect of the present invention, an automated parsing tool for parsing and modifying source code is provided which supports the addition of user-defined rules, and which parses and either modifies source code or suggests modifications to source code based upon the user-defined rules. Users can also associate a user-defined or predefined modification with each rule so that upon detection of a condition satisfying the rule, the user can be presented with the modification as an option. Compound rules built by using one or more rules as preconditions to a rule are also supported.
申请公布号 US9158538(B2) 申请公布日期 2015.10.13
申请号 US200711751508 申请日期 2007.05.21
申请人 International Business Machines Corporation 发明人 Nicholls Peter A.;Rice Andrea K.
分类号 G06F9/45;G06F9/44 主分类号 G06F9/45
代理机构 CRGO Law 代理人 Greenberg, Esq. Steven M.;CRGO Law
主权项 1. A user-extensible rule-based tool for modifying source code of a software application suitable to run on a source platform to be ported to a target platform, comprising: a rule definition interface configured to provide access for end users to establish rules for porting the source code to the target platform so that the software application can run on the target platform and to specify the relative location as one of a line before, a same line, and a same file, wherein the rule definition interface provides different templates to match different language constructs for different languages supported for the source code and the rules identify the relative location of each of the different lines of source code to be modified based upon a position of each of the different lines relative to other lines of source code; a processor configured to load a source code file of source code into a memory of a computer,parse the source code of the source code file into multiple different token sets,match the different token sets with the rules based upon the relative location of the rules, andgenerate suggested modifications to the source code according to selected matched ones of the rules; and a user interface for the end users to select modifications from the suggested modifications and apply the selected modifications to the source code.
地址 Armonk NY US