/* $ANTLR 2.7.7 (2006-11-01): "modelica_lexer.g" -> "modelica_lexer.cpp"$ */
#include "modelica_lexer.hpp"
#include <antlr/CharBuffer.hpp>
#include <antlr/TokenStreamException.hpp>
#include <antlr/TokenStreamIOException.hpp>
#include <antlr/TokenStreamRecognitionException.hpp>
#include <antlr/CharStreamException.hpp>
#include <antlr/CharStreamIOException.hpp>
#include <antlr/NoViableAltForCharException.hpp>

#line 1 "modelica_lexer.g"
#line 13 "modelica_lexer.cpp"
modelica_lexer::modelica_lexer(ANTLR_USE_NAMESPACE(std)istream& in)
  : ANTLR_USE_NAMESPACE(antlr)CharScanner(new ANTLR_USE_NAMESPACE(antlr)CharBuffer(in),true)
{
  initLiterals();
}

modelica_lexer::modelica_lexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib)
  : ANTLR_USE_NAMESPACE(antlr)CharScanner(ib,true)
{
  initLiterals();
}

modelica_lexer::modelica_lexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state)
  : ANTLR_USE_NAMESPACE(antlr)CharScanner(state,true)
{
  initLiterals();
}

void modelica_lexer::initLiterals()
{
  literals["type"] = 55;
  literals["constant"] = 12;
  literals["public"] = 48;
  literals["initial"] = 34;
  literals["annotation"] = 6;
  literals["break"] = 63;
  literals["while"] = 59;
  literals["end"] = 19;
  literals["equation"] = 21;
  literals["overload"] = 41;
  literals["flow"] = 28;
  literals["then"] = 53;
  literals["unsigned_real"] = 56;
  literals["and"] = 5;
  literals["outer"] = 40;
  literals["not"] = 39;
  literals["package"] = 44;
  literals["return"] = 62;
  literals["external"] = 25;
  literals["replaceable"] = 51;
  literals["protected"] = 47;
  literals["der"] = 14;
  literals["output"] = 43;
  literals["when"] = 58;
  literals["class"] = 9;
  literals["inner"] = 35;
  literals["enumeration"] = 20;
  literals["function"] = 30;
  literals["each"] = 15;
  literals["redeclare"] = 50;
  literals["model"] = 38;
  literals["elseif"] = 17;
  literals["parameter"] = 45;
  literals["input"] = 36;
  literals["final"] = 27;
  literals["or"] = 42;
  literals["if"] = 31;
  literals["record"] = 49;
  literals["constrainedby"] = 61;
  literals["connector"] = 11;
  literals["connect"] = 10;
  literals["results"] = 52;
  literals["for"] = 29;
  literals["extends"] = 24;
  literals["loop"] = 37;
  literals["false"] = 26;
  literals["elsewhen"] = 18;
  literals["Code"] = 8;
  literals["encapsulated"] = 22;
  literals["partial"] = 46;
  literals["expandable"] = 23;
  literals["."] = 57;
  literals["else"] = 16;
  literals["import"] = 32;
  literals["discrete"] = 13;
  literals["in"] = 33;
  literals["block"] = 7;
  literals["true"] = 54;
  literals["within"] = 60;
  literals["stream"] = 64;
  literals["algorithm"] = 4;
}

ANTLR_USE_NAMESPACE(antlr)RefToken modelica_lexer::nextToken()
{
  ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
  for (;;) {
    ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
    int _ttype = ANTLR_USE_NAMESPACE(antlr)Token::INVALID_TYPE;
    resetText();
    try {   // for lexical and char stream error handling
      switch ( LA(1)) {
      case 0x28 /* '(' */ :
      {
        mLPAR(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x29 /* ')' */ :
      {
        mRPAR(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x5b /* '[' */ :
      {
        mLBRACK(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x5d /* ']' */ :
      {
        mRBRACK(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x7b /* '{' */ :
      {
        mLBRACE(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x7d /* '}' */ :
      {
        mRBRACE(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x2b /* '+' */ :
      {
        mPLUS(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x2d /* '-' */ :
      {
        mMINUS(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x2a /* '*' */ :
      {
        mSTAR(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x5e /* '^' */ :
      {
        mPOWER(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x2c /* ',' */ :
      {
        mCOMMA(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x3b /* ';' */ :
      {
        mSEMICOLON(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x9 /* '\t' */ :
      case 0xa /* '\n' */ :
      case 0xd /* '\r' */ :
      case 0x20 /* ' ' */ :
      {
        mWS(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x27 /* '\'' */ :
      case 0x41 /* 'A' */ :
      case 0x42 /* 'B' */ :
      case 0x43 /* 'C' */ :
      case 0x44 /* 'D' */ :
      case 0x45 /* 'E' */ :
      case 0x46 /* 'F' */ :
      case 0x47 /* 'G' */ :
      case 0x48 /* 'H' */ :
      case 0x49 /* 'I' */ :
      case 0x4a /* 'J' */ :
      case 0x4b /* 'K' */ :
      case 0x4c /* 'L' */ :
      case 0x4d /* 'M' */ :
      case 0x4e /* 'N' */ :
      case 0x4f /* 'O' */ :
      case 0x50 /* 'P' */ :
      case 0x51 /* 'Q' */ :
      case 0x52 /* 'R' */ :
      case 0x53 /* 'S' */ :
      case 0x54 /* 'T' */ :
      case 0x55 /* 'U' */ :
      case 0x56 /* 'V' */ :
      case 0x57 /* 'W' */ :
      case 0x58 /* 'X' */ :
      case 0x59 /* 'Y' */ :
      case 0x5a /* 'Z' */ :
      case 0x5f /* '_' */ :
      case 0x61 /* 'a' */ :
      case 0x62 /* 'b' */ :
      case 0x63 /* 'c' */ :
      case 0x64 /* 'd' */ :
      case 0x65 /* 'e' */ :
      case 0x66 /* 'f' */ :
      case 0x67 /* 'g' */ :
      case 0x68 /* 'h' */ :
      case 0x69 /* 'i' */ :
      case 0x6a /* 'j' */ :
      case 0x6b /* 'k' */ :
      case 0x6c /* 'l' */ :
      case 0x6d /* 'm' */ :
      case 0x6e /* 'n' */ :
      case 0x6f /* 'o' */ :
      case 0x70 /* 'p' */ :
      case 0x71 /* 'q' */ :
      case 0x72 /* 'r' */ :
      case 0x73 /* 's' */ :
      case 0x74 /* 't' */ :
      case 0x75 /* 'u' */ :
      case 0x76 /* 'v' */ :
      case 0x77 /* 'w' */ :
      case 0x78 /* 'x' */ :
      case 0x79 /* 'y' */ :
      case 0x7a /* 'z' */ :
      {
        mIDENT(true);
        theRetToken=_returnToken;
        break;
      }
      case 0x22 /* '\"' */ :
      {
        mSTRING(true);
        theRetToken=_returnToken;
        break;
      }
      default:
        if ((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3d /* '=' */ )) {
          mASSIGN(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2b /* '+' */ )) {
          mPLUS_EW(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2d /* '-' */ )) {
          mMINUS_EW(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2a /* '*' */ )) {
          mSTAR_EW(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2f /* '/' */ )) {
          mSLASH_EW(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x5e /* '^' */ )) {
          mPOWER_EW(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
          mLESSEQ(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
          mGREATEREQ(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3d /* '=' */ )) {
          mEQEQ(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3e /* '>' */ )) {
          mLESSGT(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2a /* '*' */ )) {
          mML_COMMENT(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2f /* '/' */ )) {
          mSL_COMMENT(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3d /* '=' */ ) && (true)) {
          mEQUALS(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x2f /* '/' */ ) && (true)) {
          mSLASH(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
          mLESS(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
          mGREATER(true);
          theRetToken=_returnToken;
        }
        else if ((LA(1) == 0x3a /* ':' */ ) && (true)) {
          mCOLON(true);
          theRetToken=_returnToken;
        }
        else if ((_tokenSet_0.member(LA(1))) && (true)) {
          mUNSIGNED_INTEGER(true);
          theRetToken=_returnToken;
        }
      else {
        if (LA(1)==EOF_CHAR)
        {
          uponEOF();
          _returnToken = makeToken(ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE);
        }
        else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
      }
      }
      if ( !_returnToken )
        goto tryAgain; // found SKIP token

      _ttype = _returnToken->getType();
      _returnToken->setType(_ttype);
      return _returnToken;
    }
    catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& e) {
        throw ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(e);
    }
    catch (ANTLR_USE_NAMESPACE(antlr)CharStreamIOException& csie) {
      throw ANTLR_USE_NAMESPACE(antlr)TokenStreamIOException(csie.io);
    }
    catch (ANTLR_USE_NAMESPACE(antlr)CharStreamException& cse) {
      throw ANTLR_USE_NAMESPACE(antlr)TokenStreamException(cse.getMessage());
    }
tryAgain:;
  }
}

void modelica_lexer::mLPAR(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = LPAR;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('(' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mRPAR(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = RPAR;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(')' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mLBRACK(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = LBRACK;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('[' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mRBRACK(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = RBRACK;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(']' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mLBRACE(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = LBRACE;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('{' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mRBRACE(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = RBRACE;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('}' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mEQUALS(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = EQUALS;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('=' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mASSIGN(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = ASSIGN;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(":=");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mPLUS(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = PLUS;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('+' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mMINUS(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = MINUS;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('-' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSTAR(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = STAR;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('*' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSLASH(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = SLASH;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('/' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mPOWER(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = POWER;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('^' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mPLUS_EW(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = PLUS_EW;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(".+");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mMINUS_EW(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = MINUS_EW;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(".-");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSTAR_EW(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = STAR_EW;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(".*");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSLASH_EW(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = SLASH_EW;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match("./");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mPOWER_EW(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = POWER_EW;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(".^");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mCOMMA(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = COMMA;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(',' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mLESS(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = LESS;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('<' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mLESSEQ(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = LESSEQ;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match("<=");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mGREATER(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = GREATER;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('>' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mGREATEREQ(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = GREATEREQ;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(">=");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mEQEQ(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = EQEQ;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match("==");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mLESSGT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = LESSGT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match("<>");
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mCOLON(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = COLON;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(':' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSEMICOLON(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = SEMICOLON;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match(';' /* charlit */ );
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mWS(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = WS;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  {
  switch ( LA(1)) {
  case 0x20 /* ' ' */ :
  {
    match(' ' /* charlit */ );
    break;
  }
  case 0x9 /* '\t' */ :
  {
    match('\t' /* charlit */ );
    break;
  }
  case 0xa /* '\n' */ :
  case 0xd /* '\r' */ :
  {
    {
    if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ )) {
      match("\r\n");
    }
    else if ((LA(1) == 0xd /* '\r' */ ) && (true)) {
      match('\r' /* charlit */ );
    }
    else if ((LA(1) == 0xa /* '\n' */ )) {
      match('\n' /* charlit */ );
    }
    else {
      throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
    }

    }
#line 121 "modelica_lexer.g"
    newline();
#line 769 "modelica_lexer.cpp"
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  }
#line 123 "modelica_lexer.g"
  _ttype = antlr::Token::SKIP;
#line 780 "modelica_lexer.cpp"
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mML_COMMENT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = ML_COMMENT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match("/*");
  { // ( ... )*
  for (;;) {
    if (((LA(1) == 0x2a /* '*' */ ) && ((LA(2) >= 0x3 /* '\3' */  && LA(2) <= 0xff)))&&(LA(2)!='/')) {
      match('*' /* charlit */ );
    }
    else if ((_tokenSet_1.member(LA(1)))) {
      mML_COMMENT_CHAR(false);
    }
    else {
      goto _loop33;
    }

  }
  _loop33:;
  } // ( ... )*
  match("*/");
#line 130 "modelica_lexer.g"
  _ttype = antlr::Token::SKIP;
#line 813 "modelica_lexer.cpp"
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mML_COMMENT_CHAR(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = ML_COMMENT_CHAR;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  if ((LA(1) == 0xa /* '\n' */  || LA(1) == 0xd /* '\r' */ )) {
    {
    switch ( LA(1)) {
    case 0xd /* '\r' */ :
    {
      match("\r\n");
      break;
    }
    case 0xa /* '\n' */ :
    {
      match('\n' /* charlit */ );
      break;
    }
    default:
    {
      throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
#line 134 "modelica_lexer.g"
    newline();
#line 848 "modelica_lexer.cpp"
  }
  else if ((_tokenSet_2.member(LA(1)))) {
    {
    match(_tokenSet_2);
    }
  }
  else {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }

  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSL_COMMENT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = SL_COMMENT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match("//");
  { // ( ... )*
  for (;;) {
    if ((_tokenSet_3.member(LA(1)))) {
      {
      match(_tokenSet_3);
      }
    }
    else {
      goto _loop40;
    }

  }
  _loop40:;
  } // ( ... )*
#line 140 "modelica_lexer.g"
  _ttype = antlr::Token::SKIP;
#line 889 "modelica_lexer.cpp"
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mIDENT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = IDENT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  switch ( LA(1)) {
  case 0x41 /* 'A' */ :
  case 0x42 /* 'B' */ :
  case 0x43 /* 'C' */ :
  case 0x44 /* 'D' */ :
  case 0x45 /* 'E' */ :
  case 0x46 /* 'F' */ :
  case 0x47 /* 'G' */ :
  case 0x48 /* 'H' */ :
  case 0x49 /* 'I' */ :
  case 0x4a /* 'J' */ :
  case 0x4b /* 'K' */ :
  case 0x4c /* 'L' */ :
  case 0x4d /* 'M' */ :
  case 0x4e /* 'N' */ :
  case 0x4f /* 'O' */ :
  case 0x50 /* 'P' */ :
  case 0x51 /* 'Q' */ :
  case 0x52 /* 'R' */ :
  case 0x53 /* 'S' */ :
  case 0x54 /* 'T' */ :
  case 0x55 /* 'U' */ :
  case 0x56 /* 'V' */ :
  case 0x57 /* 'W' */ :
  case 0x58 /* 'X' */ :
  case 0x59 /* 'Y' */ :
  case 0x5a /* 'Z' */ :
  case 0x5f /* '_' */ :
  case 0x61 /* 'a' */ :
  case 0x62 /* 'b' */ :
  case 0x63 /* 'c' */ :
  case 0x64 /* 'd' */ :
  case 0x65 /* 'e' */ :
  case 0x66 /* 'f' */ :
  case 0x67 /* 'g' */ :
  case 0x68 /* 'h' */ :
  case 0x69 /* 'i' */ :
  case 0x6a /* 'j' */ :
  case 0x6b /* 'k' */ :
  case 0x6c /* 'l' */ :
  case 0x6d /* 'm' */ :
  case 0x6e /* 'n' */ :
  case 0x6f /* 'o' */ :
  case 0x70 /* 'p' */ :
  case 0x71 /* 'q' */ :
  case 0x72 /* 'r' */ :
  case 0x73 /* 's' */ :
  case 0x74 /* 't' */ :
  case 0x75 /* 'u' */ :
  case 0x76 /* 'v' */ :
  case 0x77 /* 'w' */ :
  case 0x78 /* 'x' */ :
  case 0x79 /* 'y' */ :
  case 0x7a /* 'z' */ :
  {
    mNONDIGIT(false);
    { // ( ... )*
    for (;;) {
      switch ( LA(1)) {
      case 0x41 /* 'A' */ :
      case 0x42 /* 'B' */ :
      case 0x43 /* 'C' */ :
      case 0x44 /* 'D' */ :
      case 0x45 /* 'E' */ :
      case 0x46 /* 'F' */ :
      case 0x47 /* 'G' */ :
      case 0x48 /* 'H' */ :
      case 0x49 /* 'I' */ :
      case 0x4a /* 'J' */ :
      case 0x4b /* 'K' */ :
      case 0x4c /* 'L' */ :
      case 0x4d /* 'M' */ :
      case 0x4e /* 'N' */ :
      case 0x4f /* 'O' */ :
      case 0x50 /* 'P' */ :
      case 0x51 /* 'Q' */ :
      case 0x52 /* 'R' */ :
      case 0x53 /* 'S' */ :
      case 0x54 /* 'T' */ :
      case 0x55 /* 'U' */ :
      case 0x56 /* 'V' */ :
      case 0x57 /* 'W' */ :
      case 0x58 /* 'X' */ :
      case 0x59 /* 'Y' */ :
      case 0x5a /* 'Z' */ :
      case 0x5f /* '_' */ :
      case 0x61 /* 'a' */ :
      case 0x62 /* 'b' */ :
      case 0x63 /* 'c' */ :
      case 0x64 /* 'd' */ :
      case 0x65 /* 'e' */ :
      case 0x66 /* 'f' */ :
      case 0x67 /* 'g' */ :
      case 0x68 /* 'h' */ :
      case 0x69 /* 'i' */ :
      case 0x6a /* 'j' */ :
      case 0x6b /* 'k' */ :
      case 0x6c /* 'l' */ :
      case 0x6d /* 'm' */ :
      case 0x6e /* 'n' */ :
      case 0x6f /* 'o' */ :
      case 0x70 /* 'p' */ :
      case 0x71 /* 'q' */ :
      case 0x72 /* 'r' */ :
      case 0x73 /* 's' */ :
      case 0x74 /* 't' */ :
      case 0x75 /* 'u' */ :
      case 0x76 /* 'v' */ :
      case 0x77 /* 'w' */ :
      case 0x78 /* 'x' */ :
      case 0x79 /* 'y' */ :
      case 0x7a /* 'z' */ :
      {
        mNONDIGIT(false);
        break;
      }
      case 0x30 /* '0' */ :
      case 0x31 /* '1' */ :
      case 0x32 /* '2' */ :
      case 0x33 /* '3' */ :
      case 0x34 /* '4' */ :
      case 0x35 /* '5' */ :
      case 0x36 /* '6' */ :
      case 0x37 /* '7' */ :
      case 0x38 /* '8' */ :
      case 0x39 /* '9' */ :
      {
        mDIGIT(false);
        break;
      }
      default:
      {
        goto _loop43;
      }
      }
    }
    _loop43:;
    } // ( ... )*
    break;
  }
  case 0x27 /* '\'' */ :
  {
    mQIDENT(false);
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  _ttype = testLiteralsTable(_ttype);
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mNONDIGIT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = NONDIGIT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  {
  switch ( LA(1)) {
  case 0x5f /* '_' */ :
  {
    match('_' /* charlit */ );
    break;
  }
  case 0x61 /* 'a' */ :
  case 0x62 /* 'b' */ :
  case 0x63 /* 'c' */ :
  case 0x64 /* 'd' */ :
  case 0x65 /* 'e' */ :
  case 0x66 /* 'f' */ :
  case 0x67 /* 'g' */ :
  case 0x68 /* 'h' */ :
  case 0x69 /* 'i' */ :
  case 0x6a /* 'j' */ :
  case 0x6b /* 'k' */ :
  case 0x6c /* 'l' */ :
  case 0x6d /* 'm' */ :
  case 0x6e /* 'n' */ :
  case 0x6f /* 'o' */ :
  case 0x70 /* 'p' */ :
  case 0x71 /* 'q' */ :
  case 0x72 /* 'r' */ :
  case 0x73 /* 's' */ :
  case 0x74 /* 't' */ :
  case 0x75 /* 'u' */ :
  case 0x76 /* 'v' */ :
  case 0x77 /* 'w' */ :
  case 0x78 /* 'x' */ :
  case 0x79 /* 'y' */ :
  case 0x7a /* 'z' */ :
  {
    matchRange('a','z');
    break;
  }
  case 0x41 /* 'A' */ :
  case 0x42 /* 'B' */ :
  case 0x43 /* 'C' */ :
  case 0x44 /* 'D' */ :
  case 0x45 /* 'E' */ :
  case 0x46 /* 'F' */ :
  case 0x47 /* 'G' */ :
  case 0x48 /* 'H' */ :
  case 0x49 /* 'I' */ :
  case 0x4a /* 'J' */ :
  case 0x4b /* 'K' */ :
  case 0x4c /* 'L' */ :
  case 0x4d /* 'M' */ :
  case 0x4e /* 'N' */ :
  case 0x4f /* 'O' */ :
  case 0x50 /* 'P' */ :
  case 0x51 /* 'Q' */ :
  case 0x52 /* 'R' */ :
  case 0x53 /* 'S' */ :
  case 0x54 /* 'T' */ :
  case 0x55 /* 'U' */ :
  case 0x56 /* 'V' */ :
  case 0x57 /* 'W' */ :
  case 0x58 /* 'X' */ :
  case 0x59 /* 'Y' */ :
  case 0x5a /* 'Z' */ :
  {
    matchRange('A','Z');
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  }
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mDIGIT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = DIGIT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  matchRange('0','9');
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mQIDENT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = QIDENT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('\'' /* charlit */ );
  {
  if ((_tokenSet_4.member(LA(1)))) {
    mQCHAR(false);
  }
  else if ((LA(1) == 0x5c /* '\\' */ )) {
    mSESCAPE(false);
  }
  else {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }

  }
  { // ( ... )*
  for (;;) {
    if ((_tokenSet_4.member(LA(1)))) {
      mQCHAR(false);
    }
    else if ((LA(1) == 0x5c /* '\\' */ )) {
      mSESCAPE(false);
    }
    else {
      goto _loop47;
    }

  }
  _loop47:;
  } // ( ... )*
  match('\'' /* charlit */ );
  _ttype = testLiteralsTable(text.substr(_begin, text.length()-_begin),_ttype);
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mQCHAR(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = QCHAR;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  switch ( LA(1)) {
  case 0xa /* '\n' */ :
  case 0xd /* '\r' */ :
  {
    {
    {
    switch ( LA(1)) {
    case 0xa /* '\n' */ :
    {
      match('\n' /* charlit */ );
      break;
    }
    case 0xd /* '\r' */ :
    {
      match("\r\n");
      break;
    }
    default:
    {
      throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    }
#line 181 "modelica_lexer.g"
    newline();
#line 1236 "modelica_lexer.cpp"
    break;
  }
  case 0x9 /* '\t' */ :
  {
    match('\t' /* charlit */ );
    break;
  }
  default:
    if ((_tokenSet_5.member(LA(1)))) {
      {
      match(_tokenSet_5);
      }
    }
  else {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSESCAPE(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = SESCAPE;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('\\' /* charlit */ );
  {
  switch ( LA(1)) {
  case 0x5c /* '\\' */ :
  {
    match('\\' /* charlit */ );
    break;
  }
  case 0x22 /* '\"' */ :
  {
    match('\"' /* charlit */ );
    break;
  }
  case 0x27 /* '\'' */ :
  {
    match("\'");
    break;
  }
  case 0x3f /* '?' */ :
  {
    match('?' /* charlit */ );
    break;
  }
  case 0x61 /* 'a' */ :
  {
    match('a' /* charlit */ );
    break;
  }
  case 0x62 /* 'b' */ :
  {
    match('b' /* charlit */ );
    break;
  }
  case 0x66 /* 'f' */ :
  {
    match('f' /* charlit */ );
    break;
  }
  case 0x6e /* 'n' */ :
  {
    match('n' /* charlit */ );
    break;
  }
  case 0x72 /* 'r' */ :
  {
    match('r' /* charlit */ );
    break;
  }
  case 0x74 /* 't' */ :
  {
    match('t' /* charlit */ );
    break;
  }
  case 0x76 /* 'v' */ :
  {
    match('v' /* charlit */ );
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  }
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mEXPONENT(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = EXPONENT;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  {
  switch ( LA(1)) {
  case 0x65 /* 'e' */ :
  {
    match('e' /* charlit */ );
    break;
  }
  case 0x45 /* 'E' */ :
  {
    match('E' /* charlit */ );
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  }
  {
  switch ( LA(1)) {
  case 0x2b /* '+' */ :
  {
    match('+' /* charlit */ );
    break;
  }
  case 0x2d /* '-' */ :
  {
    match('-' /* charlit */ );
    break;
  }
  case 0x30 /* '0' */ :
  case 0x31 /* '1' */ :
  case 0x32 /* '2' */ :
  case 0x33 /* '3' */ :
  case 0x34 /* '4' */ :
  case 0x35 /* '5' */ :
  case 0x36 /* '6' */ :
  case 0x37 /* '7' */ :
  case 0x38 /* '8' */ :
  case 0x39 /* '9' */ :
  {
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  }
  { // ( ... )+
  int _cnt55=0;
  for (;;) {
    if (((LA(1) >= 0x30 /* '0' */  && LA(1) <= 0x39 /* '9' */ ))) {
      mDIGIT(false);
    }
    else {
      if ( _cnt55>=1 ) { goto _loop55; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
    }

    _cnt55++;
  }
  _loop55:;
  }  // ( ... )+
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mUNSIGNED_INTEGER(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = UNSIGNED_INTEGER;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  if ((LA(1) == 0x2e /* '.' */ ) && ((LA(2) >= 0x30 /* '0' */  && LA(2) <= 0x39 /* '9' */ ))) {
    {
    match('.' /* charlit */ );
    { // ( ... )+
    int _cnt65=0;
    for (;;) {
      if (((LA(1) >= 0x30 /* '0' */  && LA(1) <= 0x39 /* '9' */ ))) {
        mDIGIT(false);
      }
      else {
        if ( _cnt65>=1 ) { goto _loop65; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
      }

      _cnt65++;
    }
    _loop65:;
    }  // ( ... )+
#line 168 "modelica_lexer.g"
    _ttype = UNSIGNED_REAL;
#line 1439 "modelica_lexer.cpp"
    }
    {
    if ((LA(1) == 0x45 /* 'E' */  || LA(1) == 0x65 /* 'e' */ )) {
      mEXPONENT(false);
#line 168 "modelica_lexer.g"
      _ttype = UNSIGNED_REAL;
#line 1446 "modelica_lexer.cpp"
    }
    else {
    }

    }
  }
  else if (((LA(1) >= 0x30 /* '0' */  && LA(1) <= 0x39 /* '9' */ ))) {
    { // ( ... )+
    int _cnt58=0;
    for (;;) {
      if (((LA(1) >= 0x30 /* '0' */  && LA(1) <= 0x39 /* '9' */ ))) {
        mDIGIT(false);
      }
      else {
        if ( _cnt58>=1 ) { goto _loop58; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
      }

      _cnt58++;
    }
    _loop58:;
    }  // ( ... )+
    {
    if ((LA(1) == 0x2e /* '.' */ )) {
      match('.' /* charlit */ );
      { // ( ... )*
      for (;;) {
        if (((LA(1) >= 0x30 /* '0' */  && LA(1) <= 0x39 /* '9' */ ))) {
          mDIGIT(false);
        }
        else {
          goto _loop61;
        }

      }
      _loop61:;
      } // ( ... )*
#line 166 "modelica_lexer.g"
      _ttype = UNSIGNED_REAL;
#line 1485 "modelica_lexer.cpp"
    }
    else {
    }

    }
    {
    if ((LA(1) == 0x45 /* 'E' */  || LA(1) == 0x65 /* 'e' */ )) {
      mEXPONENT(false);
#line 167 "modelica_lexer.g"
      _ttype = UNSIGNED_REAL;
#line 1496 "modelica_lexer.cpp"
    }
    else {
    }

    }
  }
  else if ((LA(1) == 0x2e /* '.' */ ) && (true)) {
    match('.' /* charlit */ );
#line 169 "modelica_lexer.g"
    _ttype = DOT;
#line 1507 "modelica_lexer.cpp"
  }
  else {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }

  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSTRING(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = STRING;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  _saveIndex = text.length();
  match('\"' /* charlit */ );
  text.erase(_saveIndex);
  { // ( ... )*
  for (;;) {
    if ((_tokenSet_6.member(LA(1)))) {
      mSCHAR(false);
    }
    else if ((LA(1) == 0x5c /* '\\' */ )) {
      mSESCAPE(false);
    }
    else {
      goto _loop69;
    }

  }
  _loop69:;
  } // ( ... )*
  _saveIndex = text.length();
  match('\"' /* charlit */ );
  text.erase(_saveIndex);
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mSCHAR(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = SCHAR;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  switch ( LA(1)) {
  case 0xa /* '\n' */ :
  case 0xd /* '\r' */ :
  {
    {
    {
    switch ( LA(1)) {
    case 0xa /* '\n' */ :
    {
      match('\n' /* charlit */ );
      break;
    }
    case 0xd /* '\r' */ :
    {
      match("\r\n");
      break;
    }
    default:
    {
      throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    }
#line 176 "modelica_lexer.g"
    newline();
#line 1586 "modelica_lexer.cpp"
    break;
  }
  case 0x9 /* '\t' */ :
  {
    match('\t' /* charlit */ );
    break;
  }
  default:
    if ((_tokenSet_7.member(LA(1)))) {
      {
      match(_tokenSet_7);
      }
    }
  else {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}

void modelica_lexer::mESC(bool _createToken) {
  int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
  _ttype = ESC;
  ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;

  match('\\' /* charlit */ );
  {
  switch ( LA(1)) {
  case 0x22 /* '\"' */ :
  {
    match('\"' /* charlit */ );
    break;
  }
  case 0x5c /* '\\' */ :
  {
    match('\\' /* charlit */ );
    break;
  }
  default:
  {
    throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
  }
  }
  }
  if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
     _token = makeToken(_ttype);
     _token->setText(text.substr(_begin, text.length()-_begin));
  }
  _returnToken = _token;
  _saveIndex=0;
}


const unsigned long modelica_lexer::_tokenSet_0_data_[] = { 0UL, 67059712UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// . 0 1 2 3 4 5 6 7 8 9
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_0(_tokenSet_0_data_,10);
const unsigned long modelica_lexer::_tokenSet_1_data_[] = { 4294967288UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13
// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! \" #
// $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
// G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g
// h i j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_1(_tokenSet_1_data_,16);
const unsigned long modelica_lexer::_tokenSet_2_data_[] = { 4294958072UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! \" # $ %
// & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H
// I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h i
// j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_2(_tokenSet_2_data_,16);
const unsigned long modelica_lexer::_tokenSet_3_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! \" # $ %
// & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
// H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h
// i j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_3(_tokenSet_3_data_,16);
const unsigned long modelica_lexer::_tokenSet_4_data_[] = { 4294967288UL, 4294967167UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13
// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! \" #
// $ % & ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
// G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i
// j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_4(_tokenSet_4_data_,16);
const unsigned long modelica_lexer::_tokenSet_5_data_[] = { 4294957560UL, 4294967167UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14 0x15
// 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! \" # $ % & ( )
// * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K
// L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_5(_tokenSet_5_data_,16);
const unsigned long modelica_lexer::_tokenSet_6_data_[] = { 4294967288UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13
// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! # $
// % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
// G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i
// j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_6(_tokenSet_6_data_,16);
const unsigned long modelica_lexer::_tokenSet_7_data_[] = { 4294957560UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
// 0x3 0x4 0x5 0x6 0x7 0x8 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14 0x15
// 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! # $ % & \' ( )
// * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K
// L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j
const ANTLR_USE_NAMESPACE(antlr)BitSet modelica_lexer::_tokenSet_7(_tokenSet_7_data_,16);

