Package org.daiitech.naftah.parser
Class NaftahParseTreeProperty<V>
java.lang.Object
org.antlr.v4.runtime.tree.ParseTreeProperty<V>
org.daiitech.naftah.parser.NaftahParseTreeProperty<V>
- Type Parameters:
V- the type of values stored in the property
- All Implemented Interfaces:
Cloneable
public class NaftahParseTreeProperty<V>
extends org.antlr.v4.runtime.tree.ParseTreeProperty<V>
implements Cloneable
Extension of ANTLR's ParseTreeProperty to expose
internal annotations map and support copying from
another NaftahParseTreeProperty.
- Author:
- Chakib Daii
-
Field Summary
Fields inherited from class org.antlr.v4.runtime.tree.ParseTreeProperty
annotations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a shallow clone of thisNaftahParseTreeProperty.voidcopyFrom(NaftahParseTreeProperty<V> other) Copies all annotations from another NaftahParseTreeProperty instance into this one, effectively merging the two.getAll()Returns the internal map holding parse tree nodes and their associated values.Methods inherited from class org.antlr.v4.runtime.tree.ParseTreeProperty
get, put, removeFrom
-
Constructor Details
-
NaftahParseTreeProperty
public NaftahParseTreeProperty()
-
-
Method Details
-
getAll
Returns the internal map holding parse tree nodes and their associated values.- Returns:
- a map of ParseTree keys to values of type V
-
copyFrom
Copies all annotations from another NaftahParseTreeProperty instance into this one, effectively merging the two.- Parameters:
other- another NaftahParseTreeProperty to copy from
-
clone
Creates a shallow clone of thisNaftahParseTreeProperty.The clone contains all the annotations of this instance but shares references for the stored values (no deep copy of the values themselves).
- Overrides:
clonein classObject- Returns:
- a cloned
NaftahParseTreePropertycontaining the same annotations - Throws:
NaftahBugError- if cloning fails unexpectedly
-