xref: /aosp_15_r20/external/antlr/runtime/JavaScript/src/org/antlr/runtime/MismatchedTokenException.js (revision 16467b971bd3e2009fad32dd79016f2c7e421deb)
1org.antlr.runtime.MismatchedTokenException = function(expecting, input) {
2    if (arguments.length===0) {
3        this.expecting = org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
4    } else {
5        org.antlr.runtime.MismatchedTokenException.superclass.constructor.call(
6                this, input);
7        this.expecting = expecting;
8    }
9};
10
11org.antlr.lang.extend(
12    org.antlr.runtime.MismatchedTokenException,
13    org.antlr.runtime.RecognitionException, {
14    toString: function() {
15        return "MismatchedTokenException(" +
16                this.getUnexpectedType() + "!=" + this.expecting + ")";
17    },
18    name: "org.antlr.runtime.MismatchedTokenException"
19});
20