[Swift-devel] readData2

Mihael Hategan hategan at mcs.anl.gov
Tue Oct 14 13:41:37 CDT 2008


Due to the inflexibility of readData (made obvious by something Tibi was
trying to do), I added readData2 in r2299. It reads things from files
which have a syntax similar to the one used by the ext mapper.

Example:
type vector {
	int columns[];
}

type matrix {
	vector rows[];
}

matrix m;

m = readData2("readData2.in");

where readData2.in could contain:
rows[0].columns[0] = 0
rows[0].columns[1] = 2
rows[0].columns[2] = 4
rows[1].columns[0] = 1
rows[1].columns[1] = 3
rows[1].columns[2] = 5

So syntax is basically:
comments lines start with "#" and are ignored; empty lines are ignored;
<path> \hs* '=' \hs* <value>

where \hs is any horizontal whitespace.




More information about the Swift-devel mailing list