aboutsummaryrefslogtreecommitdiff
path: root/runtime/ActionScript/project/src/org/antlr/runtime/UnwantedTokenException.as
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ActionScript/project/src/org/antlr/runtime/UnwantedTokenException.as')
-rw-r--r--runtime/ActionScript/project/src/org/antlr/runtime/UnwantedTokenException.as25
1 files changed, 25 insertions, 0 deletions
diff --git a/runtime/ActionScript/project/src/org/antlr/runtime/UnwantedTokenException.as b/runtime/ActionScript/project/src/org/antlr/runtime/UnwantedTokenException.as
new file mode 100644
index 0000000..c641bc8
--- /dev/null
+++ b/runtime/ActionScript/project/src/org/antlr/runtime/UnwantedTokenException.as
@@ -0,0 +1,25 @@
+package org.antlr.runtime
+{
+ public class UnwantedTokenException extends MismatchedTokenException
+ {
+ public function UnwantedTokenException(expecting:int, input:IntStream)
+ {
+ super(expecting, input);
+ }
+
+ public function get unexpectedToken():Token {
+ return token;
+ }
+
+ public override function toString():String {
+ var exp:String = ", expected "+expecting;
+ if ( expecting==TokenConstants.INVALID_TOKEN_TYPE ) {
+ exp = "";
+ }
+ if ( token==null ) {
+ return "UnwantedTokenException(found="+null+exp+")";
+ }
+ return "UnwantedTokenException(found="+token.text+exp+")";
+ }
+ }
+} \ No newline at end of file