Class work #4 -- Context-free grammars

31 views
Skip to first unread message

Akif Eyler

unread,
Mar 18, 2019, 11:27:38 PM3/18/19
to BLM
Class work #4 -- cevabınızı bugün saat 13'e kadar mail içinde gönderin:

1. Study Expression.html and show a sample derivation with these rules:
E → T | E+T | E-T 
T → F | T*F | T/F 
F → n | (E)
(use exactly 6 operations)

2. Suggest two extensions for the grammar defined above

3. Modify CFG1.html for the grammar shown below:
S → 0S0 | 1S1 | p
(palindromes with the mid-point mark)

_Akif_Eyler_

Akif Eyler

unread,
Mar 19, 2019, 2:05:57 AM3/19/19
to BLM

Ayhan Maden

unread,
Mar 19, 2019, 5:19:05 AM3/19/19
to ma.e...@gmail.com, BLM
Cevap 1)  E ==> E + T ==> E - T + T ==> T - T - T ==> T * F - T + T ==> F * F - T + T ==> F * F - T / F + T ==> F * F - F / F + T ==>  F * F - F / F + F ==> n * n - n / n + n

Cevap 2) E --> T | E + T | E - T
                T --> F | T * F | T / F | T % F | T ^ F
                F --> n

Cevap 3) Ektedir.

Akif Eyler <ma.e...@gmail.com>, 19 Mar 2019 Sal, 09:05 tarihinde şunu yazdı:
--
You received this message because you are subscribed to the Google Groups "BLM305 -- FSMVU" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fsmvu-mae+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
CFG.JPG
Reply all
Reply to author
Forward
0 new messages