Package ch.usi.si.seart.treesitter
Class Tree
- java.lang.Object
-
- ch.usi.si.seart.treesitter.Tree
-
- All Implemented Interfaces:
AutoCloseable,Iterable<Node>
public class Tree extends Object implements Iterable<Node>
A Tree represents the syntax tree of an entire source code file. It containsNodeinstances that indicate the structure of the source code.- Since:
- 1.0.0
- Author:
- Tommy MacWilliam, Ozren Dabić
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Delete the tree, freeing all the memory that it used.voidedit(@NotNull InputEdit edit)Edit the syntax tree to keep it in sync with source code that has been edited.booleanequals(Object obj)NodegetRootNode()inthashCode()booleanisNull()@NotNull Iterator<Node>iterator()StringtoString()-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
close
public void close()
Delete the tree, freeing all the memory that it used.- Specified by:
closein interfaceAutoCloseable
-
edit
public void edit(@NotNull @NotNull InputEdit edit)Edit the syntax tree to keep it in sync with source code that has been edited.- Parameters:
edit- Changes made to the source code in terms of both byte offsets and row/column coordinates
-
getRootNode
public Node getRootNode()
- Returns:
- The root node of the syntax tree
-
isNull
public final boolean isNull()
-
-