erc7730.model.paths.path_parser module

class erc7730.model.paths.path_parser.PathTransformer(visit_tokens: bool = True)[source]View on GitHub

Bases: Transformer_InPlaceRecursive

Visitor to transform the parsed path AST into path domain model objects.

absolute_data_path(ast: Any) DataPath[source]View on GitHub
array(ast: Any) Array[source]View on GitHub
array_element(ast: Any) ArrayElement[source]View on GitHub
array_index(ast: Any) Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])][source]View on GitHub
array_slice(ast: Any) ArraySlice[source]View on GitHub
container_field(ast: Any) ContainerField[source]View on GitHub
container_path(ast: Any) ContainerPath[source]View on GitHub
descriptor_path(ast: Any) DescriptorPath[source]View on GitHub
field(ast: Any) Field[source]View on GitHub
relative_data_path(ast: Any) DataPath[source]View on GitHub
slice_array_index(ast: Any) Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])] | None[source]View on GitHub
erc7730.model.paths.path_parser.to_path(path: str) ContainerPath | DataPath | DescriptorPath[source]View on GitHub

Parse a path string into a domain model object.

Parameters:

path – the path input string

Returns:

an union of all possible path types

Raises:
  • ValueError – if the input string is not a valid path

  • Exception – if the path parsing fails for an unexpected reason