Top Description Fields Constructors Methods
org.antlr.v4.runtime.tree

public Class ParseTreeProperty<V>

extends Object
Class Inheritance
Imports
java.util.IdentityHashMap, .Map

Associate a property with a parse tree node. Useful with parse tree listeners that need to associate values with particular tree nodes, kind of like specifying a return value for the listener event method that visited a particular node. Example:
ParseTreeProperty<Integer> values = new ParseTreeProperty<Integer>();
values.put(tree, 36);
int x = values.get(tree);
values.removeFrom(tree);
You would make one decl (values here) in the listener and use lots of times in your event methods.

Field Summary

Modifier and TypeField and Description
protected Map<ParseTree, V>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public V
get(ParseTree node)

public void
put(ParseTree node, V value)

public V
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationsback to summary
protected Map<ParseTree, V> annotations

Constructor Detail

ParseTreePropertyback to summary
public ParseTreeProperty()

Method Detail

getback to summary
public V get(ParseTree node)
putback to summary
public void put(ParseTree node, V value)
removeFromback to summary
public V removeFrom(ParseTree node)