antlr.debug

Class ParserEventSupport

public class ParserEventSupport extends Object

A class to assist in firing parser events NOTE: I intentionally _did_not_ synchronize the event firing and add/remove listener methods. This is because the add/remove should _only_ be called by the parser at its start/end, and the _same_thread_ should be performing the parsing. This should help performance a tad...
Field Summary
protected static intCONSUME
protected static intDONE_PARSING
protected static intENTER_RULE
protected static intEXIT_RULE
protected static intLA
protected static intMATCH
protected static intMATCH_NOT
protected static intMISMATCH
protected static intMISMATCH_NOT
protected static intNEW_LINE
protected static intREPORT_ERROR
protected static intREPORT_WARNING
protected static intSEMPRED
protected static intSYNPRED_FAILED
protected static intSYNPRED_STARTED
protected static intSYNPRED_SUCCEEDED
Constructor Summary
ParserEventSupport(Object source)
Method Summary
voidaddDoneListener(ListenerBase l)
voidaddMessageListener(MessageListener l)
voidaddNewLineListener(NewLineListener l)
voidaddParserListener(ParserListener l)
voidaddParserMatchListener(ParserMatchListener l)
voidaddParserTokenListener(ParserTokenListener l)
voidaddSemanticPredicateListener(SemanticPredicateListener l)
voidaddSyntacticPredicateListener(SyntacticPredicateListener l)
voidaddTraceListener(TraceListener l)
voidfireConsume(int value)
voidfireDoneParsing()
voidfireEnterRule(int ruleNum, int guessing, int data)
voidfireEvent(int type, ListenerBase l)
voidfireEvents(int type, Vector listeners)
voidfireExitRule(int ruleNum, int guessing, int data)
voidfireLA(int k, int la)
voidfireMatch(char c, int guessing)
voidfireMatch(char value, BitSet b, int guessing)
voidfireMatch(char value, String target, int guessing)
voidfireMatch(int value, BitSet b, String text, int guessing)
voidfireMatch(int n, String text, int guessing)
voidfireMatch(String s, int guessing)
voidfireMatchNot(char value, char n, int guessing)
voidfireMatchNot(int value, int n, String text, int guessing)
voidfireMismatch(char value, char n, int guessing)
voidfireMismatch(char value, BitSet b, int guessing)
voidfireMismatch(char value, String target, int guessing)
voidfireMismatch(int value, int n, String text, int guessing)
voidfireMismatch(int value, BitSet b, String text, int guessing)
voidfireMismatch(String value, String text, int guessing)
voidfireMismatchNot(char value, char c, int guessing)
voidfireMismatchNot(int value, int n, String text, int guessing)
voidfireNewLine(int line)
voidfireReportError(Exception e)
voidfireReportError(String s)
voidfireReportWarning(String s)
booleanfireSemanticPredicateEvaluated(int type, int condition, boolean result, int guessing)
voidfireSyntacticPredicateFailed(int guessing)
voidfireSyntacticPredicateStarted(int guessing)
voidfireSyntacticPredicateSucceeded(int guessing)
protected voidrefresh(Vector listeners)
voidrefreshListeners()
voidremoveDoneListener(ListenerBase l)
voidremoveMessageListener(MessageListener l)
voidremoveNewLineListener(NewLineListener l)
voidremoveParserListener(ParserListener l)
voidremoveParserMatchListener(ParserMatchListener l)
voidremoveParserTokenListener(ParserTokenListener l)
voidremoveSemanticPredicateListener(SemanticPredicateListener l)
voidremoveSyntacticPredicateListener(SyntacticPredicateListener l)
voidremoveTraceListener(TraceListener l)

Field Detail

CONSUME

protected static final int CONSUME

DONE_PARSING

protected static final int DONE_PARSING

ENTER_RULE

protected static final int ENTER_RULE

EXIT_RULE

protected static final int EXIT_RULE

LA

protected static final int LA

MATCH

protected static final int MATCH

MATCH_NOT

protected static final int MATCH_NOT

MISMATCH

protected static final int MISMATCH

MISMATCH_NOT

protected static final int MISMATCH_NOT

NEW_LINE

protected static final int NEW_LINE

REPORT_ERROR

protected static final int REPORT_ERROR

REPORT_WARNING

protected static final int REPORT_WARNING

SEMPRED

protected static final int SEMPRED

SYNPRED_FAILED

protected static final int SYNPRED_FAILED

SYNPRED_STARTED

protected static final int SYNPRED_STARTED

SYNPRED_SUCCEEDED

protected static final int SYNPRED_SUCCEEDED

Constructor Detail

ParserEventSupport

public ParserEventSupport(Object source)

Method Detail

addDoneListener

public void addDoneListener(ListenerBase l)

addMessageListener

public void addMessageListener(MessageListener l)

addNewLineListener

public void addNewLineListener(NewLineListener l)

addParserListener

public void addParserListener(ParserListener l)

addParserMatchListener

public void addParserMatchListener(ParserMatchListener l)

addParserTokenListener

public void addParserTokenListener(ParserTokenListener l)

addSemanticPredicateListener

public void addSemanticPredicateListener(SemanticPredicateListener l)

addSyntacticPredicateListener

public void addSyntacticPredicateListener(SyntacticPredicateListener l)

addTraceListener

public void addTraceListener(TraceListener l)

fireConsume

public void fireConsume(int value)

fireDoneParsing

public void fireDoneParsing()

fireEnterRule

public void fireEnterRule(int ruleNum, int guessing, int data)

fireEvent

public void fireEvent(int type, ListenerBase l)

fireEvents

public void fireEvents(int type, Vector listeners)

fireExitRule

public void fireExitRule(int ruleNum, int guessing, int data)

fireLA

public void fireLA(int k, int la)

fireMatch

public void fireMatch(char c, int guessing)

fireMatch

public void fireMatch(char value, BitSet b, int guessing)

fireMatch

public void fireMatch(char value, String target, int guessing)

fireMatch

public void fireMatch(int value, BitSet b, String text, int guessing)

fireMatch

public void fireMatch(int n, String text, int guessing)

fireMatch

public void fireMatch(String s, int guessing)

fireMatchNot

public void fireMatchNot(char value, char n, int guessing)

fireMatchNot

public void fireMatchNot(int value, int n, String text, int guessing)

fireMismatch

public void fireMismatch(char value, char n, int guessing)

fireMismatch

public void fireMismatch(char value, BitSet b, int guessing)

fireMismatch

public void fireMismatch(char value, String target, int guessing)

fireMismatch

public void fireMismatch(int value, int n, String text, int guessing)

fireMismatch

public void fireMismatch(int value, BitSet b, String text, int guessing)

fireMismatch

public void fireMismatch(String value, String text, int guessing)

fireMismatchNot

public void fireMismatchNot(char value, char c, int guessing)

fireMismatchNot

public void fireMismatchNot(int value, int n, String text, int guessing)

fireNewLine

public void fireNewLine(int line)

fireReportError

public void fireReportError(Exception e)

fireReportError

public void fireReportError(String s)

fireReportWarning

public void fireReportWarning(String s)

fireSemanticPredicateEvaluated

public boolean fireSemanticPredicateEvaluated(int type, int condition, boolean result, int guessing)

fireSyntacticPredicateFailed

public void fireSyntacticPredicateFailed(int guessing)

fireSyntacticPredicateStarted

public void fireSyntacticPredicateStarted(int guessing)

fireSyntacticPredicateSucceeded

public void fireSyntacticPredicateSucceeded(int guessing)

refresh

protected void refresh(Vector listeners)

refreshListeners

public void refreshListeners()

removeDoneListener

public void removeDoneListener(ListenerBase l)

removeMessageListener

public void removeMessageListener(MessageListener l)

removeNewLineListener

public void removeNewLineListener(NewLineListener l)

removeParserListener

public void removeParserListener(ParserListener l)

removeParserMatchListener

public void removeParserMatchListener(ParserMatchListener l)

removeParserTokenListener

public void removeParserTokenListener(ParserTokenListener l)

removeSemanticPredicateListener

public void removeSemanticPredicateListener(SemanticPredicateListener l)

removeSyntacticPredicateListener

public void removeSyntacticPredicateListener(SyntacticPredicateListener l)

removeTraceListener

public void removeTraceListener(TraceListener l)