ANON (Another Notorious Object Notation) is a madeup configuration format very similar to JSON. We need to build a validator that validates whether a given ANON String is syntactically correct or not.
- Host this web application and open the index.php file to test the ANON Parser
- parser : Contains the Parser Business Logic
- images : Contains sample images
- testcases : Contains multiple test cases i.e. Sample ANON String files
- index.php : Frontend for the Parser Application
I have built an ANON Parser that parses a given ANON String if it is syntactically correct. If the ANON String is invalid then it notifies you about the same. I have implemented a recursive approach to build the validator. It starts from the root and goes to the depth in case of multiple nested ANON Objects present. The parser converts the ANON String into a recursive tree and then validates each and every ANON Object present at its node. When the validation succeeds then it gives out the processed ANON Object as the response. If the parser fails at any point then it return the following error message "Invalid ANON Object".
The process of conversion of a valid ANON string to the recursive tree looks like this :