antlr.debug
Class ParserEventSupport

java.lang.Object
  |
  +--antlr.debug.ParserEventSupport

public class ParserEventSupport
extends Object

Untamed: 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
           
private  ParserController controller
           
protected static int DONE_PARSING
           
private  Hashtable doneListeners
           
protected static int ENTER_RULE
           
protected static int EXIT_RULE
           
protected static int LA
           
protected static int MATCH
           
protected static int MATCH_NOT
           
private  ParserMatchEvent matchEvent
           
private  Vector matchListeners
           
private  MessageEvent messageEvent
           
private  Vector messageListeners
           
protected static int MISMATCH
           
protected static int MISMATCH_NOT
           
protected static int NEW_LINE
           
private  NewLineEvent newLineEvent
           
private  Vector newLineListeners
           
protected static int REPORT_ERROR
           
protected static int REPORT_WARNING
           
private  int ruleDepth
           
protected static int SEMPRED
           
private  SemanticPredicateEvent semPredEvent
           
private  Vector semPredListeners
           
private  Object source
           
protected static int SYNPRED_FAILED
           
protected static int SYNPRED_STARTED
           
protected static int SYNPRED_SUCCEEDED
           
private  SyntacticPredicateEvent synPredEvent
           
private  Vector synPredListeners
           
private  ParserTokenEvent tokenEvent
           
private  Vector tokenListeners
           
private  TraceEvent traceEvent
           
private  Vector traceListeners
           
 
Constructor Summary
ParserEventSupport(Object source)
          Enabled:
 
Method Summary
 void addDoneListener(ListenerBase l)
          Enabled:
 void addMessageListener(MessageListener l)
          Enabled:
 void addNewLineListener(NewLineListener l)
          Enabled:
 void addParserListener(ParserListener l)
          Enabled:
 void addParserMatchListener(ParserMatchListener l)
          Enabled:
 void addParserTokenListener(ParserTokenListener l)
          Enabled:
 void addSemanticPredicateListener(SemanticPredicateListener l)
          Enabled:
 void addSyntacticPredicateListener(SyntacticPredicateListener l)
          Enabled:
 void addTraceListener(TraceListener l)
          Enabled:
 void fireConsume(int value)
          Enabled:
 void fireDoneParsing()
          Enabled:
 void fireEnterRule(int ruleNum, int guessing, int data)
          Enabled:
 void fireEvent(int type, ListenerBase l)
          Enabled:
 void fireEvents(int type, Vector listeners)
          Enabled:
 void fireExitRule(int ruleNum, int guessing, int data)
          Enabled:
 void fireLA(int k, int la)
          Enabled:
 void fireMatch(char value, BitSet b, int guessing)
          Enabled:
 void fireMatch(char c, int guessing)
          Enabled:
 void fireMatch(char value, String target, int guessing)
          Enabled:
 void fireMatch(int value, BitSet b, String text, int guessing)
          Enabled:
 void fireMatch(int n, String text, int guessing)
          Enabled:
 void fireMatch(String s, int guessing)
          Enabled:
 void fireMatchNot(char value, char n, int guessing)
          Enabled:
 void fireMatchNot(int value, int n, String text, int guessing)
          Enabled:
 void fireMismatch(char value, BitSet b, int guessing)
          Enabled:
 void fireMismatch(char value, char n, int guessing)
          Enabled:
 void fireMismatch(char value, String target, int guessing)
          Enabled:
 void fireMismatch(int value, BitSet b, String text, int guessing)
          Enabled:
 void fireMismatch(int value, int n, String text, int guessing)
          Enabled:
 void fireMismatch(String value, String text, int guessing)
          Enabled:
 void fireMismatchNot(char value, char c, int guessing)
          Enabled:
 void fireMismatchNot(int value, int n, String text, int guessing)
          Enabled:
 void fireNewLine(int line)
          Enabled:
 void fireReportError(Exception e)
          Enabled:
 void fireReportError(String s)
          Enabled:
 void fireReportWarning(String s)
          Enabled:
 boolean fireSemanticPredicateEvaluated(int type, int condition, boolean result, int guessing)
          Enabled:
 void fireSyntacticPredicateFailed(int guessing)
          Enabled:
 void fireSyntacticPredicateStarted(int guessing)
          Enabled:
 void fireSyntacticPredicateSucceeded(int guessing)
          Enabled:
protected  void refresh(Vector listeners)
           
 void refreshListeners()
          Enabled:
 void removeDoneListener(ListenerBase l)
          Enabled:
 void removeMessageListener(MessageListener l)
          Enabled:
 void removeNewLineListener(NewLineListener l)
          Enabled:
 void removeParserListener(ParserListener l)
          Enabled:
 void removeParserMatchListener(ParserMatchListener l)
          Enabled:
 void removeParserTokenListener(ParserTokenListener l)
          Enabled:
 void removeSemanticPredicateListener(SemanticPredicateListener l)
          Enabled:
 void removeSyntacticPredicateListener(SyntacticPredicateListener l)
          Enabled:
 void removeTraceListener(TraceListener l)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private Object source

doneListeners

private Hashtable doneListeners

matchListeners

private Vector matchListeners

messageListeners

private Vector messageListeners

tokenListeners

private Vector tokenListeners

traceListeners

private Vector traceListeners

semPredListeners

private Vector semPredListeners

synPredListeners

private Vector synPredListeners

newLineListeners

private Vector newLineListeners

matchEvent

private ParserMatchEvent matchEvent

messageEvent

private MessageEvent messageEvent

tokenEvent

private ParserTokenEvent tokenEvent

semPredEvent

private SemanticPredicateEvent semPredEvent

synPredEvent

private SyntacticPredicateEvent synPredEvent

traceEvent

private TraceEvent traceEvent

newLineEvent

private NewLineEvent newLineEvent

controller

private ParserController controller

CONSUME

protected static final int CONSUME

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

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

NEW_LINE

protected static final int NEW_LINE

DONE_PARSING

protected static final int DONE_PARSING

ruleDepth

private int ruleDepth
Constructor Detail

ParserEventSupport

public ParserEventSupport(Object source)
Enabled:

Method Detail

addDoneListener

public void addDoneListener(ListenerBase l)
Enabled:


addMessageListener

public void addMessageListener(MessageListener l)
Enabled:


addNewLineListener

public void addNewLineListener(NewLineListener l)
Enabled:


addParserListener

public void addParserListener(ParserListener l)
Enabled:


addParserMatchListener

public void addParserMatchListener(ParserMatchListener l)
Enabled:


addParserTokenListener

public void addParserTokenListener(ParserTokenListener l)
Enabled:


addSemanticPredicateListener

public void addSemanticPredicateListener(SemanticPredicateListener l)
Enabled:


addSyntacticPredicateListener

public void addSyntacticPredicateListener(SyntacticPredicateListener l)
Enabled:


addTraceListener

public void addTraceListener(TraceListener l)
Enabled:


fireConsume

public void fireConsume(int value)
Enabled:


fireDoneParsing

public void fireDoneParsing()
Enabled:


fireEnterRule

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


fireEvent

public void fireEvent(int type,
                      ListenerBase l)
Enabled:


fireEvents

public void fireEvents(int type,
                       Vector listeners)
Enabled:


fireExitRule

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


fireLA

public void fireLA(int k,
                   int la)
Enabled:


fireMatch

public void fireMatch(char c,
                      int guessing)
Enabled:


fireMatch

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


fireMatch

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


fireMatch

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


fireMatch

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


fireMatch

public void fireMatch(String s,
                      int guessing)
Enabled:


fireMatchNot

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


fireMatchNot

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


fireMismatch

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


fireMismatch

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


fireMismatch

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


fireMismatch

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


fireMismatch

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


fireMismatch

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


fireMismatchNot

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


fireMismatchNot

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


fireNewLine

public void fireNewLine(int line)
Enabled:


fireReportError

public void fireReportError(Exception e)
Enabled:


fireReportError

public void fireReportError(String s)
Enabled:


fireReportWarning

public void fireReportWarning(String s)
Enabled:


fireSemanticPredicateEvaluated

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


fireSyntacticPredicateFailed

public void fireSyntacticPredicateFailed(int guessing)
Enabled:


fireSyntacticPredicateStarted

public void fireSyntacticPredicateStarted(int guessing)
Enabled:


fireSyntacticPredicateSucceeded

public void fireSyntacticPredicateSucceeded(int guessing)
Enabled:


refresh

protected void refresh(Vector listeners)

refreshListeners

public void refreshListeners()
Enabled:


removeDoneListener

public void removeDoneListener(ListenerBase l)
Enabled:


removeMessageListener

public void removeMessageListener(MessageListener l)
Enabled:


removeNewLineListener

public void removeNewLineListener(NewLineListener l)
Enabled:


removeParserListener

public void removeParserListener(ParserListener l)
Enabled:


removeParserMatchListener

public void removeParserMatchListener(ParserMatchListener l)
Enabled:


removeParserTokenListener

public void removeParserTokenListener(ParserTokenListener l)
Enabled:


removeSemanticPredicateListener

public void removeSemanticPredicateListener(SemanticPredicateListener l)
Enabled:


removeSyntacticPredicateListener

public void removeSyntacticPredicateListener(SyntacticPredicateListener l)
Enabled:


removeTraceListener

public void removeTraceListener(TraceListener l)
Enabled:



comments?