Skip to main content
Article thumbnail
Location of Repository

Type-Directed, Whitespace-Delimited Parsing for Embedded DSLs

By Cyrus Omar, Benjamin Chung, Darya Kurilova, Alex Potanin and Jonathan Aldrich

Abstract

Domain-specific languages improve ease-of-use, expressiveness and verifiability, but defining and using different DSLs within a single application remains difficult. We introduce an approach for embedded DSLs where 1) whitespace delimits DSL-governed blocks, and 2) the parsing and type checking phases occur in tandem so that the expected type of the block determines which domain-specific parser governs that block. We argue that this approach occupies a sweet spot, providing high expressiveness and ease-of-use while maintaining safe composability. We introduce the design, provide examples and describe an ongoing implementation of this strategy in the Wyvern programming language. We also discuss how a more conventional keyword-directed strategy for parsing of DSLs can arise as a special case of this type-directed strategy

Topics: D.3.2 [Programming Languages, Language Classifications—extensible
Year: 2013
OAI identifier: oai:CiteSeerX.psu:10.1.1.353.3573
Provided by: CiteSeerX
Download PDF:
Sorry, we are unable to provide the full text but you may find it at the following location(s):
  • http://citeseerx.ist.psu.edu/v... (external link)
  • http://homepages.mcs.vuw.ac.nz... (external link)
  • Suggested articles


    To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.