[racket] What do these symbols mean in Racket regexp documentation?
On Tue, May 7, 2013 at 3:14 PM, Don Green <infodeveloperdon at gmail.com>wrote:
> Can you apply the verbage that must be represented by the symbols in
> Racket regexp documentation shown below:
>
> ;;= means what?
>
> | means what?
>
> <pces> means what?
>
>
Hi Don,
You are seeing instances of Backus-Naur Form (BNF):
http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form
This is not exclusive to Racket documentation. It is a syntax that is
commonly used in computer science to express the structure of a language.
;;= means what?
>
> | means what?
>
> <pces> means what?
>
> When I read something like:
‹*regexp*›
::=
‹*pces*›
Match ‹*pces*›
|
‹*regexp*›|‹*regexp*›
Match either ‹*regexp*›, try left first
I read this as:
"A regular expression regexp is either:
* A "pces", which will be defined later in the document,
OR
* An inner regexp, followed by a pipe "|", followed by another regexp
OR
...
where ":==" is notation meant to distinguish the left and right hand sides
of the definition, <X> is a reference to another piece of structure, and
"|" is mean to denote one of a possible set of candidates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130507/570ae29a/attachment.html>