I am learning compilers and I am troubled by how to create the context-free grammar of a language. Is there a method I can follow to create the context-free grammar for most language ? I'm new to this field so the question is basic,and I hope you can help me.
Asked
Active
Viewed 32 times
0
-
1This seems overly broad. "How can I create a context-free grammar for a language?" is like asking "How can I write a program to accomplish some task?" – David Richerby Nov 18 '14 at 16:23
-
1The answer would depend on how the language is defined in the first place. You could lessen the chance that your question would be closed as too broad if you gave a simple example of what the language specification would be. – Rick Decker Nov 18 '14 at 17:47
-
We have a reference question on this, but it is (naturally) very abstact. You can have a look at myriads of questions via [tag:formal-grammars+context-free]. – Raphael Nov 19 '14 at 11:57