Open mingodad opened 3 years ago
Cool, nice looking visualization!
After an issue was pointed out here https://github.com/Framstag/libosmscout/issues/1096#issuecomment-856664383 I implemented the generation of the EBNF understood by https://www.bottlecaps.de/rr/ui directly on CcocoR (https://github.com/mingodad/CocoR-CPP and https://github.com/mingodad/CocoR-CSharp ) and bellow is the new generated EBNF when using the -genRREBNF
command line parameter.
My forks also add several small improvements to help devlop/debug grammars with CocoR and I welcome any feedback !
//
// EBNF generated by CocoR parser generator to be viewed with https://www.bottlecaps.de/rr/ui
//
//
// productions
//
Dafny ::= ( "include" stringToken )* ( TopDecl )* EOF
TopDecl ::= ( DeclModifier )* ( SubModuleDecl | ClassDecl | DatatypeDecl | NewtypeDecl | SynonymTypeDecl | IteratorDecl | TraitDecl | ClassMemberDecl )
DeclModifier ::= ( "abstract" | ghost | static | "protected" )
SubModuleDecl ::= ( ModuleDefinition | ModuleImport | ModuleExport )
ClassDecl ::= class ( Attribute )* ClassName ( GenericParameters )? ( ( "extends" Type ( comma Type )* | ellipsis ) )? lbrace ( ( DeclModifier )* ClassMemberDecl )* rbrace
DatatypeDecl ::= ( datatype | codatatype ) ( Attribute )* DatatypeName ( GenericParameters )? singleeq ( ellipsis )? ( verticalbar )? DatatypeMemberDecl ( verticalbar DatatypeMemberDecl )* ( TypeMembers )?
NewtypeDecl ::= newtype ( Attribute )* NewtypeName singleeq ( ellipsis )? ( LocalVarName ( colon Type )? verticalbar Expression ( ( ghost witness Expression | witness ( star | Expression ) ) )? ( TypeMembers )? | Type ( TypeMembers )? )
SynonymTypeDecl ::= type ( Attribute )* SynonymTypeName ( TypeParameterCharacteristics )* ( GenericParameters )? ( ( singleeq ( LocalVarName ( colon Type )? verticalbar Expression ( ( ghost witness Expression | witness ( star | Expression ) ) )? | Type ) | ellipsis ( TypeMembers )? | TypeMembers ) )?
IteratorDecl ::= iterator ( Attribute )* IteratorName ( ( GenericParameters )? Formals ( ( "yields" | "returns" ) Formals )? | ellipsis ) IteratorSpec ( BlockStmt )?
TraitDecl ::= trait ( Attribute )* ClassName ( GenericParameters )? ( ( "extends" Type ( comma Type )* | ellipsis ) )? lbrace ( ( DeclModifier )* ClassMemberDecl )* rbrace
ClassMemberDecl ::= ( FieldDecl | ConstantFieldDecl | FunctionDecl | MethodDecl )
ModuleDefinition ::= "module" ( Attribute )* ModuleQualifiedName ( ( "refines" ModuleQualifiedName | Ident ) )? lbrace ( TopDecl )* rbrace
ModuleImport ::= import ( "opened" )? ( ModuleName singleeq QualifiedModuleExport | ModuleName colon QualifiedModuleExport | QualifiedModuleExport )
ModuleExport ::= export ( ExportId )? ( ellipsis )? ( ( "provides" ( ExportSignature ( comma ExportSignature )* | star ) | "reveals" ( ExportSignature ( comma ExportSignature )* | star ) | "extends" ExportId ( comma ExportId )* ) )*
Attribute ::= lbracecolon AttributeName ( Expressions )? rbrace
ModuleQualifiedName ::= ModuleName ( dot ModuleName )*
Ident ::= ( ident | least | greatest )
ModuleName ::= NoUSIdent
QualifiedModuleExport ::= ModuleQualifiedName ( backtick ModuleExportSuffix )?
ExportId ::= NoUSIdentOrDigits
NoUSIdentOrDigits ::= ( NoUSIdent | digits )
ExportSignature ::= TypeNameOrCtorSuffix ( dot TypeNameOrCtorSuffix )?
TypeNameOrCtorSuffix ::= IdentOrDigits
NoUSIdent ::= Ident
ModuleExportSuffix ::= ( ExportId | lbrace ExportId ( comma ExportId )* rbrace )
ClassName ::= NoUSIdent
GenericParameters ::= openAngleBracket ( Variance )? TypeVariableName ( TypeParameterCharacteristics )* ( comma ( Variance )? TypeVariableName ( TypeParameterCharacteristics )* )* closeAngleBracket
Type ::= TypeAndToken
FieldDecl ::= var ( Attribute )* FIdentType ( comma FIdentType )* OldSemi
ConstantFieldDecl ::= const ( Attribute )* CIdentType ( ellipsis )? ( gets Expression )? OldSemi
FunctionDecl ::= ( twostate )? ( function ( method )? ( Attribute )* MethodFunctionName ( ( GenericParameters )? Formals colon ( openparen GIdentType closeparen | Type ) | ellipsis ) | predicate ( method )? ( Attribute )* MethodFunctionName ( ( GenericParameters )? ( Formals )? ( colon Type )? | ellipsis ) | ( least | inductive ) predicate ( Attribute )* MethodFunctionName ( ( GenericParameters )? ( KType )? Formals ( colon )? | ellipsis ) | ( greatest predicate | copredicate ) ( Attribute )* MethodFunctionName ( ( GenericParameters )? ( KType )? Formals ( colon )? | ellipsis ) ) FunctionSpec ( FunctionBody )?
MethodDecl ::= ( method | lemma | ( greatest lemma | colemma ) | ( least | inductive ) lemma | twostate lemma | constructor ) ( Attribute )* ( MethodFunctionName )? ( ( GenericParameters )? ( KType )? Formals ( "returns" Formals )? | ellipsis ) MethodSpec ( ( DividedBlockStmt | BlockStmt ) )?
DatatypeName ::= NoUSIdent
DatatypeMemberDecl ::= ( Attribute )* DatatypeMemberName ( FormalsOptionalIds )?
TypeMembers ::= lbrace ( ( DeclModifier )* ClassMemberDecl )* rbrace
DatatypeMemberName ::= NoUSIdentOrDigits
FormalsOptionalIds ::= openparen ( TypeIdentOptional ( comma TypeIdentOptional )* )? closeparen
FIdentType ::= NoUSIdentOrDigits colon Type
OldSemi ::= ( semicolon )?
CIdentType ::= NoUSIdentOrDigits ( colon Type )?
Expression ::= EquivExpression ( semicolon Expression )?
NewtypeName ::= NoUSIdent
LocalVarName ::= NoUSIdent
SynonymTypeName ::= NoUSIdent
TypeParameterCharacteristics ::= openparen TPCharOption ( comma TPCharOption )* closeparen
GIdentType ::= ( ( ghost | "new" ) )* IdentType
IdentType ::= WildIdent colon Type
WildIdent ::= Ident
LocalIdentTypeOptional ::= WildIdent ( colon Type )?
IdentTypeOptional ::= WildIdent ( colon Type )?
TypeIdentOptional ::= ( ghost )? ( TypeAndToken ( colon Type )? | digits colon Type )
TypeAndToken ::= ( bool | char | int | nat | real | ORDINAL | bvToken | set OptGenericInstantiation | iset OptGenericInstantiation | multiset OptGenericInstantiation | seq OptGenericInstantiation | string | object | object_q | map OptGenericInstantiation | imap OptGenericInstantiation | arrayToken OptGenericInstantiation | TupleType | NamedType ) ( ( qarrow | larrow | sarrow ) Type )?
IteratorName ::= NoUSIdent
Formals ::= openparen ( GIdentType ( comma GIdentType )* )? closeparen
IteratorSpec ::= ( ( ReadsClause | ModifiesClause | ( "yield" )? ( RequiresClause | EnsuresClause ) | DecreasesClause ) )*
BlockStmt ::= lbrace ( Stmt )* rbrace
TypeVariableName ::= NoUSIdent
Variance ::= ( star | "+" | "!" | "-" )
TPCharOption ::= ( eq | digits | "!" "new" )
MethodFunctionName ::= NoUSIdentOrDigits
KType ::= lbracket ( nat | ORDINAL ) rbracket
MethodSpec ::= ( ( ModifiesClause | RequiresClause | EnsuresClause | DecreasesClause ) )*
DividedBlockStmt ::= lbrace ( Stmt )* ( "new" semicolon ( Stmt )* )? rbrace
RequiresClause ::= requires ( Attribute )* ( LabelName colon )? Expression OldSemi
LabelName ::= NoUSIdentOrDigits
EnsuresClause ::= ensures ( Attribute )* Expression OldSemi
ModifiesClause ::= modifies ( Attribute )* FrameExpression ( comma FrameExpression )* OldSemi
FrameExpression ::= ( Expression ( FrameField )? | FrameField )
DecreasesClause ::= decreases ( Attribute )* DecreasesList OldSemi
DecreasesList ::= PossiblyWildExpression ( comma PossiblyWildExpression )*
ReadsClause ::= reads ( Attribute )* PossiblyWildFrameExpression ( comma PossiblyWildFrameExpression )* OldSemi
PossiblyWildFrameExpression ::= ( star | FrameExpression )
InvariantClause ::= invariant ( Attribute )* Expression OldSemi
OptGenericInstantiation ::= ( GenericInstantiation )?
TupleType ::= openparen ( Type ( comma Type )* )? closeparen
NamedType ::= NameSegmentForTypeName ( dot TypeNameOrCtorSuffix OptGenericInstantiation )*
NameSegmentForTypeName ::= Ident OptGenericInstantiation
GenericInstantiation ::= openAngleBracket Type ( comma Type )* closeAngleBracket
FunctionSpec ::= ( ( RequiresClause | ReadsClause | EnsuresClause | DecreasesClause ) )*
FunctionBody ::= lbrace Expression rbrace
PossiblyWildExpression ::= ( star | Expression )
FrameField ::= backtick IdentOrDigits
IdentOrDigits ::= ( Ident | digits )
Stmt ::= OneStmt
OneStmt ::= ( BlockStmt | UpdateStmt | VarDeclStatement | ReturnStmt | IfStmt | WhileStmt | AssertStmt | AssumeStmt | BreakStmt | CalcStmt | ExpectStmt | ForallStmt | LabeledStmt | MatchStmt | ModifyStmt | PrintStmt | RevealStmt | SkeletonStmt | YieldStmt )
UpdateStmt ::= ( Lhs ( ( Attribute )* semicolon | ( comma Lhs )* ( gets Rhs ( comma Rhs )* | boredSmiley ( assume )? Expression | ":-" ( ( expect | assert | assume ) )? Expression ( comma Rhs )* ) semicolon | colon ) | ":-" ( ( expect | assert | assume ) )? Expression ( comma Rhs )* semicolon )
VarDeclStatement ::= ( ghost )? var ( ( Attribute )* LocalIdentTypeOptional ( comma ( Attribute )* LocalIdentTypeOptional )* ( ( gets Rhs ( comma Rhs )* | ( Attribute )* boredSmiley ( assume )? Expression | ":-" ( ( expect | assert | assume ) )? Expression ( comma Rhs )* ) )? semicolon | CasePatternLocal ( gets | ( Attribute )* boredSmiley ) Expression semicolon )
ReturnStmt ::= "return" ( Rhs ( comma Rhs )* )? semicolon
IfStmt ::= "if" ( AlternativeBlock | ( BindingGuard | Guard | ellipsis ) BlockStmt ( else ( IfStmt | BlockStmt ) )? )
WhileStmt ::= "while" ( LoopSpec AlternativeBlock | ( Guard | ellipsis ) LoopSpec ( BlockStmt | ellipsis | ) )
AssertStmt ::= assert ( Attribute )* ( ( LabelName colon )? Expression ( by BlockStmt | semicolon ) | ellipsis semicolon )
AssumeStmt ::= assume ( Attribute )* ( Expression | ellipsis ) semicolon
BreakStmt ::= "break" ( LabelName | ( "break" )* ) semicolon
CalcStmt ::= calc ( Attribute )* ( CalcOp )? lbrace ( Expression semicolon ( CalcOp )? ( ( BlockStmt | CalcStmt ) )* )* rbrace
ExpectStmt ::= expect ( Attribute )* ( Expression | ellipsis ) ( comma Expression )? semicolon
ForallStmt ::= "forall" ( openparen ( QuantifierDomain )? closeparen | ( QuantifierDomain )? ) ( EnsuresClause )* ( BlockStmt )?
LabeledStmt ::= "label" LabelName colon OneStmt
MatchStmt ::= "match" Expression ( lbrace ( CaseStmt )* rbrace | ( CaseStmt )* )
ModifyStmt ::= "modify" ( Attribute )* ( FrameExpression ( comma FrameExpression )* | ellipsis ) ( BlockStmt | semicolon )
PrintStmt ::= "print" Expression ( comma Expression )* semicolon
RevealStmt ::= reveal Expression ( comma Expression )* semicolon
SkeletonStmt ::= ellipsis semicolon
YieldStmt ::= "yield" ( Rhs ( comma Rhs )* )? semicolon
Rhs ::= ( "new" ( NewArray | TypeAndToken ( ( NewArray | openparen ( ActualBindings )? closeparen ) )? ) | star | Expression ) ( Attribute )*
Lhs ::= ( NameSegment ( Suffix )* | ConstAtomExpression Suffix ( Suffix )* )
NewArray ::= lbracket ( rbracket lbracket ( Expressions )? rbracket | Expressions rbracket ( ( openparen Expression closeparen | lbracket ( Expressions )? rbracket ) )? )
ActualBindings ::= ActualBinding ( comma ActualBinding )*
Expressions ::= Expression ( comma Expression )*
CasePatternLocal ::= ( Ident openparen ( CasePatternLocal ( comma CasePatternLocal )* )? closeparen | openparen ( CasePatternLocal ( comma CasePatternLocal )* )? closeparen | LocalIdentTypeOptional )
AlternativeBlock ::= ( lbrace ( AlternativeBlockCase )* rbrace | AlternativeBlockCase ( AlternativeBlockCase )* )
BindingGuard ::= IdentTypeOptional ( comma IdentTypeOptional )* ( Attribute )* boredSmiley Expression
Guard ::= ( star | openparen star closeparen | Expression )
AlternativeBlockCase ::= case ( BindingGuard | Expression ) darrow ( Stmt )*
LoopSpec ::= ( ( InvariantClause | DecreasesClause | ModifiesClause ) )*
ExtendedPattern ::= ( openparen ( ExtendedPattern ( comma ExtendedPattern )* )? closeparen | Ident openparen ( ExtendedPattern ( comma ExtendedPattern )* )? closeparen | PossiblyNegatedLiteralExpr | IdentTypeOptional )
PossiblyNegatedLiteralExpr ::= ( "-" ( Nat | Dec ) | LiteralExpression )
CaseStmt ::= case ExtendedPattern darrow ( Stmt )*
QuantifierDomain ::= IdentTypeOptional ( comma IdentTypeOptional )* ( Attribute )* ( verticalbar Expression )?
CalcOp ::= ( eq ( "#" lbracket Expression rbracket )? | openAngleBracket | closeAngleBracket | "<=" | ">=" | neq | neqAlt | "\u2264" | "\u2265" | EquivOp | ImpliesOp | ExpliesOp )
EquivOp ::= ( "<==>" | "\u21d4" )
ImpliesOp ::= ( "==>" | "\u21d2" )
ExpliesOp ::= ( "<==" | "\u21d0" )
AndOp ::= ( "&&" | "\u2227" )
OrOp ::= ( "||" | "\u2228" )
NegOp ::= ( "!" | "\u00ac" )
Forall ::= ( "forall" | "\u2200" )
Exists ::= ( "exists" | "\u2203" )
QSep ::= ( doublecolon | bullet )
EquivExpression ::= ImpliesExpliesExpression ( EquivOp ImpliesExpliesExpression )*
ImpliesExpliesExpression ::= LogicalExpression ( ( ImpliesOp ImpliesExpression | ExpliesOp LogicalExpression ( ExpliesOp LogicalExpression )* ( ImpliesOp )? ) )?
LogicalExpression ::= ( AndOp RelationalExpression ( AndOp RelationalExpression )* ( OrOp )? | OrOp RelationalExpression ( OrOp RelationalExpression )* ( AndOp )? | RelationalExpression ( ( AndOp RelationalExpression ( AndOp RelationalExpression )* ( OrOp )? | OrOp RelationalExpression ( OrOp RelationalExpression )* ( AndOp )? ) )? )
ImpliesExpression ::= LogicalExpression ( ImpliesOp ImpliesExpression )? ( ExpliesOp )?
RelationalExpression ::= ShiftTerm ( RelOp ShiftTerm ( RelOp ShiftTerm )* )?
ShiftTerm ::= Term ( ( openAngleBracket openAngleBracket | closeAngleBracket closeAngleBracket ) Term )*
RelOp ::= ( eq ( "#" lbracket Expression rbracket )? | openAngleBracket | closeAngleBracket | "<=" | ">=" | neq ( "#" lbracket Expression rbracket )? | in | notIn | "!" ( "!" )? | neqAlt | "\u2264" | "\u2265" )
Term ::= Factor ( AddOp Factor )*
Factor ::= BitvectorFactor ( MulOp BitvectorFactor )*
AddOp ::= ( "+" | "-" )
BitvectorFactor ::= AsExpression ( ( "&" AsExpression ( "&" AsExpression )* ( ( verticalbar | "^" ) )? | verticalbar AsExpression ( verticalbar AsExpression )* ( ( "^" | "&" ) )? | "^" AsExpression ( "^" AsExpression )* ( ( "&" | verticalbar ) )? ) )?
MulOp ::= ( star | "/" | "%" )
AsExpression ::= UnaryExpression ( ( as TypeAndToken | is TypeAndToken ) )*
UnaryExpression ::= ( "-" UnaryExpression | NegOp UnaryExpression | PrimaryExpression )
PrimaryExpression ::= ( MapDisplayExpr ( Suffix )* | SetDisplayExpr ( Suffix )* | LambdaExpression | EndlessExpression | NameSegment ( Suffix )* | SeqDisplayExpr ( Suffix )* | ConstAtomExpression ( Suffix )* )
MapDisplayExpr ::= ( map | imap ) lbracket ( MapLiteralExpressions )? rbracket
Suffix ::= ( dot ( openparen MemberBindingUpdate ( comma MemberBindingUpdate )* closeparen | DotSuffix ( GenericInstantiation ( AtCall )? | HashCall | ( AtCall )? ) ) | lbracket ( Expression ( ".." ( Expression )? | gets Expression | colon ( Expression ( colon Expression )* ( colon )? )? | ( comma Expression )* ) | ".." ( Expression )? ) rbracket | openparen ( ActualBindings )? closeparen )
SetDisplayExpr ::= ( ( iset | multiset ) )? ( lbrace ( Expressions )? rbrace | openparen Expression closeparen )
LambdaExpression ::= ( WildIdent | openparen ( IdentTypeOptional ( comma IdentTypeOptional )* )? closeparen ) LambdaSpec darrow Expression
EndlessExpression ::= ( IfExpression | MatchExpression | QuantifierExpression | SetComprehensionExpr | StmtInExpr Expression | LetExpression | MapComprehensionExpr )
NameSegment ::= Ident ( GenericInstantiation ( AtCall )? | HashCall | ( AtCall )? )
SeqDisplayExpr ::= ( seq ( GenericInstantiation )? openparen Expression comma Expression closeparen | lbracket ( Expressions )? rbracket )
ConstAtomExpression ::= ( LiteralExpression | "this" | "fresh" openparen Expression closeparen | "allocated" openparen Expression closeparen | "unchanged" ( at LabelName )? openparen FrameExpression ( comma FrameExpression )* closeparen | "old" ( at LabelName )? openparen Expression closeparen | verticalbar Expression verticalbar | ParensExpression )
LiteralExpression ::= ( "false" | "true" | "null" | Nat | Dec | charToken | stringToken )
ParensExpression ::= openparen ( ActualBindings )? closeparen
Nat ::= ( digits | hexdigits )
Dec ::= decimaldigits
LambdaSpec ::= ( ( ReadsClause | requires ( Attribute )* Expression ) )*
MapLiteralExpressions ::= Expression gets Expression ( comma Expression gets Expression )*
MapComprehensionExpr ::= ( map | imap ) IdentTypeOptional ( comma IdentTypeOptional )* ( Attribute )* ( verticalbar Expression )? QSep Expression ( gets Expression )?
IfExpression ::= "if" ( BindingGuard | Expression ) then Expression else Expression
MatchExpression ::= "match" Expression ( lbrace ( CaseExpression )* rbrace | ( CaseExpression )* )
QuantifierExpression ::= ( Forall | Exists ) QuantifierDomain QSep Expression
SetComprehensionExpr ::= ( set | iset ) IdentTypeOptional ( comma IdentTypeOptional )* ( Attribute )* verticalbar Expression ( QSep Expression )?
StmtInExpr ::= ( AssertStmt | ExpectStmt | AssumeStmt | RevealStmt | CalcStmt )
LetExpression ::= ( LetExprWithLHS | LetExprWithoutLHS )
LetExprWithLHS ::= ( ghost )? var CasePattern ( comma CasePattern )* ( gets | ( Attribute )* boredSmiley | ":-" ) Expression ( comma Expression )* semicolon Expression
LetExprWithoutLHS ::= ":-" Expression semicolon Expression
CasePattern ::= ( Ident openparen ( CasePattern ( comma CasePattern )* )? closeparen | openparen ( CasePattern ( comma CasePattern )* )? closeparen | IdentTypeOptional )
CaseExpression ::= case ExtendedPattern darrow Expression
AtCall ::= at LabelName openparen ( ActualBindings )? closeparen
HashCall ::= "#" ( GenericInstantiation )? lbracket Expression rbracket openparen ( ActualBindings )? closeparen
MemberBindingUpdate ::= NoUSIdentOrDigits gets Expression
DotSuffix ::= ( Ident | digits | decimaldigits | requires | reads )
ActualBinding ::= ( NoUSIdentOrDigits gets )? Expression
AttributeName ::= NoUSIdent
//
// tokens
//
bool ::= "bool"
char ::= "char"
int ::= "int"
nat ::= "nat"
real ::= "real"
ORDINAL ::= "ORDINAL"
object ::= "object"
object_q ::= "object?"
string ::= "string"
set ::= "set"
iset ::= "iset"
multiset ::= "multiset"
seq ::= "seq"
map ::= "map"
imap ::= "imap"
colon ::= ":"
comma ::= ","
verticalbar ::= "|"
doublecolon ::= "::"
gets ::= ":="
boredSmiley ::= ":|"
bullet ::= "\u2022"
dot ::= "."
backtick ::= "`"
semicolon ::= ";"
darrow ::= "=>"
assume ::= "assume"
assert ::= "assert"
calc ::= "calc"
case ::= "case"
then ::= "then"
else ::= "else"
as ::= "as"
is ::= "is"
by ::= "by"
in ::= "in"
decreases ::= "decreases"
invariant ::= "invariant"
function ::= "function"
predicate ::= "predicate"
least ::= "least"
greatest ::= "greatest"
inductive ::= "inductive"
twostate ::= "twostate"
copredicate ::= "copredicate"
lemma ::= "lemma"
static ::= "static"
import ::= "import"
export ::= "export"
class ::= "class"
trait ::= "trait"
datatype ::= "datatype"
codatatype ::= "codatatype"
var ::= "var"
const ::= "const"
newtype ::= "newtype"
type ::= "type"
iterator ::= "iterator"
method ::= "method"
colemma ::= "colemma"
constructor ::= "constructor"
modifies ::= "modifies"
reads ::= "reads"
requires ::= "requires"
ensures ::= "ensures"
ghost ::= "ghost"
witness ::= "witness"
lbracecolon ::= "{:"
lbrace ::= "{"
rbrace ::= "}"
lbracket ::= "["
rbracket ::= "]"
openparen ::= "("
closeparen ::= ")"
openAngleBracket ::= "<"
closeAngleBracket ::= ">"
singleeq ::= "="
eq ::= "=="
neq ::= "!="
neqAlt ::= "\u2260"
star ::= "*"
at ::= "@"
ellipsis ::= "..."
reveal ::= "reveal"
expect ::= "expect"
sarrow ::= "->"
qarrow ::= "~>"
larrow ::= "-->"
I love these diagrams! Even though I know both the grammar and Dafny.atg
file well, I'm finding it both interesting and useful to look at these.
Do you have (or can you create) some script we can use to
Dafny.atg
, andYes there is, I implemented the generation of the Parser.ebnf
on this fork of CocoR Csharp https://github.com/mingodad/CocoR-CSharp and you can download the railroad generator to generate offline using Java here https://www.bottlecaps.de/rr/download/rr-1.63-java8.zip (link from the https://www.bottlecaps.de/rr/ui on tab Welcome
).
Coco.exe -genRREBNF Dafny.atg
java -jar rr.war -out:Dafny.atg.xhtml Parser.ebnf
Also any feedback on the CocoR extensions are welcome !
Dafny-lsp.atg
Could you link to the file you're referring to?
Good question, looking at where I found it https://github.com/just-me-/dafny-language-server/blob/master/Source/Dafny/Dafny.atg I can see that it's an old clone of Dafny itself. So it's my fault when reporting it. Probably I should delete it ?
Probably I should delete it?
Delete what? This ticket also contains a sort of feature request. If you find a bug related to the grammar in the future, in might be easier to cut a separate ticket for it.
The message reporting it here https://github.com/dafny-lang/dafny/issues/1244#issuecomment-886039577
I also just got a working port of CocoR to Typescrip/Javascript here https://github.com/mingodad/CocoR-Typescript and also an online playground here https://mingodad.github.io/CocoR-Typescript/playground .
Looking for people using CocoR I found this project and I've done a experimental tool to convert CocoR grammars to a kind of EBNF understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams see bellow the converted and with some hand made changes of
Dafny.atg
to allow view it at https://www.bottlecaps.de/rr/ui the order of the rules could be changed to a better view of the railroad diagrams. Copy and paste the EBNF bellow on https://www.bottlecaps.de/rr/ui tab Edit Grammar then switch to the tab View Diagram.Cheers !