发明名称 Contraction aware parsing system for domain-specific languages
摘要 Aspects of the present invention disclose a method, computer program product, and system for parsing a domain-specific language (DSL) statement. The method includes one or more processors accessing a DSL statement that includes contracted phrases. The method further includes one or more processors identifying one or more contracted phrases in the DSL statement utilizing an annotated domain vocabulary for a DSL associated with the DSL statement and grammar rules for the DSL. The method further includes one or more processors determining expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary and the grammar rules. The method further includes one or more processors creating an expanded abstract syntax tree (AST) that is representative of the DSL statement with the determined expanded phrases replacing the identified one or more contracted phrases.
申请公布号 US9582491(B2) 申请公布日期 2017.02.28
申请号 US201615097415 申请日期 2016.04.13
申请人 International Business Machines Corporation 发明人 Bernelas Jean-Michel G. B.;Junker Ulrich M.;Mery Stephane
分类号 G06F9/45;G06F17/27;G06F9/44 主分类号 G06F9/45
代理机构 代理人 Simek Daniel R.
主权项 1. A method for parsing a domain-specific language (DSL) statement, the method comprising: accessing, by one or more processors, a DSL statement that includes contracted phrases; identifying, by one or more processors, one or more contracted phrases in the DSL statement utilizing an annotated domain vocabulary for a DSL associated with the DSL statement and grammar rules for the DSL; determining, by one or more processors, expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary and the grammar rules; creating, by one or more processors, an expanded abstract syntax tree (AST) that is representative of the DSL statement with the determined expanded phrases replacing the identified one or more contracted phrases; and identifying, by one or more processors, operators in the DSL statement that are associated with annotations in the annotated domain vocabulary; and determining, by one or more processors, extensions to add to the annotated domain vocabulary based on the identified operators.
地址 Armonk NY US