CS 222

Logo

Programming Languages

Project 2: PDef Parser Solution

You were graded based on your submission, that your code compiled, and that it successfully parsed valid PDef and successfully indicated where there was invalid PDef.

Part of your assignment included understanding how the provided PDef grammar works in terms of what is expected for a particular input – what is allowable and what is not. This was a critical step of building the parser. You are responsible for testing that your code works with a variety of inputs.

Here were the tests files I used when checking your work.

Valid PDef

Invalid PDef

Your error messages may have varied, but it should have caught the error and indicated correctly what was expected instead.

How it’s accomplished… The code in Parser.java