For faster navigation, this Iframe is preloading the Wikiwand page for Extended BNF.

Extended BNF

Uit Wikipedia, de vrije encyclopedie

Extended BNF of EBNF (extended Backus–Naur form) is een uitbreiding op BNF en wordt gebruikt om de syntaxis van computercommando's te beschrijven. Iets tussen vierkante haken is optioneel. Zo mag in het UNIX-commando voor directory-listings

ls [namen]

het argument namen worden weggelaten (dan wordt de huidige directory-inhoud getoond). De vierkante haken moeten hier dus niet letterlijk worden ingetoetst op de computerterminal maar zijn puur voor het schrijven van de handleiding van het programma ls.

Het ISO-comité heeft de officiële versie ISO/IEC 14977:1996(en) van zijn uitgebreide BNF vrijelijk beschikbaar gesteld.[1]

Syntaxis

  • [ ] vierkante haken geven 0 of 1 keer aan;
  • { } accolades geven 0 of meer keer aan;
  • | met verticale streepjes kunnen keuzemogelijkheden worden gegeven.

Voorbeelden

Met behulp van de ISO-EBNF-taal zou men over deze Nederlandstalige Wikipedia bijvoorbeeld het volgende kunnen zeggen:

"[[", LEMMA, "]]"
zorgt ervoor dat de wiki-software eerst gaat zoeken naar een pagina met als titel LEMMA. Als die wordt gevonden, zal LEMMA als hyperlink worden getoond met HTML-code die er zo uitziet:
"<a href='//nl.wikipedia.org/wiki/", LEMMA, "'; class='internal' title='", LEMMA, "'>", LEMMA, "</a>"
Maar als zo'n pagina niet wordt gevonden, komt er een klikbaar vraagtekentje achter LEMMA te staan, en de server geeft:
LEMMA, "<A HREF='//nl.wikipedia.org/wiki/", LEMMA, "'>?</A>"

Een ander wiki-voorbeeld: als je een automatische link naar een andere taal wilt maken, typ je bovenaan in de bewerkingspagina

"[[", ("en" | "fr" | "de"), ":", LEMMA_VERTAALD, "]]"

waarbij LEMMA_VERTAALD het vertaalde LEMMA is in respectievelijk de Engelse, Franse of Duitse taal.

Zie ook

{{bottomLinkPreText}} {{bottomLinkText}}
Extended BNF
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Wikiwand 2.0 is here 🎉! We've made some exciting updates - No worries, you can always revert later on