bell notificationshomepageloginNewPostedit profile

Topic : Re: In a formal syntax notation, how should I indicate many optional elements? We use a BNF style to convey syntax for SQL statements. For a (fictitious) example: CREATE PARSER [schema.]function - selfpublishingguru.com

10% popularity

Postgres tackles a similarish problem and uses ', ...' to indicate an expression is to be repeated separated by commas (e.g. www.postgresql.org/docs/9.5/static/sql-createfunction.html). So in their syntax you would write something like

CREATE PARSER [*schema*.]*function* [WITH
{ LANGUAGE='*language*'
| MODE='[FENCED|UNFENCED]'
| STUFF='*anotherParameter*'
} [, ...]
];

Now if the order of those statements is fixed, this solution does not quite work.


Load Full (0)

Login to follow topic

More posts by @Phylliss352

0 Comments

Sorted by latest first Latest Oldest Best

Back to top