Questions tagged [ebnf]

EBNF stands for Extended Backus-Naur Form, or Extended Backus Normal Form. It is an extension to BNF and is used to describe the syntax of context-free grammars, such as programming languages, document formats, or communication protocols. It improves over BNF by providing operators to express optional, zero or more, and one or more occurrences of a term. This makes EBNF much more expressive and concise compared to BNF.

EBNF is standardized format for documenting syntax. It includes an extension mechanism for defining a two-level grammar that can produce an infinite number of production rules.

References

354 questions
43
votes
6 answers

BNF vs EBNF vs ABNF: which to choose?

I want to come up with a language syntax. I have read a bit about these three, and can't really see anything that one can do that another can't. Is there any reason to use one over another? Or is it just a matter of preference?
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
22
votes
4 answers

EBNF for ECMAScript?

I'm trying to find a good EBNF description of ECMAScript, but so far I've not found anything complete. Any ideas?
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
19
votes
4 answers

EBNF grammar definitions for PHP?

I am wondering if someone has compiled an EBNF for PHP somewhere. I found both this site and this site. Both seem like they are incomplete, though. This question is very similar, but it's a year old. I would like to know if there has been any…
Azmisov
  • 6,493
  • 7
  • 53
  • 70
18
votes
2 answers

How to represent negation in BNF?

Does BNF or ABNF support negation. That is exclude certain members of the set? I did not see any such negation operator in its syntax. For example, suppose S is the set of all alphanumeric strings that are not equal to "foo" What is the BNF for S?
Jus12
  • 17,824
  • 28
  • 99
  • 157
14
votes
2 answers

EBNF or BNF for the LOGO programming language

Does anyone know where I can get the BNF or EBNF for the LOGO programming language?
Vivin Paliath
  • 94,126
  • 40
  • 223
  • 295
14
votes
2 answers

Converting EBNF to BNF

It's been a few years since my computer-language class and so I've forgotten the finer points of BNF's and EBNF's and I don't have a textbook next to me. Specifically, I've forgotten how to convert an EBNF into BNF. From what little I remember, I…
Vivin Paliath
  • 94,126
  • 40
  • 223
  • 295
12
votes
5 answers

Grammar Writing Tools

I am trying to write a grammar in EBNF (barring a really good reason, it has to be EBNF) and am looking for a couple of utilities for it - if there's a GUI interface that can make one, that would be great, but the thing I'm looking for most is…
coppro
  • 14,338
  • 5
  • 58
  • 73
12
votes
4 answers

POSIX sh EBNF grammar

Is there an existing POSIX sh grammar available or do I have to figure it out from the specification directly? Note I'm not so much interested in a pure sh; an extended but conformant sh is also more than fine for my purposes.
rubenvb
  • 74,642
  • 33
  • 187
  • 332
10
votes
3 answers

Is ANTLR an appropriate tool to serialize/deserialize a binary data format?

I need to read and write octet streams to send over various networks to communicate with smart electric meters. There is an ANSI standard, ANSI C12.19, that describes the binary data format. While the data format is not overly complex the standard…
Dan Finucane
  • 1,547
  • 2
  • 18
  • 27
10
votes
4 answers

Where can I get material for learning EBNF?

Extended Backus–Naur Form: EBNF I'm very new to parsing concepts. Where can I get sufficiently easy to read and follow material for writing a grammar for the boost::spirit library, which uses a grammar similar to EBNF? Currently I am looking into…
yesraaj
  • 46,370
  • 69
  • 194
  • 251
10
votes
1 answer

C# 5.0 EBNF grammar

I am looking for an EBNF grammar of the programming language C# in the Version 5.0. This grammar should be machine readable, so I am able to do some processing with this EBNF grammar Until now I found out that the language specification document of…
boindiil
  • 5,805
  • 1
  • 28
  • 31
10
votes
1 answer

Scala Parser Token Delimiter Problem

I'm trying to define a grammar for the commands below. object ParserWorkshop { def main(args: Array[String]) = { ChoiceParser("todo link todo to database") ChoiceParser("todo link todo to database deadline: next tuesday context:…
BefittingTheorem
  • 10,459
  • 15
  • 69
  • 96
10
votes
3 answers

Z80 ASM BNF structure... am I on the right track?

I'm trying to learn BNF and attempting to assemble some Z80 ASM code. Since I'm new to both fields, my question is, am I even on the right track? I am trying to write the format of Z80 ASM as EBNF so that I can then figure out where to go from there…
Gary Paluk
  • 1,038
  • 1
  • 14
  • 28
9
votes
1 answer

How to parse Prometheus data

I have been able to obtain the metrices by sending an HTTP GET as follows: # TYPE net_conntrack_dialer_conn_attempted_total untyped net_conntrack_dialer_conn_attempted_total{dialer_name="federate",instance="localhost:9090",job="prometheus"} 1…
Sijan Bhattarai
  • 570
  • 2
  • 6
  • 25
9
votes
1 answer

Implementing parser for markdown-like language

I have markup language which is similar to markdown and the one used by SO. Legacy parser was based on regexes and was complete nightmare to maintain, so I've come up with my own solution based on EBNF grammar and implemented via…
Daniel Kluev
  • 11,025
  • 2
  • 36
  • 36
1
2 3
23 24