Milestone 1: Syntax Complete

Project
September 27, 2021

In this milestone you submit your syntax definition.

Submission

You need to submit your ChocoPy project with a merge request on GitLab. The Git and Submissions documentation explains how to file such a request.

The deadline for submission is September 26 2021, 23:59.

Grading

We grade your submission based on compliance with the ChocoPy syntax as defined in the reference manual, taking into account:

  • lexical syntax
  • context-free syntax
  • disambiguation
    • associativity
    • precedence
  • layout constraints

Additionally, we grade your submission manually to confirm that your SDF3 grammar is idiomatic, organized, and follows best practices. To determine whether your grammar is idiomatic, we use the following guidelines:

  • Your grammar definition is organized.
    • Formatting is consistent across sections/files.
    • Grammars are split up into multiple files where appropriate.
  • Your grammar does not use deprecated or low-level SDF3 features.
    • You do not use deprecated attributes such as {prefer}.
    • You do not use bare “kernel” syntax (syntax sections that are not explicitly lexical or context-free).
  • Your grammar uses template syntax (<>) to enable pretty-printing.
  • Your grammar uses layout constraints to parse ChocoPy.
    • Your grammar does not use lexical elements for layout, such as NEWLINE, INDENT or DEDENT.
    • Your grammar uses high-level layout constraints (single-line, newline-indent, align-list, …) where possible.
  • Your grammar uses priorities and follow restrictions to disambiguate.
    • Your grammar does not use separate context-free sorts for the sole purpose of disambiguating.
  • Your grammar is as “flat” as reasonably possible.
    • Your grammar uses new sorts primarily for optionals, variants, or to extract out common patterns.
    • Your grammar generally uses a single sort for expressions and statements.
      • You do not have separate CExpr and Expr sorts.
    • Note: This rule is a guideline. Do not feel forced to needlessly flatten sorts if you believe introducing new ones will aid readability.

The bolded section is worth repeating. The ChocoPy reference manual uses two separate expression sorts in order to disambiguate and keep compatibility with Python grammar. SDF3 is powerful enough to represent these restrictions without the need for two separate sorts. In order to keep the SDF3 grammar as idiomatic as possible, as well as aid future static analysis steps, we therefore expect you to implement expressions using a single expression sort. For some more hints on how to do this, see also the (updated) lab 2 guide.

Your parser will automatically be graded in GitLab using SPT tests. These automated tests determine 70% of your grade for milestone 1, with the remaining 30% graded based on whether or not your grammar is idiomatic. A solution that passes all SPT tests but does not adhere to any of the above guidelines will therefore yield a 7 as final grade, whereas a less-complete implementation that follows all style guidelines closely will likely score better.

Early Feedback

We provide early feedback for the correctness of your syntax definition. This feedback gives you an indication which parts of your syntax definition might still be wrong. It includes a summary on how many tests you pass and how many points you earn by passing them. You have 15 early feedback attempts. Afterwards, you may still submit new merge requests, but you will not be able to receive feedback on them. Your final grade is based on the last submission done to the milestone-1-submission branch.