m2isar.frontends.coredsl2.constant_expressions

Evaluate a subset of release 2.0.21 constant expressions.

With no resolver the evaluator is literal-only. A caller may supply a scoped ISA-parameter resolver; symbol legality and evaluation cycles belong to it.

A None result means evaluation needs elaboration/type information, or an unsupported node. It is never proof that an expression is an invalid constant.

Attributes

BINARY

Functions

integer_literal(text)

Return value, bit size and signedness as IntegerValueConverter does.

integer_value(text)

cast_integer(value, width, signed)

Apply a fixed-width integer cast using two's-complement representation.

constant_value(ctx[, resolve, unsupported])

Module Contents

integer_literal(text)[source]

Return value, bit size and signedness as IntegerValueConverter does.

integer_value(text)[source]
cast_integer(value, width, signed)[source]

Apply a fixed-width integer cast using two’s-complement representation.

BINARY[source]
constant_value(ctx, resolve=None, unsupported=None)[source]