Does anyone know what “flavor” of #ABNF / #EBNF this is written in? The table heading says “EBNF,” while the paragraph above references “ABNF,” but it appears to use a format that’s different from what’s defined in RFC 5234 or ISO/IEC 14977:1996.
https://www.unicode.org/reports/tr35/#unicode-locale-identifier
I could make assumptions about some of these characters, but I’d rather be as explicit as possible.
#abnf #ebnf #unicode #cldr #ldml #tr35
With #EBNF , we have no need of Epsilon here. The #nonterminal followed by the
'*' operator simply means 0 or more of the preceding thing, here: The ElIfClause.
And for completeness: (else Statements)? means 0 or 1 of the preceding group making them optional.
Many times when trying to model your language syntax in #BNF, you are forced
to break out a new NonTerminal, and to supply a alternate Epsilon.
Often, you can avoid this with grouping and '*', '+' or '?'.
Where is E used in #EBNF
But #EBNF introduces a more succint representation. Esp. w/the Kleene star '*''.
Let's look at a broken version of the syntax of #Bash's if/then/elif syntax:
#POBNF:
IfStmt ::= if BoolExpr then Statements ElIfClause ElseClause fi
ElIfClause ::= elif BoolExpr then Statements
| ...
#EBNF:
IfStmt ::= if BoolExpr then Statements ElIfClause* (else Statements)? fi
ElIfClause ::= elif BoolExpr then Statements
ElseClause ::= else Statements
(Whitespace elided)
Sometime back, I was working on a presentation re: #BNF and had this epiphany.
The Epsilon transition was nothing to be spooked about.
For those who might not be aware: Epsilon is a terminal symbol that might
occur in a production. (A pox on my younger doofus self who thought it was the empty string).
It actually introduces nondeterminism into the #grammar rules.
The insight was that #EBNF with its regex-like symbols has no need of Epsilon.
#parser #compiler #syntax Read on ...
#bnf #grammar #ebnf #parser #compiler #syntax
I'm making a tiny change to the Balsa #ebnf grammar to reject strings with terminating branches (e.g., "CCC(C)" and "CCC(C).O"). They should never be needed and just complicate canonicalization.
Working paper at: https://chemrxiv.org/engage/chemrxiv/article-details/632159bd173b5d04e2fc8b1a
Can all Context-Free Grammars be described in Backus-Naur Form/Syntax?
Is BNF a "form" like Chomsky Normal Form or Greiback Normal Form, or is it just a "syntax" that can encode all CFG's and all BNF documents describe a CFG (a bijective encoding)?
The internet only tells me things that are so Basic I don't trust them to know about such questions, or so advanced they already assume I know the answer to this X'D
#Math
#FormalGrammars
#ContextFreeGrammar
#BNF #EBNF #BackusNaur
#Parsing #Parsers
#parsers #parsing #BackusNaur #ebnf #bnf #ContextFreeGrammar #FormalGrammars #math
Added spec and interactive railroad diagrams to jevko.org:
https://jevko.org/spec.html
https://jevko.org/diagram.xhtml
#jevko #specification #diagrams #interactive #syntax #minimal #grammar #ebnf #abnf #bnf
#jevko #specification #diagrams #interactive #syntax #minimal #grammar #ebnf #ABNF #bnf