eelco-visser-compiler-const.../lecture/2.html

922 lines
13 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="Eelco Visser">
<meta name="generator" content="Jekyll v3.8.5">
<title>Lecture 2: Declarative Syntax Definition</title>
<!-- <base href="/2021"> -->
<!--link rel="canonical" href="https://getbootstrap.com/docs/4.3/examples/starter-template/"-->
<link rel="icon" href="../img/logo/pl_ico2_2B3_icon.ico" type="image/x-icon">
<!-- Bootstrap core CSS -->
<!--link href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="../css/main.css" rel="stylesheet">
<link href="../css/borders-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="../css/pl.css">
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="../index.html">
TU Delft | CS4200
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="../lectures/index.html" tabindex="-1" aria-disabled="true">Lectures</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../homework/index.html" tabindex="-1" aria-disabled="true">Homework</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../project/index.html" tabindex="-1" aria-disabled="true">Project</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../news/index.html" tabindex="-1" aria-disabled="true">News</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../blog/index.html" tabindex="-1" aria-disabled="true">Blog</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
<a href="../lectures/2021/02-syntax-definition/CS4200-2021-2-syntax-definition.pdf">
<img class="border border-dark" width="100%" src="../lectures/2021/02-syntax-definition/CS4200-2021-2-syntax-definition/CS4200-2021-2-syntax-definition.001.png"/>
</a>
<div class="mt-3 mb-3 pt-3 pb-3 text-dark border-top border-bottom border-grey">
<div class="text-dark font-weight-bold">
<h1>
Lecture 2: Declarative Syntax Definition
</h1>
</div>
<div>
Eelco Visser
</div>
<div>
Lecture
| <a class="text-primary" href="../lectures/2021/02-syntax-definition/CS4200-2021-2-syntax-definition.pdf">PDF</a>
</div>
<div>
September 03, 2021
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-9 border-lg-right border-grey">
<p>In this lecture we study declarative syntax definition.</p>
<h3 id="slides">Slides</h3>
<ul>
<li><a href="../lectures/2021/02-syntax-definition/CS4200-2021-2-syntax-definition.pdf">Slides</a></li>
<li><a href="../lectures/2021/02-syntax-definition/CS4200-2021-2-syntax-definition-builds.pdf">Slides with builds</a></li>
</ul>
<h3 id="reading-material">Reading Material</h3>
<p>The [SEFM 2020] paper gives an overview of SDF3, the language we will use for syntax definition.</p>
<p>The [LDTA 2012] paper introduced template-based syntax definition. (This was one of the results of the masters thesis work of Tobi Vollebregt.)</p>
<h3 id="tutorial-and-talk-on-sdf3">Tutorial and Talk on SDF3</h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/7by2tVSz4mk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
<p>This is part of a <a href="https://pldi20.sigplan.org/details/pldi-2020-tutorials/3/Declarative-Language-Definition-with-Spoofax">tutorial on Spoofax</a> at the <a href="https://pldi20.sigplan.org/">PLDI 2020</a> conference in June 2020.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/SgP4GlWuUr4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
<p>This is a talk for the <a href="https://icfp20.sigplan.org/home/ocaml-2020">OCAML 2020</a> workshop at the <a href="https://icfp20.sigplan.org/">ICFP 2020</a> conference.</p>
<h3 id="references">References</h3>
<ul class="list-group list-group-flush pb-3">
<li class="list-group-item pl-lg-0 border-0 pb-0">
<div class="bd-callout border-primary pl-3">
<div>
<a name="AmorimV20"></a>
<a class="font-weight-bold text-dark" target="_blank" href="https://doi.org/10.1007/978-3-030-58768-0_1">Multi-purpose Syntax Definition with SDF3</a>
</div>
<div class="font-weight-light text-secondary" style="font-size:90%;">
<a class="text-secondary" href="https://www.linkedin.com/profile/view?id=136481548">Luis Eduardo de Souza Amorim</a>, <a class="text-secondary" href="http://eelcovisser.org">Eelco Visser</a>.
</div>
<div class="font-weight-light text-secondary" style="font-size:90%;">
SEFM 2020
[<a class="text-secondary" href="https://doi.org/10.1007/978-3-030-58768-0_1" target="_blank">doi</a>, <a class="text-secondary" target="_blank" href="https://researchr.org/publication/AmorimV20/bibtex">bib</a>, <a href="https://researchr.org/publication/AmorimV20" class="text-secondary" target="_blank">researchr</a>, <a class="text-secondary" data-toggle="collapse" href="2.html#AbstractAmorimV20" role="button" aria-expanded="false" aria-controls="AbstractAmorimV20"">abstract</a>]
<!-- AmorimV20 -->
</div>
<div class="collapse mt-1 mb-2" id="AbstractAmorimV20">
<div class="">
SDF3 is a syntax definition formalism that extends plain context-free grammars with features such as constructor declarations, declarative disambiguation rules, character-level grammars, permissive syntax, layout constraints, formatting templates, placeholder syntax, and modular composition. These features support the multi-purpose interpretation of syntax definitions, including derivation of type schemas for abstract syntax tree representations, scannerless generalized parsing of the full class of context-free grammars, error recovery, layout-sensitive parsing, parenthesization and formatting, and syntactic completion. This paper gives a high level overview of SDF3 by means of examples and provides a guide to the literature for further details.
</div>
</div>
</div>
</li>
<li class="list-group-item pl-lg-0 border-0 pb-0">
<div class="bd-callout border-primary pl-3">
<div>
<a name="VollebregtKV12"></a>
<a class="font-weight-bold text-dark" target="_blank" href="http://doi.acm.org/10.1145/2427048.2427056">Declarative specification of template-based textual editors</a>
</div>
<div class="font-weight-light text-secondary" style="font-size:90%;">
<a class="text-secondary" href="http://www.tobivollebregt.nl/">Tobi Vollebregt</a>, <a class="text-secondary" href="http://www.lclnet.nl/">Lennart C. L. Kats</a>, <a class="text-secondary" href="http://eelcovisser.org">Eelco Visser</a>.
</div>
<div class="font-weight-light text-secondary" style="font-size:90%;">
LDTA 2012
[<a href="../publications/2012/VollebregtKV12.pdf" class="text-secondary" target="_blank">pdf</a>, <a class="text-secondary" href="http://doi.acm.org/10.1145/2427048.2427056" target="_blank">doi</a>, <a class="text-secondary" target="_blank" href="https://researchr.org/publication/VollebregtKV12/bibtex">bib</a>, <a href="https://researchr.org/publication/VollebregtKV12" class="text-secondary" target="_blank">researchr</a>, <a class="text-secondary" data-toggle="collapse" href="2.html#AbstractVollebregtKV12" role="button" aria-expanded="false" aria-controls="AbstractVollebregtKV12"">abstract</a>]
<!-- -->
</div>
<div class="collapse mt-1 mb-2" id="AbstractVollebregtKV12">
<div class="">
Syntax discoverability has been a crucial advantage of structure editors for new users of a language. Despite this advantage, structure editors have not been widely adopted. Based on immediate parsing and analyses, modern textual code editors are also increasingly syntax-aware: structure and textual editors are converging into a new editing paradigm that combines text and templates. Current text-based language workbenches require redundant specification of the ingredients for a template-based editor, which is detrimental to the quality of syntactic completion, as consistency and completeness of the definition cannot be guaranteed. In this paper we describe the design and implementation of a specification language for syntax definition based on templates. It unifies the specification of parsers, unparsers and template-based editors. We evaluate the template language by application to two domain-specific languages used for tax benefits and mobile applications.
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="col-sm-12 col-md-12 col-lg-3 col-xl-3 " >
<div class="sticky-top top70 d-none d-lg-block d-xl-block">
<div class="pb4 mb3 border-bottom border-grey ">
<nav>
<ul class="pagination justify-content-left">
<li class="page-item">
<a class="page-link" href="1.html">
&laquo;
</a>
</li>
<li class="page-item">
<a class="page-link" href="../lectures/index.html">
^
</a>
</li>
<li class="page-item">
<a class="page-link" href="3.html">&raquo;</a>
</li>
</ul>
</nav>
</div>
<ul id="my_toc" class="toc list-group list-group-flush d-none d-lg-block d-xl-block p-0 ml-0 mt-3">
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#slides">Slides</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#reading-material">Reading Material</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#tutorial-and-talk-on-sdf3">Tutorial and Talk on SDF3</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#references">References</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="border-top border-bottom border-grey mt-3 pt-3">
<nav>
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="1.html">
Previous
</a>
</li>
<li class="page-item">
<a class="page-link" href="3.html">Next</a>
</li>
<li class="page-item">
<a class="page-link" href="../lectures/index.html">
Index
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>