-1

I gotta make a CFG and PDA for the grammar that has perfectly nested parentheses and brackets.

S -> [S]
S -> (S)
S -> SS
S -> Epsilon

Not sure if this is correct, or how to make the PDA from it?

y2k
  • 65,388
  • 27
  • 61
  • 86

1 Answers1

1

take a look at Spirit. It's really worth a deep visit.

Otherwise, your grammar it's so simple that a recursive LL(1) parser should be easy to write.

CapelliC
  • 59,646
  • 5
  • 47
  • 90