def _parse_line(self, line_no, line):
"""Parse a line in a TileBus file
Args:
lineno (int): The line number for printing useful error messages
line (string): The line that we are trying to parse
"""
try:
matched = statement.parseString(line)
except ParseException, exc:
raise DataError("Error parsing line in TileBus file", line_number=line_no, column=exc.col, contents=line)
if 'symbol' in matched:
self._parse_cmd(matched)
elif 'filename' in matched:
self._parse_include(matched)
elif 'variable' in matched:
self._parse_assignment(matched)
elif 'interface' in matched:
self._parse_interface(matched)
elif 'configvar' in matched:
self._parse_configvar(matched)
评论列表
文章目录