:returns next idx, table id, table name
(toks, start_idx, tables_with_alias, schema)
| 281 | |
| 282 | |
| 283 | def parse_table_unit(toks, start_idx, tables_with_alias, schema): |
| 284 | """ |
| 285 | :returns next idx, table id, table name |
| 286 | """ |
| 287 | idx = start_idx |
| 288 | len_ = len(toks) |
| 289 | key = tables_with_alias[toks[idx]] |
| 290 | |
| 291 | if idx + 1 < len_ and toks[idx + 1] == "as": |
| 292 | idx += 3 |
| 293 | else: |
| 294 | idx += 1 |
| 295 | |
| 296 | return idx, schema.idMap[key], key |
| 297 | |
| 298 | |
| 299 | def parse_value(toks, start_idx, tables_with_alias, schema, default_tables=None): |