Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for optional and parameterized non-terminals #11

Closed
bterlson opened this issue Sep 26, 2014 · 2 comments
Closed

Support for optional and parameterized non-terminals #11

bterlson opened this issue Sep 26, 2014 · 2 comments

Comments

@bterlson
Copy link
Member

Non-terminals can be optional and can also have many parameters. I suggest the following syntax:

|NonTerminalName|
|NonTerminalName_opt|
|NonTerminalName[Parameter1]|
|NonTerminalName[Parameter1, ?Parameter2]_opt|

Generally, Non-terminal name, followed by an optional ParameterList (which itself is a comma separated list of parameters surrounded by brackets, where parameters may be prefixed with a ?), followed by an optional "_opt" suffix.

_opt implies an optional non-terminal, Parameter1 is a parameter, and Parameter2 is a parameter whose value is dependent on the occurrence of the parameter in the current LHS.

This aligns with the current typographic practices of the document, though you could argue that _opt should come before the parameter list. I see no reason to do this.

@domenic
Copy link
Member

domenic commented Sep 26, 2014

What Ecmarkup should each of those go to?

@bterlson
Copy link
Member Author

|NonTerminalName| -> <emu-nt>NonTerminalName</emu-nt>
|NonTerminalName_opt| -> <emu-nt optional>NonTerminalName</emu-nt>
|NonTerminalName[Parameter1]| -> <emu-nt params="Parameter1">NonTerminalName</emu-nt>
|NonTerminalName[Parameter1, ?Parameter2]_opt| -> <emu-nt params="Parameter1, ?Parameter2" optional>NonTerminalName</emu-nt>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants