Class ActionLabel

java.lang.Object
org.antlr.analysis.Label
org.antlr.analysis.ActionLabel
All Implemented Interfaces:
Cloneable, Comparable<Label>

public class ActionLabel extends Label
  • Field Details

  • Constructor Details

    • ActionLabel

      public ActionLabel(GrammarAST actionAST)
  • Method Details

    • isEpsilon

      public boolean isEpsilon()
      Overrides:
      isEpsilon in class Label
    • isAction

      public boolean isAction()
      Overrides:
      isAction in class Label
    • toString

      public String toString()
      Description copied from class: Label
      Predicates are lists of AST nodes from the NFA created from the grammar, but the same predicate could be cut/paste into multiple places in the grammar. I must compare the text of all the predicates to truly answer whether {p1,p2} .equals {p1,p2}. Unfortunately, I cannot rely on the AST.equals() to work properly so I must do a brute force O(n^2) nested traversal of the Set doing a String compare. At this point, Labels are not compared for equals when they are predicates, but here's the code for future use.
      Overrides:
      toString in class Label
    • toString

      public String toString(Grammar g)
      Overrides:
      toString in class Label