| | 983 | The function '''`scan(stream)`''' scans the given `stream` and produces a sequence of tokens. |
| | 984 | |
| | 985 | The method '''`Loader.check_token(*TokenClasses)`''' returns `True` if the next token in the stream |
| | 986 | is an instance of one of the given `TokenClasses`. Otherwise it returns `False`. |
| | 987 | |
| | 988 | The method '''`Loader.peek_token()`''' returns the next token in the stream, but does not remove |
| | 989 | it from the internal token queue. The function returns `None` at the end of the stream. |
| | 990 | |
| | 991 | The method '''`Loader.get_token()`''' returns the next token in the stream and removes |
| | 992 | it from the internal token queue. The function returns `None` at the end of the stream. |
| | 993 | |
| | 996 | |
| | 997 | {{{ |
| | 998 | #!python |
| | 999 | parse(stream, Loader=Loader) |
| | 1000 | |
| | 1001 | Loader.check_event(*EventClasses) |
| | 1002 | Loader.peek_event() |
| | 1003 | Loader.get_event() |
| | 1004 | }}} |
| | 1005 | |
| | 1006 | The function '''`parse(stream)`''' parses the given `stream` and produces a sequence of parsing events. |
| | 1007 | |
| | 1008 | The method '''`Loader.check_event(*EventClasses)`''' returns `True` if the next event in the stream |
| | 1009 | is an instance of one of the given `EventClasses`. Otherwise it returns `False`. |
| | 1010 | |
| | 1011 | The method '''`Loader.peek_event()`''' returns the next event in the stream, but does not remove |
| | 1012 | it from the internal event queue. The function returns `None` at the end of the stream. |
| | 1013 | |
| | 1014 | The method '''`Loader.get_event()`''' returns the next event in the stream and removes |
| | 1015 | it from the internal event queue. The function returns `None` at the end of the stream. |