0

I'm tryting to write a small language syntax using BNF style. I came to an option like this:

option ::= 'option1' | 'option2' | 'read' | 'write' | etc

The first four options are as example of what values the option can have, but I can't enumerate all of them and nor I can group them. Instead, I thought to use something like etc, but I don't know if a syntax can have it. Any idea how these options can be shown, what to write instead of etc?

Thank you!

Avah
  • 227
  • 3
  • 13
  • 2
    Your question implies that you can't see how to define `etc` as a non-terminal in its own right, and that a production rule such as `etc ::= identifier` (assuming a usual sort of definition of `identifier` itself) is not satisfactory. But I'm more puzzled by your attempts to write a *small language* with a list of options which you can't write down. Why not ? – High Performance Mark Jul 28 '20 at 10:47
  • @HighPerformanceMark , Thanks a lot! Yes, that's what I want to acieve.The reason is that, I have a list of options which are already realized in the language, but in case that the language evolves, some other options are possible and desired too, so I want to make this explicit also in the syntax. – Avah Jul 28 '20 at 11:07

0 Answers0