![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
context-free grammar
if i have posted it in a wrong section, please feel free to move it!
I have to write a context-free grammr for the language in which a sentence has 0 or more b followed by a c followed by a string of d, and the number of d equals number of b! Problem! ... how do i keep track of the number of b?? there is no way, right? hmm thanks! |
|
|
|
|
|
#2 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 751
Rep Power: 3
![]() |
what if you just made sure there was a d for every b? Something like:
S = <something1> T = <something2>b<something3>d<something4> U = c |
|
|
|
|
|
#3 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
Does anyone else see the irony here?
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted. Got 'Nux?—GNU/Linux and other free software support. It's GNU/Linux, not just Linux. |
|
|
|
|
|
#4 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
Quote:
are you sure it's that easy?? btw i am not supposed to use left recursion |
|
|
|
|
|
|
#5 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
Quote:
|
|
|
|
|
|
|
#6 | |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Quote:
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
|
#7 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
Quote:
|
|
|
|
|
|
|
#8 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
You want to do a project having to do with grammar in another language, yet you don't use proper grammar in English.
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted. Got 'Nux?—GNU/Linux and other free software support. It's GNU/Linux, not just Linux. |
|
|
|
|
|
#9 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
hey, so i know how to write context-free grammar for this q now, but I need practice! could you guys come up with more questions like this that requires me to write context-free grammar?
or tell me a site where i could find such questions (and their solutions!!) |
|
|
|
|
|
#10 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 751
Rep Power: 3
![]() |
my best guess would be to google some school sites and look for homework assignments... no guarantees on getting solutions though
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Free VS2k5 & MSDN library & other stuff | Mad_guy | Coder's Corner Lounge | 17 | Jun 16th, 2006 10:06 PM |
| least significant 1 bit | eax | Assembly | 14 | May 20th, 2006 5:17 PM |
| Free Ubuntu CD's | coldDeath | Coder's Corner Lounge | 14 | Sep 24th, 2005 2:19 AM |
| Free Cross-Frame Menu | crmpicco | HTML / XHTML / CSS | 6 | May 27th, 2005 1:47 PM |
| how to use malloc() and free() | FarAway | C++ | 5 | Feb 16th, 2005 11:08 AM |