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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a shallow clone of this NaftahParseTreeProperty.
    void
    Copies all annotations from another NaftahParseTreeProperty instance into this one, effectively merging the two.
    Map<org.antlr.v4.runtime.tree.ParseTree,V>
    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

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NaftahParseTreeProperty

      public NaftahParseTreeProperty()
  • Method Details

    • getAll

      public Map<org.antlr.v4.runtime.tree.ParseTree,V> 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

      public void copyFrom(NaftahParseTreeProperty<V> other)
      Copies all annotations from another NaftahParseTreeProperty instance into this one, effectively merging the two.
      Parameters:
      other - another NaftahParseTreeProperty to copy from
    • clone

      public NaftahParseTreeProperty<V> clone()
      Creates a shallow clone of this NaftahParseTreeProperty.

      The clone contains all the annotations of this instance but shares references for the stored values (no deep copy of the values themselves).

      Overrides:
      clone in class Object
      Returns:
      a cloned NaftahParseTreeProperty containing the same annotations
      Throws:
      NaftahBugError - if cloning fails unexpectedly