Strong LL(1) grammar check

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I need to find rules that don't satisfy strong LL(1) rule:




$First_1(alpha*Follow_1(A)) cap First_1(beta*Follow_1(A)) = varnothing$



For any rule $A implies alpha | beta$




I have the following grammar:



$S implies aBA | BCA | epsilon$



$B implies bB | epsilon$



$A implies bB$



$C implies aS | BBS$



I've calculated First and Follow sets:



$First_1(S) = a, epsilon, b $



$First_1(B) = b, epsilon $



$First_1(A) = b $



$First_1(C) = a, epsilon, b $



$Follow_1(S) = $, b $



$Follow_1(B) = $, b, a $



$Follow_1(A) = $, b $



$Follow_1(C) = b $



After that I've started to compute strong LL(1) formula, but have some difficulties with multiplication:



For the rules $S implies aBA, S implies BCA$



$First_1(aBA*Follow_1(S)) cap First_1(BCA * Follow_1(S)) = \ (First_1(aBA) * Follow_1(S)) cap (First_1(BCA) * Follow_1(S)) = \ (a * epsilon, b) cap (a, epsilon, b * epsilon, b). $



From this point I don't know what is the result of those sets multiplications, I've seen the example of usage of this formula with LL(2) grammar and in the end there was $aa, ba * b$ which gave the result $ba, bb$, but for the LL(1) I'm not sure how to correct calculate it.







share|cite|improve this question























    up vote
    0
    down vote

    favorite












    I need to find rules that don't satisfy strong LL(1) rule:




    $First_1(alpha*Follow_1(A)) cap First_1(beta*Follow_1(A)) = varnothing$



    For any rule $A implies alpha | beta$




    I have the following grammar:



    $S implies aBA | BCA | epsilon$



    $B implies bB | epsilon$



    $A implies bB$



    $C implies aS | BBS$



    I've calculated First and Follow sets:



    $First_1(S) = a, epsilon, b $



    $First_1(B) = b, epsilon $



    $First_1(A) = b $



    $First_1(C) = a, epsilon, b $



    $Follow_1(S) = $, b $



    $Follow_1(B) = $, b, a $



    $Follow_1(A) = $, b $



    $Follow_1(C) = b $



    After that I've started to compute strong LL(1) formula, but have some difficulties with multiplication:



    For the rules $S implies aBA, S implies BCA$



    $First_1(aBA*Follow_1(S)) cap First_1(BCA * Follow_1(S)) = \ (First_1(aBA) * Follow_1(S)) cap (First_1(BCA) * Follow_1(S)) = \ (a * epsilon, b) cap (a, epsilon, b * epsilon, b). $



    From this point I don't know what is the result of those sets multiplications, I've seen the example of usage of this formula with LL(2) grammar and in the end there was $aa, ba * b$ which gave the result $ba, bb$, but for the LL(1) I'm not sure how to correct calculate it.







    share|cite|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to find rules that don't satisfy strong LL(1) rule:




      $First_1(alpha*Follow_1(A)) cap First_1(beta*Follow_1(A)) = varnothing$



      For any rule $A implies alpha | beta$




      I have the following grammar:



      $S implies aBA | BCA | epsilon$



      $B implies bB | epsilon$



      $A implies bB$



      $C implies aS | BBS$



      I've calculated First and Follow sets:



      $First_1(S) = a, epsilon, b $



      $First_1(B) = b, epsilon $



      $First_1(A) = b $



      $First_1(C) = a, epsilon, b $



      $Follow_1(S) = $, b $



      $Follow_1(B) = $, b, a $



      $Follow_1(A) = $, b $



      $Follow_1(C) = b $



      After that I've started to compute strong LL(1) formula, but have some difficulties with multiplication:



      For the rules $S implies aBA, S implies BCA$



      $First_1(aBA*Follow_1(S)) cap First_1(BCA * Follow_1(S)) = \ (First_1(aBA) * Follow_1(S)) cap (First_1(BCA) * Follow_1(S)) = \ (a * epsilon, b) cap (a, epsilon, b * epsilon, b). $



      From this point I don't know what is the result of those sets multiplications, I've seen the example of usage of this formula with LL(2) grammar and in the end there was $aa, ba * b$ which gave the result $ba, bb$, but for the LL(1) I'm not sure how to correct calculate it.







      share|cite|improve this question











      I need to find rules that don't satisfy strong LL(1) rule:




      $First_1(alpha*Follow_1(A)) cap First_1(beta*Follow_1(A)) = varnothing$



      For any rule $A implies alpha | beta$




      I have the following grammar:



      $S implies aBA | BCA | epsilon$



      $B implies bB | epsilon$



      $A implies bB$



      $C implies aS | BBS$



      I've calculated First and Follow sets:



      $First_1(S) = a, epsilon, b $



      $First_1(B) = b, epsilon $



      $First_1(A) = b $



      $First_1(C) = a, epsilon, b $



      $Follow_1(S) = $, b $



      $Follow_1(B) = $, b, a $



      $Follow_1(A) = $, b $



      $Follow_1(C) = b $



      After that I've started to compute strong LL(1) formula, but have some difficulties with multiplication:



      For the rules $S implies aBA, S implies BCA$



      $First_1(aBA*Follow_1(S)) cap First_1(BCA * Follow_1(S)) = \ (First_1(aBA) * Follow_1(S)) cap (First_1(BCA) * Follow_1(S)) = \ (a * epsilon, b) cap (a, epsilon, b * epsilon, b). $



      From this point I don't know what is the result of those sets multiplications, I've seen the example of usage of this formula with LL(2) grammar and in the end there was $aa, ba * b$ which gave the result $ba, bb$, but for the LL(1) I'm not sure how to correct calculate it.









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Jul 30 at 11:33









      Kevin

      184




      184

























          active

          oldest

          votes











          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "69"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2866915%2fstrong-ll1-grammar-check%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2866915%2fstrong-ll1-grammar-check%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?