FileDocCategorySizeDatePackage
DebuggingCharScanner.javaAPI DocGlassfish v2 API7344Wed Feb 08 12:31:16 GMT 2006persistence.antlr.debug

DebuggingCharScanner

public abstract class DebuggingCharScanner extends CharScanner implements DebuggingParser

Fields Summary
private ParserEventSupport
parserEventSupport
private boolean
_notDebugMode
protected String[]
ruleNames
protected String[]
semPredNames
Constructors Summary
public DebuggingCharScanner(InputBuffer cb)



	   
		super(cb);
	
public DebuggingCharScanner(LexerSharedInputState state)

		super(state);
	
Methods Summary
public charLA(int i)

		char la = super.LA(i);
		parserEventSupport.fireLA(i, la);
		return la;
	
public voidaddMessageListener(persistence.antlr.debug.MessageListener l)

		parserEventSupport.addMessageListener(l);
	
public voidaddNewLineListener(persistence.antlr.debug.NewLineListener l)

		parserEventSupport.addNewLineListener(l);
	
public voidaddParserListener(persistence.antlr.debug.ParserListener l)

		parserEventSupport.addParserListener(l);
	
public voidaddParserMatchListener(persistence.antlr.debug.ParserMatchListener l)

		parserEventSupport.addParserMatchListener(l);
	
public voidaddParserTokenListener(persistence.antlr.debug.ParserTokenListener l)

		parserEventSupport.addParserTokenListener(l);
	
public voidaddSemanticPredicateListener(persistence.antlr.debug.SemanticPredicateListener l)

		parserEventSupport.addSemanticPredicateListener(l);
	
public voidaddSyntacticPredicateListener(persistence.antlr.debug.SyntacticPredicateListener l)

		parserEventSupport.addSyntacticPredicateListener(l);
	
public voidaddTraceListener(persistence.antlr.debug.TraceListener l)

		parserEventSupport.addTraceListener(l);
	
public voidconsume()

		int la_1 = -99;
		try {la_1 = LA(1);}	
		catch (CharStreamException ignoreAnIOException) {}
		super.consume();
		parserEventSupport.fireConsume(la_1);		
	
protected voidfireEnterRule(int num, int data)

		if (isDebugMode())
			parserEventSupport.fireEnterRule(num,inputState.guessing,data);
	
protected voidfireExitRule(int num, int ttype)

		if (isDebugMode())
			parserEventSupport.fireExitRule(num,inputState.guessing, ttype);
	
protected booleanfireSemanticPredicateEvaluated(int type, int num, boolean condition)

		if (isDebugMode())
			return parserEventSupport.fireSemanticPredicateEvaluated(type,num,condition,inputState.guessing);
		else
			return condition;
	
protected voidfireSyntacticPredicateFailed()

		if (isDebugMode())
			parserEventSupport.fireSyntacticPredicateFailed(inputState.guessing);
	
protected voidfireSyntacticPredicateStarted()

		if (isDebugMode())
			parserEventSupport.fireSyntacticPredicateStarted(inputState.guessing);
	
protected voidfireSyntacticPredicateSucceeded()

		if (isDebugMode())
			parserEventSupport.fireSyntacticPredicateSucceeded(inputState.guessing);
	
public java.lang.StringgetRuleName(int num)

		return ruleNames[num];
	
public java.lang.StringgetSemPredName(int num)

		return semPredNames[num];
	
public synchronized voidgoToSleep()

		try {wait();}
		catch (InterruptedException e) {	}		
	
public booleanisDebugMode()

		return !_notDebugMode;
	
protected persistence.antlr.TokenmakeToken(int t)

		// do something with char buffer???
//		try {
//			Token tok = (Token)tokenObjectClass.newInstance();
//			tok.setType(t);
//			// tok.setText(getText()); done in generated lexer now
//			tok.setLine(line);
//			return tok;
//		}
//		catch (InstantiationException ie) {
//			panic("can't instantiate a Token");
//		}
//		catch (IllegalAccessException iae) {
//			panic("Token class is not accessible");
//		}
		return super.makeToken(t);
	
public voidmatch(char c)

		char la_1 = LA(1);
		try {
			super.match(c);
			parserEventSupport.fireMatch(c, inputState.guessing);
		}
		catch (MismatchedCharException e) {
			if (inputState.guessing == 0)
				parserEventSupport.fireMismatch(la_1, c, inputState.guessing);
			throw e;
		}
	
public voidmatch(persistence.antlr.collections.impl.BitSet b)

		String text = this.text.toString();
		char la_1 = LA(1);
		try {
			super.match(b);
			parserEventSupport.fireMatch(la_1, b, text, inputState.guessing);
		}
		catch (MismatchedCharException e) {
			if (inputState.guessing == 0)
				parserEventSupport.fireMismatch(la_1, b, text, inputState.guessing);
			throw e;
		}
	
public voidmatch(java.lang.String s)

		StringBuffer la_s = new StringBuffer("");
		int len = s.length();
		// peek at the next len worth of characters
		try {
			for(int i = 1; i <= len; i++) {
				la_s.append(super.LA(i));
			}
		}
		catch(Exception ignoreMe) {}

		try {
			super.match(s);
			parserEventSupport.fireMatch(s, inputState.guessing);
		}
		catch (MismatchedCharException e) {
			if (inputState.guessing == 0)
				parserEventSupport.fireMismatch(la_s.toString(), s, inputState.guessing);
			throw e;
		}

	
public voidmatchNot(char c)

		char la_1 = LA(1);
		try {
			super.matchNot(c);
			parserEventSupport.fireMatchNot(la_1, c, inputState.guessing);
		}
		catch (MismatchedCharException e) {
			if (inputState.guessing == 0)
				parserEventSupport.fireMismatchNot(la_1, c, inputState.guessing);
			throw e;
		}

	
public voidmatchRange(char c1, char c2)

		char la_1 = LA(1);
		try {
			super.matchRange(c1,c2);
			parserEventSupport.fireMatch(la_1, ""+c1+c2, inputState.guessing);
		}
		catch (MismatchedCharException e) {
			if (inputState.guessing == 0)
				parserEventSupport.fireMismatch(la_1, ""+c1+c2, inputState.guessing);
			throw e;
		}

	
public voidnewline()

		super.newline();
		parserEventSupport.fireNewLine(getLine());
	
public voidremoveMessageListener(persistence.antlr.debug.MessageListener l)

		parserEventSupport.removeMessageListener(l);
	
public voidremoveNewLineListener(persistence.antlr.debug.NewLineListener l)

		parserEventSupport.removeNewLineListener(l);
	
public voidremoveParserListener(persistence.antlr.debug.ParserListener l)

		parserEventSupport.removeParserListener(l);
	
public voidremoveParserMatchListener(persistence.antlr.debug.ParserMatchListener l)

		parserEventSupport.removeParserMatchListener(l);
	
public voidremoveParserTokenListener(persistence.antlr.debug.ParserTokenListener l)

		parserEventSupport.removeParserTokenListener(l);
	
public voidremoveSemanticPredicateListener(persistence.antlr.debug.SemanticPredicateListener l)

		parserEventSupport.removeSemanticPredicateListener(l);
	
public voidremoveSyntacticPredicateListener(persistence.antlr.debug.SyntacticPredicateListener l)

		parserEventSupport.removeSyntacticPredicateListener(l);
	
public voidremoveTraceListener(persistence.antlr.debug.TraceListener l)

	
		parserEventSupport.removeTraceListener(l);
	
public voidreportError(persistence.antlr.MismatchedCharException e)
Report exception errors caught in nextToken()

		parserEventSupport.fireReportError(e);
		super.reportError(e);
	
public voidreportError(java.lang.String s)
Parser error-reporting function can be overridden in subclass

		parserEventSupport.fireReportError(s);
		super.reportError(s);
	
public voidreportWarning(java.lang.String s)
Parser warning-reporting function can be overridden in subclass

		parserEventSupport.fireReportWarning(s);
		super.reportWarning(s);
	
public voidsetDebugMode(boolean value)

		_notDebugMode = !value;
	
public voidsetupDebugging()

	
public synchronized voidwakeUp()

		notify();