+bool Parser::parse_lines2(MathAtom & t)
+{
+ MathGridInset * p = t->asGridInset();
+ if (!p) {
+ lyxerr << "error in Parser::parse_lines() 1\n";
+ return false;
+ }
+
+ skipBegin();
+
+ for (int row = 0; true; ++row) {
+ // reading a row
+ for (MathInset::col_type col = 0; true; ++col) {
+ //lyxerr << "reading cell " << row << " " << col << " " << p->ncols() << "\n";
+
+ if (col >= p->ncols()) {
+ //lyxerr << "adding col " << col << "\n";
+ p->addCol(p->ncols());
+ }
+
+ parse_into(p->cell(col + row * p->ncols()), FLAG_BLOCK2);
+ //lyxerr << "read cell: " << p->cell(col + row * p->ncols()) << "\n";
+
+ // break if cell is not followed by an ampersand
+ if (nextToken().cat() != catAlign) {
+ //lyxerr << "less cells read than normal in row/col: " << row << " " << col << "\n";
+ break;
+ }
+
+ // skip the ampersand
+ getToken();
+ }
+
+ // is a \\ coming?
+ if (nextToken().isCR()) {
+ // skip the cr-token
+ getToken();
+ }
+
+ // we are finished if the next token is an '}'
+ if (nextToken().cat() == catEnd) {
+ // skip the end-token
+ getToken();
+ // leave the 'read a line'-loop
+ break;
+ }
+
+ // otherwise, we have to start a new row
+ p->appendRow();
+ }
+
+ return true;
+}
+
+
+