org.quasiliteral.syntax
Class SyntaxException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--org.quasiliteral.syntax.SyntaxException
All Implemented Interfaces:
EPrintable, Serializable

public class SyntaxException
extends RuntimeException
implements EPrintable

Untamed: Thrown if there's a grammatical error in the input.

Author:
Mark S. Miller
See Also:
Serialized Form

Field Summary
private static String ErrIndent
          Same number of spaces as in the ErrPrefix
private static String ErrPrefix
           
private  int myBound
           
private  Twine myOptLine
           
private  Twine myOptOpenner
           
private  int myStart
           
 
Fields inherited from class java.lang.RuntimeException
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
SyntaxException(String msg, Twine optLine)
          Enabled:
SyntaxException(String msg, Twine optOpenner, Twine optLine, int start, int bound)
          Enabled:
 
Method Summary
 void __printOn(TextWriter out)
          Enabled: Prints as "syntax error: " followed by an optional message, and then an optional indication of the location of the error.
 int getBound()
          Enabled:
 Twine getOptOpenner()
          Enabled:
 int getStart()
          Enabled:
 Twine optDamage()
          Enabled:
 Twine optLine()
          Enabled:
 String toString()
          Suppressed:
 
Methods inherited from class java.lang.Throwable
backtrace, eStack, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, javaStack, leaf, printStackTrace, printStackTrace, printStackTrace, printThrowableOn, setStackTrace, unwrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myOptOpenner

private final Twine myOptOpenner

myOptLine

private final Twine myOptLine

myStart

private final int myStart

myBound

private final int myBound

ErrPrefix

private static final String ErrPrefix

ErrIndent

private static final String ErrIndent
Same number of spaces as in the ErrPrefix

Constructor Detail

SyntaxException

public SyntaxException(String msg,
                       Twine optOpenner,
                       Twine optLine,
                       int start,
                       int bound)
Enabled:

Parameters:
msg -
optOpenner - optional start of syntax problem
optLine - line containing error
start - index into optLine
bound - index into optLine

SyntaxException

public SyntaxException(String msg,
                       Twine optLine)
Enabled:

Method Detail

getOptOpenner

public Twine getOptOpenner()
Enabled:

Returns:

optLine

public Twine optLine()
Enabled:


getStart

public int getStart()
Enabled:


getBound

public int getBound()
Enabled:


optDamage

public Twine optDamage()
Enabled:


__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled: Prints as "syntax error: " followed by an optional message, and then an optional indication of the location of the error.

Specified by:
__printOn in interface EPrintable
IOException

toString

public String toString()
Suppressed:

Overrides:
toString in class Throwable
Returns:
a string representation of this throwable.


comments?