Standard

Modular specification and dynamic enforcement of syntactic language constraints when generating code. / Erdweg, Sebastian; Vergu, Vlad; Mezini, Mira; Visser, Eelco.

MODULARITY '14: Proceedings of the 13th international conference on Modularity . New York, NY : Association for Computing Machinery (ACM), 2014. p. 241-252.

Research output: Chapter in Book/Report/Conference proceedingConference contributionScientificpeer-review

Harvard

Erdweg, S, Vergu, V, Mezini, M & Visser, E 2014, Modular specification and dynamic enforcement of syntactic language constraints when generating code. in MODULARITY '14: Proceedings of the 13th international conference on Modularity . Association for Computing Machinery (ACM), New York, NY, pp. 241-252, 13th International Conference on Modularity, Lugano, Switzerland, 22/04/14. https://doi.org/10.1145/2577080.2577089

APA

Erdweg, S., Vergu, V., Mezini, M., & Visser, E. (2014). Modular specification and dynamic enforcement of syntactic language constraints when generating code. In MODULARITY '14: Proceedings of the 13th international conference on Modularity (pp. 241-252). New York, NY: Association for Computing Machinery (ACM). https://doi.org/10.1145/2577080.2577089

Vancouver

Erdweg S, Vergu V, Mezini M, Visser E. Modular specification and dynamic enforcement of syntactic language constraints when generating code. In MODULARITY '14: Proceedings of the 13th international conference on Modularity . New York, NY: Association for Computing Machinery (ACM). 2014. p. 241-252 https://doi.org/10.1145/2577080.2577089

Author

Erdweg, Sebastian ; Vergu, Vlad ; Mezini, Mira ; Visser, Eelco. / Modular specification and dynamic enforcement of syntactic language constraints when generating code. MODULARITY '14: Proceedings of the 13th international conference on Modularity . New York, NY : Association for Computing Machinery (ACM), 2014. pp. 241-252

BibTeX

@inproceedings{b01042d7c68242a1845668becf7c460c,
title = "Modular specification and dynamic enforcement of syntactic language constraints when generating code",
abstract = "A key problem in metaprogramming and specifically in generative programming is to guarantee that generated code is well-formed with respect to the context-free and context-sensitive constraints of the target language. We propose typesmart constructors as a dynamic approach to enforcing the well-formedness of generated code. A typesmart constructor is a function that is used in place of a regular constructor to create values, but it may reject the creation of values if the given data violates some language-specific constraint. While typesmart constructors can be implemented individually, we demonstrate how to derive them automatically from a grammar, so that the grammar remains the sole specification of a language's syntax and is not duplicated. We have integrated support for typesmart constructors into the run-time system of Stratego to enforce usage of typesmart constructors implicitly whenever a regular constructor is called. We evaluate the applicability, performance, and usefulness of typesmart constructors for syntactic constraints in a compiler for MiniJava developed with Spoofax and in various language extensions of Java and Haskell implemented with SugarJ and SugarHaskell.",
author = "Sebastian Erdweg and Vlad Vergu and Mira Mezini and Eelco Visser",
year = "2014",
doi = "10.1145/2577080.2577089",
language = "English",
isbn = "978-1-4503-2772-5",
pages = "241--252",
booktitle = "MODULARITY '14",
publisher = "Association for Computing Machinery (ACM)",
address = "United States",

}

RIS

TY - GEN

T1 - Modular specification and dynamic enforcement of syntactic language constraints when generating code

AU - Erdweg, Sebastian

AU - Vergu, Vlad

AU - Mezini, Mira

AU - Visser, Eelco

PY - 2014

Y1 - 2014

N2 - A key problem in metaprogramming and specifically in generative programming is to guarantee that generated code is well-formed with respect to the context-free and context-sensitive constraints of the target language. We propose typesmart constructors as a dynamic approach to enforcing the well-formedness of generated code. A typesmart constructor is a function that is used in place of a regular constructor to create values, but it may reject the creation of values if the given data violates some language-specific constraint. While typesmart constructors can be implemented individually, we demonstrate how to derive them automatically from a grammar, so that the grammar remains the sole specification of a language's syntax and is not duplicated. We have integrated support for typesmart constructors into the run-time system of Stratego to enforce usage of typesmart constructors implicitly whenever a regular constructor is called. We evaluate the applicability, performance, and usefulness of typesmart constructors for syntactic constraints in a compiler for MiniJava developed with Spoofax and in various language extensions of Java and Haskell implemented with SugarJ and SugarHaskell.

AB - A key problem in metaprogramming and specifically in generative programming is to guarantee that generated code is well-formed with respect to the context-free and context-sensitive constraints of the target language. We propose typesmart constructors as a dynamic approach to enforcing the well-formedness of generated code. A typesmart constructor is a function that is used in place of a regular constructor to create values, but it may reject the creation of values if the given data violates some language-specific constraint. While typesmart constructors can be implemented individually, we demonstrate how to derive them automatically from a grammar, so that the grammar remains the sole specification of a language's syntax and is not duplicated. We have integrated support for typesmart constructors into the run-time system of Stratego to enforce usage of typesmart constructors implicitly whenever a regular constructor is called. We evaluate the applicability, performance, and usefulness of typesmart constructors for syntactic constraints in a compiler for MiniJava developed with Spoofax and in various language extensions of Java and Haskell implemented with SugarJ and SugarHaskell.

U2 - 10.1145/2577080.2577089

DO - 10.1145/2577080.2577089

M3 - Conference contribution

SN - 978-1-4503-2772-5

SP - 241

EP - 252

BT - MODULARITY '14

PB - Association for Computing Machinery (ACM)

CY - New York, NY

ER -

ID: 34371083