You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of this you can build dsls dynamically. You also get intellisense to build them and compilation validation.
But what would be interesting would be to create a BNF parser with the library and generate the code based on that input in case you have existing grammars to port.
Defining grammar directly in c# is the 'sweet spot' of Irony, you get strong typing, intellisence support, etc. And in Irony, BNF looks like natural, thanks to operator overloading.
Secondly, for all these PGs with BNF in file, the file actually has to include a lot of extra custom things, and usually it is code snippets injected into generated code. This gets really difficult to manage. You put "c" snippets into BNF grammar, but compiler or parser cannot check correctness, you have to generate the full parser code (usually its huge and cryptic), and then compile and run the whole thing, there you will see how your snippet works.
In Irony, you are in c# already, and you add extra custom code right there, thru events and other facilities - but it is directly checkable by c# environment.
That's the whole point of this approach
I've been going through this code for a while now.
All of your examples/samples are hardcoded.
I was totally confused by this.
It's like you are literally doing things the hard way.
Why can't you parse a file and generate terminals, non-terminals, and BNF rules from a file automatically?
The text was updated successfully, but these errors were encountered: