code to parse Prolog syntax - resolves #36