We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hi,
how can i get all productions of an ebnf grammar (left part)?
i want to make a visual studio grammar language service
The text was updated successfully, but these errors were encountered:
Hi @furesoft !
I know this might be outdated, but i dont wanna leave it unanswered.
If this is what you want to get: from this example EBNF grammar file:
then the code is very simple:
foreach(var child in grammar.Children) { if (!string.IsNullOrEmpty(child.Name)) { Console.WriteLine("Found grammar child:\t" + child.Name); } }
In this code, you loop through grammar Children, and just reject those who dont have anything (Those are usually newlines in the EBNF source file)
By the way, you might ask what is grammar in this context. It's the new EbnfGrammar() object!
grammar
new EbnfGrammar()
var grammar = new EbnfGrammar(EbnfStyle.Iso14977).Build(File.ReadAllText(args[0]), args[2]);
and args[2] is the start sequence keyword.
args[2]
Sorry, something went wrong.
No branches or pull requests
hi,
how can i get all productions of an ebnf grammar (left part)?
i want to make a visual studio grammar language service
The text was updated successfully, but these errors were encountered: