Top Description Methods
org.antlr.v4.runtime

public @Interface RuleDependency

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE, CONSTRUCTOR, METHOD, FIELD
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Declares a dependency upon a grammar rule, along with a set of zero or more dependent rules.

Version numbers within a grammar should be assigned on a monotonically increasing basis to allow for accurate tracking of dependent rules.

Author
Sam Harwell

Method Summary

Modifier and TypeMethod and Description
public Dependents[]
dependents()

Specifies the set of grammar rules related to rule which the annotated element depends on.

public Class<? extends Recognizer<?, ?>>
public int
rule()

public int
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

dependentsback to summary
public Dependents[] dependents()

Specifies the set of grammar rules related to rule which the annotated element depends on. Even when absent from this set, the annotated element is implicitly dependent upon the explicitly specified rule, which corresponds to the Dependents#SELF element.

By default, the annotated element is dependent upon the specified rule and its Dependents#PARENTS, i.e. the rule within one level of context information. The parents are included since the most frequent assumption about a rule is where it's used in the grammar.

recognizerback to summary
public Class<? extends Recognizer<?, ?>> recognizer()
ruleback to summary
public int rule()
versionback to summary
public int version()