OJacot-Descombes / dsharp

Open-source .NET compiler for D# (d-sharp), a "C#" with simplified syntax.
MIT License
0 stars 0 forks source link

Adapted EBNF as metasyntax notation #2

Open OJacot-Descombes opened 8 years ago

OJacot-Descombes commented 8 years ago

We need a syntax notation. Since D# will be line-oriented and (most likely) white-space sensitive I suggest using EBNF, but in a line-oriented and white-space sensitive manner, allowing us to express the D# grammar easily, without the need for end-of-line tokens and indentation tokens.

Example:

IfStatement =
    "if" Expression
        StatementSequence
    { "elsif" Expression
        StatementSequence }
    [ "else" Expression
        StatementSequence ]
;