dk.brics.grammar
Class ProductionID

java.lang.Object
  extended by dk.brics.grammar.ProductionID

public class ProductionID
extends Object

Production ID object. Used in AST nodes to describe the structure without needing the concrete productions used during parsing (so different grammars can share production IDs).


Constructor Summary
ProductionID()
          Constructs a new production ID object with null label.
ProductionID(String label)
          Constructs a new production ID object with the given label.
 
Method Summary
 String getLabel()
          Returns the label.
 boolean hasExplicitLabel()
          Checks whether the label is explicit or auto-generated.
 void setLabel(String label)
          Sets the label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductionID

public ProductionID()
Constructs a new production ID object with null label.


ProductionID

public ProductionID(String label)
Constructs a new production ID object with the given label.

Method Detail

getLabel

public String getLabel()
Returns the label.

Returns:
label

hasExplicitLabel

public boolean hasExplicitLabel()
Checks whether the label is explicit or auto-generated.

Returns:
true if explicit

setLabel

public void setLabel(String label)
Sets the label.

Parameters:
label - new label


Copyright © 2005-2008 Anders Møller.