Added ability to order the execution of dictionary adapter behaviors.
[castle.git] / Experiments / Attic / Rook / Castle.Rook.Compiler / Parser / antlr / NoViableAltForCharException.cs
blobb15150d08046883588b1ac14793666f6988c8c61
1 using System;
2 using StringBuilder = System.Text.StringBuilder;
4 namespace antlr
6 /*ANTLR Translator Generator
7 * Project led by Terence Parr at http://www.jGuru.com
8 * Software rights: http://www.antlr.org/license.html
10 * $Id:$
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.
21 [Serializable]
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())
29 foundChar = c;
32 public NoViableAltForCharException(char c, string fileName, int line, int column) :
33 base("NoViableAlt", fileName, line, column)
35 foundChar = c;
39 * Returns a clean error message (no line number/column information)
41 override public string Message
43 get
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 <= '~'))
53 mesg.Append('\'');
54 mesg.Append(foundChar);
55 mesg.Append('\'');
57 else
59 mesg.Append("0x");
60 mesg.Append(((int)foundChar).ToString("X"));
62 return mesg.ToString();