| 93 | |
| 94 | |
| 95 | bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is) |
| 96 | { |
| 97 | is.fatalCheck |
| 98 | ( |
| 99 | "primitiveEntry::readData(const dictionary&, Istream&)" |
| 100 | ); |
| 101 | |
| 102 | label blockCount = 0; |
| 103 | token currToken; |
| 104 | |
| 105 | if |
| 106 | ( |
| 107 | !is.read(currToken).bad() |
| 108 | && currToken.good() |
| 109 | && currToken != token::END_STATEMENT |
| 110 | ) |
| 111 | { |
| 112 | append(currToken, dict, is); |
| 113 | |
| 114 | if |
| 115 | ( |
| 116 | currToken == token::BEGIN_BLOCK |
| 117 | || currToken == token::BEGIN_LIST |
| 118 | ) |
| 119 | { |
| 120 | blockCount++; |
| 121 | } |
| 122 | |
| 123 | while |
| 124 | ( |
| 125 | !is.read(currToken).bad() |
| 126 | && currToken.good() |
| 127 | && !(currToken == token::END_STATEMENT && blockCount == 0) |
| 128 | ) |
| 129 | { |
| 130 | if |
| 131 | ( |
| 132 | currToken == token::BEGIN_BLOCK |
| 133 | || currToken == token::BEGIN_LIST |
| 134 | ) |
| 135 | { |
| 136 | blockCount++; |
| 137 | } |
| 138 | else if |
| 139 | ( |
| 140 | currToken == token::END_BLOCK |
| 141 | || currToken == token::END_LIST |
| 142 | ) |
| 143 | { |
| 144 | blockCount--; |
| 145 | } |
| 146 | |
| 147 | append(currToken, dict, is); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | is.fatalCheck |
| 152 | ( |