pip_services3_expressions.io.IScanner module

class pip_services3_expressions.io.IScanner.IScanner

Bases: abc.ABC

Defines scanner that can read and unread characters and count lines. This scanner is used by tokenizers to process input streams.

column() → int

Gets the column in the current line

Returns

The column in the current line in the stream

line() → int

Gets the current line number

Returns

The current line number in the stream

peek() → int

Returns the character from the top of the stream without moving the stream pointer.

Returns

A character from the top of the stream or -1 if stream is empty.

peek_column() → int

Gets the next character column number

Returns

The next character column number in the stream

peek_line() → int

Gets the next character line number

Returns

The next character line number in the stream

read() → int

Reads character from the top of the stream.

Returns

A read character or -1 if stream processed to the end.

reset()

Resets scanner to the initial position

unread()

Puts the one character back into the stream stream.

Returns

A character to be pushed back.

unread_many(count: int)

Pushes the specified number of characters to the top of the stream.

Parameters

count – A number of characters to be pushed back.