python3 traverse.py
Then give standard input and press Ctrl+D after it is complete.
cat incorrect_sample.json | python3 traverse.py
line 1:1 token recognition error at: '''
line 1:2 token recognition error at: 'a'
line 1:3 token recognition error at: '''
line 1:4 no viable alternative at input '{:'
cat correct_sample.json | python3 traverse.py
"a":1
"b":{"c":2,"d":3}
"c":2
"d":3