(a_list, token_type=None)
| 451 | |
| 452 | |
| 453 | def PopToken(a_list, token_type=None): |
| 454 | token = PopFront(a_list) |
| 455 | if token_type is not None and token.token_type != token_type: |
| 456 | print 'ERROR: %s expected at %s' % (token_type, token.start) |
| 457 | print 'ERROR: %s found instead' % (token,) |
| 458 | sys.exit(1) |
| 459 | |
| 460 | return token |
| 461 | |
| 462 | |
| 463 | def PeekToken(a_list): |