Advertisement
YahiaOsama

Untitled

May 1st, 2019
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. S --> A B {
  2. S.check = (A.n == B.n) *
  3. (A.check == 1) *
  4. (B.check == 1);
  5. }
  6. A --> a A1
  7. {
  8. A.count = 1 + A1.count;
  9. A.temp = (2 * A1.count);
  10. A.check = (A.temp == A.count);
  11. A.n = A1.n + (A.check == 1);
  12. A.temp = (A.check * A.temp) + (A1.temp * (A.check == 0));
  13. }
  14. B --> b B1
  15. {
  16. B.count = 1 + B1.count;
  17. B.temp = (3 * B1.count);
  18. B.check = (B.temp == B.count);
  19. B.n = B1.n + (B.check == 1);
  20. B.temp = (B.check * B.temp) + (B1.temp * (B.check == 0));
  21. }
  22. A --> a
  23. {
  24. A.count = 1;
  25. A.check = 1;
  26. A.n = 0;
  27. }
  28. B --> b
  29. {
  30. B.count = 1;
  31. B.check = 1;
  32. B.n = 0;
  33. }
  34. A --> epsilon
  35. {
  36. A.count = 0;
  37. A.check = 0;
  38. A.n = 0;
  39. }
  40. B --> epsilon
  41. {
  42. B.count = 0;
  43. B.check = 0;
  44. B.n = 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement