Ad
  • Custom User Avatar

    Fixed

  • Custom User Avatar

    Seconding this. In the default python tests, Alphabet is a dict but it's treated like an object. Alphabet.TYPE should be changed to Alphabet['TYPE'].

  • Custom User Avatar

    I agree that your solution works in this case. If, however, all of the '+' signs had been '-' signs, your parse tree would have to have a different shape. Did you really code '+' to be right associative and happen to still get '-' as left associative?

    I was going to change the test case to make it explicit, but I don't have time to get it right today. So, I'll just say this... the parse tree shown above does not agree with the BNF in the description. The BNF says that an expression is a term or an expression '+' a term or an expression '-' a term. It doesn't say that it can be a term '+' an expression.

  • Custom User Avatar

    Indeed. I have a solution which generates a valid pass1, I believe a valid pass2, and a proper pass3, but I can't submit because this first test-case is too strict.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution