pyndoc.readers package

This package contains classes and functions related to the Pyndoc general reader and parser, as well as Subpackages containing definitions of language-specific AST block handling for custom readers (see Subpackages below)

Subpackages

Submodules

pyndoc.readers.parser module

class pyndoc.readers.parser.Parser(lang: str)[source]

Bases: object

Class representing a general reader for all input languages

Parameters:

lang (str) – The reader’s language

context

The context stack

token

Token currently matched

check_atom_block() None[source]

Check if an atom block has ended. That is, if matching it with a next character results in None (but previously matched)

check_end() None[source]

check if the current context block has ended

check_start() None[source]

Check if a new block has just started. If so, set the current context as the block

close_context() None[source]

If the file has ended - go through each block in the context and end it

process_trailing_atom() None[source]

Immediately process an atom block without checking for the usual condition

pyndoc.readers.reader module

class pyndoc.readers.reader.Reader(lang: str)[source]

Bases: object

process(char: str) None[source]

Process a current token taking into consideration the current context tree, check if a new block has started or ended, process atom blocks

Parameters:

char (str) – The currently processed character

read(filename: str) None[source]

Open and read a file one character at a time, then pass the character to tokenizer

Module contents