If the top is $ .
On the input stream there is also a $ then the parser reports that it has successfully parsed the input , otherwise it reports an error .
If the top is $ and on the input stream there is also a $ then the parser reports that it has successfully parsed the input , otherwise it reports an error .