IP Library › Granted Patent US 11,036,937
Granted Patent B2
US 11,036,937 · App. 16/677,911 · Granted Jun 15, 2021

Contraction aware parsing system for domain-specific languages

Inventors: Jean-Michel G. B. Bernelas (Nice, FR); Ulrich M. Junker (Biot, FR); Stephane Mery (Lixington, MA)
Assignee: International Business Machines Corporation
G06F40/211G06F8/34G06F8/37G06F8/427G06F40/169G06F40/253G06F40/268G06F40/30
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,036,937
App. No.
16/677,911
Filed
Nov 8, 2019
Granted
Jun 15, 2021
Kind
B2
Examiner
DAS, CHAMELI
Art Unit
2196
USPC
717/144
Abstract

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.

Claims (54)

1. A method for parsing a domain-specific language (DSL) statement, the method comprising:

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;

determining, by one or more processors, expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary;

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;

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.

2. The method of claim 1 , wherein the identifying one or more contracted phrases in the DSL statement utilizing the annotated domain vocabulary for the DSL associated with the DSL statement comprises:

creating, by one or more processors, an AST that is representative of the DSL statement that includes contracted phrases; and

identifying, by one or more processors, one or more contracted phrases in the created AST utilizing the annotated domain vocabulary for the DSL.

3. The method of claim 2 , wherein the created AST includes semantic annotations that correspond to nodes in the created AST that include a contracted phrase.

4. The method of claim 1 , further comprising:

determining, by one or more processors, whether the expanded AST includes any contracted phrases; and

responsive to determining that the expanded AST does include contracted phrases, identifying, by one or more processors, one or more contracted phrases in the expanded AST utilizing the annotated domain vocabulary for the DSL.

5. The method of claim 1 , wherein the determining expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary, further comprises:

expanding, by one or more processors, the one or more identified contracted phrases according to the domain vocabulary for the DSL.

6. The method of claim 1 , further comprising:

determining, by one or more processors, one or more rules to add to grammar rules for the DSL based on the determined extensions to add to the annotated domain vocabulary.

7. A computer program product for parsing a domain-specific language (DSL) statement, the computer program product comprising:

one or more computer readable storage media and program instructions stored on the one or more computer readable storage media, the program instructions comprising:

program instructions to identify one or more contracted phrases in the DSL statement utilizing an annotated domain vocabulary for a DSL associated with the DSL statement;

program instructions to determine expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary;

program instructions to create 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;

program instructions to identify operators in the DSL statement that are associated with annotations in the annotated domain vocabulary; and

program instructions to determine extensions to add to the annotated domain vocabulary based on the identified operators.

8. The computer program product of claim 7 , wherein the program instructions to identify one or more contracted phrases in the DSL statement utilizing the annotated domain vocabulary for the DSL associated with the DSL statement comprise program instructions to:

create an AST that is representative of the DSL statement that includes contracted phrases; and

identify one or more contracted phrases in the created AST utilizing the annotated domain vocabulary for the DSL.

9. The computer program product of claim 8 , wherein the created AST includes semantic annotations that correspond to nodes in the created AST that include a contracted phrase.

10. The computer program product of claim 7 , further comprising program instructions, stored on the one or more computer readable storage media, to:

determine whether the expanded AST includes any contracted phrases; and

responsive to determining that the expanded AST does include contracted phrases, identify one or more contracted phrases in the expanded AST utilizing the annotated domain vocabulary for the DSL.

11. The computer program product of claim 7 , wherein the program instructions to determine expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary, further comprise program instructions to:

expand the one or more identified contracted phrases according to the domain vocabulary for the DSL.

12. The computer program product of claim 7 , further comprising program instructions, stored on the one or more computer readable storage media, to:

determine one or more rules to add to grammar rules for the DSL based on the determined extensions to add to the annotated domain vocabulary.

13. A computer system parsing a domain-specific language (DSL) statement, the computer system comprising:

one or more computer processors;

one or more computer readable storage media; and

program instructions stored on the computer readable storage media for execution by at least one of the one or more processors, the program instructions comprising:

program instructions to identify one or more contracted phrases in the DSL statement utilizing an annotated domain vocabulary for a DSL associated with the DSL statement;

program instructions to determine expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary;

program instructions to create 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;

program instructions to identify operators in the DSL statement that are associated with annotations in the annotated domain vocabulary; and

program instructions to determine extensions to add to the annotated domain vocabulary based on the identified operators.

14. The computer system of claim 13 , wherein the program instructions to identify one or more contracted phrases in the DSL statement utilizing the annotated domain vocabulary for the DSL associated with the DSL statement comprise program instructions to:

create an AST that is representative of the DSL statement that includes contracted phrases; and

identify one or more contracted phrases in the created AST utilizing the annotated domain vocabulary for the DSL and.

15. The computer system of claim 13 , further comprising program instructions, stored on the computer readable storage media for execution by at least one of the one or more processors, to:

determine whether the expanded AST includes any contracted phrases; and

responsive to determining that the expanded AST does include contracted phrases, identify one or more contracted phrases in the expanded AST utilizing the annotated domain vocabulary for the DSL.

16. The computer system of claim 13 , wherein the program instructions to determine expanded phrases corresponding to the identified one or more contracted phrases based on the annotated domain vocabulary, further comprise program instructions to:

expand the one or more identified contracted phrases according to the domain vocabulary for the DSL.

17. The computer system of claim 13 , further comprising program instructions, stored on the computer readable storage media for execution by at least one of the one or more processors, to:

determine one or more rules to add to grammar rules for the DSL based on the determined extensions to add to the annotated domain vocabulary.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 8, 2019
From: BERNELAS, JEAN-MICHEL G.B.; JUNKER, ULRICH M.; MERY, STEPHANE
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 050972/0175 →
Continuity (5)
Continuation 15409788 · Jan 19, 2017
Continuation 15097415 · Apr 13, 2016
Continuation 14686998 · Apr 15, 2015
Continuation 14538959 · Nov 12, 2014
Related Publication 20200073927A1 · Mar 5, 2020
Cited By (1)
US 12,393,403