How to do context-free grammar?

Let’s learn how to do context-free grammar. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How can I write my context-free grammar?

I'm trying to write a CFG over the alphabet Σ = {a,b} for all words starting and ending with the same number of a's, with at least one b in the middle. Now I understand the basic concept of CFG, variables, production rules, etc. Unfortunately I've run out of ideas for writing the aforementioned CFG. All I've got so far is S → aYXYa X → XbX | b | λ Y → ??? I think that the production rules S and X will give me a string with two as on both sides with as many bs in the middle as I'd like. However...

Answer:

S → aSa | B B → b | bB This should be the CFG you're looking for. Whenever you've dealing with the...

Read more

L R at Stack Overflow Mark as irrelevant Undo

Other solutions

Which of these sentences uses grammar correctly?

Which of these sentences uses grammar correctly? (Points : 1) This condominium is the one which needs repairs. This condominium is the one, which needs repairs. This condominium is the one that needs repairs. 3. Which of these sentences uses grammar...

Answer:

This isn't going to be the answer you want; but, sorry, this is one of those grammar tests set with...

Read more

Create a Better Community at Yahoo! Answers Mark as irrelevant Undo

What are the differences between the DTC theory of grammar (transformational grammar) and Chomsky's X-bar grammar?

In Fodor, Garrett & Bever book from 1974, "The Psychology of Language", they raise some arguments against the DTC theory of complexity and grammar transformations. What are the differences between the DTC grammar and Chomsky's X-bar grammar...

Answer:

Noam Chomsky (linguist, author) laid the foundations of transformational grammar with his first theory...

Read more

David Sweet at Quora Mark as irrelevant Undo

How can one learn to fully comprehend and use grammar?

That title is supposed to be ironic, and this isn't necessarily about English grammar. I grew up speaking English in the United States and had no problems writing and speaking. I picked up French for 4 years in secondary education, but when conversational...

Answer:

Read a lot. Read newspapers, magazines, novels written by non-Indian authors. Buy books for grammar...

Read more

Sowmya Jain at Quora Mark as irrelevant Undo

What does the "grammar" in grammar schools mean/signify?

I know what grammar means so I do not any definitions of the word grammar I just don't get why grammar schools are called grammar schools based on the meaning of grammar as wel know it.

Answer:

It means they teach ya ta talk proper there, guv! Just like wot I do! Not like them little gobshites...

Read more

DeLite aka xXxCHExXx AJB ROCKS!! at Yahoo! Answers Mark as irrelevant Undo

I am not able to learn Japanese. I don't know how to go about learning the grammar?

I got interested in learning Japanese 3.5 years ago. I used to just copy kanji characters for fun. Later I started learning hiragana, katakana and some vocabulary. Then I joined an online correspondence course for Japanese but I finished half of it and...

Answer:

Passive learning is really good for input, but if you really want to speak/write Japanese, you have...

Read more

eguru at Yahoo! Answers Mark as irrelevant Undo

Looking for a good book on English grammar.

Looking for a good book on English grammar. Greetings. In my job, I have to do a lot of writing and editing. I don't have an English background (economics was my major), but I completed all of the required English courses in college. However, over the...

Answer:

This isn't an entertaining book at all, but I recommend the Gregg Reference Manual as a reference. It...

Read more

dbirchum at Ask.Metafilter.Com Mark as irrelevant Undo

Why is C++ grammar so hard to parse?

I am working on a project in which I am taking help of "yacc-able" C grammar. I thought that it would be easy to do experiments on C grammar by writing my own actions in yacc file and then use the same procedure for C++ grammar. Now after ...

Answer:

C is hard to parse, and C++ is harder. I don't remember the specifics, but what I heard is that the...

Read more

Paul King at Quora Mark as irrelevant Undo

Do you think it is right to punish people who make grammar and spelling mistakes? Do you think it is right to treat them as inferiors? Why?

I have made many, many of my own spelling mistakes. I have not always used correct grammar. I have noticed other people ridiculing people for spelling things wrong and for using poor grammar. I have noticed people going on the attack over this sort of...

Answer:

No we should never punish anyone..we don't know why they make mistakes..maybe they are dsylexic or can...

Read more

AnonymousGirl at Answerbag.com Mark as irrelevant Undo

How to grammar (grammar help)?

Well I am having an argument with my gramatically disabled sister. She posted on facebook a grammar lesson with the title "Today's grammar check" which is seemingly contradictory to me. Would that not mean "Today is grammar check?"...

Answer:

Actually, she is right. "Today's" is possessive. It's as if she's saying "grammar check...

Read more

The Engie at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.