antlr
Class DefaultToolErrorHandler

java.lang.Object
  |
  +--antlr.DefaultToolErrorHandler
All Implemented Interfaces:
ToolErrorHandler

class DefaultToolErrorHandler
extends Object
implements ToolErrorHandler


Field Summary
(package private)  CharFormatter javaCharFormatter
           
 
Constructor Summary
(package private) DefaultToolErrorHandler()
           
 
Method Summary
private  void dumpSets(Grammar grammar, boolean lexicalAnalysis, int depth, Lookahead[] sets, String linePrefix)
          Dump token/character sets to System.out
 void warnAltAmbiguity(Grammar grammar, AlternativeBlock blk, boolean lexicalAnalysis, int depth, Lookahead[] sets, int altIdx1, int altIdx2)
          Issue a warning about ambiguity between a alternates
 void warnAltExitAmbiguity(Grammar grammar, BlockWithImpliedExitPath blk, boolean lexicalAnalysis, int depth, Lookahead[] sets, int altIdx)
          Issue a warning about ambiguity between an alternate and exit path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

javaCharFormatter

CharFormatter javaCharFormatter
Constructor Detail

DefaultToolErrorHandler

DefaultToolErrorHandler()
Method Detail

dumpSets

private void dumpSets(Grammar grammar,
                      boolean lexicalAnalysis,
                      int depth,
                      Lookahead[] sets,
                      String linePrefix)
Dump token/character sets to System.out

Parameters:
lexicalAnalysis - true for lexical rule
depth - The depth of the ambiguity
sets - An array of bitsets containing the ambiguities

warnAltAmbiguity

public void warnAltAmbiguity(Grammar grammar,
                             AlternativeBlock blk,
                             boolean lexicalAnalysis,
                             int depth,
                             Lookahead[] sets,
                             int altIdx1,
                             int altIdx2)
Issue a warning about ambiguity between a alternates

Specified by:
warnAltAmbiguity in interface ToolErrorHandler
Parameters:
blk - The block being analyzed
lexicalAnalysis - true for lexical rule
depth - The depth of the ambiguity
sets - An array of bitsets containing the ambiguities
altIdx1 - The zero-based index of the first ambiguous alternative
altIdx2 - The zero-based index of the second ambiguous alternative

warnAltExitAmbiguity

public void warnAltExitAmbiguity(Grammar grammar,
                                 BlockWithImpliedExitPath blk,
                                 boolean lexicalAnalysis,
                                 int depth,
                                 Lookahead[] sets,
                                 int altIdx)
Issue a warning about ambiguity between an alternate and exit path.

Specified by:
warnAltExitAmbiguity in interface ToolErrorHandler
Parameters:
blk - The block being analyzed
lexicalAnalysis - true for lexical rule
depth - The depth of the ambiguity
sets - An array of bitsets containing the ambiguities
altIdx - The zero-based index of the ambiguous alternative


comments?