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

A textual transformation tool to transform usual EBNF specification to equivalent JSON specification (grammar) #1

Open
foo123 opened this issue Mar 25, 2016 · 0 comments

Comments

@foo123
Copy link
Owner

foo123 commented Mar 25, 2016

This is to remind and propose (for anyone interested) that since EBNF grammar notations/specifications do not use JSON format, but a rather similar textual format, for example

EBNF

a_rule ::= symbol1
| symbol2
| 'literal symbol'
| ..
;

or even:

EBNF

a_rule ::= <symbol1>
| <symbol2>
| 'literal symbol'
| ..
;

Although it is rather straightforward to transform the above examples into a JSON grammar for highlight. It is even better to have a transformation tool for that.

Given that JSON grammar (as used by *-grammar highlighter add-ons) can accept and parse EBNF/PEG notation. The task is even easier. For example, just split each rule as rule_name => rule_definition and create a JSON-like object from that (more correctly the Syntax part of the overall JSON grammar).

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

No branches or pull requests

1 participant