Difference between revisions of "Prokee Syntax Notation"
Jump to navigation
Jump to search
(Created page with " <b>Characteristics of the syntax notation:</b> * Terminal symbols are written without quotation marks. * There is no concatenation operator. Successive symbols are written o...") |
|||
| Line 1: | Line 1: | ||
| + | The '''Prokee Syntax Notation''' is a notation for syntax rules used by some prokee modules. | ||
<b>Characteristics of the syntax notation:</b> | <b>Characteristics of the syntax notation:</b> | ||
| Line 16: | Line 17: | ||
! !! EBNF !! Prokee Notation !! Remarks | ! !! EBNF !! Prokee Notation !! Remarks | ||
|- | |- | ||
| − | | Terminal symbols || <code>'a'</code> || <code>a</code> || | + | | Terminal symbols || <code>'a'</code> || <code>a</code> || No single or double quotes |
|- | |- | ||
| Termination symbols ';' or '.' || <code>'a';</code> || <code>a</code> || No termination symbol | | Termination symbols ';' or '.' || <code>'a';</code> || <code>a</code> || No termination symbol | ||
Revision as of 23:02, 6 May 2019
The Prokee Syntax Notation is a notation for syntax rules used by some prokee modules.
Characteristics of the syntax notation:
- Terminal symbols are written without quotation marks.
- There is no concatenation operator. Successive symbols are written one after the other (without a comma or space).
- There is no termination symbol ';' (or. '.'). The syntax rules are usually specified individually as separate string literals, which means that no termination symbol is necessary.
- For optional repetitions, "{}" is omitted. Instead, three dots "..." are used to indicate optional continuation. Since repetition is always optional, the three points are always enclosed in square brackets (see examples below).
- Any Unicode characters can be used as terminal symbols. (Preferred encoding is UTF-8.)
- Spaces are not treated differently than other terminal symbols.
- If non-terminal symbols are to be used as terminal symbols, then a backslash can be prefixed to this symbol.
- As in EBNF, grouping is done with "()" and optional parts are written within brackets "[]". And '|' is used for alternatives.
- Within angle brackets "<>", additional syntax specifications can be specified depending on the application.
| EBNF | Prokee Notation | Remarks | |
|---|---|---|---|
| Terminal symbols | 'a' |
a |
No single or double quotes |
| Termination symbols ';' or '.' | 'a'; |
a |
No termination symbol |
| Concatenation | 'a', 'b', 'c' |
abc |
No spaces, no concatenation operator |
| Alternatives with '|' | 'a', 'b' | 'c' |
ab|c |
|
| Grouping | 'a', ( 'b' | 'c' ) |
a(b|c)
| |
| Optional parts | 'a', [ 'b' ] , 'c' |
a[b]c
| |
| Optional repetition, example 1 | 'a', { 'b' }, 'c' |
a[b[...]]c |
Optional repetition of the element left of [...]
|
| Optional repetition, example 2 | 'a', 'b', { 'b' }, 'c' |
ab[...]c
| |
| Optional repetition, example 3 | 'a', 'b', { 'a', 'b' }, 'c' |
(ab)[...]c
| |
| Optional repetition (with separator) | 'x', { ',', 'x' } |
x[,...] |
equal to x[(,x)[...]]
|