•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 374,148 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,461 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser:
Views: 482 | Replies: 4
![]() |
•
•
Join Date: May 2008
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
I'm very new to this topic so not so good. I'm trying to right this to be right recursive:
Question (1)
A ---> A + B
A ---> C
B ---> B + C
B ---> C
C ---> (A)
C ---> integer
Would it be something like this:
A ---> BA'
A' ---> +BA'
A ---> C
B ---> CB'
B' ---> +CB'
B ---> C
C ---> (A)
C ---> integer
Question (2)
S ---> (L) | a
L ---> L, S | S
This one I really don't have a clue on. I'm assuming that it is the same as writing:
S ---> (L)
s ---> a
L ---> L, S (dont know what the comma means, normally its a terminal symbol)
L ---> S
If someone can please give me a model answer which I can then follow and analyse to get a better understanding. Thanks!
Question (1)
A ---> A + B
A ---> C
B ---> B + C
B ---> C
C ---> (A)
C ---> integer
Would it be something like this:
A ---> BA'
A' ---> +BA'
A ---> C
B ---> CB'
B' ---> +CB'
B ---> C
C ---> (A)
C ---> integer
Question (2)
S ---> (L) | a
L ---> L, S | S
This one I really don't have a clue on. I'm assuming that it is the same as writing:
S ---> (L)
s ---> a
L ---> L, S (dont know what the comma means, normally its a terminal symbol)
L ---> S
If someone can please give me a model answer which I can then follow and analyse to get a better understanding. Thanks!
Last edited by sid99 : May 13th, 2008 at 12:10 pm.
•
•
Join Date: Apr 2008
Posts: 14
Reputation:
Rep Power: 1
Solved Threads: 3
(Ok late; so I doubt this will get looked at!)
Question (1)
A ---> A + B
A ---> C
B ---> B + C
B ---> C
C ---> (A)
C ---> integer
This I think is right:
A --> CA'
A' --> null
A' --> +BA'
B --> CB'
B' --> +CB'
C --> (A)
C --> int
Question (2)
S ---> (L) | a
L ---> L, S | S
-
S --> (L)
S --> a
L --> SL'
L' --> null
L' --> ,SL'
I think that these grammar's match; but its late and I haven't fully checked them.
Question (1)
A ---> A + B
A ---> C
B ---> B + C
B ---> C
C ---> (A)
C ---> integer
This I think is right:
A --> CA'
A' --> null
A' --> +BA'
B --> CB'
B' --> +CB'
C --> (A)
C --> int
Question (2)
S ---> (L) | a
L ---> L, S | S
-
S --> (L)
S --> a
L --> SL'
L' --> null
L' --> ,SL'
I think that these grammar's match; but its late and I haven't fully checked them.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Computer Science and Software Design Marketplace
Other Threads in the Computer Science and Software Design Forum
- Previous Thread: Computer Science Degree
- Next Thread: Tips on Creating Generic Protocol Parser


Linear Mode