Basic types

When building abstract syntax tree each value is represented as node. This node must be a subclass of Value class.

base:

This module contains base class for all objects representing value in AST

class pseudo.type.base.EOL

Representation of newline.

class pseudo.type.base.Value(value, line='')

Node containing a value.

- value

Value of instance.

- line

Line of pseudocode representation

numbers:

This module contains functions and classes for handling numeric objects in pseudocode.

class pseudo.type.numbers.Int(*args, **kwargs)

Int value node.

pseudo.type.numbers.is_digit(c) → bool

Checks if given char is a digit.

pseudo.type.numbers.read_number(lexer) → pseudo.type.numbers.Int

Read a number from the stream.

string:

This module contains everything about strings.

class pseudo.type.string.String(value, line='')

String value node.

pseudo.type.string.read_string(lexer) → pseudo.type.string.String

Read a string from the stream.

bool:

This module contains everything about bool in pseudocode.

class pseudo.type.bool.Bool(value, line='')

Bool value node.

static eval_operation(operator: str, left: pseudo.type.base.Value, right: pseudo.type.base.Value, r)

Eval bool operation.

Parameters:
  • operator (-) – str, bool operator
  • left (-) – Value
  • right (-) – Value
pseudo.type.bool.read_bool(keyword: str) → pseudo.type.bool.Bool

Parse bool str to Bool object.