Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MismatchedCharException.hpp

Go to the documentation of this file.
00001 #ifndef INC_MismatchedCharException_hpp__
00002 #define INC_MismatchedCharException_hpp__
00003 
00004 /* ANTLR Translator Generator
00005  * Project led by Terence Parr at http://www.jGuru.com
00006  * Software rights: http://www.antlr.org/license.html
00007  *
00008  * $Id: MismatchedCharException.hpp,v 1.1 2004/10/08 16:27:34 dfisher Exp $
00009  */
00010 
00011 #include <antlr/config.hpp>
00012 #include <antlr/RecognitionException.hpp>
00013 #include <antlr/BitSet.hpp>
00014 
00015 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00016 namespace antlr {
00017 #endif
00018 
00019 class CharScanner;
00020 
00021 class ANTLR_API MismatchedCharException : public RecognitionException {
00022 public:
00023         // Types of chars
00024 #ifndef NO_STATIC_CONSTS
00025         static const int CHAR = 1;
00026         static const int NOT_CHAR = 2;
00027         static const int RANGE = 3;
00028         static const int NOT_RANGE = 4;
00029         static const int SET = 5;
00030         static const int NOT_SET = 6;
00031 #else
00032         enum {
00033                 CHAR = 1,
00034                 NOT_CHAR = 2,
00035                 RANGE = 3,
00036                 NOT_RANGE = 4,
00037                 SET = 5,
00038                 NOT_SET = 6
00039         };
00040 #endif
00041 
00042 public:
00043         // One of the above
00044         int mismatchType;
00045 
00046         // what was found on the input stream
00047         int foundChar;
00048 
00049         // For CHAR/NOT_CHAR and RANGE/NOT_RANGE
00050         int expecting;
00051 
00052         // For RANGE/NOT_RANGE (expecting is lower bound of range)
00053         int upper;
00054 
00055         // For SET/NOT_SET
00056         BitSet set;
00057 
00058 protected:
00059         // who knows...they may want to ask scanner questions
00060         CharScanner* scanner;
00061 
00062 public:
00063         MismatchedCharException();
00064 
00065         // Expected range / not range
00066         MismatchedCharException(
00067                 int c,
00068                 int lower,
00069                 int upper_,
00070                 bool matchNot,
00071                 CharScanner* scanner_
00072         );
00073 
00074         // Expected token / not token
00075         MismatchedCharException(
00076                 int c,
00077                 int expecting_,
00078                 bool matchNot,
00079                 CharScanner* scanner_
00080         );
00081 
00082         // Expected BitSet / not BitSet
00083         MismatchedCharException(
00084                 int c,
00085                 BitSet set_,
00086                 bool matchNot,
00087                 CharScanner* scanner_
00088         );
00089 
00090         ~MismatchedCharException() throw() {}
00091 
00095         ANTLR_USE_NAMESPACE(std)string getMessage() const;
00096 };
00097 
00098 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00099 }
00100 #endif
00101 
00102 #endif //INC_MismatchedCharException_hpp__

Generated on Wed Nov 3 12:59:00 2004 for Lemur Toolkit by doxygen1.2.18