Execution of program code having language-level integration of program models
First Claim
1. A computer-implemented method for executing program code, the method comprising:
- receiving a source code file that includes computer code in a host language integrated with inset computer code in a domain specific language, the domain specific language being different from the host language;
reading the source code file;
responsive to reading computer code in the host language, invoking a set of computing instructions indicated by the computer code in accordance with the host language by interpreting a computing instruction indicated by the computer code as an operation in the host language; and
responsive to reading inset computer code in the domain specific language, invoking a set of computing instructions indicated by the inset computer code in accordance with the domain specific language by performing operations including;
selecting a domain specific language specification for the inset computer code, the domain specific language specification including instructions written in the host language for executing the inset computer code by relating tokens that include strings of characters from the domain specific language to corresponding tokens that include strings of characters from the host language and relating at least one grammatical rule for operations on tokens from the domain specific language to at least one corresponding grammatical rule for operations on tokens from the host language, andusing the domain specific language specification to process the inset computer code.
2 Assignments
0 Petitions
Accused Products
Abstract
To enable language-level integration of multiple programming languages into a single programming framework, one or more domain specific languages (DSLs) are specified as incremental extensions to a host programming language. An application created in this framework may include program code written in the host language as well as DSL inset code that is written in any of the DSLs. The extensions to the host language are described in DSL specifications, which define how the DSL inset code is processed. At runtime, DSL inset code in the source code is detected and passed to a DSL inset processor for execution according to an appropriate DSL specification, whereas source code in the host language is executed by a host language processor.
-
Citations
17 Claims
-
1. A computer-implemented method for executing program code, the method comprising:
-
receiving a source code file that includes computer code in a host language integrated with inset computer code in a domain specific language, the domain specific language being different from the host language; reading the source code file; responsive to reading computer code in the host language, invoking a set of computing instructions indicated by the computer code in accordance with the host language by interpreting a computing instruction indicated by the computer code as an operation in the host language; and responsive to reading inset computer code in the domain specific language, invoking a set of computing instructions indicated by the inset computer code in accordance with the domain specific language by performing operations including; selecting a domain specific language specification for the inset computer code, the domain specific language specification including instructions written in the host language for executing the inset computer code by relating tokens that include strings of characters from the domain specific language to corresponding tokens that include strings of characters from the host language and relating at least one grammatical rule for operations on tokens from the domain specific language to at least one corresponding grammatical rule for operations on tokens from the host language, and using the domain specific language specification to process the inset computer code. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer program product for executing program code, the computer program product comprising a computer-readable storage medium including computer program code that comprises:
-
a host language processor configured to execute program code in a host language by interpreting a line of program code in the host language as an operation in the host language; a domain specific language inset processor configured to execute program code in a domain specific language by performing operations including; selecting a domain specific language specification for domain specific language, the domain specific language specification including instructions written in the host language for executing the program code in the domain specific language by relating tokens that include strings of characters from the domain specific language to corresponding tokens that include strings of characters from the host language and relating at least one grammatical rule for operations on tokens from the domain specific language to at least one corresponding grammatical rule for operations on tokens from the host language, the domain specific language being different from the host language, and using the domain specific language specification to process the inset computer code; and a lexical analyzer configured to receive a source code file that contains includes computer code in the host language integrated with inset computer code in the domain specific language, the lexical analyzer being further configured to pass program code in the host language to the host language processor and pass inset computer code in the domain specific language to the domain specific language inset processor. - View Dependent Claims (9, 10, 11, 12)
-
-
13. A computer program product for executing program code, the computer program product comprising a computer-readable storage medium including computer program code for:
-
receiving a source code file that includes computer code in a host language integrated with inset computer code in a domain specific language, the domain specific language being different from the host language; reading the source code file; responsive to reading computer code in the host language, invoking a set of computing instructions indicated by the computer code in accordance with the host language by interpreting a computing instruction indicated by the computer code as an operation in the host language; and responsive to reading inset computer code in the domain specific language, invoking a set of computing instructions indicated by the inset computer code in accordance with the domain specific language by performing operations including; selecting a domain specific language specification for the inset computer code, the domain specific language specification including instructions written in the host language for executing the inset computer code by relating tokens that include strings of characters from the domain specific language to corresponding tokens that include strings of characters from the host language and relating at least one grammatical rule for operations on tokens from the domain specific language to at least one corresponding grammatical rule for operations on tokens from the host language, and using the domain specific language specification to process the inset computer code. - View Dependent Claims (14, 15, 16, 17)
-
Specification