Dec-27-2019, 01:47 PM
(This post was last modified: Dec-27-2019, 01:47 PM by Gribouillis.)
kingsman Wrote:I get what the table_data_lines is doing but I don't know the things in read_table.Well, 'table_name' is the name of the table to read. It is known because this function is called immediately after the parser has read a line starting with TABLE:. The 'sequence' argument is the sequence produced by
what is the parameter inside (table_name, sequence, parsed_file)?
table_data_line()
, that is to say a sequence of pairs (lineno, line)
read from the file. When the sequence is passed to read_table()
, the lines that come next in the sequence are the rows of the table. The argument 'parsed_file' is the list to which we add the TableRecord
's that we produce. This list is created in the function parse_file()
.The function
read_table()
read lines in the file and create a TableRecord which rows are extracted from these lines. It stops when it meets a line starting with TABLE:, which indicates the beginning of a new table. In that case, it returns the name of the next table.I ignored the line File C:... at the beginning of the file that you linked. Is this line a part of the file? In that case, we may need to modify
parse_file()
in order to ignore all the lines that come before the first TABLE:... line.