antlr.debug
Class ParserEventSupport

java.lang.Object
  |
  +--antlr.debug.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 int CONSUME
           
protected static int DONE_PARSING
           
protected static int ENTER_RULE
           
protected static int EXIT_RULE
           
protected static int LA
           
protected static int MATCH
           
protected static int MATCH_NOT
           
protected static int MISMATCH
           
protected static int MISMATCH_NOT
           
protected static int NEW_LINE
           
protected static int REPORT_ERROR
           
protected static int REPORT_WARNING
           
protected static int SEMPRED
           
protected static int SYNPRED_FAILED
           
protected static int SYNPRED_STARTED
           
protected static int SYNPRED_SUCCEEDED
           
 
Constructor Summary
ParserEventSupport(Object source)
           
 
Method Summary
 void addDoneListener(ListenerBase l)
           
 void addMessageListener(MessageListener l)
           
 void addNewLineListener(NewLineListener l)
           
 void addParserListener(ParserListener l)
           
 void addParserMatchListener(ParserMatchListener l)
           
 void addParserTokenListener(ParserTokenListener l)
           
 void addSemanticPredicateListener(SemanticPredicateListener l)
           
 void addSyntacticPredicateListener(SyntacticPredicateListener l)
           
 void addTraceListener(TraceListener l)
           
 void fireConsume(int value)
           
 void fireDoneParsing()
           
 void fireEnterRule(int ruleNum, int guessing, int data)
           
 void fireEvent(int type, ListenerBase l)
           
 void fireEvents(int type, Vector listeners)
           
 void fireExitRule(int ruleNum, int guessing, int data)
           
 void fireLA(int k, int la)
           
 void fireMatch(char value, BitSet b, int guessing)
           
 void fireMatch(char c, int guessing)
           
 void fireMatch(char value, String target, int guessing)
           
 void fireMatch(int value, BitSet b, String text, int guessing)
           
 void fireMatch(int n, String text, int guessing)
           
 void fireMatch(String s, int guessing)
           
 void fireMatchNot(char value, char n, int guessing)
           
 void fireMatchNot(int value, int n, String text, int guessing)
           
 void fireMismatch(char value, BitSet b, int guessing)
           
 void fireMismatch(char value, char n, int guessing)
           
 void fireMismatch(char value, String target, int guessing)
           
 void fireMismatch(int value, BitSet b, String text, int guessing)
           
 void fireMismatch(int value, int n, String text, int guessing)
           
 void fireMismatch(String value, String text, int guessing)
           
 void fireMismatchNot(char value, char c, int guessing)
           
 void fireMismatchNot(int value, int n, String text, int guessing)
           
 void fireNewLine(int line)
           
 void fireReportError(Exception e)
           
 void fireReportError(String s)
           
 void fireReportWarning(String s)
           
 boolean fireSemanticPredicateEvaluated(int type, int condition, boolean result, int guessing)
           
 void fireSyntacticPredicateFailed(int guessing)
           
 void fireSyntacticPredicateStarted(int guessing)
           
 void fireSyntacticPredicateSucceeded(int guessing)
           
protected  void refresh(Vector listeners)
           
 void refreshListeners()
           
 void removeDoneListener(ListenerBase l)
           
 void removeMessageListener(MessageListener l)
           
 void removeNewLineListener(NewLineListener l)
           
 void removeParserListener(ParserListener l)
           
 void removeParserMatchListener(ParserMatchListener l)
           
 void removeParserTokenListener(ParserTokenListener l)
           
 void removeSemanticPredicateListener(SemanticPredicateListener l)
           
 void removeSyntacticPredicateListener(SyntacticPredicateListener l)
           
 void removeTraceListener(TraceListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSUME

protected static final int CONSUME
See Also:
Constant Field Values

ENTER_RULE

protected static final int ENTER_RULE
See Also:
Constant Field Values

EXIT_RULE

protected static final int EXIT_RULE
See Also:
Constant Field Values

LA

protected static final int LA
See Also:
Constant Field Values

MATCH

protected static final int MATCH
See Also:
Constant Field Values

MATCH_NOT

protected static final int MATCH_NOT
See Also:
Constant Field Values

MISMATCH

protected static final int MISMATCH
See Also:
Constant Field Values

MISMATCH_NOT

protected static final int MISMATCH_NOT
See Also:
Constant Field Values

REPORT_ERROR

protected static final int REPORT_ERROR
See Also:
Constant Field Values

REPORT_WARNING

protected static final int REPORT_WARNING
See Also:
Constant Field Values

SEMPRED

protected static final int SEMPRED
See Also:
Constant Field Values

SYNPRED_FAILED

protected static final int SYNPRED_FAILED
See Also:
Constant Field Values

SYNPRED_STARTED

protected static final int SYNPRED_STARTED
See Also:
Constant Field Values

SYNPRED_SUCCEEDED

protected static final int SYNPRED_SUCCEEDED
See Also:
Constant Field Values

NEW_LINE

protected static final int NEW_LINE
See Also:
Constant Field Values

DONE_PARSING

protected static final int DONE_PARSING
See Also:
Constant Field Values
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)


Copyright 1999-2003 Oliver Zeigermann. All Rights Reserved.