org.antlr.analysis
Class ActionLabel

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

public class ActionLabel
extends Label


Field Summary
 GrammarAST actionAST
           
 
Fields inherited from class org.antlr.analysis.Label
ACTION, DOWN, EOF, EOR_TOKEN_TYPE, EOT, EPSILON, EPSILON_STR, INVALID, label, labelSet, MAX_CHAR_VALUE, MIN_ATOM_VALUE, MIN_CHAR_VALUE, MIN_TOKEN_TYPE, NUM_FAUX_LABELS, SEMPRED, SET, UP
 
Constructor Summary
ActionLabel(GrammarAST actionAST)
           
 
Method Summary
 boolean isAction()
           
 boolean isEpsilon()
           
 java.lang.String toString()
          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.
 java.lang.String toString(Grammar g)
           
 
Methods inherited from class org.antlr.analysis.Label
add, clone, compareTo, equals, getAtom, getSemanticContext, getSet, hashCode, intersect, isAtom, isSemanticPredicate, isSet, matches, matches, matches, setSet
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

actionAST

public GrammarAST actionAST
Constructor Detail

ActionLabel

public ActionLabel(GrammarAST actionAST)
Method Detail

isEpsilon

public boolean isEpsilon()
Overrides:
isEpsilon in class Label

isAction

public boolean isAction()
Overrides:
isAction in class Label

toString

public java.lang.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 java.lang.String toString(Grammar g)
Overrides:
toString in class Label


Copyright © 2011. All Rights Reserved.