opendap/src/main/java/opendap/dap/parsers/Dap2Lex.java
public void yyerror(String s)
{
    String kind = "?";
    switch (parsestate.parseClass) {
    case Dap2Parse.DapDAS: kind = "DAS"; break;
    case Dap2Parse.DapDDS: kind = "DDS"; break;
    case Dap2Parse.DapERR: kind = "Error"; break;
    default: kind = "?"; break;
    }
    System.err.println("yyerror: "+s+"; "+kind+" parse failed at line: " + lineno+" char: "+charno+"; near: ");
    String context = parsestate.flatten(getInput());
    int show = (context.length() < CONTEXTLEN ? context.length() : CONTEXTLEN);
    System.err.println(context.substring(context.length() - show)+"^");
        if(parsestate.getURL() != null)
            System.err.println("\turl="+parsestate.getURL());
    new Exception().printStackTrace(System.err);
}
public void yyerror(String s)
{
    String kind = "?";
    switch (parsestate.parseClass) {
    case Dap2Parse.DapDAS: kind = "DAS"; break;
    case Dap2Parse.DapDDS: kind = "DDS"; break;
    case Dap2Parse.DapERR: kind = "Error"; break;
    default: kind = "?"; break;
    }
    System.err.println("yyerror: "+s+"; "+kind+" parse failed at line: " + lineno+" char: "+charno+"; near: ");
    String context = parsestate.flatten(getInput());
    int show = (context.length() < CONTEXTLEN ? context.length() : CONTEXTLEN);
    System.err.println(context.substring(context.length() - show)+"^");
        if(parsestate.getURL() != null)
            System.err.println("\turl="+parsestate.getURL());
    new Exception().printStackTrace(System.err);
}
public void yyerror ( String s ) { String kind = "?" ; switch ( parsestate . parseClass ) { case Dap2Parse . DapDAS : kind = "DAS" ; break ; case Dap2Parse . DapDDS : kind = "DDS" ; break ; case Dap2Parse . DapERR : kind = "Error" ; break ; default : kind = "?" ; break ; } System . err . println ( "yyerror: " + s + "; " + kind + " parse failed at line: " + lineno + " char: " + charno + "; near: " ) ; String context = parsestate . flatten ( getInput ( ) ) ; int show = ( context . length ( ) < CONTEXTLEN ? context . length ( ) : CONTEXTLEN ) ; System . err . println ( context . substring ( context . length ( ) - show ) + "^" ) ; if ( parsestate . getURL ( ) != null ) System . err . println ( "\turl=" + parsestate . getURL ( ) ) ; new Exception ( ) . printStackTrace ( System . err ) ; }
Entry point for error reporting.  Emits an error
in a user-defined way.

@param s The string for the error message.
Entry point for error reporting . Emits an error in a user - defined way .