Questions tagged [abnf]

Augmented Backus–Naur Form (ABNF) is a metalanguage based on Backus–Naur Form (BNF)

In computer science, Augmented Backus–Naur Form (ABNF) is a metalanguage based on Backus–Naur Form (BNF), but consisting of its own syntax and derivation rules. The motive principle for ABNF is to describe a formal system of a language to be used as a bidirectional communications protocol.

via: Wikipedia

38 questions
10
votes
1 answer

What does [CFWS] and [FWS] mean in this ABNF?

The RFC 2282 for emails have the below ABNF for quoted-string. quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS] I googled and foundthat CFWS is Comments, Folding,…
Priya R
  • 451
  • 4
  • 14
6
votes
2 answers

Unicode version of ABNF?

I want to write a grammar for a file format whose content can contain characters other than US-ASCII ones. Since I am used to ABNF, I try to use it... However, none of RFCs 5234 and 7405 are very friendly towards people who DO NOT use US ASCII. In…
fge
  • 119,121
  • 33
  • 254
  • 329
5
votes
2 answers

Is the alternative operator in ABNF commutative?

Is the alternative operator (/) in Augmented Backus-Naur Form commutative? For example, is s = a / b the same as s = b / a?
Xandaros
  • 645
  • 1
  • 6
  • 17
3
votes
3 answers

Transform ABNF rules to REGEX

I need to transform undermentioned ABNF rules (mlaer) to REGEX mlaer = 1*( lebal "." ) lebal lebal = gid-tel *(rts-hdl) rts-hdl = *( alpha / digit / "-" ) gid-tel gid-tel = alpha / digit alpha = %x41-5A …
Tom Cruise
  • 509
  • 1
  • 6
  • 10
2
votes
1 answer

What is the format of HTTP 1.1 header values?

I read the rfc7230 section 3.2. After removing obsolete rules, the spec about header field is: header-field = field-name ":" OWS field-value OWS field-name = token field-value = *field-content field-content = field-vchar [ 1*( SP / HTAB )…
martixingwei
  • 199
  • 1
  • 1
  • 7
2
votes
1 answer

Parse into a complex struct with boost::spirit

I have an input encoded with ABNF grammar rules (it is MEGACO protocol): !/3 [15.232.33.21]:2134 T=173619123 { C=230234621 { PR=9, MF=ip/187/6/23045241 { ... }, MF=ip/187/6/23045242 …
Nikolay Kovalenko
  • 1,767
  • 2
  • 13
  • 14
2
votes
0 answers

abnf parser with node js

Can any one suggest how to parse TEXT using ABNF grammar? Installed abnf module. I have grammar in abc.abnf file. I have text content in abc.txt file. I am successful in validating the grammar. I want content in abc.txt need to validated against…
Dinesh
  • 51
  • 1
  • 6
2
votes
1 answer

Preventing duplicate characters in ABNF

I want to create an ABNF rule that contains the characters "imsxeADSUXju". Each character is optional. The order does not matter, but a character may not appear more than once. E.g.: it must match "i" "im" "mi" "" "uUsejXx" "imsxeADSUXju" But not…
XcinnaY
  • 274
  • 2
  • 10
2
votes
2 answers

ANTLR 4.1 Variable ANTLR 4 token multiplicity yields error: "closure with at least one alternative that can match empty string"

Basically what I'm trying to do is create a grammar for Internationalized Resource Identifiers in ANTLR 4.1. The hardest time I've had thus far is trying to get the production rule for ipv6address working correctly. The way ipv6address is defined in…
2
votes
2 answers

convert ABNF rules to regular expressions

Please help me understand this ABNF rule ([a-z]* [A-Z]* [0-9]*)*. I think it could be converted to the regex like this [a-zA-Z0-9]*. So the ABNF rule should match lowercase and/or uppercase letters and/or numbers in any order and their combinations.…
canoe
  • 1,273
  • 13
  • 29
1
vote
1 answer

Understanding ABNF syntax "0"

In RFC 3986, they defined the rule: path-empty = 0 For simplicity, let's assume pchar is defined: pchar = 'a' / 'b' / 'c' What does path-empty match and how is it matched? I've read the Wikipedia page on ABNF. My guess is that matches the…
Oliver
  • 1,465
  • 4
  • 17
1
vote
1 answer

How to remove left-recursion from grammar rules

The following set of antlr grammar lines gives me the error for number_operation & number_argument as given below The following sets of rules are mutually left-recursive number_funtion : COUNT LEFT_PAREN number_argument…
KVM
  • 125
  • 14
1
vote
1 answer

ABNF augmented by HTTP : normative reference for #symbol

Context Solving a CORS issue, I was wondering what are the valid values for the HTTP response header Access-Control-Allow-Headers. The Whatwg CORS spec on header syntax tells me in ABNF that : Access-Control-Allow-Headers = #field-name And the…
Gabriel Glenn
  • 1,174
  • 1
  • 13
  • 30
1
vote
1 answer

Is there any IDEs or plugins for developing ABNF grammars?

I am currently debugging an ABNF grammar. It is currently very big. I am finding it difficult to debug. An IDE or syntax highlighter would be very helpful. Is there any recommended ABNF grammar IDE or plugin available? Not the BNF ides and plugins. …
user3243499
  • 2,953
  • 6
  • 33
  • 75
1
vote
0 answers

boost::spirit for ABNF

I need to create a parser for a protocol encoded in ABNF format. I am inclined to use boost::spirit for this task. I read documentation but I'm still not sure what is the most effective way to do it. As far as I understand it is better to create a…
Nikolay Kovalenko
  • 1,767
  • 2
  • 13
  • 14
1
2 3