File: ebnf-iso.el.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This is part of ebnf2ps package.
This package defines a parser for ISO EBNF.
See ebnf2ps.el for documentation.
ISO EBNF Syntax
---------------
See the URL:
https://www.cl.cam.ac.uk/~mgk25/iso-ebnf.html
("International Standard of the ISO EBNF Notation").
ISO EBNF = syntax rule, {syntax rule};
syntax rule = meta identifier, '=', definition list, ';';
definition list = single definition, {'|', single definition};
single definition = term, {',', term};
term = factor, ['-', exception];
exception = factor (* without <meta identifier> *);
factor = [integer, '*'], primary;
primary = optional sequence | repeated sequence | special sequence
| grouped sequence | meta identifier | terminal string
| empty;
empty = ;
optional sequence = '[', definition list, ']';
repeated sequence = '{', definition list, '}';
grouped sequence = '(', definition list, ')';
terminal string = "'", character - "'", {character - "'"}, "'"
| '"', character - '"', {character - '"'}, '"';
special sequence = '?', {character - '?'}, '?';
meta identifier = letter, { letter | decimal digit | ' ' };
integer = decimal digit, {decimal digit};
comment = '(*', {comment symbol}, '*)';
comment symbol = comment (* <== NESTED COMMENT *)
| terminal string | special sequence | character;
letter = ? A-Z a-z ?;
decimal digit = ? 0-9 ?;
character = letter | decimal digit
| ',' | '=' | '|' | '/' | '!' | '*' | '(' | ')' | '[' | ']' | '{'
| '}' | "'" | '"' | '?' | '-' | ';' | '.' | ' ' | ':' | '+' | '_'
| '%' | '@' | '&' | '#' | '$' | '<' | '>' | '\' | '^' | ' | '~';
There is also the following alternative representation:
STANDARD ALTERNATIVE
| ==> / or !
[ ==> (/
] ==> /)
{ ==> (:
} ==> :)
; ==> .
Differences Between ISO EBNF And ebnf2ps ISO EBNF
-------------------------------------------------
ISO EBNF accepts the characters given by <character> production above,
HORIZONTAL TAB (^I), VERTICAL TAB (^K), NEWLINE (^J or ^M) and FORM FEED
(^L), any other characters are invalid. But ebnf2ps accepts also the
european 8-bit accentuated characters (from \240 to \377) and underscore
(_).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Defined variables (3)
ebnf-iso-lex | Value returned by ‘ebnf-iso-lex’ function. |
ebnf-iso-token-table | Vector used to map characters to a lexical token. |
ebnf-no-meta-identifier | Used by ‘ebnf-iso-term’ and ‘ebnf-iso-lex’ functions. |
Defined functions (8)
ebnf-iso-factor | (TOKEN) |
ebnf-iso-initialize | () |
ebnf-iso-lex | () |
ebnf-iso-normalize | (STR) |
ebnf-iso-parser | (START) |
ebnf-iso-primary | (TOKEN) |
ebnf-iso-syntax-rule | (TOKEN) |
ebnf-iso-term | (TOKEN) |