Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   [The "BSD license"]
   Copyright (c) 2005-2009 Terence Parr
   All rights reserved.
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
  3. The name of the author may not be used to endorse or promote products
      derived from this software without specific prior written permission.
 package org.antlr.runtime.debug;
 public class DebugTreeParser extends TreeParser {
Who to notify when events in the parser occur.
 	protected DebugEventListener dbg = null;
 	private static final String TAG = "ANTLR:DEBUG:DebugTreeParser";

Used to differentiate between fixed lookahead and cyclic DFA decisions while profiling.
 	public boolean isCyclicDecision = false;

Create a normal parser except wrap the token stream in a debug proxy that fires consume events.
 		super(input instanceof DebugTreeNodeStream?input:new DebugTreeNodeStream(input,dbg), state);
 		super(input instanceof DebugTreeNodeStream?input:new DebugTreeNodeStream(input,null), state);
 		this(input instanceof DebugTreeNodeStream?input:new DebugTreeNodeStream(input,dbg), dbgnull);

Provide a new debug event listener for this parser. Notify the input stream too that it should send events to this listener.
 	public void setDebugListener(DebugEventListener dbg) {
 		if (  instanceof DebugTreeNodeStream ) {
 		this. = dbg;
 		return ;
 	public void reportError(IOException e) {
 		android.util.Log.e(, android.util.Log.getStackTraceString(e));
 	public void reportError(RecognitionException e) {
 	protected Object getMissingSymbol(IntStream input,
 									  int expectedTokenType,
 									  BitSet follow)
 		Object o = super.getMissingSymbol(inputeexpectedTokenTypefollow);
 		return o;
 	public void beginResync() {
	public void endResync() {
	public void beginBacktrack(int level) {
	public void endBacktrack(int levelboolean successful) {
New to GrepCode? Check out our FAQ X