Attributes of the
BoundingBoxclass:The
BoundingBoxclass primarily contains four numerical attributes indicating the ‘top’, ‘bottom’, ‘left’, and ‘right’ boundaries of the box. These attributes indicate the maximum and minimum x and y coordinates covered by a particular symbol in the Abstract Syntax Tree (AST), thus defining its size and position in a 2D plane.
Interaction with
LineItemandSymbolGraphNavigatorclasses:The
LineItemclass: TheBoundingBoxof aLineItem(a line of code represented in the AST) would represent the range of the line inside the file. This range can then be used to extract the specific line from the source code.The
SymbolGraphNavigatorclass:SymbolGraphNavigatoris used to navigate through the symbol graph produced from the AST. TheBoundingBoxproperty for each node in the graph helps locate each symbol’s position spatially. This allows for better navigation and interaction with the graph.
Executable usage of
BoundingBoxclass:Currently, the
BoundingBoxclass is intended for internal use within AST analysis and parsing, and is not meant to be used directly or manipulated by developers. It embodies a low-level functionality specific to AST parsing tasks, so usage examples may not be readily intelligible without a larger context of the AST parsing or code analysis operation.