FileDocCategorySizeDatePackage
CharRangeElement.javaAPI DocGlassfish v2 API1408Wed Aug 30 15:34:06 BST 2006persistence.antlr

CharRangeElement

public class CharRangeElement extends AlternativeElement

Fields Summary
String
label
protected char
begin
protected char
end
protected String
beginText
protected String
endText
Constructors Summary
public CharRangeElement(LexerGrammar g, Token t1, Token t2, int autoGenType)



             
        super(g);
        begin = (char)ANTLRLexer.tokenTypeForCharLiteral(t1.getText());
        beginText = t1.getText();
        end = (char)ANTLRLexer.tokenTypeForCharLiteral(t2.getText());
        endText = t2.getText();
        line = t1.getLine();
        // track which characters are referenced in the grammar
        for (int i = begin; i <= end; i++) {
            g.charVocabulary.add(i);
        }
        this.autoGenType = autoGenType;
    
Methods Summary
public voidgenerate()

        grammar.generator.gen(this);
    
public java.lang.StringgetLabel()

        return label;
    
public persistence.antlr.Lookaheadlook(int k)

        return grammar.theLLkAnalyzer.look(k, this);
    
public voidsetLabel(java.lang.String label_)

        label = label_;
    
public java.lang.StringtoString()

        if (label != null)
            return " " + label + ":" + beginText + ".." + endText;
        else
            return " " + beginText + ".." + endText;