[SOLVED] What is the name of this language?

In the docs, you say that the grammar for format!() is:

format_string := <text> [ maybe-format <text> ] *
maybe-format := '{' '{' | '}' '}' | <format>
format := '{' [ argument ] [ ':' format_spec ] '}'
argument := integer | identifier

format_spec := [[fill]align][sign]['#']['0'][width]['.' precision][type]
fill := character
align := '<' | '^' | '>'
sign := '+' | '-'
width := count
precision := count | '*'
type := identifier | '?' | ''
count := parameter | integer
parameter := argument '

I have two questions:

  1. Is there a name for this kind of notation?
  2. What tools can parse this notation?

(this is probably a better fit on URLO)

This is one variant of EBNF grammar notation.

2 Likes

Ah, @CAD97 was faster. I was going to say:

Interpreting the [ maybe-format <text> ] * as an alternative syntax for { maybe-format <text> } and ignoring the <> around <format> (no idea why they’re there, Edit: let’s see if we can just remove those), this is pretty much an extended Backus–Naur form.

1 Like

What is URLO?

https://users.rust-lang.org/

users.rust-lang.org

Ok, Thank you guys.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.