2 using StringBuilder
= System
.Text
.StringBuilder
;
6 /*ANTLR Translator Generator
7 * Project led by Terence Parr at http://www.jGuru.com
8 * Software rights: http://www.antlr.org/license.html
14 // ANTLR C# Code Generator by Micheal Jordan
15 // Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
16 // Anthony Oguntimehin
18 // With many thanks to Eric V. Smith from the ANTLR list.
22 public class NoViableAltForCharException
: RecognitionException
24 public char foundChar
;
26 public NoViableAltForCharException(char c
, CharScanner scanner
) :
27 base("NoViableAlt", scanner
.getFilename(), scanner
.getLine(), scanner
.getColumn())
32 public NoViableAltForCharException(char c
, string fileName
, int line
, int column
) :
33 base("NoViableAlt", fileName
, line
, column
)
39 * Returns a clean error message (no line number/column information)
41 override public string Message
45 StringBuilder mesg
= new StringBuilder("unexpected char: ");
47 // I'm trying to mirror a change in the C++ stuff.
48 // But java seems to lack something isprint-ish..
49 // so we do it manually. This is probably too restrictive.
51 if ((foundChar
>= ' ') && (foundChar
<= '~'))
54 mesg
.Append(foundChar
);
60 mesg
.Append(((int)foundChar
).ToString("X"));
62 return mesg
.ToString();