polytracker.parsing¶
parsing classes¶
ImmutableParseTree¶
- class polytracker.parsing.ImmutableParseTree(value: V, children: Iterable[IPT] = ())¶
Bases:
Generic
[V
],ParseTree
[V
]- classmethod __class_getitem__(params)¶
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo(Generic[T]): ….
- clone() IPT ¶
- value: V¶
MutableParseTree¶
- class polytracker.parsing.MutableParseTree(value: V, children: Iterable[IPT] = ())¶
Bases:
Generic
[V
],ImmutableParseTree
[V
]- classmethod __class_getitem__(params)¶
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo(Generic[T]): ….
- add_child(new_child: MPT)¶
- clone() IPT ¶
- value: V¶
NonGeneralizedParseTree¶
- class polytracker.parsing.NonGeneralizedParseTree(value: Union[Start, TraceEvent, Terminal], children: Iterable[G] = ())¶
Bases:
MutableParseTree
[Union
[Start
,TraceEvent
,Terminal
]]- classmethod __class_getitem__(params)¶
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo(Generic[T]): ….
- add_child(new_child: MPT)¶
- best_partition(right_sibling: NonGeneralizedParseTree) Optional[int] ¶
- best_subset(parent: NonGeneralizedParseTree) Tuple[int, int] ¶
- bottom_up_pass()¶
- clone() IPT ¶
- deconflict_parent(parent: NonGeneralizedParseTree)¶
- deconflict_sibling(right_sibling: NonGeneralizedParseTree)¶
- simplify()¶
- top_down_pass()¶
- value: V¶
- verify_bounds(check_overlap=True, check_coverage=True, check_missing_children=True)¶
ParseTree¶
- class polytracker.parsing.ParseTree(value: V)¶
-
- classmethod __class_getitem__(params)¶
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo(Generic[T]): ….
- __init__(value: V)¶
- abstract clone() T ¶
- value: V¶
Start¶
Terminal¶
parsing functions¶
escape_byte¶
highlight_offset¶
trace_to_non_generalized_tree¶
- polytracker.parsing.trace_to_non_generalized_tree(trace: ProgramTrace) NonGeneralizedParseTree ¶
trace_to_tree¶
- polytracker.parsing.trace_to_tree(trace: ProgramTrace, node_type: Type[N] = polytracker.parsing.ParseTree[typing.Union[polytracker.parsing.Start, polytracker.tracing.TraceEvent, polytracker.parsing.Terminal]], include_terminals: bool = True) N ¶