Skip to content

CS606 - Compiler Construction

2 Topics 68 Posts
  • 0 Votes
    2 Posts
    864 Views
    zareenZ
    Discussion is right way to get Solution of the every assignment, Quiz and GDB. We are always here to discuss and Guideline, Please Don’t visit Cyberian only for Solution. Cyberian Team always happy to facilitate to provide the idea solution. Please don’t hesitate to contact us! NOTE: Don’t copy or replicating idea solutions.
  • 0 Votes
    48 Posts
    32k Views
    zareenZ
    The FIRST of a sentential form is the set of terminal symbols that lead any sentential from derived from the very first sentential form. In this particular case X and Y only derive the empty string and as a result the empty string is the FIRST set of both non-terminal symbols X and Y. The FIRST of S, however, includes “a” as in the first production once can derive a sentential form that starts with an “a” given that X can be replaced by the empty string. X similar reasoning allows you to include “b” in the FIRST(S). summary: FIRST(X) = {e}, FIRST(Y) = {e}, FIRST(S) = {a, b} The FOLLOW set of a non-terminal symbol is the set of terminals that can appear after that non-terminal symbol in any sentential form derived from the grammar’s start symbol. By definition the follow of the start symbol will automatically include the $ sign which represents the end of the input string. In this particular case by looking at the productions of S one can determine right away that the follow of X includes the terminal “a” and “b” and that the FOLLOW of Y includes the terminal “b”. Given that the non-terminal S does not appear in any productions, not even in its own productions, the FOLLOW of S is only $. summary: FOLLOW(S) = {$}, FOLLOW(X) = {a, b}, FOLLOW(Y) = {b}. b) YES, because the intersection of the FIRST for every non-terminal symbol in empty. This leads to the parsing table for this LL method as indicated below. As there is no conflict in entry then grammar is clearly LL (1). [23/01, 21:33] Waqas Ahmad: a b $ S S→XaXb S → Yb A X→ε X→ε B Y→ε
How to Build a $1,000/Month PAK VS BAN Live Live Cricket Streaming
File Sharing

1

Online

3.0k

Users

2.8k

Topics

8.2k

Posts
| |