def readline(self):
line = self.file.readline()<EOL>if self.grammar and line:<EOL><INDENT>try:<EOL><INDENT>return self.grammar.parseString(line).asDict()<EOL><DEDENT>except ParseException:<EOL><INDENT>return self.readline()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return line<EOL><DEDENT>
Reads (and optionally parses) a single line.