diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/ada | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/ada')
61 files changed, 41623 insertions, 0 deletions
diff --git a/languages/ada/AdaAST.hpp b/languages/ada/AdaAST.hpp new file mode 100644 index 00000000..1bb2bd07 --- /dev/null +++ b/languages/ada/AdaAST.hpp @@ -0,0 +1,77 @@ +#ifndef ADAAST_HPP +#define ADAAST_HPP + +#include <antlr/CommonAST.hpp> + +class AdaAST; +typedef antlr::ASTRefCount<AdaAST> RefAdaAST; + +class AdaAST : public antlr::CommonAST { +public: + AdaAST() : m_line (0), m_column (0) {} + + ~AdaAST() {} + + int getLine () const { return m_line; } + void setLine (int line) { m_line = line; } + + int getColumn () const { return m_column; } + void setColumn (int column) { m_column = column; } + + void initialize (antlr::RefToken t) { + antlr::CommonAST::initialize (t); + m_line = t->getLine () - 1; + m_column = t->getColumn () - 1; + } + + void initialize (int t, const std::string& txt) { + setType (t); + setText (txt); + m_line = 0; + m_column = 0; + } + + RefAdaAST duplicate (void) const { + AdaAST *ast = new AdaAST (*this); + return RefAdaAST (ast); + } + + void set (int t, const std::string& txt) { + setType (t); + setText (txt); + } + + void addChild (RefAdaAST c) { + antlr::RefAST n( c.get() ); + antlr::BaseAST::addChild (n); + } + + RefAdaAST down () const { + return RefAdaAST (antlr::BaseAST::getFirstChild ()); + } + + RefAdaAST right () const { + return RefAdaAST (antlr::BaseAST::getNextSibling ()); + } + + /* bool equals(RefAdaAST t) const { + return ((antlr::BaseAST*)this)->equals (t); + } */ + + static antlr::RefAST factory (void) { + RefAdaAST n( new AdaAST ); + return n.get(); + } + + static const RefAdaAST nullAdaAST; + +private: + int m_line; + int m_column; +}; + +#define Set(n, t) (n)->set(t, #t) +// for Java compatibility: +#define boolean bool + +#endif diff --git a/languages/ada/AdaLexer.cpp b/languages/ada/AdaLexer.cpp new file mode 100644 index 00000000..2ac19416 --- /dev/null +++ b/languages/ada/AdaLexer.cpp @@ -0,0 +1,1507 @@ +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaLexer.cpp"$ */ +#include "AdaLexer.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 1531 "ada.g" + +#include "preambles.h" + +#line 16 "AdaLexer.cpp" +AdaLexer::AdaLexer(ANTLR_USE_NAMESPACE(std)istream& in) + : ANTLR_USE_NAMESPACE(antlr)CharScanner(new ANTLR_USE_NAMESPACE(antlr)CharBuffer(in),false) +{ + initLiterals(); +} + +AdaLexer::AdaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib) + : ANTLR_USE_NAMESPACE(antlr)CharScanner(ib,false) +{ + initLiterals(); +} + +AdaLexer::AdaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state) + : ANTLR_USE_NAMESPACE(antlr)CharScanner(state,false) +{ + initLiterals(); +} + +void AdaLexer::initLiterals() +{ + literals["until"] = 78; + literals["xor"] = 86; + literals["abstract"] = 40; + literals["reverse"] = 71; + literals["use"] = 13; + literals["requeue"] = 84; + literals["with"] = 11; + literals["task"] = 42; + literals["at"] = 49; + literals["for"] = 47; + literals["else"] = 68; + literals["is"] = 23; + literals["of"] = 55; + literals["range"] = 16; + literals["and"] = 85; + literals["begin"] = 62; + literals["procedure"] = 24; + literals["separate"] = 39; + literals["private"] = 20; + literals["pragma"] = 4; + literals["delay"] = 77; + literals["abort"] = 80; + literals["function"] = 25; + literals["digits"] = 17; + literals["declare"] = 72; + literals["raise"] = 83; + literals["not"] = 87; + literals["record"] = 38; + literals["all"] = 30; + literals["in"] = 32; + literals["generic"] = 61; + literals["terminate"] = 82; + literals["subtype"] = 51; + literals["delta"] = 18; + literals["when"] = 58; + literals["null"] = 37; + literals["entry"] = 46; + literals["elsif"] = 67; + literals["case"] = 57; + literals["others"] = 27; + literals["do"] = 76; + literals["abs"] = 100; + literals["constant"] = 53; + literals["renames"] = 34; + literals["then"] = 66; + literals["exception"] = 52; + literals["protected"] = 43; + literals["accept"] = 75; + literals["or"] = 81; + literals["if"] = 65; + literals["aliased"] = 56; + literals["loop"] = 69; + literals["return"] = 41; + literals["limited"] = 60; + literals["new"] = 26; + literals["array"] = 54; + literals["rem"] = 99; + literals["end"] = 48; + literals["body"] = 22; + literals["mod"] = 50; + literals["goto"] = 74; + literals["tagged"] = 59; + literals["select"] = 79; + literals["while"] = 70; + literals["package"] = 21; + literals["type"] = 14; + literals["access"] = 19; + literals["out"] = 33; + literals["exit"] = 73; +} + +ANTLR_USE_NAMESPACE(antlr)RefToken AdaLexer::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 0x7c /* '|' */ : + { + mPIPE(true); + theRetToken=_returnToken; + break; + } + case 0x26 /* '&' */ : + { + mCONCAT(true); + theRetToken=_returnToken; + break; + } + case 0x2b /* '+' */ : + { + mPLUS(true); + theRetToken=_returnToken; + break; + } + case 0x28 /* '(' */ : + { + mLPAREN(true); + theRetToken=_returnToken; + break; + } + case 0x29 /* ')' */ : + { + mRPAREN(true); + theRetToken=_returnToken; + break; + } + case 0x2c /* ',' */ : + { + mCOMMA(true); + theRetToken=_returnToken; + break; + } + case 0x3b /* ';' */ : + { + mSEMI(true); + theRetToken=_returnToken; + 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' */ : + { + mIDENTIFIER(true); + theRetToken=_returnToken; + break; + } + case 0x27 /* '\'' */ : + { + mTIC_OR_CHARACTER_LITERAL(true); + theRetToken=_returnToken; + break; + } + case 0x22 /* '\"' */ : + { + mCHAR_STRING(true); + theRetToken=_returnToken; + 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' */ : + { + mNUMERIC_LIT(true); + theRetToken=_returnToken; + break; + } + case 0x9 /* '\t' */ : + case 0xa /* '\n' */ : + case 0xc /* '\14' */ : + case 0xd /* '\r' */ : + case 0x20 /* ' ' */ : + { + mWS_(true); + theRetToken=_returnToken; + break; + } + default: + if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ ) && ((LA(3) >= 0x3 /* '\3' */ && LA(3) <= 0xff))) { + mCOMMENT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ ) && (true)) { + mCOMMENT_INTRO(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2e /* '.' */ )) { + mDOT_DOT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3c /* '<' */ )) { + mLT_LT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3e /* '>' */ )) { + mOX(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ )) { + mGT_GT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3e /* '>' */ )) { + mRIGHT_SHAFT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mNE(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mLE(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mGE(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2a /* '*' */ ) && (LA(2) == 0x2a /* '*' */ )) { + mEXPON(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2e /* '.' */ ) && (true)) { + mDOT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3d /* '=' */ ) && (true)) { + mEQ(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (true)) { + mLT_(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3e /* '>' */ ) && (true)) { + mGT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2d /* '-' */ ) && (true)) { + mMINUS(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2a /* '*' */ ) && (true)) { + mSTAR(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2f /* '/' */ ) && (true)) { + mDIV(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3a /* ':' */ ) && (true)) { + mCOLON(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 AdaLexer::mCOMMENT_INTRO(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = COMMENT_INTRO; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("--"); +#line 1888 "ada.g" + lastTokenWasTicCompatible=false; +#line 345 "AdaLexer.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 AdaLexer::mDOT_DOT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DOT_DOT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(".."); +#line 1889 "ada.g" + lastTokenWasTicCompatible=false; +#line 362 "AdaLexer.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 AdaLexer::mLT_LT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LT_LT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("<<"); +#line 1890 "ada.g" + lastTokenWasTicCompatible=false; +#line 379 "AdaLexer.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 AdaLexer::mOX(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = OX; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("<>"); +#line 1891 "ada.g" + lastTokenWasTicCompatible=false; +#line 396 "AdaLexer.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 AdaLexer::mGT_GT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = GT_GT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(">>"); +#line 1892 "ada.g" + lastTokenWasTicCompatible=false; +#line 413 "AdaLexer.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 AdaLexer::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(":="); +#line 1893 "ada.g" + lastTokenWasTicCompatible=false; +#line 430 "AdaLexer.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 AdaLexer::mRIGHT_SHAFT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = RIGHT_SHAFT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("=>"); +#line 1894 "ada.g" + lastTokenWasTicCompatible=false; +#line 447 "AdaLexer.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 AdaLexer::mNE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = NE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("/="); +#line 1895 "ada.g" + lastTokenWasTicCompatible=false; +#line 464 "AdaLexer.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 AdaLexer::mLE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("<="); +#line 1896 "ada.g" + lastTokenWasTicCompatible=false; +#line 481 "AdaLexer.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 AdaLexer::mGE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = GE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(">="); +#line 1897 "ada.g" + lastTokenWasTicCompatible=false; +#line 498 "AdaLexer.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 AdaLexer::mEXPON(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EXPON; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("**"); +#line 1898 "ada.g" + lastTokenWasTicCompatible=false; +#line 515 "AdaLexer.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 AdaLexer::mPIPE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = PIPE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('|' /* charlit */ ); +#line 1899 "ada.g" + lastTokenWasTicCompatible=false; +#line 532 "AdaLexer.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 AdaLexer::mCONCAT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = CONCAT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('&' /* charlit */ ); +#line 1900 "ada.g" + lastTokenWasTicCompatible=false; +#line 549 "AdaLexer.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 AdaLexer::mDOT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DOT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('.' /* charlit */ ); +#line 1901 "ada.g" + lastTokenWasTicCompatible=false; +#line 566 "AdaLexer.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 AdaLexer::mEQ(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EQ; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('=' /* charlit */ ); +#line 1902 "ada.g" + lastTokenWasTicCompatible=false; +#line 583 "AdaLexer.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 AdaLexer::mLT_(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LT_; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('<' /* charlit */ ); +#line 1903 "ada.g" + lastTokenWasTicCompatible=false; +#line 600 "AdaLexer.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 AdaLexer::mGT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = GT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('>' /* charlit */ ); +#line 1904 "ada.g" + lastTokenWasTicCompatible=false; +#line 617 "AdaLexer.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 AdaLexer::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 */ ); +#line 1905 "ada.g" + lastTokenWasTicCompatible=false; +#line 634 "AdaLexer.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 AdaLexer::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 */ ); +#line 1906 "ada.g" + lastTokenWasTicCompatible=false; +#line 651 "AdaLexer.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 AdaLexer::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 */ ); +#line 1907 "ada.g" + lastTokenWasTicCompatible=false; +#line 668 "AdaLexer.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 AdaLexer::mDIV(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DIV; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('/' /* charlit */ ); +#line 1908 "ada.g" + lastTokenWasTicCompatible=false; +#line 685 "AdaLexer.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 AdaLexer::mLPAREN(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LPAREN; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('(' /* charlit */ ); +#line 1909 "ada.g" + lastTokenWasTicCompatible=false; +#line 702 "AdaLexer.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 AdaLexer::mRPAREN(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = RPAREN; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(')' /* charlit */ ); +#line 1910 "ada.g" + lastTokenWasTicCompatible=true; +#line 719 "AdaLexer.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 AdaLexer::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 */ ); +#line 1911 "ada.g" + lastTokenWasTicCompatible=false; +#line 736 "AdaLexer.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 AdaLexer::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 */ ); +#line 1912 "ada.g" + lastTokenWasTicCompatible=false; +#line 753 "AdaLexer.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 AdaLexer::mSEMI(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = SEMI; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(';' /* charlit */ ); +#line 1913 "ada.g" + lastTokenWasTicCompatible=false; +#line 770 "AdaLexer.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 AdaLexer::mIDENTIFIER(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = IDENTIFIER; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + matchRange('a','z'); + } + { // ( ... )* + for (;;) { + if ((_tokenSet_0.member(LA(1)))) { + { + switch ( LA(1)) { + case 0x5f /* '_' */ : + { + 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' */ : + 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' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + switch ( LA(1)) { + 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 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' */ : + { + matchRange('0','9'); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else { + goto _loop512; + } + + } + _loop512:; + } // ( ... )* + _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 AdaLexer::mTIC_OR_CHARACTER_LITERAL(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = TIC_OR_CHARACTER_LITERAL; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + _saveIndex = text.length(); + match("\'"); + text.erase(_saveIndex); +#line 1927 "ada.g" + _ttype = TIC; +#line 921 "AdaLexer.cpp" + { + if ((((LA(1) >= 0x3 /* '\3' */ && LA(1) <= 0xff)))&&( ! lastTokenWasTicCompatible )) { + matchNot(EOF/*_CHAR*/); + _saveIndex = text.length(); + match("\'"); + text.erase(_saveIndex); +#line 1929 "ada.g" + _ttype = CHARACTER_LITERAL; +#line 930 "AdaLexer.cpp" + } + else { + } + + } +#line 1931 "ada.g" + lastTokenWasTicCompatible=false; +#line 938 "AdaLexer.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 AdaLexer::mCHAR_STRING(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = CHAR_STRING; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + _saveIndex = text.length(); + match('\"' /* charlit */ ); + text.erase(_saveIndex); + { // ( ... )* + for (;;) { + if ((LA(1) == 0x22 /* '\"' */ ) && (LA(2) == 0x22 /* '\"' */ )) { + match("\"\""); + } + else if ((_tokenSet_1.member(LA(1)))) { + { + match(_tokenSet_1); + } + } + else { + goto _loop518; + } + + } + _loop518:; + } // ( ... )* + _saveIndex = text.length(); + match('\"' /* charlit */ ); + text.erase(_saveIndex); +#line 1934 "ada.g" + lastTokenWasTicCompatible=true; +#line 977 "AdaLexer.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 AdaLexer::mNUMERIC_LIT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = NUMERIC_LIT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { // ( ... )+ + int _cnt521=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt521>=1 ) { goto _loop521; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt521++; + } + _loop521:; + } // ( ... )+ + { + switch ( LA(1)) { + case 0x23 /* '#' */ : + { + match('#' /* charlit */ ); + mBASED_INTEGER(false); + { + switch ( LA(1)) { + case 0x2e /* '.' */ : + { + match('.' /* charlit */ ); + mBASED_INTEGER(false); + break; + } + case 0x23 /* '#' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + match('#' /* charlit */ ); + break; + } + case 0x5f /* '_' */ : + { + { // ( ... )+ + int _cnt527=0; + for (;;) { + if ((LA(1) == 0x5f /* '_' */ )) { + match('_' /* charlit */ ); + { // ( ... )+ + int _cnt526=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt526>=1 ) { goto _loop526; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt526++; + } + _loop526:; + } // ( ... )+ + } + else { + if ( _cnt527>=1 ) { goto _loop527; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt527++; + } + _loop527:; + } // ( ... )+ + break; + } + default: + { + } + } + } + { + if (((LA(1) == 0x2e /* '.' */ || LA(1) == 0x65 /* 'e' */ ))&&( LA(2)!='.' )) { + { + switch ( LA(1)) { + case 0x2e /* '.' */ : + { + match('.' /* charlit */ ); + { // ( ... )+ + int _cnt531=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt531>=1 ) { goto _loop531; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt531++; + } + _loop531:; + } // ( ... )+ + { // ( ... )* + for (;;) { + if ((LA(1) == 0x5f /* '_' */ )) { + match('_' /* charlit */ ); + { // ( ... )+ + int _cnt534=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt534>=1 ) { goto _loop534; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt534++; + } + _loop534:; + } // ( ... )+ + } + else { + goto _loop535; + } + + } + _loop535:; + } // ( ... )* + { + if ((LA(1) == 0x65 /* 'e' */ )) { + mEXPONENT(false); + } + else { + } + + } + break; + } + case 0x65 /* 'e' */ : + { + mEXPONENT(false); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else { + } + + } +#line 1945 "ada.g" + lastTokenWasTicCompatible=false; +#line 1144 "AdaLexer.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 AdaLexer::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'); + } +#line 1950 "ada.g" + lastTokenWasTicCompatible=false; +#line 1163 "AdaLexer.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 AdaLexer::mBASED_INTEGER(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = BASED_INTEGER; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + mEXTENDED_DIGIT(false); + } + { // ( ... )* + for (;;) { + if ((_tokenSet_2.member(LA(1)))) { + { + switch ( LA(1)) { + case 0x5f /* '_' */ : + { + 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' */ : + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + mEXTENDED_DIGIT(false); + } + else { + goto _loop550; + } + + } + _loop550:; + } // ( ... )* +#line 1959 "ada.g" + lastTokenWasTicCompatible=false; +#line 1226 "AdaLexer.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 AdaLexer::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; + + { + match('e' /* charlit */ ); + } + { + 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 _cnt543=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt543>=1 ) { goto _loop543; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt543++; + } + _loop543:; + } // ( ... )+ +#line 1953 "ada.g" + lastTokenWasTicCompatible=false; +#line 1290 "AdaLexer.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 AdaLexer::mEXTENDED_DIGIT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EXTENDED_DIGIT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + switch ( LA(1)) { + 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; + } + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + { + matchRange('a','f'); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } +#line 1956 "ada.g" + lastTokenWasTicCompatible=false; +#line 1338 "AdaLexer.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 AdaLexer::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 0xc /* '\14' */ : + { + match('\14' /* 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 1971 "ada.g" + newline(); +#line 1389 "AdaLexer.cpp" + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } +#line 1973 "ada.g" + _ttype = antlr::Token::SKIP; +#line 1400 "AdaLexer.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 AdaLexer::mCOMMENT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = COMMENT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + mCOMMENT_INTRO(false); + { // ( ... )* + for (;;) { + if ((_tokenSet_3.member(LA(1)))) { + { + match(_tokenSet_3); + } + } + else { + goto _loop557; + } + + } + _loop557:; + } // ( ... )* + { + switch ( LA(1)) { + case 0xa /* '\n' */ : + { + match('\n' /* charlit */ ); + break; + } + case 0xd /* '\r' */ : + { + match('\r' /* charlit */ ); + { + if ((LA(1) == 0xa /* '\n' */ )) { + match('\n' /* charlit */ ); + } + else { + } + + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } +#line 1978 "ada.g" + _ttype = antlr::Token::SKIP; + newline(); + lastTokenWasTicCompatible=false; +#line 1459 "AdaLexer.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; +} + + +const unsigned long AdaLexer::_tokenSet_0_data_[] = { 0UL, 67043328UL, 2147483648UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// 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 +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_0(_tokenSet_0_data_,10); +const unsigned long AdaLexer::_tokenSet_1_data_[] = { 4294967288UL, 4294967291UL, 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 k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 +// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 +// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f +// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad +// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb +// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9 +// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 +// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 +// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 +// 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_1(_tokenSet_1_data_,16); +const unsigned long AdaLexer::_tokenSet_2_data_[] = { 0UL, 67043328UL, 2147483648UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// 0 1 2 3 4 5 6 7 8 9 _ a b c d e f +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_2(_tokenSet_2_data_,10); +const unsigned long AdaLexer::_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 k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 +// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 +// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f +// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad +// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb +// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9 +// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 +// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 +// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 +// 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_3(_tokenSet_3_data_,16); + diff --git a/languages/ada/AdaLexer.hpp b/languages/ada/AdaLexer.hpp new file mode 100644 index 00000000..795c7bba --- /dev/null +++ b/languages/ada/AdaLexer.hpp @@ -0,0 +1,86 @@ +#ifndef INC_AdaLexer_hpp_ +#define INC_AdaLexer_hpp_ + +#line 29 "ada.g" + +#include <antlr/SemanticException.hpp> // antlr wants this +#include "AdaAST.hpp" +#include "preambles.h" + +#line 11 "AdaLexer.hpp" +#include <antlr/config.hpp> +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaLexer.hpp"$ */ +#include <antlr/CommonToken.hpp> +#include <antlr/InputBuffer.hpp> +#include <antlr/BitSet.hpp> +#include "AdaTokenTypes.hpp" +#include <antlr/CharScanner.hpp> +class CUSTOM_API AdaLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public AdaTokenTypes +{ +#line 1879 "ada.g" + + ANTLR_LEXER_PREAMBLE + private: + bool lastTokenWasTicCompatible; +#line 22 "AdaLexer.hpp" +private: + void initLiterals(); +public: + bool getCaseSensitiveLiterals() const + { + return false; + } +public: + AdaLexer(ANTLR_USE_NAMESPACE(std)istream& in); + AdaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib); + AdaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state); + ANTLR_USE_NAMESPACE(antlr)RefToken nextToken(); + public: void mCOMMENT_INTRO(bool _createToken); + public: void mDOT_DOT(bool _createToken); + public: void mLT_LT(bool _createToken); + public: void mOX(bool _createToken); + public: void mGT_GT(bool _createToken); + public: void mASSIGN(bool _createToken); + public: void mRIGHT_SHAFT(bool _createToken); + public: void mNE(bool _createToken); + public: void mLE(bool _createToken); + public: void mGE(bool _createToken); + public: void mEXPON(bool _createToken); + public: void mPIPE(bool _createToken); + public: void mCONCAT(bool _createToken); + public: void mDOT(bool _createToken); + public: void mEQ(bool _createToken); + public: void mLT_(bool _createToken); + public: void mGT(bool _createToken); + public: void mPLUS(bool _createToken); + public: void mMINUS(bool _createToken); + public: void mSTAR(bool _createToken); + public: void mDIV(bool _createToken); + public: void mLPAREN(bool _createToken); + public: void mRPAREN(bool _createToken); + public: void mCOLON(bool _createToken); + public: void mCOMMA(bool _createToken); + public: void mSEMI(bool _createToken); + public: void mIDENTIFIER(bool _createToken); + public: void mTIC_OR_CHARACTER_LITERAL(bool _createToken); + public: void mCHAR_STRING(bool _createToken); + public: void mNUMERIC_LIT(bool _createToken); + protected: void mDIGIT(bool _createToken); + protected: void mBASED_INTEGER(bool _createToken); + protected: void mEXPONENT(bool _createToken); + protected: void mEXTENDED_DIGIT(bool _createToken); + public: void mWS_(bool _createToken); + public: void mCOMMENT(bool _createToken); +private: + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; +}; + +#endif /*INC_AdaLexer_hpp_*/ diff --git a/languages/ada/AdaParser.cpp b/languages/ada/AdaParser.cpp new file mode 100644 index 00000000..e783595e --- /dev/null +++ b/languages/ada/AdaParser.cpp @@ -0,0 +1,12283 @@ +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaParser.cpp"$ */ +#include "AdaParser.hpp" +#include <antlr/NoViableAltException.hpp> +#include <antlr/SemanticException.hpp> +#include <antlr/ASTFactory.hpp> +#line 1 "ada.g" +#line 8 "AdaParser.cpp" +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,k) +{ +} + +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,2) +{ +} + +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,k) +{ +} + +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,2) +{ +} + +AdaParser::AdaParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(state,2) +{ +} + +void AdaParser::compilation_unit() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST compilation_unit_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + context_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PRIVATE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case GENERIC: + { + library_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEPARATE: + { + subunit(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop4; + } + + } + _loop4:; + } // ( ... )* + compilation_unit_AST = RefAdaAST(currentAST.root); + returnAST = compilation_unit_AST; +} + +void AdaParser::context_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST context_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case WITH: + { + with_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case USE: + { + use_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop14; + } + } + } + _loop14:; + } // ( ... )* + if ( inputState->guessing==0 ) { + context_items_opt_AST = RefAdaAST(currentAST.root); +#line 86 "ada.g" + context_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CONTEXT_CLAUSE,"CONTEXT_CLAUSE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(context_items_opt_AST)))); +#line 135 "AdaParser.cpp" + currentAST.root = context_items_opt_AST; + if ( context_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + context_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = context_items_opt_AST->getFirstChild(); + else + currentAST.child = context_items_opt_AST; + currentAST.advanceChildToEnd(); + } + context_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = context_items_opt_AST; +} + +void AdaParser::library_item() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST library_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + private_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PACKAGE: + { + lib_pkg_spec_or_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl_or_rename_or_inst_or_body(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GENERIC: + { + generic_decl(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + library_item_AST = RefAdaAST(currentAST.root); +#line 133 "ada.g" + library_item_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(LIBRARY_ITEM,"LIBRARY_ITEM")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(library_item_AST)))); +#line 194 "AdaParser.cpp" + currentAST.root = library_item_AST; + if ( library_item_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + library_item_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = library_item_AST->getFirstChild(); + else + currentAST.child = library_item_AST; + currentAST.advanceChildToEnd(); + } + library_item_AST = RefAdaAST(currentAST.root); + returnAST = library_item_AST; +} + +void AdaParser::subunit() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subunit_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken sep = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST sep_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + sep = LT(1); + if ( inputState->guessing == 0 ) { + sep_AST = astFactory->create(sep); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(sep_AST)); + } + match(SEPARATE); + match(LPAREN); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 1497 "ada.g" + Set(sep_AST, SUBUNIT); +#line 229 "AdaParser.cpp" + } + { + switch ( LA(1)) { + case PROCEDURE: + case FUNCTION: + { + subprogram_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PACKAGE: + { + package_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case TASK: + { + task_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PROTECTED: + { + protected_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subunit_AST = RefAdaAST(currentAST.root); + returnAST = subunit_AST; +} + +void AdaParser::pragma() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pragma_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp3_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp3_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp3_AST)); + } + match(PRAGMA); + RefAdaAST tmp4_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp4_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp4_AST)); + } + match(IDENTIFIER); + pragma_args_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + pragma_AST = RefAdaAST(currentAST.root); + returnAST = pragma_AST; +} + +void AdaParser::pragma_args_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pragma_args_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + pragma_arg(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + pragma_arg(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop9; + } + + } + _loop9:; + } // ( ... )* + match(RPAREN); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + pragma_args_opt_AST = RefAdaAST(currentAST.root); + returnAST = pragma_args_opt_AST; +} + +void AdaParser::pragma_arg() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pragma_arg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + if ((LA(1) == IDENTIFIER) && (LA(2) == RIGHT_SHAFT)) { + RefAdaAST tmp9_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp9_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST)); + } + match(IDENTIFIER); + RefAdaAST tmp10_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp10_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp10_AST)); + } + match(RIGHT_SHAFT); + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pragma_arg_AST = RefAdaAST(currentAST.root); + returnAST = pragma_arg_AST; +} + +void AdaParser::expression() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST expression_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken o = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST o_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case AND: + { + a = LT(1); + if ( inputState->guessing == 0 ) { + a_AST = astFactory->create(a); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST)); + } + match(AND); + { + switch ( LA(1)) { + case THEN: + { + match(THEN); + if ( inputState->guessing==0 ) { +#line 1417 "ada.g" + Set (a_AST, AND_THEN); +#line 416 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case OR: + { + o = LT(1); + if ( inputState->guessing == 0 ) { + o_AST = astFactory->create(o); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(o_AST)); + } + match(OR); + { + switch ( LA(1)) { + case ELSE: + { + match(ELSE); + if ( inputState->guessing==0 ) { +#line 1418 "ada.g" + Set (o_AST, OR_ELSE); +#line 462 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case XOR: + { + RefAdaAST tmp13_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp13_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp13_AST)); + } + match(XOR); + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop450; + } + } + } + _loop450:; + } // ( ... )* + expression_AST = RefAdaAST(currentAST.root); + returnAST = expression_AST; +} + +void AdaParser::with_clause() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST with_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WITH); + c_name_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 94 "ada.g" + Set(w_AST, WITH_CLAUSE); +#line 539 "AdaParser.cpp" + } + with_clause_AST = RefAdaAST(currentAST.root); + returnAST = with_clause_AST; +} + +void AdaParser::use_clause() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST use_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken u = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST u_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + u = LT(1); + if ( inputState->guessing == 0 ) { + u_AST = astFactory->create(u); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(u_AST)); + } + match(USE); + { + switch ( LA(1)) { + case TYPE: + { + match(TYPE); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop25; + } + + } + _loop25:; + } // ( ... )* + if ( inputState->guessing==0 ) { +#line 108 "ada.g" + Set(u_AST, USE_TYPE_CLAUSE); +#line 586 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + c_name_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 109 "ada.g" + Set(u_AST, USE_CLAUSE); +#line 599 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + use_clause_AST = RefAdaAST(currentAST.root); + returnAST = use_clause_AST; +} + +void AdaParser::c_name_list() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST c_name_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop18; + } + + } + _loop18:; + } // ( ... )* + c_name_list_AST = RefAdaAST(currentAST.root); + returnAST = c_name_list_AST; +} + +void AdaParser::compound_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST compound_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp19_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp19_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp19_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + if ((LA(1) == DOT)) { + RefAdaAST tmp20_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp20_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST)); + } + match(DOT); + RefAdaAST tmp21_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp21_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp21_AST)); + } + match(IDENTIFIER); + } + else { + goto _loop21; + } + + } + _loop21:; + } // ( ... )* + compound_name_AST = RefAdaAST(currentAST.root); + returnAST = compound_name_AST; +} + +void AdaParser::subtype_mark() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subtype_mark_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case TIC: + { + RefAdaAST tmp22_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp22_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST)); + } + match(TIC); + attribute_id(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case LPAREN: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case USE: + case RANGE: + case DIGITS: + case DELTA: + case IS: + case PIPE: + case DOT_DOT: + case RENAMES: + case ASSIGN: + case AT: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subtype_mark_AST = RefAdaAST(currentAST.root); + returnAST = subtype_mark_AST; +} + +void AdaParser::attribute_id() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST attribute_id_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case RANGE: + { + RefAdaAST tmp23_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp23_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST)); + } + match(RANGE); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case DIGITS: + { + RefAdaAST tmp24_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp24_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST)); + } + match(DIGITS); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case DELTA: + { + RefAdaAST tmp25_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp25_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp25_AST)); + } + match(DELTA); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case ACCESS: + { + RefAdaAST tmp26_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp26_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST)); + } + match(ACCESS); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp27_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp27_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp27_AST)); + } + match(IDENTIFIER); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = attribute_id_AST; +} + +void AdaParser::private_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST private_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + RefAdaAST tmp28_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp28_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp28_AST)); + } + match(PRIVATE); + break; + } + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case GENERIC: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + private_opt_AST = RefAdaAST(currentAST.root); +#line 137 "ada.g" + private_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_opt_AST)))); +#line 843 "AdaParser.cpp" + currentAST.root = private_opt_AST; + if ( private_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + private_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = private_opt_AST->getFirstChild(); + else + currentAST.child = private_opt_AST; + currentAST.advanceChildToEnd(); + } + private_opt_AST = RefAdaAST(currentAST.root); + returnAST = private_opt_AST; +} + +void AdaParser::lib_pkg_spec_or_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST lib_pkg_spec_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + pkg = LT(1); + if ( inputState->guessing == 0 ) { + pkg_AST = astFactory->create(pkg); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST)); + } + match(PACKAGE); + { + switch ( LA(1)) { + case BODY: + { + match(BODY); + def_id(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + pkg_body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 143 "ada.g" + Set(pkg_AST, PACKAGE_BODY); +#line 887 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + def_id(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + spec_decl_part(pkg_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + lib_pkg_spec_or_body_AST = RefAdaAST(currentAST.root); + returnAST = lib_pkg_spec_or_body_AST; +} + +void AdaParser::subprog_decl_or_rename_or_inst_or_body( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 944 "ada.g" + RefAdaAST t; +#line 925 "AdaParser.cpp" + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + if ((LA(1) == IS) && (LA(2) == NEW)) { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 948 "ada.g" + Set(p_AST, GENERIC_PROCEDURE_INSTANTIATION); +#line 949 "AdaParser.cpp" + } + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) { + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 950 "ada.g" + Set(p_AST, PROCEDURE_RENAMING_DECLARATION); +#line 968 "AdaParser.cpp" + } + break; + } + case IS: + { + match(IS); + { + switch ( LA(1)) { + case SEPARATE: + case ABSTRACT: + { + separate_or_abstract(p_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 952 "ada.g" + Set(p_AST, PROCEDURE_BODY); +#line 1007 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 954 "ada.g" + pop_def_id(); + Set(p_AST, PROCEDURE_DECLARATION); +#line 1025 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 961 "ada.g" + Set(f_AST, GENERIC_FUNCTION_INSTANTIATION); +#line 1068 "AdaParser.cpp" + } + break; + } + case LPAREN: + case RETURN: + { + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 963 "ada.g" + Set(f_AST, FUNCTION_RENAMING_DECLARATION); +#line 1090 "AdaParser.cpp" + } + break; + } + case IS: + { + match(IS); + { + switch ( LA(1)) { + case SEPARATE: + case ABSTRACT: + { + separate_or_abstract(f_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 965 "ada.g" + Set(f_AST, FUNCTION_BODY); +#line 1129 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 967 "ada.g" + pop_def_id(); + Set(f_AST, FUNCTION_DECLARATION); +#line 1147 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprog_decl_or_rename_or_inst_or_body_AST; +} + +void AdaParser::generic_decl( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken g = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST g_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + g = LT(1); + if ( inputState->guessing == 0 ) { + g_AST = astFactory->create(g); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(g_AST)); + } + match(GENERIC); + generic_formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PACKAGE: + { + match(PACKAGE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 865 "ada.g" + Set(g_AST, GENERIC_PACKAGE_RENAMING); +#line 1216 "AdaParser.cpp" + } + break; + } + case IS: + { + match(IS); + pkg_spec_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 866 "ada.g" + Set(g_AST, GENERIC_PACKAGE_DECLARATION); +#line 1230 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case PROCEDURE: + { + match(PROCEDURE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 869 "ada.g" + Set(g_AST, GENERIC_PROCEDURE_RENAMING); +#line 1264 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 872 "ada.g" + Set(g_AST, GENERIC_PROCEDURE_DECLARATION); pop_def_id(); +#line 1273 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case FUNCTION: + { + match(FUNCTION); + def_designator(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 875 "ada.g" + Set(g_AST, GENERIC_FUNCTION_RENAMING); +#line 1307 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 878 "ada.g" + Set(g_AST, GENERIC_FUNCTION_DECLARATION); pop_def_id(); +#line 1316 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + generic_decl_AST = RefAdaAST(currentAST.root); + returnAST = generic_decl_AST; +} + +void AdaParser::def_id( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_id_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST cn_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if (((LA(1) == IDENTIFIER) && (_tokenSet_4.member(LA(2))))&&( lib_level )) { + compound_name(); + if (inputState->guessing==0) { + cn_AST = returnAST; + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 171 "ada.g" + push_def_id(cn_AST); +#line 1358 "AdaParser.cpp" + } + def_id_AST = RefAdaAST(currentAST.root); + } + else if (((LA(1) == IDENTIFIER) && (_tokenSet_5.member(LA(2))))&&( !lib_level )) { + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(IDENTIFIER); + if ( inputState->guessing==0 ) { +#line 172 "ada.g" + push_def_id(n_AST); +#line 1372 "AdaParser.cpp" + } + def_id_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = def_id_AST; +} + +void AdaParser::pkg_body_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pkg_body_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + declarative_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + block_body_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pkg_body_part_AST = RefAdaAST(currentAST.root); + returnAST = pkg_body_part_AST; +} + +void AdaParser::spec_decl_part( + RefAdaAST pkg +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST spec_decl_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IS: + { + match(IS); + { + switch ( LA(1)) { + case NEW: + { + generic_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 364 "ada.g" + Set(pkg, GENERIC_PACKAGE_INSTANTIATION); +#line 1427 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PRIVATE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case END: + case SUBTYPE: + case GENERIC: + { + pkg_spec_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 365 "ada.g" + Set(pkg, PACKAGE_SPECIFICATION); +#line 1453 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 367 "ada.g" + Set(pkg, PACKAGE_RENAMING_DECLARATION); +#line 1474 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + spec_decl_part_AST = RefAdaAST(currentAST.root); + returnAST = spec_decl_part_AST; +} + +void AdaParser::subprog_decl( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprog_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 148 "ada.g" + RefAdaAST t; +#line 1501 "AdaParser.cpp" + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + if ((LA(1) == IS) && (LA(2) == NEW)) { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 152 "ada.g" + Set(p_AST, GENERIC_PROCEDURE_INSTANTIATION); +#line 1525 "AdaParser.cpp" + } + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 154 "ada.g" + Set(p_AST, PROCEDURE_RENAMING_DECLARATION); +#line 1544 "AdaParser.cpp" + } + break; + } + case SEMI: + case IS: + { + is_separate_or_abstract_or_decl(p_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + subprog_decl_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 161 "ada.g" + Set(f_AST, GENERIC_FUNCTION_INSTANTIATION); +#line 1596 "AdaParser.cpp" + } + break; + } + case LPAREN: + case RETURN: + { + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 163 "ada.g" + Set(f_AST, FUNCTION_RENAMING_DECLARATION); +#line 1618 "AdaParser.cpp" + } + break; + } + case SEMI: + case IS: + { + is_separate_or_abstract_or_decl(f_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subprog_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprog_decl_AST; +} + +void AdaParser::generic_subp_inst() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_subp_inst_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(IS); + generic_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + generic_subp_inst_AST = RefAdaAST(currentAST.root); + returnAST = generic_subp_inst_AST; +} + +void AdaParser::formal_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + parameter_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == SEMI)) { + match(SEMI); + parameter_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop70; + } + + } + _loop70:; + } // ( ... )* + match(RPAREN); + break; + } + case SEMI: + case IS: + case RENAMES: + case WHEN: + case DO: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + formal_part_opt_AST = RefAdaAST(currentAST.root); +#line 235 "ada.g" + formal_part_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FORMAL_PART_OPT,"FORMAL_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(formal_part_opt_AST)))); +#line 1723 "AdaParser.cpp" + currentAST.root = formal_part_opt_AST; + if ( formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = formal_part_opt_AST->getFirstChild(); + else + currentAST.child = formal_part_opt_AST; + currentAST.advanceChildToEnd(); + } + formal_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = formal_part_opt_AST; +} + +void AdaParser::renames() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST renames_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 258 "ada.g" + RefAdaAST dummy; +#line 1742 "AdaParser.cpp" + + match(RENAMES); + { + switch ( LA(1)) { + case IDENTIFIER: + { + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case CHAR_STRING: + { + dummy=definable_operator_symbol(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 262 "ada.g" + pop_def_id(); +#line 1772 "AdaParser.cpp" + } + renames_AST = RefAdaAST(currentAST.root); + returnAST = renames_AST; +} + +void AdaParser::is_separate_or_abstract_or_decl( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST is_separate_or_abstract_or_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IS: + { + match(IS); + separate_or_abstract(t); + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 305 "ada.g" + pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_DECLARATION); + else + Set(t, FUNCTION_DECLARATION); + +#line 1802 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = is_separate_or_abstract_or_decl_AST; +} + +void AdaParser::def_designator( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_designator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 330 "ada.g" + RefAdaAST d; +#line 1823 "AdaParser.cpp" + + if (((LA(1) == IDENTIFIER) && (_tokenSet_7.member(LA(2))))&&( lib_level )) { + compound_name(); + if (inputState->guessing==0) { + n_AST = returnAST; + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 332 "ada.g" + push_def_id(n_AST); +#line 1834 "AdaParser.cpp" + } + def_designator_AST = RefAdaAST(currentAST.root); + } + else if (((LA(1) == IDENTIFIER || LA(1) == CHAR_STRING) && (LA(2) == LPAREN || LA(2) == IS || LA(2) == RETURN))&&( !lib_level )) { + d=designator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 333 "ada.g" + push_def_id(d); +#line 1846 "AdaParser.cpp" + } + def_designator_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = def_designator_AST; +} + +void AdaParser::function_tail() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST function_tail_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + func_formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RETURN); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail_AST = RefAdaAST(currentAST.root); + returnAST = function_tail_AST; +} + +void AdaParser::generic_inst() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_inst_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(NEW); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 179 "ada.g" + pop_def_id(); +#line 1910 "AdaParser.cpp" + } + generic_inst_AST = RefAdaAST(currentAST.root); + returnAST = generic_inst_AST; +} + +void AdaParser::value_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST value_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop445; + } + + } + _loop445:; + } // ( ... )* + if ( inputState->guessing==0 ) { + value_s_AST = RefAdaAST(currentAST.root); +#line 1405 "ada.g" + value_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VALUES,"VALUES")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(value_s_AST)))); +#line 1945 "AdaParser.cpp" + currentAST.root = value_s_AST; + if ( value_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + value_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = value_s_AST->getFirstChild(); + else + currentAST.child = value_s_AST; + currentAST.advanceChildToEnd(); + } + value_s_AST = RefAdaAST(currentAST.root); + returnAST = value_s_AST; +} + +void AdaParser::parenth_values() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST parenth_values_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop46; + } + + } + _loop46:; + } // ( ... )* + match(RPAREN); + parenth_values_AST = RefAdaAST(currentAST.root); + returnAST = parenth_values_AST; +} + +void AdaParser::value() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST value_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case OTHERS: + { + RefAdaAST tmp60_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp60_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp60_AST)); + } + match(OTHERS); + match(RIGHT_SHAFT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + ranged_expr_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RIGHT_SHAFT: + { + RefAdaAST tmp62_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp62_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp62_AST)); + } + match(RIGHT_SHAFT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case COMMA: + case RPAREN: + case WITH: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + value_AST = RefAdaAST(currentAST.root); + returnAST = value_AST; +} + +void AdaParser::ranged_expr_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST ranged_expr_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + ranged_expr(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + RefAdaAST tmp63_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp63_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp63_AST)); + } + match(PIPE); + ranged_expr(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop52; + } + + } + _loop52:; + } // ( ... )* + ranged_expr_s_AST = RefAdaAST(currentAST.root); + returnAST = ranged_expr_s_AST; +} + +void AdaParser::ranged_expr() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST ranged_expr_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case DOT_DOT: + { + RefAdaAST tmp64_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp64_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp64_AST)); + } + match(DOT_DOT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RANGE: + { + RefAdaAST tmp65_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp65_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp65_AST)); + } + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case PIPE: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + ranged_expr_AST = RefAdaAST(currentAST.root); + returnAST = ranged_expr_AST; +} + +void AdaParser::simple_expression() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST simple_expression_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PLUS: + { + RefAdaAST tmp66_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp66_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp66_AST)); + } + match(PLUS); + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case MINUS: + { + RefAdaAST tmp67_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp67_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp67_AST)); + } + match(MINUS); + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case CONCAT: + { + RefAdaAST tmp68_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp68_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp68_AST)); + } + match(CONCAT); + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop458; + } + } + } + _loop458:; + } // ( ... )* + simple_expression_AST = RefAdaAST(currentAST.root); + returnAST = simple_expression_AST; +} + +void AdaParser::range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched59 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m59 = mark(); + synPredMatched59 = true; + inputState->guessing++; + try { + { + range_dots(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched59 = false; + } + rewind(_m59); + inputState->guessing--; + } + if ( synPredMatched59 ) { + range_dots(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((LA(1) == IDENTIFIER) && (LA(2) == LPAREN || LA(2) == DOT || LA(2) == TIC)) { + range_attrib_ref(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + range_AST = RefAdaAST(currentAST.root); + returnAST = range_AST; +} + +void AdaParser::range_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 203 "ada.g" + Set(r_AST, RANGE_CONSTRAINT); +#line 2287 "AdaParser.cpp" + } + range_constraint_AST = RefAdaAST(currentAST.root); + returnAST = range_constraint_AST; +} + +void AdaParser::range_dots() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_dots_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + RefAdaAST tmp69_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp69_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp69_AST)); + } + match(DOT_DOT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_dots_AST = RefAdaAST(currentAST.root); + returnAST = range_dots_AST; +} + +void AdaParser::range_attrib_ref() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_attrib_ref_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + prefix(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(TIC); + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(RANGE); + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case ASSIGN: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 219 "ada.g" + Set(r_AST, RANGE_ATTRIBUTE_REFERENCE); +#line 2374 "AdaParser.cpp" + } + range_attrib_ref_AST = RefAdaAST(currentAST.root); + returnAST = range_attrib_ref_AST; +} + +void AdaParser::prefix() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prefix_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp73_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp73_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp73_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case DOT: + { + RefAdaAST tmp74_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp74_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp74_AST)); + } + match(DOT); + { + switch ( LA(1)) { + case ALL: + { + RefAdaAST tmp75_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp75_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp75_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp76_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp76_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp76_AST)); + } + match(IDENTIFIER); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 228 "ada.g" + Set(p_AST, INDEXED_COMPONENT); +#line 2450 "AdaParser.cpp" + } + break; + } + default: + { + goto _loop66; + } + } + } + _loop66:; + } // ( ... )* + prefix_AST = RefAdaAST(currentAST.root); + returnAST = prefix_AST; +} + +void AdaParser::parameter_specification() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST parameter_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + mode_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + parameter_specification_AST = RefAdaAST(currentAST.root); +#line 240 "ada.g" + parameter_specification_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_SPECIFICATION,"PARAMETER_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(parameter_specification_AST)))); +#line 2492 "AdaParser.cpp" + currentAST.root = parameter_specification_AST; + if ( parameter_specification_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + parameter_specification_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = parameter_specification_AST->getFirstChild(); + else + currentAST.child = parameter_specification_AST; + currentAST.advanceChildToEnd(); + } + parameter_specification_AST = RefAdaAST(currentAST.root); + returnAST = parameter_specification_AST; +} + +void AdaParser::def_ids_colon() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_ids_colon_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + defining_identifier_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(COLON); + def_ids_colon_AST = RefAdaAST(currentAST.root); + returnAST = def_ids_colon_AST; +} + +void AdaParser::mode_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST mode_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IN: + { + RefAdaAST tmp79_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp79_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp79_AST)); + } + match(IN); + { + switch ( LA(1)) { + case OUT: + { + RefAdaAST tmp80_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp80_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp80_AST)); + } + match(OUT); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case OUT: + { + RefAdaAST tmp81_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp81_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp81_AST)); + } + match(OUT); + break; + } + case ACCESS: + { + RefAdaAST tmp82_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp82_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp82_AST)); + } + match(ACCESS); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + mode_opt_AST = RefAdaAST(currentAST.root); +#line 255 "ada.g" + mode_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mode_opt_AST)))); +#line 2592 "AdaParser.cpp" + currentAST.root = mode_opt_AST; + if ( mode_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + mode_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = mode_opt_AST->getFirstChild(); + else + currentAST.child = mode_opt_AST; + currentAST.advanceChildToEnd(); + } + mode_opt_AST = RefAdaAST(currentAST.root); + returnAST = mode_opt_AST; +} + +void AdaParser::init_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST init_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ASSIGN: + { + match(ASSIGN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case RPAREN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + init_opt_AST = RefAdaAST(currentAST.root); +#line 468 "ada.g" + init_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(INIT_OPT,"INIT_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(init_opt_AST)))); +#line 2636 "AdaParser.cpp" + currentAST.root = init_opt_AST; + if ( init_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + init_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = init_opt_AST->getFirstChild(); + else + currentAST.child = init_opt_AST; + currentAST.advanceChildToEnd(); + } + init_opt_AST = RefAdaAST(currentAST.root); + returnAST = init_opt_AST; +} + +void AdaParser::defining_identifier_list() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST defining_identifier_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp84_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp84_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp84_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + RefAdaAST tmp86_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp86_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp86_AST)); + } + match(IDENTIFIER); + } + else { + goto _loop75; + } + + } + _loop75:; + } // ( ... )* + if ( inputState->guessing==0 ) { + defining_identifier_list_AST = RefAdaAST(currentAST.root); +#line 249 "ada.g" + defining_identifier_list_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DEFINING_IDENTIFIER_LIST,"DEFINING_IDENTIFIER_LIST")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(defining_identifier_list_AST)))); +#line 2683 "AdaParser.cpp" + currentAST.root = defining_identifier_list_AST; + if ( defining_identifier_list_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + defining_identifier_list_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = defining_identifier_list_AST->getFirstChild(); + else + currentAST.child = defining_identifier_list_AST; + currentAST.advanceChildToEnd(); + } + defining_identifier_list_AST = RefAdaAST(currentAST.root); + returnAST = defining_identifier_list_AST; +} + +void AdaParser::name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 265 "ada.g" + RefAdaAST dummy; +#line 2704 "AdaParser.cpp" + + RefAdaAST tmp87_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp87_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp87_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case DOT: + { + RefAdaAST tmp88_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp88_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp88_AST)); + } + match(DOT); + { + switch ( LA(1)) { + case ALL: + { + RefAdaAST tmp89_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp89_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp89_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp90_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp90_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp90_AST)); + } + match(IDENTIFIER); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp91_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp91_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp91_AST)); + } + match(CHARACTER_LITERAL); + break; + } + case CHAR_STRING: + { + dummy=is_operator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 273 "ada.g" + Set(p_AST, INDEXED_COMPONENT); +#line 2787 "AdaParser.cpp" + } + break; + } + case TIC: + { + RefAdaAST tmp93_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp93_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp93_AST)); + } + match(TIC); + attribute_id(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop84; + } + } + } + _loop84:; + } // ( ... )* + name_AST = RefAdaAST(currentAST.root); + returnAST = name_AST; +} + +RefAdaAST AdaParser::definable_operator_symbol() { +#line 285 "ada.g" + RefAdaAST d; +#line 2820 "AdaParser.cpp" + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST definable_operator_symbol_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken op = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST op_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if (!( definable_operator(LT(1)->getText().c_str()) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" definable_operator(LT(1)->getText().c_str()) "); + op = LT(1); + if ( inputState->guessing == 0 ) { + op_AST = astFactory->create(op); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(op_AST)); + } + match(CHAR_STRING); + if ( inputState->guessing==0 ) { +#line 287 "ada.g" + op_AST->setType(OPERATOR_SYMBOL); d=op_AST; +#line 2838 "AdaParser.cpp" + } + definable_operator_symbol_AST = RefAdaAST(currentAST.root); + returnAST = definable_operator_symbol_AST; + return d; +} + +RefAdaAST AdaParser::is_operator() { +#line 280 "ada.g" + RefAdaAST d; +#line 2848 "AdaParser.cpp" + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST is_operator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken op = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST op_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if (!( is_operator_symbol(LT(1)->getText().c_str()) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" is_operator_symbol(LT(1)->getText().c_str()) "); + op = LT(1); + if ( inputState->guessing == 0 ) { + op_AST = astFactory->create(op); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(op_AST)); + } + match(CHAR_STRING); + if ( inputState->guessing==0 ) { +#line 282 "ada.g" + op_AST->setType(OPERATOR_SYMBOL); d=op_AST; +#line 2866 "AdaParser.cpp" + } + is_operator_AST = RefAdaAST(currentAST.root); + returnAST = is_operator_AST; + return d; +} + +void AdaParser::parenthesized_primary() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST parenthesized_primary_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pp = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pp_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + pp = LT(1); + if ( inputState->guessing == 0 ) { + pp_AST = astFactory->create(pp); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pp_AST)); + } + match(LPAREN); + { + if ((LA(1) == NuLL) && (LA(2) == RECORD)) { + RefAdaAST tmp94_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp94_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp94_AST)); + } + match(NuLL); + match(RECORD); + } + else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2)))) { + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + extension_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 295 "ada.g" + Set(pp_AST, PARENTHESIZED_PRIMARY); +#line 2915 "AdaParser.cpp" + } + parenthesized_primary_AST = RefAdaAST(currentAST.root); + returnAST = parenthesized_primary_AST; +} + +void AdaParser::extension_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST extension_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case WITH: + { + match(WITH); + { + if ((LA(1) == NuLL) && (LA(2) == RECORD)) { + RefAdaAST tmp98_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp98_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp98_AST)); + } + match(NuLL); + match(RECORD); + } + else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_11.member(LA(2)))) { + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + break; + } + case RPAREN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + extension_opt_AST = RefAdaAST(currentAST.root); +#line 299 "ada.g" + extension_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXTENSION_OPT,"EXTENSION_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(extension_opt_AST)))); +#line 2969 "AdaParser.cpp" + currentAST.root = extension_opt_AST; + if ( extension_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + extension_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = extension_opt_AST->getFirstChild(); + else + currentAST.child = extension_opt_AST; + currentAST.advanceChildToEnd(); + } + extension_opt_AST = RefAdaAST(currentAST.root); + returnAST = extension_opt_AST; +} + +void AdaParser::separate_or_abstract( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST separate_or_abstract_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case SEPARATE: + { + match(SEPARATE); + if ( inputState->guessing==0 ) { +#line 315 "ada.g" + pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_BODY_STUB); + else + Set(t, FUNCTION_BODY_STUB); + +#line 3001 "AdaParser.cpp" + } + break; + } + case ABSTRACT: + { + match(ABSTRACT); + if ( inputState->guessing==0 ) { +#line 322 "ada.g" + pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, ABSTRACT_PROCEDURE_DECLARATION); + else + Set(t, ABSTRACT_FUNCTION_DECLARATION); + +#line 3016 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = separate_or_abstract_AST; +} + +RefAdaAST AdaParser::designator() { +#line 336 "ada.g" + RefAdaAST d; +#line 3031 "AdaParser.cpp" + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST designator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 336 "ada.g" + RefAdaAST op; +#line 3039 "AdaParser.cpp" + + switch ( LA(1)) { + case CHAR_STRING: + { + op=definable_operator_symbol(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 338 "ada.g" + d = op; +#line 3051 "AdaParser.cpp" + } + designator_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(IDENTIFIER); + if ( inputState->guessing==0 ) { +#line 339 "ada.g" + d = n_AST; +#line 3067 "AdaParser.cpp" + } + designator_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = designator_AST; + return d; +} + +void AdaParser::func_formal_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST func_formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + func_param(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == SEMI)) { + match(SEMI); + func_param(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop100; + } + + } + _loop100:; + } // ( ... )* + match(RPAREN); + break; + } + case RETURN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + func_formal_part_opt_AST = RefAdaAST(currentAST.root); +#line 348 "ada.g" + func_formal_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FORMAL_PART_OPT,"FORMAL_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(func_formal_part_opt_AST)))); +#line 3129 "AdaParser.cpp" + currentAST.root = func_formal_part_opt_AST; + if ( func_formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + func_formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = func_formal_part_opt_AST->getFirstChild(); + else + currentAST.child = func_formal_part_opt_AST; + currentAST.advanceChildToEnd(); + } + func_formal_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = func_formal_part_opt_AST; +} + +void AdaParser::func_param() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST func_param_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + in_access_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + func_param_AST = RefAdaAST(currentAST.root); +#line 354 "ada.g" + func_param_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_SPECIFICATION,"PARAMETER_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(func_param_AST)))); +#line 3168 "AdaParser.cpp" + currentAST.root = func_param_AST; + if ( func_param_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + func_param_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = func_param_AST->getFirstChild(); + else + currentAST.child = func_param_AST; + currentAST.advanceChildToEnd(); + } + func_param_AST = RefAdaAST(currentAST.root); + returnAST = func_param_AST; +} + +void AdaParser::in_access_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST in_access_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IN: + { + RefAdaAST tmp105_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp105_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp105_AST)); + } + match(IN); + break; + } + case ACCESS: + { + RefAdaAST tmp106_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp106_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp106_AST)); + } + match(ACCESS); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + in_access_opt_AST = RefAdaAST(currentAST.root); +#line 360 "ada.g" + in_access_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(in_access_opt_AST)))); +#line 3222 "AdaParser.cpp" + currentAST.root = in_access_opt_AST; + if ( in_access_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + in_access_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = in_access_opt_AST->getFirstChild(); + else + currentAST.child = in_access_opt_AST; + currentAST.advanceChildToEnd(); + } + in_access_opt_AST = RefAdaAST(currentAST.root); + returnAST = in_access_opt_AST; +} + +void AdaParser::pkg_spec_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pkg_spec_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + basic_declarative_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + private_declarative_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pkg_spec_part_AST = RefAdaAST(currentAST.root); + returnAST = pkg_spec_part_AST; +} + +void AdaParser::basic_declarative_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST basic_declarative_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + basic_decl_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop114; + } + } + } + _loop114:; + } // ( ... )* + if ( inputState->guessing==0 ) { + basic_declarative_items_opt_AST = RefAdaAST(currentAST.root); +#line 385 "ada.g" + basic_declarative_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BASIC_DECLARATIVE_ITEMS_OPT,"BASIC_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(basic_declarative_items_opt_AST)))); +#line 3303 "AdaParser.cpp" + currentAST.root = basic_declarative_items_opt_AST; + if ( basic_declarative_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + basic_declarative_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = basic_declarative_items_opt_AST->getFirstChild(); + else + currentAST.child = basic_declarative_items_opt_AST; + currentAST.advanceChildToEnd(); + } + basic_declarative_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = basic_declarative_items_opt_AST; +} + +void AdaParser::private_declarative_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST private_declarative_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + basic_decl_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop111; + } + } + } + _loop111:; + } // ( ... )* + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + private_declarative_items_opt_AST = RefAdaAST(currentAST.root); +#line 378 "ada.g" + private_declarative_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PRIVATE_DECLARATIVE_ITEMS_OPT,"PRIVATE_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_declarative_items_opt_AST)))); +#line 3380 "AdaParser.cpp" + currentAST.root = private_declarative_items_opt_AST; + if ( private_declarative_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + private_declarative_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = private_declarative_items_opt_AST->getFirstChild(); + else + currentAST.child = private_declarative_items_opt_AST; + currentAST.advanceChildToEnd(); + } + private_declarative_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = private_declarative_items_opt_AST; +} + +void AdaParser::end_id_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST end_id_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + e = LT(1); + if ( inputState->guessing == 0 ) { + e_AST = astFactory->create(e); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST)); + } + match(END); + id_opt_aux(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1176 "ada.g" + Set(e_AST, END_ID_OPT); +#line 3413 "AdaParser.cpp" + } + end_id_opt_AST = RefAdaAST(currentAST.root); + returnAST = end_id_opt_AST; +} + +void AdaParser::basic_decl_item() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST basic_decl_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken tsk = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST tsk_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pro = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pro_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PACKAGE: + { + pkg = LT(1); + if ( inputState->guessing == 0 ) { + pkg_AST = astFactory->create(pkg); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST)); + } + match(PACKAGE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + spec_decl_part(pkg_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case TASK: + { + tsk = LT(1); + if ( inputState->guessing == 0 ) { + tsk_AST = astFactory->create(tsk); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tsk_AST)); + } + match(TASK); + task_type_or_single_decl(tsk_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case PROTECTED: + { + pro = LT(1); + if ( inputState->guessing == 0 ) { + pro_AST = astFactory->create(pro); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pro_AST)); + } + match(PROTECTED); + prot_type_or_single_decl(pro_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + case USE: + case TYPE: + case FOR: + case SUBTYPE: + case GENERIC: + { + decl_common(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = basic_decl_item_AST; +} + +void AdaParser::basic_declarative_items() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST basic_declarative_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt117=0; + for (;;) { + switch ( LA(1)) { + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + basic_decl_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + if ( _cnt117>=1 ) { goto _loop117; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + } + _cnt117++; + } + _loop117:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + basic_declarative_items_AST = RefAdaAST(currentAST.root); +#line 392 "ada.g" + basic_declarative_items_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BASIC_DECLARATIVE_ITEMS_OPT,"BASIC_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(basic_declarative_items_AST)))); +#line 3562 "AdaParser.cpp" + currentAST.root = basic_declarative_items_AST; + if ( basic_declarative_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + basic_declarative_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = basic_declarative_items_AST->getFirstChild(); + else + currentAST.child = basic_declarative_items_AST; + currentAST.advanceChildToEnd(); + } + basic_declarative_items_AST = RefAdaAST(currentAST.root); + returnAST = basic_declarative_items_AST; +} + +void AdaParser::task_type_or_single_decl( + RefAdaAST tsk +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_type_or_single_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case TYPE: + { + match(TYPE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrim_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + task_definition_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 408 "ada.g" + Set(tsk, TASK_TYPE_DECLARATION); +#line 3601 "AdaParser.cpp" + } + task_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + task_definition_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 410 "ada.g" + Set(tsk, SINGLE_TASK_DECLARATION); +#line 3619 "AdaParser.cpp" + } + task_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = task_type_or_single_decl_AST; +} + +void AdaParser::prot_type_or_single_decl( + RefAdaAST pro +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_type_or_single_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case TYPE: + { + match(TYPE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrim_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + protected_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 539 "ada.g" + Set(pro, PROTECTED_TYPE_DECLARATION); +#line 3658 "AdaParser.cpp" + } + prot_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + protected_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 541 "ada.g" + Set(pro, SINGLE_PROTECTED_DECLARATION); +#line 3676 "AdaParser.cpp" + } + prot_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = prot_type_or_single_decl_AST; +} + +void AdaParser::decl_common() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST decl_common_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken erd = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST erd_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken ord = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST ord_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken od = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST od_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case TYPE: + { + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TYPE); + RefAdaAST tmp111_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp111_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp111_AST)); + } + match(IDENTIFIER); + { + switch ( LA(1)) { + case IS: + { + match(IS); + type_def(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case LPAREN: + { + { + switch ( LA(1)) { + case LPAREN: + { + discrim_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + derived_or_private_or_record(t_AST, true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 587 "ada.g" + Set(t_AST, INCOMPLETE_TYPE_DECLARATION); +#line 3759 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + empty_discrim_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 590 "ada.g" + Set(t_AST, INCOMPLETE_TYPE_DECLARATION); +#line 3780 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case SUBTYPE: + { + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(SUBTYPE); + RefAdaAST tmp115_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp115_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp115_AST)); + } + match(IDENTIFIER); + match(IS); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 604 "ada.g" + Set(s_AST, SUBTYPE_DECLARATION); +#line 3825 "AdaParser.cpp" + } + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case GENERIC: + { + generic_decl(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case USE: + { + use_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case FOR: + { + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(FOR); + { + bool synPredMatched184 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == USE))) { + int _m184 = mark(); + synPredMatched184 = true; + inputState->guessing++; + try { + { + local_enum_name(); + match(USE); + match(LPAREN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched184 = false; + } + rewind(_m184); + inputState->guessing--; + } + if ( synPredMatched184 ) { + local_enum_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(USE); + enumeration_aggregate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 609 "ada.g" + Set(r_AST, ENUMERATION_REPESENTATION_CLAUSE); +#line 3888 "AdaParser.cpp" + } + } + else if ((LA(1) == IDENTIFIER) && (LA(2) == DOT || LA(2) == USE || LA(2) == TIC)) { + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(USE); + rep_spec_part(r_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + match(SEMI); + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + default: + bool synPredMatched186 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == COLON))) { + int _m186 = mark(); + synPredMatched186 = true; + inputState->guessing++; + try { + { + match(IDENTIFIER); + match(COLON); + match(EXCEPTION); + match(RENAMES); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched186 = false; + } + rewind(_m186); + inputState->guessing--; + } + if ( synPredMatched186 ) { + RefAdaAST tmp121_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp121_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp121_AST)); + } + match(IDENTIFIER); + erd = LT(1); + if ( inputState->guessing == 0 ) { + erd_AST = astFactory->create(erd); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(erd_AST)); + } + match(COLON); + match(EXCEPTION); + match(RENAMES); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 615 "ada.g" + Set(erd_AST, EXCEPTION_RENAMING_DECLARATION); +#line 3954 "AdaParser.cpp" + } + decl_common_AST = RefAdaAST(currentAST.root); + } + else { + bool synPredMatched188 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == COLON))) { + int _m188 = mark(); + synPredMatched188 = true; + inputState->guessing++; + try { + { + match(IDENTIFIER); + match(COLON); + subtype_mark(); + match(RENAMES); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched188 = false; + } + rewind(_m188); + inputState->guessing--; + } + if ( synPredMatched188 ) { + RefAdaAST tmp125_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp125_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp125_AST)); + } + match(IDENTIFIER); + ord = LT(1); + if ( inputState->guessing == 0 ) { + ord_AST = astFactory->create(ord); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(ord_AST)); + } + match(COLON); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RENAMES); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 618 "ada.g" + Set(ord_AST, OBJECT_RENAMING_DECLARATION); +#line 4004 "AdaParser.cpp" + } + decl_common_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == IDENTIFIER) && (LA(2) == COMMA || LA(2) == COLON)) { + defining_identifier_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + od = LT(1); + if ( inputState->guessing == 0 ) { + od_AST = astFactory->create(od); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(od_AST)); + } + match(COLON); + { + if ((LA(1) == EXCEPTION)) { + match(EXCEPTION); + if ( inputState->guessing==0 ) { +#line 621 "ada.g" + Set(od_AST, EXCEPTION_DECLARATION); +#line 4025 "AdaParser.cpp" + } + } + else { + bool synPredMatched191 = false; + if (((LA(1) == CONSTANT) && (LA(2) == ASSIGN))) { + int _m191 = mark(); + synPredMatched191 = true; + inputState->guessing++; + try { + { + match(CONSTANT); + match(ASSIGN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched191 = false; + } + rewind(_m191); + inputState->guessing--; + } + if ( synPredMatched191 ) { + match(CONSTANT); + match(ASSIGN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 623 "ada.g" + Set(od_AST, NUMBER_DECLARATION); +#line 4056 "AdaParser.cpp" + } + } + else if ((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2)))) { + aliased_constant_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case ARRAY: + { + array_type_definition(od_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 626 "ada.g" + Set(od_AST, ARRAY_OBJECT_DECLARATION); +#line 4079 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 630 "ada.g" + Set(od_AST, OBJECT_DECLARATION); +#line 4096 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + decl_common_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + }} + returnAST = decl_common_AST; +} + +void AdaParser::discrim_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrim_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + discrim_part_text(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case IS: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + discrim_part_opt_AST = RefAdaAST(currentAST.root); +#line 420 "ada.g" + discrim_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrim_part_opt_AST)))); +#line 4153 "AdaParser.cpp" + currentAST.root = discrim_part_opt_AST; + if ( discrim_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discrim_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discrim_part_opt_AST->getFirstChild(); + else + currentAST.child = discrim_part_opt_AST; + currentAST.advanceChildToEnd(); + } + discrim_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = discrim_part_opt_AST; +} + +void AdaParser::task_definition_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_definition_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IS: + { + match(IS); + task_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + private_task_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + task_definition_opt_AST = RefAdaAST(currentAST.root); + break; + } + case SEMI: + { + match(SEMI); + if ( inputState->guessing==0 ) { +#line 415 "ada.g" + pop_def_id(); +#line 4197 "AdaParser.cpp" + } + task_definition_opt_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = task_definition_opt_AST; +} + +void AdaParser::task_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop138; + } + + } + _loop138:; + } // ( ... )* + entrydecls_repspecs_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + task_items_opt_AST = RefAdaAST(currentAST.root); +#line 473 "ada.g" + task_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TASK_ITEMS_OPT,"TASK_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(task_items_opt_AST)))); +#line 4239 "AdaParser.cpp" + currentAST.root = task_items_opt_AST; + if ( task_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + task_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = task_items_opt_AST->getFirstChild(); + else + currentAST.child = task_items_opt_AST; + currentAST.advanceChildToEnd(); + } + task_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = task_items_opt_AST; +} + +void AdaParser::private_task_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST private_task_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop163; + } + + } + _loop163:; + } // ( ... )* + entrydecls_repspecs_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + private_task_items_opt_AST = RefAdaAST(currentAST.root); +#line 530 "ada.g" + private_task_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PRIVATE_TASK_ITEMS_OPT,"PRIVATE_TASK_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_task_items_opt_AST)))); +#line 4298 "AdaParser.cpp" + currentAST.root = private_task_items_opt_AST; + if ( private_task_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + private_task_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = private_task_items_opt_AST->getFirstChild(); + else + currentAST.child = private_task_items_opt_AST; + currentAST.advanceChildToEnd(); + } + private_task_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = private_task_items_opt_AST; +} + +void AdaParser::discrim_part_text() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrim_part_text_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp137_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp137_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp137_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + { + discriminant_specifications(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(RPAREN); + discrim_part_text_AST = RefAdaAST(currentAST.root); + returnAST = discrim_part_text_AST; +} + +void AdaParser::discriminant_specifications() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_specifications_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + discriminant_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == SEMI)) { + match(SEMI); + discriminant_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop130; + } + + } + _loop130:; + } // ( ... )* + if ( inputState->guessing==0 ) { + discriminant_specifications_AST = RefAdaAST(currentAST.root); +#line 450 "ada.g" + discriminant_specifications_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_SPECIFICATIONS,"DISCRIMINANT_SPECIFICATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_specifications_AST)))); +#line 4378 "AdaParser.cpp" + currentAST.root = discriminant_specifications_AST; + if ( discriminant_specifications_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discriminant_specifications_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discriminant_specifications_AST->getFirstChild(); + else + currentAST.child = discriminant_specifications_AST; + currentAST.advanceChildToEnd(); + } + discriminant_specifications_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_specifications_AST; +} + +void AdaParser::known_discrim_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST known_discrim_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + discriminant_specifications(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { + known_discrim_part_AST = RefAdaAST(currentAST.root); +#line 430 "ada.g" + known_discrim_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(known_discrim_part_AST)))); +#line 4407 "AdaParser.cpp" + currentAST.root = known_discrim_part_AST; + if ( known_discrim_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + known_discrim_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = known_discrim_part_AST->getFirstChild(); + else + currentAST.child = known_discrim_part_AST; + currentAST.advanceChildToEnd(); + } + known_discrim_part_AST = RefAdaAST(currentAST.root); + returnAST = known_discrim_part_AST; +} + +void AdaParser::empty_discrim_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST empty_discrim_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if ( inputState->guessing==0 ) { + empty_discrim_opt_AST = RefAdaAST(currentAST.root); +#line 436 "ada.g" + empty_discrim_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(empty_discrim_opt_AST)))); +#line 4430 "AdaParser.cpp" + currentAST.root = empty_discrim_opt_AST; + if ( empty_discrim_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + empty_discrim_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = empty_discrim_opt_AST->getFirstChild(); + else + currentAST.child = empty_discrim_opt_AST; + currentAST.advanceChildToEnd(); + } + empty_discrim_opt_AST = RefAdaAST(currentAST.root); + returnAST = empty_discrim_opt_AST; +} + +void AdaParser::discrim_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrim_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + discrim_part_text(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + discrim_part_AST = RefAdaAST(currentAST.root); +#line 443 "ada.g" + discrim_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrim_part_AST)))); +#line 4457 "AdaParser.cpp" + currentAST.root = discrim_part_AST; + if ( discrim_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discrim_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discrim_part_AST->getFirstChild(); + else + currentAST.child = discrim_part_AST; + currentAST.advanceChildToEnd(); + } + discrim_part_AST = RefAdaAST(currentAST.root); + returnAST = discrim_part_AST; +} + +void AdaParser::discriminant_specification() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + access_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + discriminant_specification_AST = RefAdaAST(currentAST.root); +#line 457 "ada.g" + discriminant_specification_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_SPECIFICATION,"DISCRIMINANT_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_specification_AST)))); +#line 4496 "AdaParser.cpp" + currentAST.root = discriminant_specification_AST; + if ( discriminant_specification_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discriminant_specification_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discriminant_specification_AST->getFirstChild(); + else + currentAST.child = discriminant_specification_AST; + currentAST.advanceChildToEnd(); + } + discriminant_specification_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_specification_AST; +} + +void AdaParser::access_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST access_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ACCESS: + { + RefAdaAST tmp142_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp142_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp142_AST)); + } + match(ACCESS); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + access_opt_AST = RefAdaAST(currentAST.root); +#line 464 "ada.g" + access_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(access_opt_AST)))); +#line 4540 "AdaParser.cpp" + currentAST.root = access_opt_AST; + if ( access_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + access_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = access_opt_AST->getFirstChild(); + else + currentAST.child = access_opt_AST; + currentAST.advanceChildToEnd(); + } + access_opt_AST = RefAdaAST(currentAST.root); + returnAST = access_opt_AST; +} + +void AdaParser::entrydecls_repspecs_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entrydecls_repspecs_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == ENTRY)) { + entry_declaration(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case FOR: + { + rep_spec(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop142; + } + } + } + _loop142:; + } // ( ... )* + } + else { + goto _loop143; + } + + } + _loop143:; + } // ( ... )* + entrydecls_repspecs_opt_AST = RefAdaAST(currentAST.root); + returnAST = entrydecls_repspecs_opt_AST; +} + +void AdaParser::entry_declaration() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_declaration_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + e = LT(1); + if ( inputState->guessing == 0 ) { + e_AST = astFactory->create(e); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST)); + } + match(ENTRY); + RefAdaAST tmp143_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp143_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp143_AST)); + } + match(IDENTIFIER); + discrete_subtype_def_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 482 "ada.g" + Set (e_AST, ENTRY_DECLARATION); +#line 4635 "AdaParser.cpp" + } + entry_declaration_AST = RefAdaAST(currentAST.root); + returnAST = entry_declaration_AST; +} + +void AdaParser::rep_spec() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST rep_spec_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(FOR); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(USE); + rep_spec_part(r_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + rep_spec_AST = RefAdaAST(currentAST.root); + returnAST = rep_spec_AST; +} + +void AdaParser::discrete_subtype_def_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_subtype_def_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched148 = false; + if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) { + int _m148 = mark(); + synPredMatched148 = true; + inputState->guessing++; + try { + { + match(LPAREN); + discrete_subtype_definition(); + match(RPAREN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched148 = false; + } + rewind(_m148); + inputState->guessing--; + } + if ( synPredMatched148 ) { + match(LPAREN); + discrete_subtype_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + } + else if ((LA(1) == SEMI || LA(1) == LPAREN) && (_tokenSet_14.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + discrete_subtype_def_opt_AST = RefAdaAST(currentAST.root); +#line 489 "ada.g" + discrete_subtype_def_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRETE_SUBTYPE_DEF_OPT,"DISCRETE_SUBTYPE_DEF_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrete_subtype_def_opt_AST)))); +#line 4712 "AdaParser.cpp" + currentAST.root = discrete_subtype_def_opt_AST; + if ( discrete_subtype_def_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discrete_subtype_def_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discrete_subtype_def_opt_AST->getFirstChild(); + else + currentAST.child = discrete_subtype_def_opt_AST; + currentAST.advanceChildToEnd(); + } + discrete_subtype_def_opt_AST = RefAdaAST(currentAST.root); + returnAST = discrete_subtype_def_opt_AST; +} + +void AdaParser::discrete_subtype_definition() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_subtype_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched152 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m152 = mark(); + synPredMatched152 = true; + inputState->guessing++; + try { + { + range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched152 = false; + } + rewind(_m152); + inputState->guessing--; + } + if ( synPredMatched152 ) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_15.member(LA(2)))) { + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + discrete_subtype_definition_AST = RefAdaAST(currentAST.root); + returnAST = discrete_subtype_definition_AST; +} + +void AdaParser::subtype_ind() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subtype_ind_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + subtype_ind_AST = RefAdaAST(currentAST.root); +#line 693 "ada.g" + subtype_ind_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SUBTYPE_INDICATION,"SUBTYPE_INDICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(subtype_ind_AST)))); +#line 4785 "AdaParser.cpp" + currentAST.root = subtype_ind_AST; + if ( subtype_ind_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + subtype_ind_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = subtype_ind_AST->getFirstChild(); + else + currentAST.child = subtype_ind_AST; + currentAST.advanceChildToEnd(); + } + subtype_ind_AST = RefAdaAST(currentAST.root); + returnAST = subtype_ind_AST; +} + +void AdaParser::rep_spec_part( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST rep_spec_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case RECORD: + { + match(RECORD); + align_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + comp_loc_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(RECORD); + if ( inputState->guessing==0 ) { +#line 512 "ada.g" + Set(t, RECORD_REPRESENTATION_CLAUSE); +#line 4822 "AdaParser.cpp" + } + rep_spec_part_AST = RefAdaAST(currentAST.root); + break; + } + case AT: + { + match(AT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 514 "ada.g" + Set(t, AT_CLAUSE); +#line 4837 "AdaParser.cpp" + } + rep_spec_part_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 517 "ada.g" + Set(t, ATTRIBUTE_DEFINITION_CLAUSE); +#line 4861 "AdaParser.cpp" + } + rep_spec_part_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = rep_spec_part_AST; +} + +void AdaParser::align_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST align_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case AT: + { + match(AT); + match(MOD); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case PRAGMA: + case IDENTIFIER: + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + align_opt_AST = RefAdaAST(currentAST.root); +#line 521 "ada.g" + align_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MOD_CLAUSE_OPT,"MOD_CLAUSE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(align_opt_AST)))); +#line 4908 "AdaParser.cpp" + currentAST.root = align_opt_AST; + if ( align_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + align_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = align_opt_AST->getFirstChild(); + else + currentAST.child = align_opt_AST; + currentAST.advanceChildToEnd(); + } + align_opt_AST = RefAdaAST(currentAST.root); + returnAST = align_opt_AST; +} + +void AdaParser::comp_loc_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST comp_loc_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(AT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + default: + { + goto _loop159; + } + } + } + _loop159:; + } // ( ... )* + if ( inputState->guessing==0 ) { + comp_loc_s_AST = RefAdaAST(currentAST.root); +#line 525 "ada.g" + comp_loc_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_CLAUSES_OPT,"COMPONENT_CLAUSES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(comp_loc_s_AST)))); +#line 4968 "AdaParser.cpp" + currentAST.root = comp_loc_s_AST; + if ( comp_loc_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + comp_loc_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = comp_loc_s_AST->getFirstChild(); + else + currentAST.child = comp_loc_s_AST; + currentAST.advanceChildToEnd(); + } + comp_loc_s_AST = RefAdaAST(currentAST.root); + returnAST = comp_loc_s_AST; +} + +void AdaParser::protected_definition() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST protected_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(IS); + prot_op_decl_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_private_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + protected_definition_AST = RefAdaAST(currentAST.root); + returnAST = protected_definition_AST; +} + +void AdaParser::prot_private_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_private_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + case PROCEDURE: + case FUNCTION: + case ENTRY: + case FOR: + { + prot_op_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + comp_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop168; + } + } + } + _loop168:; + } // ( ... )* + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + prot_private_opt_AST = RefAdaAST(currentAST.root); +#line 545 "ada.g" + prot_private_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_PRIVATE_OPT,"PROT_PRIVATE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_private_opt_AST)))); +#line 5061 "AdaParser.cpp" + currentAST.root = prot_private_opt_AST; + if ( prot_private_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_private_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_private_opt_AST->getFirstChild(); + else + currentAST.child = prot_private_opt_AST; + currentAST.advanceChildToEnd(); + } + prot_private_opt_AST = RefAdaAST(currentAST.root); + returnAST = prot_private_opt_AST; +} + +void AdaParser::prot_op_decl() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_op_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case ENTRY: + { + entry_declaration(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 561 "ada.g" + pop_def_id(); Set(p_AST, PROCEDURE_DECLARATION); +#line 5113 "AdaParser.cpp" + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 563 "ada.g" + pop_def_id(); Set(f_AST, FUNCTION_DECLARATION); +#line 5138 "AdaParser.cpp" + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case FOR: + { + rep_spec(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = prot_op_decl_AST; +} + +void AdaParser::comp_decl() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST comp_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + component_subtype_def(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { + comp_decl_AST = RefAdaAST(currentAST.root); +#line 575 "ada.g" + comp_decl_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_DECLARATION,"COMPONENT_DECLARATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(comp_decl_AST)))); +#line 5192 "AdaParser.cpp" + currentAST.root = comp_decl_AST; + if ( comp_decl_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + comp_decl_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = comp_decl_AST->getFirstChild(); + else + currentAST.child = comp_decl_AST; + currentAST.advanceChildToEnd(); + } + comp_decl_AST = RefAdaAST(currentAST.root); + returnAST = comp_decl_AST; +} + +void AdaParser::prot_op_decl_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_op_decl_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((_tokenSet_16.member(LA(1)))) { + prot_op_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop172; + } + + } + _loop172:; + } // ( ... )* + if ( inputState->guessing==0 ) { + prot_op_decl_s_AST = RefAdaAST(currentAST.root); +#line 555 "ada.g" + prot_op_decl_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_OP_DECLARATIONS,"PROT_OP_DECLARATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_op_decl_s_AST)))); +#line 5229 "AdaParser.cpp" + currentAST.root = prot_op_decl_s_AST; + if ( prot_op_decl_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_op_decl_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_op_decl_s_AST->getFirstChild(); + else + currentAST.child = prot_op_decl_s_AST; + currentAST.advanceChildToEnd(); + } + prot_op_decl_s_AST = RefAdaAST(currentAST.root); + returnAST = prot_op_decl_s_AST; +} + +void AdaParser::prot_member_decl_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_member_decl_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + case PROCEDURE: + case FUNCTION: + case ENTRY: + case FOR: + { + prot_op_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + comp_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop176; + } + } + } + _loop176:; + } // ( ... )* + if ( inputState->guessing==0 ) { + prot_member_decl_s_AST = RefAdaAST(currentAST.root); +#line 569 "ada.g" + prot_member_decl_s_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_MEMBER_DECLARATIONS,"PROT_MEMBER_DECLARATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_member_decl_s_AST)))); +#line 5283 "AdaParser.cpp" + currentAST.root = prot_member_decl_s_AST; + if ( prot_member_decl_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_member_decl_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_member_decl_s_AST->getFirstChild(); + else + currentAST.child = prot_member_decl_s_AST; + currentAST.advanceChildToEnd(); + } + prot_member_decl_s_AST = RefAdaAST(currentAST.root); + returnAST = prot_member_decl_s_AST; +} + +void AdaParser::component_subtype_def() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST component_subtype_def_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + aliased_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + component_subtype_def_AST = RefAdaAST(currentAST.root); + returnAST = component_subtype_def_AST; +} + +void AdaParser::type_def( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST type_def_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + enum_id_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 638 "ada.g" + Set(t, ENUMERATION_TYPE_DECLARATION); +#line 5332 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case RANGE: + { + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 640 "ada.g" + Set(t, SIGNED_INTEGER_TYPE_DECLARATION); +#line 5347 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case MOD: + { + match(MOD); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 642 "ada.g" + Set(t, MODULAR_TYPE_DECLARATION); +#line 5362 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case DIGITS: + { + match(DIGITS); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 644 "ada.g" + Set(t, FLOATING_POINT_DECLARATION); +#line 5381 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case DELTA: + { + match(DELTA); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RANGE: + { + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 647 "ada.g" + Set(t, ORDINARY_FIXED_POINT_DECLARATION); +#line 5405 "AdaParser.cpp" + } + break; + } + case DIGITS: + { + match(DIGITS); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 649 "ada.g" + Set(t, DECIMAL_FIXED_POINT_DECLARATION); +#line 5423 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case ARRAY: + { + array_type_definition(t); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case ACCESS: + { + access_type_definition(t); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case PRIVATE: + case NEW: + case NuLL: + case RECORD: + case ABSTRACT: + case TAGGED: + case LIMITED: + { + empty_discrim_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + derived_or_private_or_record(t, false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = type_def_AST; +} + +void AdaParser::derived_or_private_or_record( + RefAdaAST t, boolean has_discrim +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST derived_or_private_or_record_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched246 = false; + if (((LA(1) == NEW || LA(1) == ABSTRACT) && (LA(2) == IDENTIFIER || LA(2) == NEW))) { + int _m246 = mark(); + synPredMatched246 = true; + inputState->guessing++; + try { + { + { + switch ( LA(1)) { + case ABSTRACT: + { + match(ABSTRACT); + break; + } + case NEW: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(NEW); + subtype_ind(); + match(WITH); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched246 = false; + } + rewind(_m246); + inputState->guessing--; + } + if ( synPredMatched246 ) { + abstract_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(WITH); + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 772 "ada.g" + Set(t, PRIVATE_EXTENSION_DECLARATION); +#line 5542 "AdaParser.cpp" + } + break; + } + case NuLL: + case RECORD: + { + record_definition(has_discrim); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 774 "ada.g" + Set(t, DERIVED_RECORD_EXTENSION); +#line 5556 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + derived_or_private_or_record_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == NEW) && (LA(2) == IDENTIFIER)) { + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 776 "ada.g" + Set(t, ORDINARY_DERIVED_TYPE_DECLARATION); +#line 5577 "AdaParser.cpp" + } + derived_or_private_or_record_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) { + abstract_tagged_limited_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 778 "ada.g" + Set(t, PRIVATE_TYPE_DECLARATION); +#line 5594 "AdaParser.cpp" + } + break; + } + case NuLL: + case RECORD: + { + record_definition(has_discrim); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 780 "ada.g" + Set(t, RECORD_TYPE_DECLARATION); +#line 5608 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + derived_or_private_or_record_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = derived_or_private_or_record_AST; +} + +void AdaParser::local_enum_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST local_enum_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp177_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp177_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp177_AST)); + } + match(IDENTIFIER); + local_enum_name_AST = RefAdaAST(currentAST.root); + returnAST = local_enum_name_AST; +} + +void AdaParser::enumeration_aggregate() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST enumeration_aggregate_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + parenth_values(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + enumeration_aggregate_AST = RefAdaAST(currentAST.root); + returnAST = enumeration_aggregate_AST; +} + +void AdaParser::aliased_constant_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST aliased_constant_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ALIASED: + { + RefAdaAST tmp178_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp178_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp178_AST)); + } + match(ALIASED); + break; + } + case IDENTIFIER: + case CONSTANT: + case ARRAY: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case CONSTANT: + { + RefAdaAST tmp179_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp179_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp179_AST)); + } + match(CONSTANT); + break; + } + case IDENTIFIER: + case ARRAY: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + aliased_constant_opt_AST = RefAdaAST(currentAST.root); +#line 858 "ada.g" + aliased_constant_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(aliased_constant_opt_AST)))); +#line 5712 "AdaParser.cpp" + currentAST.root = aliased_constant_opt_AST; + if ( aliased_constant_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + aliased_constant_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = aliased_constant_opt_AST->getFirstChild(); + else + currentAST.child = aliased_constant_opt_AST; + currentAST.advanceChildToEnd(); + } + aliased_constant_opt_AST = RefAdaAST(currentAST.root); + returnAST = aliased_constant_opt_AST; +} + +void AdaParser::array_type_definition( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST array_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(ARRAY); + match(LPAREN); + index_or_discrete_range_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + match(OF); + component_subtype_def(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 669 "ada.g" + Set(t, ARRAY_TYPE_DECLARATION); +#line 5747 "AdaParser.cpp" + } + array_type_definition_AST = RefAdaAST(currentAST.root); + returnAST = array_type_definition_AST; +} + +void AdaParser::enum_id_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST enum_id_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + enumeration_literal_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + enumeration_literal_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop197; + } + + } + _loop197:; + } // ( ... )* + enum_id_s_AST = RefAdaAST(currentAST.root); + returnAST = enum_id_s_AST; +} + +void AdaParser::range_constraint_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_constraint_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case RANGE: + { + range_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case WITH: + case ASSIGN: + case LOOP: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + range_constraint_opt_AST = RefAdaAST(currentAST.root); + returnAST = range_constraint_opt_AST; +} + +void AdaParser::access_type_definition( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST access_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(ACCESS); + { + switch ( LA(1)) { + case PROCEDURE: + case FUNCTION: + case PROTECTED: + { + protected_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PROCEDURE: + { + match(PROCEDURE); + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 751 "ada.g" + Set(t, ACCESS_TO_PROCEDURE_DECLARATION); +#line 5846 "AdaParser.cpp" + } + break; + } + case FUNCTION: + { + match(FUNCTION); + func_formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RETURN); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 753 "ada.g" + Set(t, ACCESS_TO_FUNCTION_DECLARATION); +#line 5865 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case IDENTIFIER: + case ALL: + case CONSTANT: + { + constant_all_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 756 "ada.g" + Set(t, ACCESS_TO_OBJECT_DECLARATION); +#line 5892 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + access_type_definition_AST = RefAdaAST(currentAST.root); + returnAST = access_type_definition_AST; +} + +void AdaParser::enumeration_literal_specification() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST enumeration_literal_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IDENTIFIER: + { + RefAdaAST tmp189_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp189_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp189_AST)); + } + match(IDENTIFIER); + enumeration_literal_specification_AST = RefAdaAST(currentAST.root); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp190_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp190_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp190_AST)); + } + match(CHARACTER_LITERAL); + enumeration_literal_specification_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = enumeration_literal_specification_AST; +} + +void AdaParser::index_or_discrete_range_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST index_or_discrete_range_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + index_or_discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + RefAdaAST tmp191_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp191_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp191_AST)); + } + match(COMMA); + index_or_discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop204; + } + + } + _loop204:; + } // ( ... )* + index_or_discrete_range_s_AST = RefAdaAST(currentAST.root); + returnAST = index_or_discrete_range_s_AST; +} + +void AdaParser::index_or_discrete_range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST index_or_discrete_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case DOT_DOT: + { + RefAdaAST tmp192_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp192_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp192_AST)); + } + match(DOT_DOT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RANGE: + { + RefAdaAST tmp193_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp193_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp193_AST)); + } + match(RANGE); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp194_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp194_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp194_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case COMMA: + case RPAREN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + index_or_discrete_range_AST = RefAdaAST(currentAST.root); + returnAST = index_or_discrete_range_AST; +} + +void AdaParser::aliased_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST aliased_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ALIASED: + { + RefAdaAST tmp195_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp195_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp195_AST)); + } + match(ALIASED); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + aliased_opt_AST = RefAdaAST(currentAST.root); +#line 689 "ada.g" + aliased_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(aliased_opt_AST)))); +#line 6093 "AdaParser.cpp" + currentAST.root = aliased_opt_AST; + if ( aliased_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + aliased_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = aliased_opt_AST->getFirstChild(); + else + currentAST.child = aliased_opt_AST; + currentAST.advanceChildToEnd(); + } + aliased_opt_AST = RefAdaAST(currentAST.root); + returnAST = aliased_opt_AST; +} + +void AdaParser::constraint_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST constraint_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case RANGE: + { + range_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DIGITS: + { + digits_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DELTA: + { + delta_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case WITH: + case ASSIGN: + case LOOP: + { + break; + } + default: + bool synPredMatched215 = false; + if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) { + int _m215 = mark(); + synPredMatched215 = true; + inputState->guessing++; + try { + { + index_constraint(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched215 = false; + } + rewind(_m215); + inputState->guessing--; + } + if ( synPredMatched215 ) { + index_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2)))) { + discriminant_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + constraint_opt_AST = RefAdaAST(currentAST.root); + returnAST = constraint_opt_AST; +} + +void AdaParser::digits_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST digits_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + d = LT(1); + if ( inputState->guessing == 0 ) { + d_AST = astFactory->create(d); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST)); + } + match(DIGITS); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 706 "ada.g" + Set(d_AST, DIGITS_CONSTRAINT); +#line 6208 "AdaParser.cpp" + } + digits_constraint_AST = RefAdaAST(currentAST.root); + returnAST = digits_constraint_AST; +} + +void AdaParser::delta_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST delta_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + d = LT(1); + if ( inputState->guessing == 0 ) { + d_AST = astFactory->create(d); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST)); + } + match(DELTA); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 710 "ada.g" + Set(d_AST, DELTA_CONSTRAINT); +#line 6238 "AdaParser.cpp" + } + delta_constraint_AST = RefAdaAST(currentAST.root); + returnAST = delta_constraint_AST; +} + +void AdaParser::index_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST index_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop220; + } + + } + _loop220:; + } // ( ... )* + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 714 "ada.g" + Set(p_AST, INDEX_CONSTRAINT); +#line 6281 "AdaParser.cpp" + } + index_constraint_AST = RefAdaAST(currentAST.root); + returnAST = index_constraint_AST; +} + +void AdaParser::discriminant_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + discriminant_association(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + discriminant_association(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop226; + } + + } + _loop226:; + } // ( ... )* + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 724 "ada.g" + Set(p_AST, DISCRIMINANT_CONSTRAINT); +#line 6324 "AdaParser.cpp" + } + discriminant_constraint_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_constraint_AST; +} + +void AdaParser::discrete_range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched223 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m223 = mark(); + synPredMatched223 = true; + inputState->guessing++; + try { + { + range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched223 = false; + } + rewind(_m223); + inputState->guessing--; + } + if ( synPredMatched223 ) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_range_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_19.member(LA(2)))) { + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_range_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = discrete_range_AST; +} + +void AdaParser::discriminant_association() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_association_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + selector_names_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + discriminant_association_AST = RefAdaAST(currentAST.root); +#line 728 "ada.g" + discriminant_association_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_ASSOCIATION,"DISCRIMINANT_ASSOCIATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_association_AST)))); +#line 6390 "AdaParser.cpp" + currentAST.root = discriminant_association_AST; + if ( discriminant_association_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discriminant_association_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discriminant_association_AST->getFirstChild(); + else + currentAST.child = discriminant_association_AST; + currentAST.advanceChildToEnd(); + } + discriminant_association_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_association_AST; +} + +void AdaParser::selector_names_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST selector_names_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched231 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == RIGHT_SHAFT || LA(2) == PIPE))) { + int _m231 = mark(); + synPredMatched231 = true; + inputState->guessing++; + try { + { + association_head(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched231 = false; + } + rewind(_m231); + inputState->guessing--; + } + if ( synPredMatched231 ) { + association_head(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + selector_names_opt_AST = RefAdaAST(currentAST.root); +#line 736 "ada.g" + selector_names_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SELECTOR_NAMES_OPT,"SELECTOR_NAMES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(selector_names_opt_AST)))); +#line 6443 "AdaParser.cpp" + currentAST.root = selector_names_opt_AST; + if ( selector_names_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + selector_names_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = selector_names_opt_AST->getFirstChild(); + else + currentAST.child = selector_names_opt_AST; + currentAST.advanceChildToEnd(); + } + selector_names_opt_AST = RefAdaAST(currentAST.root); + returnAST = selector_names_opt_AST; +} + +void AdaParser::association_head() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST association_head_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + selector_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + match(PIPE); + selector_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop234; + } + + } + _loop234:; + } // ( ... )* + match(RIGHT_SHAFT); + association_head_AST = RefAdaAST(currentAST.root); + returnAST = association_head_AST; +} + +void AdaParser::selector_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST selector_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp202_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp202_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp202_AST)); + } + match(IDENTIFIER); + selector_name_AST = RefAdaAST(currentAST.root); + returnAST = selector_name_AST; +} + +void AdaParser::protected_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST protected_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PROTECTED: + { + RefAdaAST tmp203_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp203_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp203_AST)); + } + match(PROTECTED); + break; + } + case PROCEDURE: + case FUNCTION: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + protected_opt_AST = RefAdaAST(currentAST.root); +#line 761 "ada.g" + protected_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(protected_opt_AST)))); +#line 6533 "AdaParser.cpp" + currentAST.root = protected_opt_AST; + if ( protected_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + protected_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = protected_opt_AST->getFirstChild(); + else + currentAST.child = protected_opt_AST; + currentAST.advanceChildToEnd(); + } + protected_opt_AST = RefAdaAST(currentAST.root); + returnAST = protected_opt_AST; +} + +void AdaParser::constant_all_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST constant_all_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case CONSTANT: + { + RefAdaAST tmp204_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp204_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp204_AST)); + } + match(CONSTANT); + break; + } + case ALL: + { + RefAdaAST tmp205_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp205_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp205_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + constant_all_opt_AST = RefAdaAST(currentAST.root); +#line 765 "ada.g" + constant_all_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(constant_all_opt_AST)))); +#line 6588 "AdaParser.cpp" + currentAST.root = constant_all_opt_AST; + if ( constant_all_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + constant_all_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = constant_all_opt_AST->getFirstChild(); + else + currentAST.child = constant_all_opt_AST; + currentAST.advanceChildToEnd(); + } + constant_all_opt_AST = RefAdaAST(currentAST.root); + returnAST = constant_all_opt_AST; +} + +void AdaParser::abstract_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abstract_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ABSTRACT: + { + RefAdaAST tmp206_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp206_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp206_AST)); + } + match(ABSTRACT); + break; + } + case NEW: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + abstract_opt_AST = RefAdaAST(currentAST.root); +#line 785 "ada.g" + abstract_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abstract_opt_AST)))); +#line 6632 "AdaParser.cpp" + currentAST.root = abstract_opt_AST; + if ( abstract_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + abstract_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = abstract_opt_AST->getFirstChild(); + else + currentAST.child = abstract_opt_AST; + currentAST.advanceChildToEnd(); + } + abstract_opt_AST = RefAdaAST(currentAST.root); + returnAST = abstract_opt_AST; +} + +void AdaParser::record_definition( + boolean has_discrim +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST record_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case RECORD: + { + match(RECORD); + component_list(has_discrim); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(RECORD); + record_definition_AST = RefAdaAST(currentAST.root); + break; + } + case NuLL: + { + match(NuLL); + match(RECORD); + record_definition_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = record_definition_AST; +} + +void AdaParser::abstract_tagged_limited_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abstract_tagged_limited_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ABSTRACT: + { + RefAdaAST tmp212_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp212_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp212_AST)); + } + match(ABSTRACT); + match(TAGGED); + break; + } + case TAGGED: + { + RefAdaAST tmp214_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp214_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp214_AST)); + } + match(TAGGED); + break; + } + case PRIVATE: + case NuLL: + case RECORD: + case LIMITED: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case LIMITED: + { + RefAdaAST tmp215_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp215_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp215_AST)); + } + match(LIMITED); + break; + } + case PRIVATE: + case NuLL: + case RECORD: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + abstract_tagged_limited_opt_AST = RefAdaAST(currentAST.root); +#line 847 "ada.g" + abstract_tagged_limited_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abstract_tagged_limited_opt_AST)))); +#line 6750 "AdaParser.cpp" + currentAST.root = abstract_tagged_limited_opt_AST; + if ( abstract_tagged_limited_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + abstract_tagged_limited_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = abstract_tagged_limited_opt_AST->getFirstChild(); + else + currentAST.child = abstract_tagged_limited_opt_AST; + currentAST.advanceChildToEnd(); + } + abstract_tagged_limited_opt_AST = RefAdaAST(currentAST.root); + returnAST = abstract_tagged_limited_opt_AST; +} + +void AdaParser::component_list( + boolean has_discrim +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST component_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case NuLL: + { + match(NuLL); + match(SEMI); + component_list_AST = RefAdaAST(currentAST.root); + break; + } + case PRAGMA: + case IDENTIFIER: + { + component_items(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case CASE: + { + variant_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( has_discrim )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" has_discrim "); + break; + } + case END: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + component_list_AST = RefAdaAST(currentAST.root); + break; + } + case CASE: + { + empty_component_items(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + variant_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( has_discrim )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" has_discrim "); + component_list_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = component_list_AST; +} + +void AdaParser::component_items() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST component_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt256=0; + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + comp_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + if ( _cnt256>=1 ) { goto _loop256; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + } + _cnt256++; + } + _loop256:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + component_items_AST = RefAdaAST(currentAST.root); +#line 800 "ada.g" + component_items_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_ITEMS,"COMPONENT_ITEMS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(component_items_AST)))); +#line 6873 "AdaParser.cpp" + currentAST.root = component_items_AST; + if ( component_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + component_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = component_items_AST->getFirstChild(); + else + currentAST.child = component_items_AST; + currentAST.advanceChildToEnd(); + } + component_items_AST = RefAdaAST(currentAST.root); + returnAST = component_items_AST; +} + +void AdaParser::variant_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST variant_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST c_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + c = LT(1); + if ( inputState->guessing == 0 ) { + c_AST = astFactory->create(c); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST)); + } + match(CASE); + discriminant_direct_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + variant_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(CASE); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 812 "ada.g" + Set (c_AST, VARIANT_PART); +#line 6914 "AdaParser.cpp" + } + variant_part_AST = RefAdaAST(currentAST.root); + returnAST = variant_part_AST; +} + +void AdaParser::empty_component_items() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST empty_component_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if ( inputState->guessing==0 ) { + empty_component_items_AST = RefAdaAST(currentAST.root); +#line 806 "ada.g" + empty_component_items_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_ITEMS,"COMPONENT_ITEMS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(empty_component_items_AST)))); +#line 6930 "AdaParser.cpp" + currentAST.root = empty_component_items_AST; + if ( empty_component_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + empty_component_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = empty_component_items_AST->getFirstChild(); + else + currentAST.child = empty_component_items_AST; + currentAST.advanceChildToEnd(); + } + empty_component_items_AST = RefAdaAST(currentAST.root); + returnAST = empty_component_items_AST; +} + +void AdaParser::discriminant_direct_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_direct_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp222_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp222_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp222_AST)); + } + match(IDENTIFIER); + discriminant_direct_name_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_direct_name_AST; +} + +void AdaParser::variant_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST variant_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt262=0; + for (;;) { + if ((LA(1) == WHEN)) { + variant(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + + _cnt262++; + } + _loop262:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + variant_s_AST = RefAdaAST(currentAST.root); +#line 819 "ada.g" + variant_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VARIANTS,"VARIANTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(variant_s_AST)))); +#line 6984 "AdaParser.cpp" + currentAST.root = variant_s_AST; + if ( variant_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + variant_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = variant_s_AST->getFirstChild(); + else + currentAST.child = variant_s_AST; + currentAST.advanceChildToEnd(); + } + variant_s_AST = RefAdaAST(currentAST.root); + returnAST = variant_s_AST; +} + +void AdaParser::variant() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST variant_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WHEN); + choice_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + component_list(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 823 "ada.g" + Set (w_AST, VARIANT); +#line 7022 "AdaParser.cpp" + } + variant_AST = RefAdaAST(currentAST.root); + returnAST = variant_AST; +} + +void AdaParser::choice_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST choice_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + RefAdaAST tmp224_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp224_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp224_AST)); + } + match(PIPE); + choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop266; + } + + } + _loop266:; + } // ( ... )* + choice_s_AST = RefAdaAST(currentAST.root); + returnAST = choice_s_AST; +} + +void AdaParser::choice() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST choice_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if ((LA(1) == OTHERS)) { + RefAdaAST tmp225_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp225_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp225_AST)); + } + match(OTHERS); + choice_AST = RefAdaAST(currentAST.root); + } + else { + bool synPredMatched269 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_20.member(LA(2))))) { + int _m269 = mark(); + synPredMatched269 = true; + inputState->guessing++; + try { + { + discrete_with_range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched269 = false; + } + rewind(_m269); + inputState->guessing--; + } + if ( synPredMatched269 ) { + discrete_with_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + choice_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_21.member(LA(2)))) { + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + choice_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = choice_AST; +} + +void AdaParser::discrete_with_range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_with_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched272 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == DOT || LA(2) == TIC || LA(2) == RANGE))) { + int _m272 = mark(); + synPredMatched272 = true; + inputState->guessing++; + try { + { + mark_with_constraint(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched272 = false; + } + rewind(_m272); + inputState->guessing--; + } + if ( synPredMatched272 ) { + mark_with_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_with_range_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2)))) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_with_range_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = discrete_with_range_AST; +} + +void AdaParser::mark_with_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST mark_with_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + mark_with_constraint_AST = RefAdaAST(currentAST.root); +#line 839 "ada.g" + mark_with_constraint_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MARK_WITH_CONSTRAINT,"MARK_WITH_CONSTRAINT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mark_with_constraint_AST)))); +#line 7174 "AdaParser.cpp" + currentAST.root = mark_with_constraint_AST; + if ( mark_with_constraint_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + mark_with_constraint_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = mark_with_constraint_AST->getFirstChild(); + else + currentAST.child = mark_with_constraint_AST; + currentAST.advanceChildToEnd(); + } + mark_with_constraint_AST = RefAdaAST(currentAST.root); + returnAST = mark_with_constraint_AST; +} + +void AdaParser::generic_formal_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case USE: + { + use_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case WITH: + case TYPE: + { + generic_formal_parameter(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop289; + } + } + } + _loop289:; + } // ( ... )* + if ( inputState->guessing==0 ) { + generic_formal_part_opt_AST = RefAdaAST(currentAST.root); +#line 885 "ada.g" + generic_formal_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(GENERIC_FORMAL_PART,"GENERIC_FORMAL_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(generic_formal_part_opt_AST)))); +#line 7234 "AdaParser.cpp" + currentAST.root = generic_formal_part_opt_AST; + if ( generic_formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + generic_formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = generic_formal_part_opt_AST->getFirstChild(); + else + currentAST.child = generic_formal_part_opt_AST; + currentAST.advanceChildToEnd(); + } + generic_formal_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = generic_formal_part_opt_AST; +} + +void AdaParser::generic_formal_parameter() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_formal_parameter_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case TYPE: + { + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TYPE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + match(BOX); + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 895 "ada.g" + Set (t_AST, FORMAL_DISCRETE_TYPE_DECLARATION); +#line 7285 "AdaParser.cpp" + } + break; + } + case RANGE: + { + match(RANGE); + match(BOX); + if ( inputState->guessing==0 ) { +#line 897 "ada.g" + Set (t_AST, FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); +#line 7296 "AdaParser.cpp" + } + break; + } + case MOD: + { + match(MOD); + match(BOX); + if ( inputState->guessing==0 ) { +#line 899 "ada.g" + Set (t_AST, FORMAL_MODULAR_TYPE_DECLARATION); +#line 7307 "AdaParser.cpp" + } + break; + } + case DELTA: + { + match(DELTA); + match(BOX); + { + switch ( LA(1)) { + case DIGITS: + { + match(DIGITS); + match(BOX); + if ( inputState->guessing==0 ) { +#line 902 "ada.g" + Set (t_AST, FORMAL_DECIMAL_FIXED_POINT_DECLARATION); +#line 7324 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 903 "ada.g" + Set (t_AST, FORMAL_ORDINARY_FIXED_POINT_DECLARATION); +#line 7333 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case DIGITS: + { + match(DIGITS); + match(BOX); + if ( inputState->guessing==0 ) { +#line 906 "ada.g" + Set (t_AST, FORMAL_FLOATING_POINT_DECLARATION); +#line 7352 "AdaParser.cpp" + } + break; + } + case ARRAY: + { + array_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ACCESS: + { + access_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRIVATE: + case NEW: + case ABSTRACT: + case TAGGED: + case LIMITED: + { + empty_discrim_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discriminable_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + discrim_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + discriminable_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 913 "ada.g" + pop_def_id(); +#line 7418 "AdaParser.cpp" + } + break; + } + case WITH: + { + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WITH); + { + switch ( LA(1)) { + case PROCEDURE: + { + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subprogram_default_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 915 "ada.g" + Set(w_AST, FORMAL_PROCEDURE_DECLARATION); +#line 7450 "AdaParser.cpp" + } + break; + } + case FUNCTION: + { + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subprogram_default_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 917 "ada.g" + Set(w_AST, FORMAL_FUNCTION_DECLARATION); +#line 7472 "AdaParser.cpp" + } + break; + } + case PACKAGE: + { + match(PACKAGE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + match(NEW); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_package_actual_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 919 "ada.g" + Set(w_AST, FORMAL_PACKAGE_DECLARATION); +#line 7496 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 921 "ada.g" + pop_def_id(); +#line 7509 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + parameter_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + generic_formal_parameter_AST = RefAdaAST(currentAST.root); + returnAST = generic_formal_parameter_AST; +} + +void AdaParser::discriminable_type_definition( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminable_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched299 = false; + if (((LA(1) == NEW || LA(1) == ABSTRACT) && (LA(2) == IDENTIFIER || LA(2) == NEW))) { + int _m299 = mark(); + synPredMatched299 = true; + inputState->guessing++; + try { + { + { + switch ( LA(1)) { + case ABSTRACT: + { + match(ABSTRACT); + break; + } + case NEW: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(NEW); + subtype_ind(); + match(WITH); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched299 = false; + } + rewind(_m299); + inputState->guessing--; + } + if ( synPredMatched299 ) { + abstract_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(WITH); + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 930 "ada.g" + Set (t, FORMAL_PRIVATE_EXTENSION_DECLARATION); +#line 7589 "AdaParser.cpp" + } + discriminable_type_definition_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == NEW) && (LA(2) == IDENTIFIER)) { + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 932 "ada.g" + Set (t, FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); +#line 7602 "AdaParser.cpp" + } + discriminable_type_definition_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_22.member(LA(1))) && (_tokenSet_23.member(LA(2)))) { + abstract_tagged_limited_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 934 "ada.g" + Set (t, FORMAL_PRIVATE_TYPE_DECLARATION); +#line 7615 "AdaParser.cpp" + } + discriminable_type_definition_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = discriminable_type_definition_AST; +} + +void AdaParser::subprogram_default_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprogram_default_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IS: + { + match(IS); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp253_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp253_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp253_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + { + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subprogram_default_opt_AST = RefAdaAST(currentAST.root); + returnAST = subprogram_default_opt_AST; +} + +void AdaParser::formal_package_actual_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST formal_package_actual_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp255_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp255_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp255_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + { + defining_identifier_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(RPAREN); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + formal_package_actual_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = formal_package_actual_part_opt_AST; +} + +void AdaParser::body_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST body_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + declarative_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + block_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + body_part_AST = RefAdaAST(currentAST.root); + returnAST = body_part_AST; +} + +void AdaParser::declarative_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST declarative_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + declarative_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop316; + } + } + } + _loop316:; + } // ( ... )* + if ( inputState->guessing==0 ) { + declarative_part_AST = RefAdaAST(currentAST.root); +#line 978 "ada.g" + declarative_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DECLARATIVE_PART,"DECLARATIVE_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(declarative_part_AST)))); +#line 7799 "AdaParser.cpp" + currentAST.root = declarative_part_AST; + if ( declarative_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + declarative_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = declarative_part_AST->getFirstChild(); + else + currentAST.child = declarative_part_AST; + currentAST.advanceChildToEnd(); + } + declarative_part_AST = RefAdaAST(currentAST.root); + returnAST = declarative_part_AST; +} + +void AdaParser::block_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST block_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken b = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST b_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + b = LT(1); + if ( inputState->guessing == 0 ) { + b_AST = astFactory->create(b); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(b_AST)); + } + match(BEGIN); + handled_stmt_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1058 "ada.g" + Set(b_AST, BLOCK_BODY); +#line 7832 "AdaParser.cpp" + } + block_body_AST = RefAdaAST(currentAST.root); + returnAST = block_body_AST; +} + +void AdaParser::declarative_item() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST declarative_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken tsk = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST tsk_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pro = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pro_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PACKAGE: + { + pkg = LT(1); + if ( inputState->guessing == 0 ) { + pkg_AST = astFactory->create(pkg); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST)); + } + match(PACKAGE); + { + switch ( LA(1)) { + case BODY: + { + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case SEPARATE: + { + separate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 986 "ada.g" + Set(pkg_AST, PACKAGE_BODY_STUB); +#line 7878 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case END: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + pkg_body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 988 "ada.g" + Set(pkg_AST, PACKAGE_BODY); +#line 7904 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + case IDENTIFIER: + { + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + spec_decl_part(pkg_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case TASK: + { + tsk = LT(1); + if ( inputState->guessing == 0 ) { + tsk_AST = astFactory->create(tsk); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tsk_AST)); + } + match(TASK); + { + switch ( LA(1)) { + case BODY: + { + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case SEPARATE: + { + separate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 994 "ada.g" + Set(tsk_AST, TASK_BODY_STUB); +#line 7964 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 995 "ada.g" + Set(tsk_AST, TASK_BODY); +#line 7989 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + case IDENTIFIER: + case TYPE: + { + task_type_or_single_decl(tsk_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case PROTECTED: + { + pro = LT(1); + if ( inputState->guessing == 0 ) { + pro_AST = astFactory->create(pro); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pro_AST)); + } + match(PROTECTED); + { + switch ( LA(1)) { + case BODY: + { + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case SEPARATE: + { + separate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1002 "ada.g" + Set(pro_AST, PROTECTED_BODY_STUB); +#line 8046 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case PROCEDURE: + case FUNCTION: + case ENTRY: + case END: + { + prot_op_bodies_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1004 "ada.g" + Set(pro_AST, PROTECTED_BODY); +#line 8067 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case IDENTIFIER: + case TYPE: + { + prot_type_or_single_decl(pro_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl_or_rename_or_inst_or_body(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case USE: + case TYPE: + case FOR: + case SUBTYPE: + case GENERIC: + { + decl_common(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + declarative_item_AST = RefAdaAST(currentAST.root); + returnAST = declarative_item_AST; +} + +void AdaParser::body_is() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST body_is_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(BODY); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_is_AST = RefAdaAST(currentAST.root); + returnAST = body_is_AST; +} + +void AdaParser::separate() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST separate_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(SEPARATE); + if ( inputState->guessing==0 ) { +#line 1023 "ada.g" + pop_def_id(); +#line 8153 "AdaParser.cpp" + } + separate_AST = RefAdaAST(currentAST.root); + returnAST = separate_AST; +} + +void AdaParser::prot_op_bodies_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_op_bodies_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case ENTRY: + { + entry_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl_or_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop332; + } + } + } + _loop332:; + } // ( ... )* + if ( inputState->guessing==0 ) { + prot_op_bodies_opt_AST = RefAdaAST(currentAST.root); +#line 1039 "ada.g" + prot_op_bodies_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_OP_BODIES_OPT,"PROT_OP_BODIES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_op_bodies_opt_AST)))); +#line 8205 "AdaParser.cpp" + currentAST.root = prot_op_bodies_opt_AST; + if ( prot_op_bodies_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_op_bodies_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_op_bodies_opt_AST->getFirstChild(); + else + currentAST.child = prot_op_bodies_opt_AST; + currentAST.advanceChildToEnd(); + } + prot_op_bodies_opt_AST = RefAdaAST(currentAST.root); + returnAST = prot_op_bodies_opt_AST; +} + +void AdaParser::block_body_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST block_body_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case BEGIN: + { + match(BEGIN); + handled_stmt_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + block_body_opt_AST = RefAdaAST(currentAST.root); +#line 1030 "ada.g" + block_body_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BLOCK_BODY_OPT,"BLOCK_BODY_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(block_body_opt_AST)))); +#line 8249 "AdaParser.cpp" + currentAST.root = block_body_opt_AST; + if ( block_body_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + block_body_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = block_body_opt_AST->getFirstChild(); + else + currentAST.child = block_body_opt_AST; + currentAST.advanceChildToEnd(); + } + block_body_opt_AST = RefAdaAST(currentAST.root); + returnAST = block_body_opt_AST; +} + +void AdaParser::handled_stmt_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST handled_stmt_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + except_handler_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + handled_stmt_s_AST = RefAdaAST(currentAST.root); +#line 1062 "ada.g" + handled_stmt_s_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(HANDLED_SEQUENCE_OF_STATEMENTS,"HANDLED_SEQUENCE_OF_STATEMENTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(handled_stmt_s_AST)))); +#line 8280 "AdaParser.cpp" + currentAST.root = handled_stmt_s_AST; + if ( handled_stmt_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + handled_stmt_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = handled_stmt_s_AST->getFirstChild(); + else + currentAST.child = handled_stmt_s_AST; + currentAST.advanceChildToEnd(); + } + handled_stmt_s_AST = RefAdaAST(currentAST.root); + returnAST = handled_stmt_s_AST; +} + +void AdaParser::entry_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + e = LT(1); + if ( inputState->guessing == 0 ) { + e_AST = astFactory->create(e); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST)); + } + match(ENTRY); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_body_formal_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_barrier(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1236 "ada.g" + Set (e_AST, ENTRY_BODY); +#line 8327 "AdaParser.cpp" + } + entry_body_AST = RefAdaAST(currentAST.root); + returnAST = entry_body_AST; +} + +void AdaParser::subprog_decl_or_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprog_decl_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1046 "ada.g" + Set(p_AST, PROCEDURE_BODY); +#line 8371 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 1047 "ada.g" + pop_def_id(); Set(p_AST, PROCEDURE_DECLARATION); +#line 8380 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + subprog_decl_or_body_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1051 "ada.g" + Set(f_AST, FUNCTION_BODY); +#line 8422 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 1052 "ada.g" + pop_def_id(); Set(f_AST, FUNCTION_DECLARATION); +#line 8431 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + subprog_decl_or_body_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprog_decl_or_body_AST; +} + +void AdaParser::statements() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST statements_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt342=0; + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case LT_LT: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + statement(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + if ( _cnt342>=1 ) { goto _loop342; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + } + _cnt342++; + } + _loop342:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + statements_AST = RefAdaAST(currentAST.root); +#line 1074 "ada.g" + statements_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SEQUENCE_OF_STATEMENTS,"SEQUENCE_OF_STATEMENTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(statements_AST)))); +#line 8509 "AdaParser.cpp" + currentAST.root = statements_AST; + if ( statements_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + statements_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = statements_AST->getFirstChild(); + else + currentAST.child = statements_AST; + currentAST.advanceChildToEnd(); + } + statements_AST = RefAdaAST(currentAST.root); + returnAST = statements_AST; +} + +void AdaParser::except_handler_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST except_handler_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case EXCEPTION: + { + match(EXCEPTION); + { // ( ... )+ + int _cnt429=0; + for (;;) { + if ((LA(1) == WHEN)) { + exception_handler(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + if ( _cnt429>=1 ) { goto _loop429; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + + _cnt429++; + } + _loop429:; + } // ( ... )+ + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + except_handler_part_opt_AST = RefAdaAST(currentAST.root); +#line 1365 "ada.g" + except_handler_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXCEPT_HANDLER_PART_OPT,"EXCEPT_HANDLER_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(except_handler_part_opt_AST)))); +#line 8566 "AdaParser.cpp" + currentAST.root = except_handler_part_opt_AST; + if ( except_handler_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + except_handler_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = except_handler_part_opt_AST->getFirstChild(); + else + currentAST.child = except_handler_part_opt_AST; + currentAST.advanceChildToEnd(); + } + except_handler_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = except_handler_part_opt_AST; +} + +void AdaParser::handled_stmts_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST handled_stmts_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRAGMA: + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case LT_LT: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + except_handler_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + handled_stmts_opt_AST = RefAdaAST(currentAST.root); +#line 1068 "ada.g" + handled_stmts_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(HANDLED_STMTS_OPT,"HANDLED_STMTS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(handled_stmts_opt_AST)))); +#line 8632 "AdaParser.cpp" + currentAST.root = handled_stmts_opt_AST; + if ( handled_stmts_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + handled_stmts_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = handled_stmts_opt_AST->getFirstChild(); + else + currentAST.child = handled_stmts_opt_AST; + currentAST.advanceChildToEnd(); + } + handled_stmts_opt_AST = RefAdaAST(currentAST.root); + returnAST = handled_stmts_opt_AST; +} + +void AdaParser::statement() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST statement_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_label_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case NuLL: + { + null_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case EXIT: + { + exit_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RETURN: + { + return_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GOTO: + { + goto_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DELAY: + { + delay_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ABORT: + { + abort_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RAISE: + { + raise_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case REQUEUE: + { + requeue_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ACCEPT: + { + accept_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SELECT: + { + select_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IF: + { + if_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case CASE: + { + case_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case FOR: + case LOOP: + case WHILE: + { + loop_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case BEGIN: + case DECLARE: + { + block(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(SEMI); + break; + } + default: + if ((LA(1) == IDENTIFIER) && (LA(2) == COLON)) { + statement_identifier(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case FOR: + case LOOP: + case WHILE: + { + loop_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case BEGIN: + case DECLARE: + { + block(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_24.member(LA(2)))) { + call_or_assignment(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + statement_AST = RefAdaAST(currentAST.root); +#line 1100 "ada.g" + statement_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(STATEMENT,"STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(statement_AST)))); +#line 8833 "AdaParser.cpp" + currentAST.root = statement_AST; + if ( statement_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + statement_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = statement_AST->getFirstChild(); + else + currentAST.child = statement_AST; + currentAST.advanceChildToEnd(); + } + statement_AST = RefAdaAST(currentAST.root); + returnAST = statement_AST; +} + +void AdaParser::def_label_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_label_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LT_LT: + { + match(LT_LT); + RefAdaAST tmp277_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp277_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp277_AST)); + } + match(IDENTIFIER); + match(GT_GT); + break; + } + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + def_label_opt_AST = RefAdaAST(currentAST.root); +#line 1104 "ada.g" + def_label_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(LABEL_OPT,"LABEL_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(def_label_opt_AST)))); +#line 8896 "AdaParser.cpp" + currentAST.root = def_label_opt_AST; + if ( def_label_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + def_label_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = def_label_opt_AST->getFirstChild(); + else + currentAST.child = def_label_opt_AST; + currentAST.advanceChildToEnd(); + } + def_label_opt_AST = RefAdaAST(currentAST.root); + returnAST = def_label_opt_AST; +} + +void AdaParser::null_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST null_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(NuLL); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1108 "ada.g" + Set(s_AST, NULL_STATEMENT); +#line 8926 "AdaParser.cpp" + } + null_stmt_AST = RefAdaAST(currentAST.root); + returnAST = null_stmt_AST; +} + +void AdaParser::exit_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST exit_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(EXIT); + { + switch ( LA(1)) { + case IDENTIFIER: + { + label_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case WHEN: + { + RefAdaAST tmp280_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp280_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp280_AST)); + } + match(WHEN); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1206 "ada.g" + Set(s_AST, EXIT_STATEMENT); +#line 8996 "AdaParser.cpp" + } + exit_stmt_AST = RefAdaAST(currentAST.root); + returnAST = exit_stmt_AST; +} + +void AdaParser::return_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST return_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(RETURN); + { + switch ( LA(1)) { + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1213 "ada.g" + Set(s_AST, RETURN_STATEMENT); +#line 9049 "AdaParser.cpp" + } + return_stmt_AST = RefAdaAST(currentAST.root); + returnAST = return_stmt_AST; +} + +void AdaParser::goto_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST goto_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(GOTO); + label_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1217 "ada.g" + Set(s_AST, GOTO_STATEMENT); +#line 9076 "AdaParser.cpp" + } + goto_stmt_AST = RefAdaAST(currentAST.root); + returnAST = goto_stmt_AST; +} + +void AdaParser::delay_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST delay_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + d = LT(1); + if ( inputState->guessing == 0 ) { + d_AST = astFactory->create(d); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST)); + } + match(DELAY); + until_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1282 "ada.g" + Set (d_AST, DELAY_STATEMENT); +#line 9107 "AdaParser.cpp" + } + delay_stmt_AST = RefAdaAST(currentAST.root); + returnAST = delay_stmt_AST; +} + +void AdaParser::abort_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abort_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + a = LT(1); + if ( inputState->guessing == 0 ) { + a_AST = astFactory->create(a); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST)); + } + match(ABORT); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop425; + } + + } + _loop425:; + } // ( ... )* + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1361 "ada.g" + Set (a_AST, ABORT_STATEMENT); +#line 9150 "AdaParser.cpp" + } + abort_stmt_AST = RefAdaAST(currentAST.root); + returnAST = abort_stmt_AST; +} + +void AdaParser::raise_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST raise_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(RAISE); + { + switch ( LA(1)) { + case IDENTIFIER: + { + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1389 "ada.g" + Set (r_AST, RAISE_STATEMENT); +#line 9193 "AdaParser.cpp" + } + raise_stmt_AST = RefAdaAST(currentAST.root); + returnAST = raise_stmt_AST; +} + +void AdaParser::requeue_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST requeue_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(REQUEUE); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case WITH: + { + match(WITH); + RefAdaAST tmp289_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp289_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp289_AST)); + } + match(ABORT); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1393 "ada.g" + Set (r_AST, REQUEUE_STATEMENT); +#line 9243 "AdaParser.cpp" + } + requeue_stmt_AST = RefAdaAST(currentAST.root); + returnAST = requeue_stmt_AST; +} + +void AdaParser::accept_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST accept_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + a = LT(1); + if ( inputState->guessing == 0 ) { + a_AST = astFactory->create(a); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST)); + } + match(ACCEPT); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_index_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case DO: + { + match(DO); + handled_stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case SEMI: + { + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1264 "ada.g" + pop_def_id(); +#line 9296 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 1266 "ada.g" + Set (a_AST, ACCEPT_STATEMENT); +#line 9309 "AdaParser.cpp" + } + accept_stmt_AST = RefAdaAST(currentAST.root); + returnAST = accept_stmt_AST; +} + +void AdaParser::select_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST select_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(SELECT); + { + bool synPredMatched403 = false; + if (((LA(1) == IDENTIFIER || LA(1) == DELAY) && (_tokenSet_25.member(LA(2))))) { + int _m403 = mark(); + synPredMatched403 = true; + inputState->guessing++; + try { + { + triggering_alternative(); + match(THEN); + match(ABORT); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched403 = false; + } + rewind(_m403); + inputState->guessing--; + } + if ( synPredMatched403 ) { + triggering_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(THEN); + match(ABORT); + abortable_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1297 "ada.g" + Set (s_AST, ASYNCHRONOUS_SELECT); +#line 9361 "AdaParser.cpp" + } + } + else if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) { + selective_accept(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1299 "ada.g" + Set (s_AST, SELECTIVE_ACCEPT); +#line 9372 "AdaParser.cpp" + } + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_28.member(LA(2)))) { + entry_call_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case OR: + { + match(OR); + delay_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1301 "ada.g" + Set (s_AST, TIMED_ENTRY_CALL); +#line 9392 "AdaParser.cpp" + } + break; + } + case ELSE: + { + match(ELSE); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1302 "ada.g" + Set (s_AST, CONDITIONAL_ENTRY_CALL); +#line 9406 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + match(END); + match(SELECT); + match(SEMI); + select_stmt_AST = RefAdaAST(currentAST.root); + returnAST = select_stmt_AST; +} + +void AdaParser::if_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST if_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(IF); + cond_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + elsifs_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + else_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(IF); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1114 "ada.g" + Set(s_AST, IF_STATEMENT); +#line 9460 "AdaParser.cpp" + } + if_stmt_AST = RefAdaAST(currentAST.root); + returnAST = if_stmt_AST; +} + +void AdaParser::case_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST case_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(CASE); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + alternative_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(CASE); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1134 "ada.g" + Set(s_AST, CASE_STATEMENT); +#line 9494 "AdaParser.cpp" + } + case_stmt_AST = RefAdaAST(currentAST.root); + returnAST = case_stmt_AST; +} + +void AdaParser::loop_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST loop_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken l = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST l_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + iteration_scheme_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + l = LT(1); + if ( inputState->guessing == 0 ) { + l_AST = astFactory->create(l); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(l_AST)); + } + match(LOOP); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(LOOP); + if ( inputState->guessing==0 ) { +#line 1146 "ada.g" + Set(l_AST, LOOP_STATEMENT); +#line 9526 "AdaParser.cpp" + } + loop_stmt_AST = RefAdaAST(currentAST.root); + returnAST = loop_stmt_AST; +} + +void AdaParser::block() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST block_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + declare_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + block_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + block_AST = RefAdaAST(currentAST.root); +#line 1198 "ada.g" + block_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BLOCK_STATEMENT,"BLOCK_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(block_AST)))); +#line 9549 "AdaParser.cpp" + currentAST.root = block_AST; + if ( block_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + block_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = block_AST->getFirstChild(); + else + currentAST.child = block_AST; + currentAST.advanceChildToEnd(); + } + block_AST = RefAdaAST(currentAST.root); + returnAST = block_AST; +} + +void AdaParser::statement_identifier() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST statement_identifier_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + } + match(IDENTIFIER); + match(COLON); + if ( inputState->guessing==0 ) { +#line 1186 "ada.g" + push_def_id(n_AST); +#line 9578 "AdaParser.cpp" + } + returnAST = statement_identifier_AST; +} + +void AdaParser::id_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST id_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + id_opt_aux(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + id_opt_AST = RefAdaAST(currentAST.root); +#line 1172 "ada.g" + id_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ID_OPT,"ID_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_opt_AST)))); +#line 9596 "AdaParser.cpp" + currentAST.root = id_opt_AST; + if ( id_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + id_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = id_opt_AST->getFirstChild(); + else + currentAST.child = id_opt_AST; + currentAST.advanceChildToEnd(); + } + id_opt_AST = RefAdaAST(currentAST.root); + returnAST = id_opt_AST; +} + +void AdaParser::call_or_assignment() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST call_or_assignment_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case ASSIGN: + { + match(ASSIGN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + call_or_assignment_AST = RefAdaAST(currentAST.root); +#line 1222 "ada.g" + call_or_assignment_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ASSIGNMENT_STATEMENT,"ASSIGNMENT_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(call_or_assignment_AST)))); +#line 9632 "AdaParser.cpp" + currentAST.root = call_or_assignment_AST; + if ( call_or_assignment_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + call_or_assignment_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = call_or_assignment_AST->getFirstChild(); + else + currentAST.child = call_or_assignment_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { + call_or_assignment_AST = RefAdaAST(currentAST.root); +#line 1225 "ada.g" + call_or_assignment_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CALL_STATEMENT,"CALL_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(call_or_assignment_AST)))); +#line 9650 "AdaParser.cpp" + currentAST.root = call_or_assignment_AST; + if ( call_or_assignment_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + call_or_assignment_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = call_or_assignment_AST->getFirstChild(); + else + currentAST.child = call_or_assignment_AST; + currentAST.advanceChildToEnd(); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + call_or_assignment_AST = RefAdaAST(currentAST.root); + returnAST = call_or_assignment_AST; +} + +void AdaParser::cond_clause() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST cond_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST c_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + c = LT(1); + if ( inputState->guessing == 0 ) { + c_AST = astFactory->create(c); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST)); + } + match(THEN); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1118 "ada.g" + Set(c_AST, COND_CLAUSE); +#line 9696 "AdaParser.cpp" + } + cond_clause_AST = RefAdaAST(currentAST.root); + returnAST = cond_clause_AST; +} + +void AdaParser::elsifs_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST elsifs_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == ELSIF)) { + match(ELSIF); + cond_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop354; + } + + } + _loop354:; + } // ( ... )* + if ( inputState->guessing==0 ) { + elsifs_opt_AST = RefAdaAST(currentAST.root); +#line 1126 "ada.g" + elsifs_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELSIFS_OPT,"ELSIFS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(elsifs_opt_AST)))); +#line 9727 "AdaParser.cpp" + currentAST.root = elsifs_opt_AST; + if ( elsifs_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + elsifs_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = elsifs_opt_AST->getFirstChild(); + else + currentAST.child = elsifs_opt_AST; + currentAST.advanceChildToEnd(); + } + elsifs_opt_AST = RefAdaAST(currentAST.root); + returnAST = elsifs_opt_AST; +} + +void AdaParser::else_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST else_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ELSE: + { + match(ELSE); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + else_opt_AST = RefAdaAST(currentAST.root); +#line 1130 "ada.g" + else_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELSE_OPT,"ELSE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(else_opt_AST)))); +#line 9770 "AdaParser.cpp" + currentAST.root = else_opt_AST; + if ( else_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + else_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = else_opt_AST->getFirstChild(); + else + currentAST.child = else_opt_AST; + currentAST.advanceChildToEnd(); + } + else_opt_AST = RefAdaAST(currentAST.root); + returnAST = else_opt_AST; +} + +void AdaParser::condition() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST condition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + condition_AST = RefAdaAST(currentAST.root); + returnAST = condition_AST; +} + +void AdaParser::alternative_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST alternative_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt360=0; + for (;;) { + if ((LA(1) == WHEN)) { + case_statement_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + if ( _cnt360>=1 ) { goto _loop360; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + + _cnt360++; + } + _loop360:; + } // ( ... )+ + alternative_s_AST = RefAdaAST(currentAST.root); + returnAST = alternative_s_AST; +} + +void AdaParser::case_statement_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST case_statement_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(WHEN); + choice_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1141 "ada.g" + Set(s_AST, CASE_STATEMENT_ALTERNATIVE); +#line 9847 "AdaParser.cpp" + } + case_statement_alternative_AST = RefAdaAST(currentAST.root); + returnAST = case_statement_alternative_AST; +} + +void AdaParser::iteration_scheme_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST iteration_scheme_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case WHILE: + { + RefAdaAST tmp316_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp316_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp316_AST)); + } + match(WHILE); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case FOR: + { + RefAdaAST tmp317_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp317_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp317_AST)); + } + match(FOR); + RefAdaAST tmp318_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp318_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp318_AST)); + } + match(IDENTIFIER); + match(IN); + reverse_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_subtype_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LOOP: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + iteration_scheme_opt_AST = RefAdaAST(currentAST.root); +#line 1152 "ada.g" + iteration_scheme_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ITERATION_SCHEME_OPT,"ITERATION_SCHEME_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(iteration_scheme_opt_AST)))); +#line 9914 "AdaParser.cpp" + currentAST.root = iteration_scheme_opt_AST; + if ( iteration_scheme_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + iteration_scheme_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = iteration_scheme_opt_AST->getFirstChild(); + else + currentAST.child = iteration_scheme_opt_AST; + currentAST.advanceChildToEnd(); + } + iteration_scheme_opt_AST = RefAdaAST(currentAST.root); + returnAST = iteration_scheme_opt_AST; +} + +void AdaParser::reverse_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST reverse_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case REVERSE: + { + RefAdaAST tmp320_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp320_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp320_AST)); + } + match(REVERSE); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + reverse_opt_AST = RefAdaAST(currentAST.root); +#line 1158 "ada.g" + reverse_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(reverse_opt_AST)))); +#line 9968 "AdaParser.cpp" + currentAST.root = reverse_opt_AST; + if ( reverse_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + reverse_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = reverse_opt_AST->getFirstChild(); + else + currentAST.child = reverse_opt_AST; + currentAST.advanceChildToEnd(); + } + reverse_opt_AST = RefAdaAST(currentAST.root); + returnAST = reverse_opt_AST; +} + +void AdaParser::id_opt_aux() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST id_opt_aux_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 1161 "ada.g" + RefAdaAST endid; +#line 9988 "AdaParser.cpp" + + switch ( LA(1)) { + case CHAR_STRING: + { + endid=definable_operator_symbol(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( end_id_matches_def_id (endid) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" end_id_matches_def_id (endid) "); + id_opt_aux_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + compound_name(); + if (inputState->guessing==0) { + n_AST = returnAST; + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( end_id_matches_def_id (n_AST) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" end_id_matches_def_id (n_AST) "); + id_opt_aux_AST = RefAdaAST(currentAST.root); + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 1168 "ada.g" + pop_def_id(); +#line 10019 "AdaParser.cpp" + } + id_opt_aux_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = id_opt_aux_AST; +} + +void AdaParser::declare_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST declare_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case DECLARE: + { + match(DECLARE); + declarative_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case BEGIN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + declare_opt_AST = RefAdaAST(currentAST.root); +#line 1202 "ada.g" + declare_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DECLARE_OPT,"DECLARE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(declare_opt_AST)))); +#line 10062 "AdaParser.cpp" + currentAST.root = declare_opt_AST; + if ( declare_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + declare_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = declare_opt_AST->getFirstChild(); + else + currentAST.child = declare_opt_AST; + currentAST.advanceChildToEnd(); + } + declare_opt_AST = RefAdaAST(currentAST.root); + returnAST = declare_opt_AST; +} + +void AdaParser::label_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST label_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp322_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp322_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp322_AST)); + } + match(IDENTIFIER); + label_name_AST = RefAdaAST(currentAST.root); + returnAST = label_name_AST; +} + +void AdaParser::entry_body_formal_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_body_formal_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + entry_index_spec_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_body_formal_part_AST = RefAdaAST(currentAST.root); + returnAST = entry_body_formal_part_AST; +} + +void AdaParser::entry_barrier() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_barrier_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(WHEN); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_barrier_AST = RefAdaAST(currentAST.root); + returnAST = entry_barrier_AST; +} + +void AdaParser::entry_index_spec_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_index_spec_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched388 = false; + if (((LA(1) == LPAREN) && (LA(2) == FOR))) { + int _m388 = mark(); + synPredMatched388 = true; + inputState->guessing++; + try { + { + match(LPAREN); + match(FOR); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched388 = false; + } + rewind(_m388); + inputState->guessing--; + } + if ( synPredMatched388 ) { + match(LPAREN); + match(FOR); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IN); + discrete_subtype_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + } + else if ((LA(1) == LPAREN || LA(1) == WHEN) && (_tokenSet_0.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + entry_index_spec_opt_AST = RefAdaAST(currentAST.root); +#line 1247 "ada.g" + entry_index_spec_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_INDEX_SPECIFICATION,"ENTRY_INDEX_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_index_spec_opt_AST)))); +#line 10170 "AdaParser.cpp" + currentAST.root = entry_index_spec_opt_AST; + if ( entry_index_spec_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_index_spec_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_index_spec_opt_AST->getFirstChild(); + else + currentAST.child = entry_index_spec_opt_AST; + currentAST.advanceChildToEnd(); + } + entry_index_spec_opt_AST = RefAdaAST(currentAST.root); + returnAST = entry_index_spec_opt_AST; +} + +void AdaParser::entry_call_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_call_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { + entry_call_stmt_AST = RefAdaAST(currentAST.root); +#line 1257 "ada.g" + entry_call_stmt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_CALL_STATEMENT,"ENTRY_CALL_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_call_stmt_AST)))); +#line 10198 "AdaParser.cpp" + currentAST.root = entry_call_stmt_AST; + if ( entry_call_stmt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_call_stmt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_call_stmt_AST->getFirstChild(); + else + currentAST.child = entry_call_stmt_AST; + currentAST.advanceChildToEnd(); + } + entry_call_stmt_AST = RefAdaAST(currentAST.root); + returnAST = entry_call_stmt_AST; +} + +void AdaParser::entry_index_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_index_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched396 = false; + if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) { + int _m396 = mark(); + synPredMatched396 = true; + inputState->guessing++; + try { + { + match(LPAREN); + expression(); + match(RPAREN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched396 = false; + } + rewind(_m396); + inputState->guessing--; + } + if ( synPredMatched396 ) { + match(LPAREN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + } + else if ((LA(1) == SEMI || LA(1) == LPAREN || LA(1) == DO) && (_tokenSet_29.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + entry_index_opt_AST = RefAdaAST(currentAST.root); +#line 1276 "ada.g" + entry_index_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_INDEX_OPT,"ENTRY_INDEX_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_index_opt_AST)))); +#line 10255 "AdaParser.cpp" + currentAST.root = entry_index_opt_AST; + if ( entry_index_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_index_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_index_opt_AST->getFirstChild(); + else + currentAST.child = entry_index_opt_AST; + currentAST.advanceChildToEnd(); + } + entry_index_opt_AST = RefAdaAST(currentAST.root); + returnAST = entry_index_opt_AST; +} + +void AdaParser::until_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST until_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case UNTIL: + { + RefAdaAST tmp331_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp331_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp331_AST)); + } + match(UNTIL); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + until_opt_AST = RefAdaAST(currentAST.root); +#line 1286 "ada.g" + until_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(until_opt_AST)))); +#line 10309 "AdaParser.cpp" + currentAST.root = until_opt_AST; + if ( until_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + until_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = until_opt_AST->getFirstChild(); + else + currentAST.child = until_opt_AST; + currentAST.advanceChildToEnd(); + } + until_opt_AST = RefAdaAST(currentAST.root); + returnAST = until_opt_AST; +} + +void AdaParser::triggering_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST triggering_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case DELAY: + { + delay_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + entry_call_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + triggering_alternative_AST = RefAdaAST(currentAST.root); +#line 1310 "ada.g" + triggering_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TRIGGERING_ALTERNATIVE,"TRIGGERING_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(triggering_alternative_AST)))); +#line 10360 "AdaParser.cpp" + currentAST.root = triggering_alternative_AST; + if ( triggering_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + triggering_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = triggering_alternative_AST->getFirstChild(); + else + currentAST.child = triggering_alternative_AST; + currentAST.advanceChildToEnd(); + } + triggering_alternative_AST = RefAdaAST(currentAST.root); + returnAST = triggering_alternative_AST; +} + +void AdaParser::abortable_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abortable_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + abortable_part_AST = RefAdaAST(currentAST.root); +#line 1316 "ada.g" + abortable_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ABORTABLE_PART,"ABORTABLE_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abortable_part_AST)))); +#line 10387 "AdaParser.cpp" + currentAST.root = abortable_part_AST; + if ( abortable_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + abortable_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = abortable_part_AST->getFirstChild(); + else + currentAST.child = abortable_part_AST; + currentAST.advanceChildToEnd(); + } + abortable_part_AST = RefAdaAST(currentAST.root); + returnAST = abortable_part_AST; +} + +void AdaParser::selective_accept() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST selective_accept_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + guard_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + or_select_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + else_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + selective_accept_AST = RefAdaAST(currentAST.root); + returnAST = selective_accept_AST; +} + +void AdaParser::entry_call_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_call_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + entry_call_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + entry_call_alternative_AST = RefAdaAST(currentAST.root); +#line 1322 "ada.g" + entry_call_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_CALL_ALTERNATIVE,"ENTRY_CALL_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_call_alternative_AST)))); +#line 10443 "AdaParser.cpp" + currentAST.root = entry_call_alternative_AST; + if ( entry_call_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_call_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_call_alternative_AST->getFirstChild(); + else + currentAST.child = entry_call_alternative_AST; + currentAST.advanceChildToEnd(); + } + entry_call_alternative_AST = RefAdaAST(currentAST.root); + returnAST = entry_call_alternative_AST; +} + +void AdaParser::delay_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST delay_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + delay_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + delay_alternative_AST = RefAdaAST(currentAST.root); +#line 1347 "ada.g" + delay_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DELAY_ALTERNATIVE,"DELAY_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(delay_alternative_AST)))); +#line 10474 "AdaParser.cpp" + currentAST.root = delay_alternative_AST; + if ( delay_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + delay_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = delay_alternative_AST->getFirstChild(); + else + currentAST.child = delay_alternative_AST; + currentAST.advanceChildToEnd(); + } + delay_alternative_AST = RefAdaAST(currentAST.root); + returnAST = delay_alternative_AST; +} + +void AdaParser::stmts_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST stmts_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case LT_LT: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + statement(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop419; + } + } + } + _loop419:; + } // ( ... )* + stmts_opt_AST = RefAdaAST(currentAST.root); + returnAST = stmts_opt_AST; +} + +void AdaParser::guard_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST guard_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case WHEN: + { + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WHEN); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop413; + } + + } + _loop413:; + } // ( ... )* + break; + } + case ACCEPT: + case DELAY: + case TERMINATE: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 1331 "ada.g" + Set(w_AST, GUARD_OPT); +#line 10595 "AdaParser.cpp" + } + guard_opt_AST = RefAdaAST(currentAST.root); + returnAST = guard_opt_AST; +} + +void AdaParser::select_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST select_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case ACCEPT: + { + accept_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative_AST = RefAdaAST(currentAST.root); + break; + } + case DELAY: + { + delay_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative_AST = RefAdaAST(currentAST.root); + break; + } + case TERMINATE: + { + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TERMINATE); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1337 "ada.g" + Set(t_AST, TERMINATE_ALTERNATIVE); +#line 10639 "AdaParser.cpp" + } + select_alternative_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = select_alternative_AST; +} + +void AdaParser::or_select_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST or_select_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == OR)) { + match(OR); + guard_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop422; + } + + } + _loop422:; + } // ( ... )* + if ( inputState->guessing==0 ) { + or_select_opt_AST = RefAdaAST(currentAST.root); +#line 1356 "ada.g" + or_select_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(OR_SELECT_OPT,"OR_SELECT_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(or_select_opt_AST)))); +#line 10682 "AdaParser.cpp" + currentAST.root = or_select_opt_AST; + if ( or_select_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + or_select_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = or_select_opt_AST->getFirstChild(); + else + currentAST.child = or_select_opt_AST; + currentAST.advanceChildToEnd(); + } + or_select_opt_AST = RefAdaAST(currentAST.root); + returnAST = or_select_opt_AST; +} + +void AdaParser::accept_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST accept_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + accept_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + accept_alternative_AST = RefAdaAST(currentAST.root); +#line 1341 "ada.g" + accept_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ACCEPT_ALTERNATIVE,"ACCEPT_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(accept_alternative_AST)))); +#line 10713 "AdaParser.cpp" + currentAST.root = accept_alternative_AST; + if ( accept_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + accept_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = accept_alternative_AST->getFirstChild(); + else + currentAST.child = accept_alternative_AST; + currentAST.advanceChildToEnd(); + } + accept_alternative_AST = RefAdaAST(currentAST.root); + returnAST = accept_alternative_AST; +} + +void AdaParser::exception_handler() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST exception_handler_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WHEN); + identifier_colon_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + except_choice_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1372 "ada.g" + Set (w_AST, EXCEPTION_HANDLER); +#line 10755 "AdaParser.cpp" + } + exception_handler_AST = RefAdaAST(currentAST.root); + returnAST = exception_handler_AST; +} + +void AdaParser::identifier_colon_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST identifier_colon_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + if ((LA(1) == IDENTIFIER) && (LA(2) == COLON)) { + RefAdaAST tmp336_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp336_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp336_AST)); + } + match(IDENTIFIER); + match(COLON); + } + else if ((LA(1) == IDENTIFIER || LA(1) == OTHERS) && (LA(2) == RIGHT_SHAFT || LA(2) == DOT || LA(2) == PIPE)) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + identifier_colon_opt_AST = RefAdaAST(currentAST.root); +#line 1376 "ada.g" + identifier_colon_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(IDENTIFIER_COLON_OPT,"IDENTIFIER_COLON_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(identifier_colon_opt_AST)))); +#line 10788 "AdaParser.cpp" + currentAST.root = identifier_colon_opt_AST; + if ( identifier_colon_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + identifier_colon_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = identifier_colon_opt_AST->getFirstChild(); + else + currentAST.child = identifier_colon_opt_AST; + currentAST.advanceChildToEnd(); + } + identifier_colon_opt_AST = RefAdaAST(currentAST.root); + returnAST = identifier_colon_opt_AST; +} + +void AdaParser::except_choice_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST except_choice_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + exception_choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + RefAdaAST tmp338_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp338_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp338_AST)); + } + match(PIPE); + exception_choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop435; + } + + } + _loop435:; + } // ( ... )* + except_choice_s_AST = RefAdaAST(currentAST.root); + returnAST = except_choice_s_AST; +} + +void AdaParser::exception_choice() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST exception_choice_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IDENTIFIER: + { + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + exception_choice_AST = RefAdaAST(currentAST.root); + break; + } + case OTHERS: + { + RefAdaAST tmp339_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp339_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp339_AST)); + } + match(OTHERS); + exception_choice_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = exception_choice_AST; +} + +void AdaParser::operator_call() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST operator_call_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken cs = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST cs_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + cs = LT(1); + if ( inputState->guessing == 0 ) { + cs_AST = astFactory->create(cs); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(cs_AST)); + } + match(CHAR_STRING); + operator_call_tail(cs_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + operator_call_AST = RefAdaAST(currentAST.root); + returnAST = operator_call_AST; +} + +void AdaParser::operator_call_tail( + RefAdaAST opstr +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST operator_call_tail_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + if (!( is_operator_symbol(opstr->getText().c_str()) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" is_operator_symbol(opstr->getText().c_str()) "); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 1401 "ada.g" + opstr->setType(OPERATOR_SYMBOL); +#line 10908 "AdaParser.cpp" + } + operator_call_tail_AST = RefAdaAST(currentAST.root); + returnAST = operator_call_tail_AST; +} + +void AdaParser::relation() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST relation_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IN: + { + RefAdaAST tmp342_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp342_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp342_AST)); + } + match(IN); + range_or_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NOT: + { + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(NOT); + match(IN); + range_or_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1425 "ada.g" + Set (n_AST, NOT_IN); +#line 10957 "AdaParser.cpp" + } + break; + } + case EQ: + { + RefAdaAST tmp344_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp344_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp344_AST)); + } + match(EQ); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NE: + { + RefAdaAST tmp345_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp345_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp345_AST)); + } + match(NE); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LT_: + { + RefAdaAST tmp346_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp346_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp346_AST)); + } + match(LT_); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LE: + { + RefAdaAST tmp347_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp347_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp347_AST)); + } + match(LE); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GT: + { + RefAdaAST tmp348_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp348_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp348_AST)); + } + match(GT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GE: + { + RefAdaAST tmp349_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp349_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp349_AST)); + } + match(GE); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case ASSIGN: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + relation_AST = RefAdaAST(currentAST.root); + returnAST = relation_AST; +} + +void AdaParser::range_or_mark() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_or_mark_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched455 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m455 = mark(); + synPredMatched455 = true; + inputState->guessing++; + try { + { + range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched455 = false; + } + rewind(_m455); + inputState->guessing--; + } + if ( synPredMatched455 ) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_or_mark_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_30.member(LA(2)))) { + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_or_mark_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = range_or_mark_AST; +} + +void AdaParser::signed_term() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST signed_term_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken m = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST m_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PLUS: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PLUS); + term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1447 "ada.g" + Set(p_AST, UNARY_PLUS); +#line 11141 "AdaParser.cpp" + } + signed_term_AST = RefAdaAST(currentAST.root); + break; + } + case MINUS: + { + m = LT(1); + if ( inputState->guessing == 0 ) { + m_AST = astFactory->create(m); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(m_AST)); + } + match(MINUS); + term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1448 "ada.g" + Set(m_AST, UNARY_MINUS); +#line 11161 "AdaParser.cpp" + } + signed_term_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case ABS: + case NUMERIC_LIT: + { + term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + signed_term_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = signed_term_AST; +} + +void AdaParser::term() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST term_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case STAR: + { + RefAdaAST tmp350_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp350_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp350_AST)); + } + match(STAR); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DIV: + { + RefAdaAST tmp351_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp351_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp351_AST)); + } + match(DIV); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case MOD: + { + RefAdaAST tmp352_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp352_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp352_AST)); + } + match(MOD); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case REM: + { + RefAdaAST tmp353_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp353_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp353_AST)); + } + match(REM); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop462; + } + } + } + _loop462:; + } // ( ... )* + term_AST = RefAdaAST(currentAST.root); + returnAST = term_AST; +} + +void AdaParser::factor() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST factor_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case NOT: + { + RefAdaAST tmp354_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp354_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp354_AST)); + } + match(NOT); + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ABS: + { + RefAdaAST tmp355_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp355_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp355_AST)); + } + match(ABS); + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NUMERIC_LIT: + { + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case EXPON: + { + RefAdaAST tmp356_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp356_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp356_AST)); + } + match(EXPON); + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case IN: + case ASSIGN: + case MOD: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + factor_AST = RefAdaAST(currentAST.root); + returnAST = factor_AST; +} + +void AdaParser::primary() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST primary_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken cs = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST cs_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IDENTIFIER: + { + name_or_qualified(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LPAREN: + { + parenthesized_primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NEW: + { + allocator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NuLL: + { + RefAdaAST tmp357_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp357_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp357_AST)); + } + match(NuLL); + break; + } + case NUMERIC_LIT: + { + RefAdaAST tmp358_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp358_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp358_AST)); + } + match(NUMERIC_LIT); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp359_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp359_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp359_AST)); + } + match(CHARACTER_LITERAL); + break; + } + case CHAR_STRING: + { + cs = LT(1); + if ( inputState->guessing == 0 ) { + cs_AST = astFactory->create(cs); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(cs_AST)); + } + match(CHAR_STRING); + { + switch ( LA(1)) { + case LPAREN: + { + operator_call_tail(cs_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case IN: + case ASSIGN: + case MOD: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case EXPON: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + primary_AST = RefAdaAST(currentAST.root); + returnAST = primary_AST; +} + +void AdaParser::name_or_qualified() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST name_or_qualified_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 1479 "ada.g" + RefAdaAST dummy; +#line 11528 "AdaParser.cpp" + + RefAdaAST tmp360_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp360_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp360_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case DOT: + { + RefAdaAST tmp361_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp361_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp361_AST)); + } + match(DOT); + { + switch ( LA(1)) { + case ALL: + { + RefAdaAST tmp362_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp362_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp362_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp363_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp363_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp363_AST)); + } + match(IDENTIFIER); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp364_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp364_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp364_AST)); + } + match(CHARACTER_LITERAL); + break; + } + case CHAR_STRING: + { + dummy=is_operator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 1487 "ada.g" + Set(p_AST, INDEXED_COMPONENT); +#line 11611 "AdaParser.cpp" + } + break; + } + case TIC: + { + RefAdaAST tmp366_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp366_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp366_AST)); + } + match(TIC); + { + switch ( LA(1)) { + case LPAREN: + { + parenthesized_primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case RANGE: + case DIGITS: + case DELTA: + case ACCESS: + { + attribute_id(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + goto _loop473; + } + } + } + _loop473:; + } // ( ... )* + name_or_qualified_AST = RefAdaAST(currentAST.root); + returnAST = name_or_qualified_AST; +} + +void AdaParser::allocator() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST allocator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(NEW); + name_or_qualified(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1493 "ada.g" + Set(n_AST, ALLOCATOR); +#line 11685 "AdaParser.cpp" + } + allocator_AST = RefAdaAST(currentAST.root); + returnAST = allocator_AST; +} + +void AdaParser::subprogram_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprogram_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1507 "ada.g" + pop_def_id(); Set(p_AST, PROCEDURE_BODY); +#line 11726 "AdaParser.cpp" + } + subprogram_body_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1509 "ada.g" + pop_def_id(); Set(f_AST, FUNCTION_BODY); +#line 11756 "AdaParser.cpp" + } + subprogram_body_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprogram_body_AST; +} + +void AdaParser::package_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST package_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PACKAGE); + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pkg_body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1513 "ada.g" + Set(p_AST, PACKAGE_BODY); +#line 11794 "AdaParser.cpp" + } + package_body_AST = RefAdaAST(currentAST.root); + returnAST = package_body_AST; +} + +void AdaParser::task_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TASK); + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1517 "ada.g" + Set(t_AST, TASK_BODY); +#line 11825 "AdaParser.cpp" + } + task_body_AST = RefAdaAST(currentAST.root); + returnAST = task_body_AST; +} + +void AdaParser::protected_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST protected_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROTECTED); + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_bodies_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1521 "ada.g" + Set(p_AST, PROTECTED_BODY); +#line 11860 "AdaParser.cpp" + } + protected_body_AST = RefAdaAST(currentAST.root); + returnAST = protected_body_AST; +} + +void AdaParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ) +{ + factory.setMaxNodeType(289); +} +const char* AdaParser::tokenNames[] = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"pragma\"", + "IDENTIFIER", + "SEMI", + "LPAREN", + "COMMA", + "RPAREN", + "RIGHT_SHAFT", + "\"with\"", + "DOT", + "\"use\"", + "\"type\"", + "TIC", + "\"range\"", + "\"digits\"", + "\"delta\"", + "\"access\"", + "\"private\"", + "\"package\"", + "\"body\"", + "\"is\"", + "\"procedure\"", + "\"function\"", + "\"new\"", + "\"others\"", + "PIPE", + "DOT_DOT", + "\"all\"", + "COLON", + "\"in\"", + "\"out\"", + "\"renames\"", + "CHARACTER_LITERAL", + "CHAR_STRING", + "\"null\"", + "\"record\"", + "\"separate\"", + "\"abstract\"", + "\"return\"", + "\"task\"", + "\"protected\"", + "BOX", + "ASSIGN", + "\"entry\"", + "\"for\"", + "\"end\"", + "\"at\"", + "\"mod\"", + "\"subtype\"", + "\"exception\"", + "\"constant\"", + "\"array\"", + "\"of\"", + "\"aliased\"", + "\"case\"", + "\"when\"", + "\"tagged\"", + "\"limited\"", + "\"generic\"", + "\"begin\"", + "LT_LT", + "GT_GT", + "\"if\"", + "\"then\"", + "\"elsif\"", + "\"else\"", + "\"loop\"", + "\"while\"", + "\"reverse\"", + "\"declare\"", + "\"exit\"", + "\"goto\"", + "\"accept\"", + "\"do\"", + "\"delay\"", + "\"until\"", + "\"select\"", + "\"abort\"", + "\"or\"", + "\"terminate\"", + "\"raise\"", + "\"requeue\"", + "\"and\"", + "\"xor\"", + "\"not\"", + "EQ", + "NE", + "LT_", + "LE", + "GT", + "GE", + "PLUS", + "MINUS", + "CONCAT", + "STAR", + "DIV", + "\"rem\"", + "\"abs\"", + "EXPON", + "NUMERIC_LIT", + "ABORTABLE_PART", + "ABORT_STATEMENT", + "ACCEPT_ALTERNATIVE", + "ACCEPT_STATEMENT", + "ALLOCATOR", + "ASSIGNMENT_STATEMENT", + "ASYNCHRONOUS_SELECT", + "ATTRIBUTE_DEFINITION_CLAUSE", + "AT_CLAUSE", + "BLOCK_STATEMENT", + "CASE_STATEMENT", + "CASE_STATEMENT_ALTERNATIVE", + "CODE_STATEMENT", + "COMPONENT_DECLARATION", + "CONDITIONAL_ENTRY_CALL", + "CONTEXT_CLAUSE", + "DECLARATIVE_PART", + "DEFINING_IDENTIFIER_LIST", + "DELAY_ALTERNATIVE", + "DELAY_STATEMENT", + "DELTA_CONSTRAINT", + "DIGITS_CONSTRAINT", + "DISCRIMINANT_ASSOCIATION", + "DISCRIMINANT_CONSTRAINT", + "DISCRIMINANT_SPECIFICATION", + "ENTRY_BODY", + "ENTRY_CALL_ALTERNATIVE", + "ENTRY_CALL_STATEMENT", + "ENTRY_DECLARATION", + "ENTRY_INDEX_SPECIFICATION", + "ENUMERATION_REPESENTATION_CLAUSE", + "EXCEPTION_DECLARATION", + "EXCEPTION_HANDLER", + "EXCEPTION_RENAMING_DECLARATION", + "EXIT_STATEMENT", + "FORMAL_PACKAGE_DECLARATION", + "GENERIC_FORMAL_PART", + "GENERIC_PACKAGE_DECLARATION", + "GOTO_STATEMENT", + "HANDLED_SEQUENCE_OF_STATEMENTS", + "HANDLED_STMTS_OPT", + "IF_STATEMENT", + "INCOMPLETE_TYPE_DECLARATION", + "INDEXED_COMPONENT", + "INDEX_CONSTRAINT", + "LIBRARY_ITEM", + "LOOP_STATEMENT", + "NAME", + "NULL_STATEMENT", + "NUMBER_DECLARATION", + "OBJECT_DECLARATION", + "OBJECT_RENAMING_DECLARATION", + "OPERATOR_SYMBOL", + "PACKAGE_BODY", + "PACKAGE_BODY_STUB", + "PACKAGE_RENAMING_DECLARATION", + "PACKAGE_SPECIFICATION", + "PARAMETER_SPECIFICATION", + "PRIVATE_EXTENSION_DECLARATION", + "PRIVATE_TYPE_DECLARATION", + "PROTECTED_BODY", + "PROTECTED_BODY_STUB", + "PROTECTED_TYPE_DECLARATION", + "RAISE_STATEMENT", + "RANGE_ATTRIBUTE_REFERENCE", + "RECORD_REPRESENTATION_CLAUSE", + "REQUEUE_STATEMENT", + "RETURN_STATEMENT", + "SELECTIVE_ACCEPT", + "SEQUENCE_OF_STATEMENTS", + "SINGLE_PROTECTED_DECLARATION", + "SINGLE_TASK_DECLARATION", + "STATEMENT", + "SUBTYPE_DECLARATION", + "SUBTYPE_INDICATION", + "SUBTYPE_MARK", + "SUBUNIT", + "TASK_BODY", + "TASK_BODY_STUB", + "TASK_TYPE_DECLARATION", + "TERMINATE_ALTERNATIVE", + "TIMED_ENTRY_CALL", + "TRIGGERING_ALTERNATIVE", + "USE_CLAUSE", + "USE_TYPE_CLAUSE", + "VARIANT", + "VARIANT_PART", + "WITH_CLAUSE", + "ABSTRACT_FUNCTION_DECLARATION", + "ABSTRACT_PROCEDURE_DECLARATION", + "ACCESS_TO_FUNCTION_DECLARATION", + "ACCESS_TO_OBJECT_DECLARATION", + "ACCESS_TO_PROCEDURE_DECLARATION", + "ARRAY_OBJECT_DECLARATION", + "ARRAY_TYPE_DECLARATION", + "AND_THEN", + "BASIC_DECLARATIVE_ITEMS_OPT", + "BLOCK_BODY", + "BLOCK_BODY_OPT", + "CALL_STATEMENT", + "COMPONENT_CLAUSES_OPT", + "COMPONENT_ITEMS", + "COND_CLAUSE", + "DECIMAL_FIXED_POINT_DECLARATION", + "DECLARE_OPT", + "DERIVED_RECORD_EXTENSION", + "DISCRETE_SUBTYPE_DEF_OPT", + "DISCRIMINANT_SPECIFICATIONS", + "DISCRIM_PART_OPT", + "ELSE_OPT", + "ELSIFS_OPT", + "END_ID_OPT", + "ENTRY_INDEX_OPT", + "ENUMERATION_TYPE_DECLARATION", + "EXCEPT_HANDLER_PART_OPT", + "EXTENSION_OPT", + "FLOATING_POINT_DECLARATION", + "FORMAL_DECIMAL_FIXED_POINT_DECLARATION", + "FORMAL_DISCRETE_TYPE_DECLARATION", + "FORMAL_FLOATING_POINT_DECLARATION", + "FORMAL_FUNCTION_DECLARATION", + "FORMAL_MODULAR_TYPE_DECLARATION", + "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION", + "FORMAL_ORDINARY_FIXED_POINT_DECLARATION", + "FORMAL_PART_OPT", + "FORMAL_PRIVATE_EXTENSION_DECLARATION", + "FORMAL_PRIVATE_TYPE_DECLARATION", + "FORMAL_PROCEDURE_DECLARATION", + "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION", + "FUNCTION_BODY", + "FUNCTION_BODY_STUB", + "FUNCTION_DECLARATION", + "FUNCTION_RENAMING_DECLARATION", + "GENERIC_FUNCTION_DECLARATION", + "GENERIC_FUNCTION_INSTANTIATION", + "GENERIC_FUNCTION_RENAMING", + "GENERIC_PACKAGE_INSTANTIATION", + "GENERIC_PACKAGE_RENAMING", + "GENERIC_PROCEDURE_DECLARATION", + "GENERIC_PROCEDURE_INSTANTIATION", + "GENERIC_PROCEDURE_RENAMING", + "GUARD_OPT", + "IDENTIFIER_COLON_OPT", + "ID_OPT", + "INIT_OPT", + "ITERATION_SCHEME_OPT", + "LABEL_OPT", + "MARK_WITH_CONSTRAINT", + "MODIFIERS", + "MODULAR_TYPE_DECLARATION", + "MOD_CLAUSE_OPT", + "NOT_IN", + "ORDINARY_DERIVED_TYPE_DECLARATION", + "ORDINARY_FIXED_POINT_DECLARATION", + "OR_ELSE", + "OR_SELECT_OPT", + "PARENTHESIZED_PRIMARY", + "PRIVATE_DECLARATIVE_ITEMS_OPT", + "PRIVATE_TASK_ITEMS_OPT", + "PROCEDURE_BODY", + "PROCEDURE_BODY_STUB", + "PROCEDURE_DECLARATION", + "PROCEDURE_RENAMING_DECLARATION", + "PROT_MEMBER_DECLARATIONS", + "PROT_OP_BODIES_OPT", + "PROT_OP_DECLARATIONS", + "PROT_PRIVATE_OPT", + "RANGED_EXPRS", + "RANGE_CONSTRAINT", + "RECORD_TYPE_DECLARATION", + "SELECTOR_NAMES_OPT", + "SIGNED_INTEGER_TYPE_DECLARATION", + "TASK_ITEMS_OPT", + "UNARY_MINUS", + "UNARY_PLUS", + "VALUE", + "VALUES", + "VARIANTS", + "COMMENT_INTRO", + "OX", + "TIC_OR_CHARACTER_LITERAL", + "DIGIT", + "EXPONENT", + "EXTENDED_DIGIT", + "BASED_INTEGER", + "WS_", + "COMMENT", + 0 +}; + +const unsigned long AdaParser::_tokenSet_0_data_[] = { 67109024UL, 56UL, 3229614080UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN "new" CHARACTER_LITERAL CHAR_STRING "null" "not" PLUS +// MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_0(_tokenSet_0_data_,10); +const unsigned long AdaParser::_tokenSet_1_data_[] = { 201364384UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN COMMA RPAREN DOT TIC "new" "others" "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_1(_tokenSet_1_data_,10); +const unsigned long AdaParser::_tokenSet_2_data_[] = { 8388800UL, 4UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN "is" "renames" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_2(_tokenSet_2_data_,10); +const unsigned long AdaParser::_tokenSet_3_data_[] = { 52453426UL, 1611238800UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// EOF "pragma" IDENTIFIER "use" "type" "package" "procedure" "function" +// CHAR_STRING "separate" "abstract" "task" "protected" "for" "end" "subtype" +// "generic" "begin" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_3(_tokenSet_3_data_,10); +const unsigned long AdaParser::_tokenSet_4_data_[] = { 8392896UL, 67108869UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN DOT "is" "in" "renames" "when" "do" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_4(_tokenSet_4_data_,10); +const unsigned long AdaParser::_tokenSet_5_data_[] = { 8388800UL, 67108869UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN "is" "in" "renames" "when" "do" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_5(_tokenSet_5_data_,10); +const unsigned long AdaParser::_tokenSet_6_data_[] = { 53502002UL, 537496976UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// EOF "pragma" IDENTIFIER "use" "type" "private" "package" "procedure" +// "function" CHAR_STRING "separate" "abstract" "task" "protected" "for" +// "end" "subtype" "generic" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_6(_tokenSet_6_data_,10); +const unsigned long AdaParser::_tokenSet_7_data_[] = { 8392832UL, 512UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// LPAREN DOT "is" "return" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_7(_tokenSet_7_data_,10); +const unsigned long AdaParser::_tokenSet_8_data_[] = { 738234528UL, 262200UL, 3229614080UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN DOT TIC "new" "others" DOT_DOT CHARACTER_LITERAL CHAR_STRING +// "null" "mod" "not" PLUS MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_8(_tokenSet_8_data_,10); +const unsigned long AdaParser::_tokenSet_9_data_[] = { 201326752UL, 56UL, 3229614080UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN "new" "others" CHARACTER_LITERAL CHAR_STRING "null" +// "not" PLUS MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_9(_tokenSet_9_data_,10); +const unsigned long AdaParser::_tokenSet_10_data_[] = { 1006739360UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN COMMA RPAREN RIGHT_SHAFT "with" DOT TIC "range" "new" +// "others" PIPE DOT_DOT "in" CHARACTER_LITERAL CHAR_STRING "null" "mod" +// "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR DIV +// "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_10(_tokenSet_10_data_,10); +const unsigned long AdaParser::_tokenSet_11_data_[] = { 1006737312UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN COMMA RPAREN RIGHT_SHAFT DOT TIC "range" "new" "others" +// PIPE DOT_DOT "in" CHARACTER_LITERAL CHAR_STRING "null" "mod" "or" "and" +// "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR DIV "rem" "abs" +// EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_11(_tokenSet_11_data_,10); +const unsigned long AdaParser::_tokenSet_12_data_[] = { 32UL, 23068672UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER "constant" "array" "aliased" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_12(_tokenSet_12_data_,10); +const unsigned long AdaParser::_tokenSet_13_data_[] = { 495840UL, 6299648UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER SEMI LPAREN DOT TIC "range" "digits" "delta" ASSIGN "constant" +// "array" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_13(_tokenSet_13_data_,10); +const unsigned long AdaParser::_tokenSet_14_data_[] = { 51380274UL, 114688UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// EOF "pragma" IDENTIFIER "private" "procedure" "function" "entry" "for" +// "end" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_14(_tokenSet_14_data_,10); +const unsigned long AdaParser::_tokenSet_15_data_[] = { 496256UL, 0UL, 32UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// LPAREN RPAREN DOT TIC "range" "digits" "delta" "loop" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_15(_tokenSet_15_data_,10); +const unsigned long AdaParser::_tokenSet_16_data_[] = { 50331664UL, 49152UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" "procedure" "function" "entry" "for" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_16(_tokenSet_16_data_,10); +const unsigned long AdaParser::_tokenSet_17_data_[] = { 1048576UL, 402653536UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "private" "null" "record" "abstract" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_17(_tokenSet_17_data_,10); +const unsigned long AdaParser::_tokenSet_18_data_[] = { 1048688UL, 436207712UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" IDENTIFIER SEMI "private" "null" "record" "case" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_18(_tokenSet_18_data_,10); +const unsigned long AdaParser::_tokenSet_19_data_[] = { 496512UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// LPAREN COMMA RPAREN DOT TIC "range" "digits" "delta" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_19(_tokenSet_19_data_,10); +const unsigned long AdaParser::_tokenSet_20_data_[] = { 738300064UL, 262200UL, 3229614080UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN DOT TIC "range" "new" "others" DOT_DOT CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "not" PLUS MINUS CONCAT STAR DIV "rem" "abs" +// EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_20(_tokenSet_20_data_,10); +const unsigned long AdaParser::_tokenSet_21_data_[] = { 469800096UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN RIGHT_SHAFT DOT TIC "new" "others" PIPE "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_21(_tokenSet_21_data_,10); +const unsigned long AdaParser::_tokenSet_22_data_[] = { 1048576UL, 402653440UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "private" "abstract" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_22(_tokenSet_22_data_,10); +const unsigned long AdaParser::_tokenSet_23_data_[] = { 1048640UL, 402653184UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI "private" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_23(_tokenSet_23_data_,10); +const unsigned long AdaParser::_tokenSet_24_data_[] = { 37056UL, 8192UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN DOT TIC ASSIGN +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_24(_tokenSet_24_data_,10); +const unsigned long AdaParser::_tokenSet_25_data_[] = { 67145952UL, 56UL, 3229630464UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER SEMI LPAREN DOT TIC "new" CHARACTER_LITERAL CHAR_STRING "null" +// "until" "not" PLUS MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_25(_tokenSet_25_data_,10); +const unsigned long AdaParser::_tokenSet_26_data_[] = { 0UL, 67108864UL, 272384UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "when" "accept" "delay" "terminate" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_26(_tokenSet_26_data_,10); +const unsigned long AdaParser::_tokenSet_27_data_[] = { 67109088UL, 56UL, 3229630464UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER SEMI LPAREN "new" CHARACTER_LITERAL CHAR_STRING "null" "until" +// "not" PLUS MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_27(_tokenSet_27_data_,10); +const unsigned long AdaParser::_tokenSet_28_data_[] = { 37056UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN DOT TIC +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_28(_tokenSet_28_data_,10); +const unsigned long AdaParser::_tokenSet_29_data_[] = { 48UL, 3323036192UL, 1814398UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" IDENTIFIER "null" "return" "for" "end" "exception" "case" "when" +// "begin" LT_LT "if" "then" "elsif" "else" "loop" "while" "declare" "exit" +// "goto" "accept" "delay" "select" "abort" "or" "raise" "requeue" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_29(_tokenSet_29_data_,10); +const unsigned long AdaParser::_tokenSet_30_data_[] = { 813932352UL, 8192UL, 6422564UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI COMMA RPAREN RIGHT_SHAFT "with" DOT TIC "range" "digits" "is" PIPE +// DOT_DOT ASSIGN "then" "loop" "or" "and" "xor" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_30(_tokenSet_30_data_,10); + + diff --git a/languages/ada/AdaParser.hpp b/languages/ada/AdaParser.hpp new file mode 100644 index 00000000..0074c820 --- /dev/null +++ b/languages/ada/AdaParser.hpp @@ -0,0 +1,389 @@ +#ifndef INC_AdaParser_hpp_ +#define INC_AdaParser_hpp_ + +#line 29 "ada.g" + +#include <antlr/SemanticException.hpp> // antlr wants this +#include "AdaAST.hpp" +#include "preambles.h" + +#line 11 "AdaParser.hpp" +#include <antlr/config.hpp> +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaParser.hpp"$ */ +#include <antlr/TokenStream.hpp> +#include <antlr/TokenBuffer.hpp> +#include "AdaTokenTypes.hpp" +#include <antlr/LLkParser.hpp> + +class CUSTOM_API AdaParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public AdaTokenTypes +{ +#line 53 "ada.g" + + ANTLR_PARSER_PREAMBLE + +public: + // Ada support stuff + void push_def_id (const RefAdaAST& defid); + const RefAdaAST& pop_def_id (); + bool end_id_matches_def_id (const RefAdaAST& endid); + bool definable_operator (const char *string); // operator_symbol sans "/=" + bool is_operator_symbol (const char *string); +#line 22 "AdaParser.hpp" +public: + void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); +protected: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k); +public: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf); +protected: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k); +public: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer); + AdaParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state); + int getNumTokens() const + { + return AdaParser::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return AdaParser::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return AdaParser::tokenNames; + } + public: void compilation_unit(); + public: void context_items_opt(); + public: void library_item(); + public: void subunit(); + public: void pragma(); + public: void pragma_args_opt(); + public: void pragma_arg(); + public: void expression(); + public: void with_clause(); + public: void use_clause(); + public: void c_name_list(); + public: void compound_name(); + public: void subtype_mark(); + public: void attribute_id(); + public: void private_opt(); + public: void lib_pkg_spec_or_body(); + public: void subprog_decl_or_rename_or_inst_or_body( + boolean lib_level + ); + public: void generic_decl( + boolean lib_level + ); + public: void def_id( + boolean lib_level + ); + public: void pkg_body_part(); + public: void spec_decl_part( + RefAdaAST pkg + ); + public: void subprog_decl( + boolean lib_level + ); + public: void generic_subp_inst(); + public: void formal_part_opt(); + public: void renames(); + public: void is_separate_or_abstract_or_decl( + RefAdaAST t + ); + public: void def_designator( + boolean lib_level + ); + public: void function_tail(); + public: void generic_inst(); + public: void value_s(); + public: void parenth_values(); + public: void value(); + public: void ranged_expr_s(); + public: void ranged_expr(); + public: void simple_expression(); + public: void range(); + public: void range_constraint(); + public: void range_dots(); + public: void range_attrib_ref(); + public: void prefix(); + public: void parameter_specification(); + public: void def_ids_colon(); + public: void mode_opt(); + public: void init_opt(); + public: void defining_identifier_list(); + public: void name(); + public: RefAdaAST definable_operator_symbol(); + public: RefAdaAST is_operator(); + public: void parenthesized_primary(); + public: void extension_opt(); + public: void separate_or_abstract( + RefAdaAST t + ); + public: RefAdaAST designator(); + public: void func_formal_part_opt(); + public: void func_param(); + public: void in_access_opt(); + public: void pkg_spec_part(); + public: void basic_declarative_items_opt(); + public: void private_declarative_items_opt(); + public: void end_id_opt(); + public: void basic_decl_item(); + public: void basic_declarative_items(); + public: void task_type_or_single_decl( + RefAdaAST tsk + ); + public: void prot_type_or_single_decl( + RefAdaAST pro + ); + public: void decl_common(); + public: void discrim_part_opt(); + public: void task_definition_opt(); + public: void task_items_opt(); + public: void private_task_items_opt(); + public: void discrim_part_text(); + public: void discriminant_specifications(); + public: void known_discrim_part(); + public: void empty_discrim_opt(); + public: void discrim_part(); + public: void discriminant_specification(); + public: void access_opt(); + public: void entrydecls_repspecs_opt(); + public: void entry_declaration(); + public: void rep_spec(); + public: void discrete_subtype_def_opt(); + public: void discrete_subtype_definition(); + public: void subtype_ind(); + public: void rep_spec_part( + RefAdaAST t + ); + public: void align_opt(); + public: void comp_loc_s(); + public: void protected_definition(); + public: void prot_private_opt(); + public: void prot_op_decl(); + public: void comp_decl(); + public: void prot_op_decl_s(); + public: void prot_member_decl_s(); + public: void component_subtype_def(); + public: void type_def( + RefAdaAST t + ); + public: void derived_or_private_or_record( + RefAdaAST t, boolean has_discrim + ); + public: void local_enum_name(); + public: void enumeration_aggregate(); + public: void aliased_constant_opt(); + public: void array_type_definition( + RefAdaAST t + ); + public: void enum_id_s(); + public: void range_constraint_opt(); + public: void access_type_definition( + RefAdaAST t + ); + public: void enumeration_literal_specification(); + public: void index_or_discrete_range_s(); + public: void index_or_discrete_range(); + public: void aliased_opt(); + public: void constraint_opt(); + public: void digits_constraint(); + public: void delta_constraint(); + public: void index_constraint(); + public: void discriminant_constraint(); + public: void discrete_range(); + public: void discriminant_association(); + public: void selector_names_opt(); + public: void association_head(); + public: void selector_name(); + public: void protected_opt(); + public: void constant_all_opt(); + public: void abstract_opt(); + public: void record_definition( + boolean has_discrim + ); + public: void abstract_tagged_limited_opt(); + public: void component_list( + boolean has_discrim + ); + public: void component_items(); + public: void variant_part(); + public: void empty_component_items(); + public: void discriminant_direct_name(); + public: void variant_s(); + public: void variant(); + public: void choice_s(); + public: void choice(); + public: void discrete_with_range(); + public: void mark_with_constraint(); + public: void generic_formal_part_opt(); + public: void generic_formal_parameter(); + public: void discriminable_type_definition( + RefAdaAST t + ); + public: void subprogram_default_opt(); + public: void formal_package_actual_part_opt(); + public: void body_part(); + public: void declarative_part(); + public: void block_body(); + public: void declarative_item(); + public: void body_is(); + public: void separate(); + public: void prot_op_bodies_opt(); + public: void block_body_opt(); + public: void handled_stmt_s(); + public: void entry_body(); + public: void subprog_decl_or_body(); + public: void statements(); + public: void except_handler_part_opt(); + public: void handled_stmts_opt(); + public: void statement(); + public: void def_label_opt(); + public: void null_stmt(); + public: void exit_stmt(); + public: void return_stmt(); + public: void goto_stmt(); + public: void delay_stmt(); + public: void abort_stmt(); + public: void raise_stmt(); + public: void requeue_stmt(); + public: void accept_stmt(); + public: void select_stmt(); + public: void if_stmt(); + public: void case_stmt(); + public: void loop_stmt(); + public: void block(); + public: void statement_identifier(); + public: void id_opt(); + public: void call_or_assignment(); + public: void cond_clause(); + public: void elsifs_opt(); + public: void else_opt(); + public: void condition(); + public: void alternative_s(); + public: void case_statement_alternative(); + public: void iteration_scheme_opt(); + public: void reverse_opt(); + public: void id_opt_aux(); + public: void declare_opt(); + public: void label_name(); + public: void entry_body_formal_part(); + public: void entry_barrier(); + public: void entry_index_spec_opt(); + public: void entry_call_stmt(); + public: void entry_index_opt(); + public: void until_opt(); + public: void triggering_alternative(); + public: void abortable_part(); + public: void selective_accept(); + public: void entry_call_alternative(); + public: void delay_alternative(); + public: void stmts_opt(); + public: void guard_opt(); + public: void select_alternative(); + public: void or_select_opt(); + public: void accept_alternative(); + public: void exception_handler(); + public: void identifier_colon_opt(); + public: void except_choice_s(); + public: void exception_choice(); + public: void operator_call(); + public: void operator_call_tail( + RefAdaAST opstr + ); + public: void relation(); + public: void range_or_mark(); + public: void signed_term(); + public: void term(); + public: void factor(); + public: void primary(); + public: void name_or_qualified(); + public: void allocator(); + public: void subprogram_body(); + public: void package_body(); + public: void task_body(); + public: void protected_body(); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); + } + +protected: + RefAdaAST returnAST; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 290; +#else + enum { + NUM_TOKENS = 290 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; + static const unsigned long _tokenSet_5_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5; + static const unsigned long _tokenSet_6_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6; + static const unsigned long _tokenSet_7_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7; + static const unsigned long _tokenSet_8_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8; + static const unsigned long _tokenSet_9_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9; + static const unsigned long _tokenSet_10_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10; + static const unsigned long _tokenSet_11_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11; + static const unsigned long _tokenSet_12_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12; + static const unsigned long _tokenSet_13_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13; + static const unsigned long _tokenSet_14_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14; + static const unsigned long _tokenSet_15_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15; + static const unsigned long _tokenSet_16_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16; + static const unsigned long _tokenSet_17_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17; + static const unsigned long _tokenSet_18_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18; + static const unsigned long _tokenSet_19_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19; + static const unsigned long _tokenSet_20_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20; + static const unsigned long _tokenSet_21_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21; + static const unsigned long _tokenSet_22_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22; + static const unsigned long _tokenSet_23_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23; + static const unsigned long _tokenSet_24_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24; + static const unsigned long _tokenSet_25_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25; + static const unsigned long _tokenSet_26_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26; + static const unsigned long _tokenSet_27_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27; + static const unsigned long _tokenSet_28_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28; + static const unsigned long _tokenSet_29_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29; + static const unsigned long _tokenSet_30_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30; +}; + +#endif /*INC_AdaParser_hpp_*/ diff --git a/languages/ada/AdaStoreWalker.cpp b/languages/ada/AdaStoreWalker.cpp new file mode 100644 index 00000000..167d671c --- /dev/null +++ b/languages/ada/AdaStoreWalker.cpp @@ -0,0 +1,9439 @@ +/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalker.cpp"$ */ +#include "AdaStoreWalker.hpp" +#include <antlr/Token.hpp> +#include <antlr/AST.hpp> +#include <antlr/NoViableAltException.hpp> +#include <antlr/MismatchedTokenException.hpp> +#include <antlr/SemanticException.hpp> +#include <antlr/BitSet.hpp> +#line 1 "expandedada.store.g" +#line 11 "AdaStoreWalker.cpp" +AdaStoreWalker::AdaStoreWalker() + : ANTLR_USE_NAMESPACE(antlr)TreeParser() { +} + +void AdaStoreWalker::compilation_unit(RefAdaAST _t) { + RefAdaAST compilation_unit_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling +#line 116 "expandedada.store.g" + init(); +#line 22 "AdaStoreWalker.cpp" + context_items_opt(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case LIBRARY_ITEM: + { + library_item(_t); + _t = _retTree; + break; + } + case SUBUNIT: + { + subunit(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop4; + } + + } + _loop4:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::context_items_opt(RefAdaAST _t) { + RefAdaAST context_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t70 = _t; + RefAdaAST tmp1_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONTEXT_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case WITH_CLAUSE: + { + with_clause(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + default: + { + goto _loop72; + } + } + } + _loop72:; + } // ( ... )* + _t = __t70; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::library_item(RefAdaAST _t) { + RefAdaAST library_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST pb = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST gpi = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST ps = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST prd = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + RefAdaAST __t17 = _t; + RefAdaAST tmp2_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LIBRARY_ITEM); + _t = _t->getFirstChild(); + RefAdaAST __t18 = _t; + RefAdaAST tmp3_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRIVATE: + { + RefAdaAST tmp4_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE); + _t = _t->getNextSibling(); +#line 132 "expandedada.store.g" + m_currentAccess = CodeModelItem::Protected; +#line 149 "AdaStoreWalker.cpp" + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t18; + _t = _t->getNextSibling(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + lib_subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + RefAdaAST __t21 = _t; + RefAdaAST tmp5_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY); + _t = _t->getFirstChild(); + pb = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t21; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_INSTANTIATION: + { + RefAdaAST __t22 = _t; + RefAdaAST tmp6_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + gpi = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 136 "expandedada.store.g" + + defineScope( gpi ); + +#line 213 "AdaStoreWalker.cpp" + generic_inst(_t); + _t = _retTree; + _t = __t22; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + RefAdaAST __t23 = _t; + RefAdaAST tmp7_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + ps = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 142 "expandedada.store.g" + + NamespaceDom psc = defineScope( ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + +#line 236 "AdaStoreWalker.cpp" + pkg_spec_part(_t); + _t = _retTree; +#line 149 "expandedada.store.g" + + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setEndPosition (endLine, 0); + m_addToStore = false; + +#line 250 "AdaStoreWalker.cpp" + _t = __t23; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + RefAdaAST __t24 = _t; + RefAdaAST tmp8_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + prd = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 161 "expandedada.store.g" + + defineScope( prd ); + +#line 268 "AdaStoreWalker.cpp" + renames(_t); + _t = _retTree; + _t = __t24; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t17; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subunit(RefAdaAST _t) { + RefAdaAST subunit_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t521 = _t; + RefAdaAST tmp9_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBUNIT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case FUNCTION_BODY: + case PROCEDURE_BODY: + { + subprogram_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + package_body(_t); + _t = _retTree; + break; + } + case TASK_BODY: + { + task_body(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY: + { + protected_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t521; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pragma(RefAdaAST _t) { + RefAdaAST pragma_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t64 = _t; + RefAdaAST tmp10_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRAGMA); + _t = _t->getFirstChild(); + RefAdaAST tmp11_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_0.member(_t->getType()))) { + pragma_arg(_t); + _t = _retTree; + } + else { + goto _loop66; + } + + } + _loop66:; + } // ( ... )* + _t = __t64; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::with_clause(RefAdaAST _t) { + RefAdaAST with_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t6 = _t; + RefAdaAST tmp12_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WITH_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt8=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + compound_name(_t); + _t = _retTree; + } + else { + if ( _cnt8>=1 ) { goto _loop8; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt8++; + } + _loop8:; + } // ( ... )+ + _t = __t6; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::compound_name(RefAdaAST _t) { + RefAdaAST compound_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp13_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t74 = _t; + RefAdaAST tmp14_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + RefAdaAST tmp15_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + _t = __t74; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::use_clause(RefAdaAST _t) { + RefAdaAST use_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST c = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case USE_TYPE_CLAUSE: + { + RefAdaAST __t10 = _t; + RefAdaAST tmp16_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USE_TYPE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt12=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT || _t->getType() == TIC)) { + subtype_mark(_t); + _t = _retTree; + } + else { + if ( _cnt12>=1 ) { goto _loop12; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt12++; + } + _loop12:; + } // ( ... )+ + _t = __t10; + _t = _t->getNextSibling(); + break; + } + case USE_CLAUSE: + { + RefAdaAST __t13 = _t; + RefAdaAST tmp17_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt15=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + c = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + compound_name(_t); + _t = _retTree; +#line 127 "expandedada.store.g" + m_imports.back ().push_back (qtext (c)); +#line 527 "AdaStoreWalker.cpp" + } + else { + if ( _cnt15>=1 ) { goto _loop15; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt15++; + } + _loop15:; + } // ( ... )+ + _t = __t13; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subtype_mark(RefAdaAST _t) { + RefAdaAST subtype_mark_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case TIC: + { + RefAdaAST __t76 = _t; + RefAdaAST tmp18_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t76; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::lib_subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t) { + RefAdaAST lib_subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling +#line 310 "expandedada.store.g" + m_addToStore = true; +#line 603 "AdaStoreWalker.cpp" + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } +#line 315 "expandedada.store.g" + m_addToStore = false; +#line 643 "AdaStoreWalker.cpp" + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::def_id(RefAdaAST _t) { + RefAdaAST def_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST cn = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + cn = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + compound_name(_t); + _t = _retTree; +#line 189 "expandedada.store.g" + + // kdDebug() << "cn:compound_name started " << endl; + if (m_addToStore) { + // kdDebug() << "cn:compound_name m_addToStore " << endl; + if (m_isSubprogram) { + // kdDebug() << "cn:compound_name m_isSubprogram " << endl; + FunctionDom method = m_model->create<FunctionModel>(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); + // kdDebug() << "cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(cn->getLine(), cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel + /* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete (method); + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } else { + // TBC: what about other declarations? + } + } + +#line 691 "AdaStoreWalker.cpp" + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pkg_body_part(RefAdaAST _t) { + RefAdaAST pkg_body_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_inst(RefAdaAST _t) { + RefAdaAST generic_inst_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + compound_name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pkg_spec_part(RefAdaAST _t) { + RefAdaAST pkg_spec_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + basic_declarative_items_opt(_t); + _t = _retTree; + private_declarative_items_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::renames(RefAdaAST _t) { + RefAdaAST renames_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case CHARACTER_STRING: + { + RefAdaAST tmp19_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + RefAdaAST tmp20_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_decl(RefAdaAST _t) { + RefAdaAST generic_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST gpd = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_RENAMING: + { + RefAdaAST __t49 = _t; + RefAdaAST tmp21_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t49; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + { + RefAdaAST __t50 = _t; + RefAdaAST tmp22_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + gpd = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 284 "expandedada.store.g" + + NamespaceDom psc = defineScope( gpd ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + +#line 860 "AdaStoreWalker.cpp" + pkg_spec_part(_t); + _t = _retTree; +#line 291 "expandedada.store.g" + + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) + m_scopeStack.append( m_model->globalNamespace() ); + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + +#line 872 "AdaStoreWalker.cpp" + _t = __t50; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_RENAMING: + { + RefAdaAST __t51 = _t; + RefAdaAST tmp23_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t51; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_DECLARATION: + { + RefAdaAST __t52 = _t; + RefAdaAST tmp24_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t52; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_RENAMING: + { + RefAdaAST __t53 = _t; + RefAdaAST tmp25_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t53; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_DECLARATION: + { + RefAdaAST __t54 = _t; + RefAdaAST tmp26_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + subprog_def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t54; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_def_id(RefAdaAST _t) { + RefAdaAST subprog_def_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling +#line 171 "expandedada.store.g" + m_isSubprogram = true; +#line 965 "AdaStoreWalker.cpp" + def_id(_t); + _t = _retTree; +#line 173 "expandedada.store.g" + m_isSubprogram = false; +#line 970 "AdaStoreWalker.cpp" + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_decl(RefAdaAST _t) { + RefAdaAST subprog_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PROCEDURE_INSTANTIATION: + { + RefAdaAST __t27 = _t; + RefAdaAST tmp27_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_INSTANTIATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t27; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_RENAMING_DECLARATION: + { + RefAdaAST __t28 = _t; + RefAdaAST tmp28_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t28; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_DECLARATION: + { + RefAdaAST __t29 = _t; + RefAdaAST tmp29_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t29; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_BODY_STUB: + { + RefAdaAST __t30 = _t; + RefAdaAST tmp30_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_BODY_STUB); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t30; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_PROCEDURE_DECLARATION: + { + RefAdaAST __t31 = _t; + RefAdaAST tmp31_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t31; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_INSTANTIATION: + { + RefAdaAST __t32 = _t; + RefAdaAST tmp32_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_INSTANTIATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t32; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_RENAMING_DECLARATION: + { + RefAdaAST __t33 = _t; + RefAdaAST tmp33_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t33; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + RefAdaAST __t34 = _t; + RefAdaAST tmp34_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t34; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY_STUB: + { + RefAdaAST __t35 = _t; + RefAdaAST tmp35_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_BODY_STUB); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t35; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + { + RefAdaAST __t36 = _t; + RefAdaAST tmp36_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t36; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_part_opt(RefAdaAST _t) { + RefAdaAST formal_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t112 = _t; + RefAdaAST tmp37_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == PARAMETER_SPECIFICATION)) { + parameter_specification(_t); + _t = _retTree; + } + else { + goto _loop114; + } + + } + _loop114:; + } // ( ... )* + _t = __t112; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::def_designator(RefAdaAST _t) { + RefAdaAST def_designator_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST cn = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + cn = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + compound_name(_t); + _t = _retTree; +#line 221 "expandedada.store.g" + + // kdDebug() << "def_designator cn:compound_name started" << endl; + if (m_addToStore) { + // kdDebug() << "def_designator cn:compound_name m_addToStore" << endl; + FunctionDom method = m_model->create<FunctionModel>(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); + // kdDebug() << "def_designator cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(cn->getLine(), cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel + /* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete method; + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } + +#line 1218 "AdaStoreWalker.cpp" + break; + } + case OPERATOR_SYMBOL: + { + definable_operator_symbol(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::function_tail(RefAdaAST _t) { + RefAdaAST function_tail_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + formal_part_opt(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::definable_operator_symbol(RefAdaAST _t) { + RefAdaAST definable_operator_symbol_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp38_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::spec_decl_part(RefAdaAST _t) { + RefAdaAST spec_decl_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST ps = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_INSTANTIATION: + { + RefAdaAST __t40 = _t; + RefAdaAST tmp39_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t40; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + RefAdaAST __t41 = _t; + RefAdaAST tmp40_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + ps = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 250 "expandedada.store.g" + + NamespaceDom psc = defineScope( ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + +#line 1312 "AdaStoreWalker.cpp" + pkg_spec_part(_t); + _t = _retTree; +#line 257 "expandedada.store.g" + + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + +#line 1326 "AdaStoreWalker.cpp" + _t = __t41; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + RefAdaAST __t42 = _t; + RefAdaAST tmp41_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t42; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::basic_declarative_items_opt(RefAdaAST _t) { + RefAdaAST basic_declarative_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t136 = _t; + RefAdaAST tmp42_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BASIC_DECLARATIVE_ITEMS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_1.member(_t->getType()))) { + basic_decl_item(_t); + _t = _retTree; + } + else { + goto _loop138; + } + + } + _loop138:; + } // ( ... )* + _t = __t136; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::private_declarative_items_opt(RefAdaAST _t) { + RefAdaAST private_declarative_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { +#line 276 "expandedada.store.g" + m_currentAccess = CodeModelItem::Protected; +#line 1457 "AdaStoreWalker.cpp" + { // ( ... )+ + int _cnt47=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + basic_decl_item(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt47>=1 ) { goto _loop47; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + } + _cnt47++; + } + _loop47:; + } // ( ... )+ +#line 278 "expandedada.store.g" + m_currentAccess = CodeModelItem::Public; +#line 1538 "AdaStoreWalker.cpp" + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::end_id_opt(RefAdaAST _t) { + RefAdaAST end_id_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t86 = _t; + RefAdaAST tmp43_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),END); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t86; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::basic_decl_item(RefAdaAST _t) { + RefAdaAST basic_decl_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_formal_part_opt(RefAdaAST _t) { + RefAdaAST generic_formal_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t295 = _t; + RefAdaAST tmp44_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FORMAL_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case FORMAL_PACKAGE_DECLARATION: + case PARAMETER_SPECIFICATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + case FORMAL_DISCRETE_TYPE_DECLARATION: + case FORMAL_FLOATING_POINT_DECLARATION: + case FORMAL_FUNCTION_DECLARATION: + case FORMAL_MODULAR_TYPE_DECLARATION: + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + case FORMAL_PRIVATE_TYPE_DECLARATION: + case FORMAL_PROCEDURE_DECLARATION: + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + generic_formal_parameter(_t); + _t = _retTree; + break; + } + default: + { + goto _loop297; + } + } + } + _loop297:; + } // ( ... )* + _t = __t295; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::procedure_body(RefAdaAST _t) { + RefAdaAST procedure_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t319 = _t; + RefAdaAST tmp45_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t319; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::function_body(RefAdaAST _t) { + RefAdaAST function_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t321 = _t; + RefAdaAST tmp46_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_BODY); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t321; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t) { + RefAdaAST subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_decl_or_body(RefAdaAST _t) { + RefAdaAST subprog_decl_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + RefAdaAST __t59 = _t; + RefAdaAST tmp47_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t59; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + case FUNCTION_DECLARATION: + { + RefAdaAST __t60 = _t; + RefAdaAST tmp48_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t60; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::package_body(RefAdaAST _t) { + RefAdaAST package_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST id = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + RefAdaAST __t62 = _t; + RefAdaAST tmp49_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY); + _t = _t->getFirstChild(); + id = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t62; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pragma_arg(RefAdaAST _t) { + RefAdaAST pragma_arg_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RIGHT_SHAFT: + { + RefAdaAST __t68 = _t; + RefAdaAST tmp50_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RIGHT_SHAFT); + _t = _t->getFirstChild(); + RefAdaAST tmp51_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t68; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::expression(RefAdaAST _t) { + RefAdaAST expression_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case AND: + { + RefAdaAST __t479 = _t; + RefAdaAST tmp52_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t479; + _t = _t->getNextSibling(); + break; + } + case AND_THEN: + { + RefAdaAST __t480 = _t; + RefAdaAST tmp53_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND_THEN); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t480; + _t = _t->getNextSibling(); + break; + } + case OR: + { + RefAdaAST __t481 = _t; + RefAdaAST tmp54_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t481; + _t = _t->getNextSibling(); + break; + } + case OR_ELSE: + { + RefAdaAST __t482 = _t; + RefAdaAST tmp55_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR_ELSE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t482; + _t = _t->getNextSibling(); + break; + } + case XOR: + { + RefAdaAST __t483 = _t; + RefAdaAST tmp56_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),XOR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t483; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case NOT_IN: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + relation(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::attribute_id(RefAdaAST _t) { + RefAdaAST attribute_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE: + { + RefAdaAST tmp57_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE); + _t = _t->getNextSibling(); + break; + } + case DIGITS: + { + RefAdaAST tmp58_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIGITS); + _t = _t->getNextSibling(); + break; + } + case DELTA: + { + RefAdaAST tmp59_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELTA); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + RefAdaAST tmp60_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp61_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::modifiers(RefAdaAST _t) { + RefAdaAST modifiers_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t79 = _t; + RefAdaAST tmp62_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT: + { + RefAdaAST tmp63_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + RefAdaAST tmp64_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS); + _t = _t->getNextSibling(); + break; + } + case ALIASED: + { + RefAdaAST tmp65_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALIASED); + _t = _t->getNextSibling(); + break; + } + case ALL: + { + RefAdaAST tmp66_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case CONSTANT: + { + RefAdaAST tmp67_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONSTANT); + _t = _t->getNextSibling(); + break; + } + case IN: + { + RefAdaAST tmp68_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN); + _t = _t->getNextSibling(); + break; + } + case LIMITED: + { + RefAdaAST tmp69_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LIMITED); + _t = _t->getNextSibling(); + break; + } + case OUT: + { + RefAdaAST tmp70_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OUT); + _t = _t->getNextSibling(); + break; + } + case PRIVATE: + { + RefAdaAST tmp71_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE); + _t = _t->getNextSibling(); + break; + } + case PROTECTED: + { + RefAdaAST tmp72_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED); + _t = _t->getNextSibling(); + break; + } + case REVERSE: + { + RefAdaAST tmp73_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REVERSE); + _t = _t->getNextSibling(); + break; + } + case TAGGED: + { + RefAdaAST tmp74_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TAGGED); + _t = _t->getNextSibling(); + break; + } + default: + { + goto _loop81; + } + } + } + _loop81:; + } // ( ... )* + _t = __t79; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::id_opt(RefAdaAST _t) { + RefAdaAST id_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t83 = _t; + RefAdaAST tmp75_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ID_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t83; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::value_s(RefAdaAST _t) { + RefAdaAST value_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t475 = _t; + RefAdaAST tmp76_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VALUES); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt477=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + if ( _cnt477>=1 ) { goto _loop477; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt477++; + } + _loop477:; + } // ( ... )+ + _t = __t475; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::value(RefAdaAST _t) { + RefAdaAST value_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + RefAdaAST __t91 = _t; + RefAdaAST tmp77_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + _t = __t91; + _t = _t->getNextSibling(); + break; + } + case RIGHT_SHAFT: + { + RefAdaAST __t92 = _t; + RefAdaAST tmp78_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RIGHT_SHAFT); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t92; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case PIPE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr_s(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::ranged_expr_s(RefAdaAST _t) { + RefAdaAST ranged_expr_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + RefAdaAST __t94 = _t; + RefAdaAST tmp79_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + ranged_expr(_t); + _t = _retTree; + _t = __t94; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::ranged_expr(RefAdaAST _t) { + RefAdaAST ranged_expr_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + RefAdaAST __t96 = _t; + RefAdaAST tmp80_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t96; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + RefAdaAST __t97 = _t; + RefAdaAST tmp81_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t97; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::simple_expression(RefAdaAST _t) { + RefAdaAST simple_expression_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PLUS: + { + RefAdaAST __t495 = _t; + RefAdaAST tmp82_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t495; + _t = _t->getNextSibling(); + break; + } + case MINUS: + { + RefAdaAST __t496 = _t; + RefAdaAST tmp83_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t496; + _t = _t->getNextSibling(); + break; + } + case CONCAT: + { + RefAdaAST __t497 = _t; + RefAdaAST tmp84_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONCAT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t497; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + signed_term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range(RefAdaAST _t) { + RefAdaAST range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + range_dots(_t); + _t = _retTree; + break; + } + case RANGE_ATTRIBUTE_REFERENCE: + { + range_attrib_ref(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_constraint(RefAdaAST _t) { + RefAdaAST range_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t99 = _t; + RefAdaAST tmp85_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE_CONSTRAINT); + _t = _t->getFirstChild(); + range(_t); + _t = _retTree; + _t = __t99; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_dots(RefAdaAST _t) { + RefAdaAST range_dots_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t103 = _t; + RefAdaAST tmp86_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t103; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_attrib_ref(RefAdaAST _t) { + RefAdaAST range_attrib_ref_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t105 = _t; + RefAdaAST tmp87_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE_ATTRIBUTE_REFERENCE); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t105; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prefix(RefAdaAST _t) { + RefAdaAST prefix_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp88_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t108 = _t; + RefAdaAST tmp89_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + RefAdaAST tmp90_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp91_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t108; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + RefAdaAST __t110 = _t; + RefAdaAST tmp92_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t110; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::parameter_specification(RefAdaAST _t) { + RefAdaAST parameter_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t116 = _t; + RefAdaAST tmp93_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARAMETER_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t116; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::defining_identifier_list(RefAdaAST _t) { + RefAdaAST defining_identifier_list_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t118 = _t; + RefAdaAST tmp94_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DEFINING_IDENTIFIER_LIST); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt120=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + RefAdaAST tmp95_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + else { + if ( _cnt120>=1 ) { goto _loop120; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt120++; + } + _loop120:; + } // ( ... )+ + _t = __t118; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::init_opt(RefAdaAST _t) { + RefAdaAST init_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t154 = _t; + RefAdaAST tmp96_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INIT_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t154; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::name(RefAdaAST _t) { + RefAdaAST name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp97_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t123 = _t; + RefAdaAST tmp98_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + RefAdaAST tmp99_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp100_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp101_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + RefAdaAST tmp102_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t123; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + RefAdaAST __t125 = _t; + RefAdaAST tmp103_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t125; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + RefAdaAST __t126 = _t; + RefAdaAST tmp104_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t126; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::parenthesized_primary(RefAdaAST _t) { + RefAdaAST parenthesized_primary_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t129 = _t; + RefAdaAST tmp105_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARENTHESIZED_PRIMARY); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + RefAdaAST tmp106_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + extension_opt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t129; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::extension_opt(RefAdaAST _t) { + RefAdaAST extension_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t132 = _t; + RefAdaAST tmp107_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXTENSION_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + RefAdaAST tmp108_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t132; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_type_or_single_decl(RefAdaAST _t) { + RefAdaAST task_type_or_single_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case TASK_TYPE_DECLARATION: + { + RefAdaAST __t141 = _t; + RefAdaAST tmp109_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t141; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + { + RefAdaAST __t142 = _t; + RefAdaAST tmp110_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SINGLE_TASK_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t142; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_type_or_single_decl(RefAdaAST _t) { + RefAdaAST prot_type_or_single_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROTECTED_TYPE_DECLARATION: + { + RefAdaAST __t182 = _t; + RefAdaAST tmp111_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t182; + _t = _t->getNextSibling(); + break; + } + case SINGLE_PROTECTED_DECLARATION: + { + RefAdaAST __t183 = _t; + RefAdaAST tmp112_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SINGLE_PROTECTED_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t183; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::decl_common(RefAdaAST _t) { + RefAdaAST decl_common_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENUMERATION_TYPE_DECLARATION: + { + RefAdaAST __t202 = _t; + RefAdaAST tmp113_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENUMERATION_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp114_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + enum_id_s(_t); + _t = _retTree; + _t = __t202; + _t = _t->getNextSibling(); + break; + } + case SIGNED_INTEGER_TYPE_DECLARATION: + { + RefAdaAST __t203 = _t; + RefAdaAST tmp115_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp116_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + range(_t); + _t = _retTree; + _t = __t203; + _t = _t->getNextSibling(); + break; + } + case MODULAR_TYPE_DECLARATION: + { + RefAdaAST __t204 = _t; + RefAdaAST tmp117_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp118_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t204; + _t = _t->getNextSibling(); + break; + } + case FLOATING_POINT_DECLARATION: + { + RefAdaAST __t205 = _t; + RefAdaAST tmp119_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp120_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t205; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_FIXED_POINT_DECLARATION: + { + RefAdaAST __t206 = _t; + RefAdaAST tmp121_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp122_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t206; + _t = _t->getNextSibling(); + break; + } + case DECIMAL_FIXED_POINT_DECLARATION: + { + RefAdaAST __t207 = _t; + RefAdaAST tmp123_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp124_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t207; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + access_type_declaration(_t); + _t = _retTree; + break; + } + case INCOMPLETE_TYPE_DECLARATION: + { + RefAdaAST __t208 = _t; + RefAdaAST tmp125_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INCOMPLETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp126_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + _t = __t208; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_EXTENSION_DECLARATION: + { + RefAdaAST __t209 = _t; + RefAdaAST tmp127_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t209; + _t = _t->getNextSibling(); + break; + } + case DERIVED_RECORD_EXTENSION: + { + RefAdaAST __t210 = _t; + RefAdaAST tmp128_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DERIVED_RECORD_EXTENSION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t210; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_DERIVED_TYPE_DECLARATION: + { + RefAdaAST __t211 = _t; + RefAdaAST tmp129_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t211; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_TYPE_DECLARATION: + { + RefAdaAST __t212 = _t; + RefAdaAST tmp130_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t212; + _t = _t->getNextSibling(); + break; + } + case RECORD_TYPE_DECLARATION: + { + RefAdaAST __t213 = _t; + RefAdaAST tmp131_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t213; + _t = _t->getNextSibling(); + break; + } + case SUBTYPE_DECLARATION: + { + RefAdaAST __t214 = _t; + RefAdaAST tmp132_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBTYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp133_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + subtype_ind(_t); + _t = _retTree; + _t = __t214; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case EXCEPTION_RENAMING_DECLARATION: + { + RefAdaAST __t215 = _t; + RefAdaAST tmp134_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + _t = __t215; + _t = _t->getNextSibling(); + break; + } + case OBJECT_RENAMING_DECLARATION: + { + RefAdaAST __t216 = _t; + RefAdaAST tmp135_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJECT_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + name(_t); + _t = _retTree; + _t = __t216; + _t = _t->getNextSibling(); + break; + } + case EXCEPTION_DECLARATION: + { + RefAdaAST __t217 = _t; + RefAdaAST tmp136_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + _t = __t217; + _t = _t->getNextSibling(); + break; + } + case NUMBER_DECLARATION: + { + RefAdaAST __t218 = _t; + RefAdaAST tmp137_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUMBER_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t218; + _t = _t->getNextSibling(); + break; + } + case ARRAY_OBJECT_DECLARATION: + { + RefAdaAST __t219 = _t; + RefAdaAST tmp138_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + array_type_definition(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t219; + _t = _t->getNextSibling(); + break; + } + case OBJECT_DECLARATION: + { + RefAdaAST __t220 = _t; + RefAdaAST tmp139_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t220; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrim_part_opt(RefAdaAST _t) { + RefAdaAST discrim_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t145 = _t; + RefAdaAST tmp140_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIM_PART_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp141_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case DISCRIMINANT_SPECIFICATIONS: + { + discriminant_specifications(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t145; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_definition_opt(RefAdaAST _t) { + RefAdaAST task_definition_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + task_items_opt(_t); + _t = _retTree; + private_task_items_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_items_opt(RefAdaAST _t) { + RefAdaAST task_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t157 = _t; + RefAdaAST tmp142_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t157; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::private_task_items_opt(RefAdaAST _t) { + RefAdaAST private_task_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t180 = _t; + RefAdaAST tmp143_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t180; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_specifications(RefAdaAST _t) { + RefAdaAST discriminant_specifications_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t148 = _t; + RefAdaAST tmp144_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_SPECIFICATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_SPECIFICATION)) { + discriminant_specification(_t); + _t = _retTree; + } + else { + goto _loop150; + } + + } + _loop150:; + } // ( ... )* + _t = __t148; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_specification(RefAdaAST _t) { + RefAdaAST discriminant_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t152 = _t; + RefAdaAST tmp145_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t152; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entrydecls_repspecs_opt(RefAdaAST _t) { + RefAdaAST entrydecls_repspecs_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + default: + { + goto _loop160; + } + } + } + _loop160:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_declaration(RefAdaAST _t) { + RefAdaAST entry_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t162 = _t; + RefAdaAST tmp146_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp147_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + discrete_subtype_def_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t162; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::rep_spec(RefAdaAST _t) { + RefAdaAST rep_spec_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RECORD_REPRESENTATION_CLAUSE: + { + RefAdaAST __t168 = _t; + RefAdaAST tmp148_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD_REPRESENTATION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + align_opt(_t); + _t = _retTree; + comp_loc_s(_t); + _t = _retTree; + _t = __t168; + _t = _t->getNextSibling(); + break; + } + case AT_CLAUSE: + { + RefAdaAST __t169 = _t; + RefAdaAST tmp149_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AT_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t169; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + { + RefAdaAST __t170 = _t; + RefAdaAST tmp150_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ATTRIBUTE_DEFINITION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t170; + _t = _t->getNextSibling(); + break; + } + case ENUMERATION_REPESENTATION_CLAUSE: + { + RefAdaAST __t171 = _t; + RefAdaAST tmp151_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENUMERATION_REPESENTATION_CLAUSE); + _t = _t->getFirstChild(); + local_enum_name(_t); + _t = _retTree; + enumeration_aggregate(_t); + _t = _retTree; + _t = __t171; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_subtype_def_opt(RefAdaAST _t) { + RefAdaAST discrete_subtype_def_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t164 = _t; + RefAdaAST tmp152_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRETE_SUBTYPE_DEF_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case SUBTYPE_INDICATION: + { + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t164; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_subtype_definition(RefAdaAST _t) { + RefAdaAST discrete_subtype_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subtype_ind(RefAdaAST _t) { + RefAdaAST subtype_ind_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t239 = _t; + RefAdaAST tmp153_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBTYPE_INDICATION); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + constraint_opt(_t); + _t = _retTree; + _t = __t239; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::align_opt(RefAdaAST _t) { + RefAdaAST align_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t173 = _t; + RefAdaAST tmp154_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD_CLAUSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t173; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::comp_loc_s(RefAdaAST _t) { + RefAdaAST comp_loc_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t176 = _t; + RefAdaAST tmp155_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_CLAUSES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + break; + } + default: + { + goto _loop178; + } + } + } + _loop178:; + } // ( ... )* + _t = __t176; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::local_enum_name(RefAdaAST _t) { + RefAdaAST local_enum_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp156_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::enumeration_aggregate(RefAdaAST _t) { + RefAdaAST enumeration_aggregate_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + goto _loop293; + } + + } + _loop293:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::protected_definition(RefAdaAST _t) { + RefAdaAST protected_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + prot_op_decl_s(_t); + _t = _retTree; + prot_private_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_private_opt(RefAdaAST _t) { + RefAdaAST prot_private_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t185 = _t; + RefAdaAST tmp157_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_PRIVATE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROT_MEMBER_DECLARATIONS: + { + prot_member_decl_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t185; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_member_decl_s(RefAdaAST _t) { + RefAdaAST prot_member_decl_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t196 = _t; + RefAdaAST tmp158_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_MEMBER_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENTRY_DECLARATION: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + case FUNCTION_DECLARATION: + case PROCEDURE_DECLARATION: + { + prot_op_decl(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop198; + } + } + } + _loop198:; + } // ( ... )* + _t = __t196; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_op_decl_s(RefAdaAST _t) { + RefAdaAST prot_op_decl_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t189 = _t; + RefAdaAST tmp159_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_OP_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_3.member(_t->getType()))) { + prot_op_decl(_t); + _t = _retTree; + } + else { + goto _loop191; + } + + } + _loop191:; + } // ( ... )* + _t = __t189; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_op_decl(RefAdaAST _t) { + RefAdaAST prot_op_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + RefAdaAST __t193 = _t; + RefAdaAST tmp160_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t193; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + RefAdaAST __t194 = _t; + RefAdaAST tmp161_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t194; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::comp_decl(RefAdaAST _t) { + RefAdaAST comp_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t200 = _t; + RefAdaAST tmp162_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t200; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::component_subtype_def(RefAdaAST _t) { + RefAdaAST component_subtype_def_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::enum_id_s(RefAdaAST _t) { + RefAdaAST enum_id_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )+ + int _cnt224=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == CHARACTER_LITERAL)) { + enumeration_literal_specification(_t); + _t = _retTree; + } + else { + if ( _cnt224>=1 ) { goto _loop224; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt224++; + } + _loop224:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_constraint_opt(RefAdaAST _t) { + RefAdaAST range_constraint_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::array_type_declaration(RefAdaAST _t) { + RefAdaAST array_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t230 = _t; + RefAdaAST tmp163_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp164_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + array_type_definition(_t); + _t = _retTree; + _t = __t230; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::access_type_declaration(RefAdaAST _t) { + RefAdaAST access_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCESS_TO_PROCEDURE_DECLARATION: + { + RefAdaAST __t263 = _t; + RefAdaAST tmp165_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp166_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t263; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + { + RefAdaAST __t264 = _t; + RefAdaAST tmp167_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp168_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t264; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_OBJECT_DECLARATION: + { + RefAdaAST __t265 = _t; + RefAdaAST tmp169_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp170_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t265; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::id_and_discrim(RefAdaAST _t) { + RefAdaAST id_and_discrim_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp171_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::record_definition(RefAdaAST _t) { + RefAdaAST record_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::array_type_definition(RefAdaAST _t) { + RefAdaAST array_type_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + index_or_discrete_range_s(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::enumeration_literal_specification(RefAdaAST _t) { + RefAdaAST enumeration_literal_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp172_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp173_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::index_or_discrete_range_s(RefAdaAST _t) { + RefAdaAST index_or_discrete_range_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + index_or_discrete_range(_t); + _t = _retTree; + break; + } + case COMMA: + { + RefAdaAST __t232 = _t; + RefAdaAST tmp174_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMMA); + _t = _t->getFirstChild(); + index_or_discrete_range_s(_t); + _t = _retTree; + index_or_discrete_range(_t); + _t = _retTree; + _t = __t232; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::index_or_discrete_range(RefAdaAST _t) { + RefAdaAST index_or_discrete_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + RefAdaAST __t234 = _t; + RefAdaAST tmp175_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t234; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + RefAdaAST __t235 = _t; + RefAdaAST tmp176_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp177_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t235; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::constraint_opt(RefAdaAST _t) { + RefAdaAST constraint_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case DIGITS_CONSTRAINT: + { + digits_constraint(_t); + _t = _retTree; + break; + } + case DELTA_CONSTRAINT: + { + delta_constraint(_t); + _t = _retTree; + break; + } + case INDEX_CONSTRAINT: + { + index_constraint(_t); + _t = _retTree; + break; + } + case DISCRIMINANT_CONSTRAINT: + { + discriminant_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::digits_constraint(RefAdaAST _t) { + RefAdaAST digits_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t243 = _t; + RefAdaAST tmp178_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIGITS_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t243; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::delta_constraint(RefAdaAST _t) { + RefAdaAST delta_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t245 = _t; + RefAdaAST tmp179_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELTA_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t245; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::index_constraint(RefAdaAST _t) { + RefAdaAST index_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t247 = _t; + RefAdaAST tmp180_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEX_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt249=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == DOT_DOT || _t->getType() == RANGE_ATTRIBUTE_REFERENCE || _t->getType() == SUBTYPE_INDICATION)) { + discrete_range(_t); + _t = _retTree; + } + else { + if ( _cnt249>=1 ) { goto _loop249; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt249++; + } + _loop249:; + } // ( ... )+ + _t = __t247; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_constraint(RefAdaAST _t) { + RefAdaAST discriminant_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t252 = _t; + RefAdaAST tmp181_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt254=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_ASSOCIATION)) { + discriminant_association(_t); + _t = _retTree; + } + else { + if ( _cnt254>=1 ) { goto _loop254; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt254++; + } + _loop254:; + } // ( ... )+ + _t = __t252; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_range(RefAdaAST _t) { + RefAdaAST discrete_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_association(RefAdaAST _t) { + RefAdaAST discriminant_association_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t256 = _t; + RefAdaAST tmp182_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_ASSOCIATION); + _t = _t->getFirstChild(); + selector_names_opt(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t256; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::selector_names_opt(RefAdaAST _t) { + RefAdaAST selector_names_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t258 = _t; + RefAdaAST tmp183_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SELECTOR_NAMES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + selector_name(_t); + _t = _retTree; + } + else { + goto _loop260; + } + + } + _loop260:; + } // ( ... )* + _t = __t258; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::selector_name(RefAdaAST _t) { + RefAdaAST selector_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp184_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::component_list(RefAdaAST _t) { + RefAdaAST component_list_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + component_items(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case VARIANT_PART: + { + variant_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::component_items(RefAdaAST _t) { + RefAdaAST component_items_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t271 = _t; + RefAdaAST tmp185_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_ITEMS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop273; + } + } + } + _loop273:; + } // ( ... )* + _t = __t271; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::variant_part(RefAdaAST _t) { + RefAdaAST variant_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t275 = _t; + RefAdaAST tmp186_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT_PART); + _t = _t->getFirstChild(); + discriminant_direct_name(_t); + _t = _retTree; + variant_s(_t); + _t = _retTree; + _t = __t275; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_direct_name(RefAdaAST _t) { + RefAdaAST discriminant_direct_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp187_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::variant_s(RefAdaAST _t) { + RefAdaAST variant_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t278 = _t; + RefAdaAST tmp188_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt280=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == VARIANT)) { + variant(_t); + _t = _retTree; + } + else { + if ( _cnt280>=1 ) { goto _loop280; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt280++; + } + _loop280:; + } // ( ... )+ + _t = __t278; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::variant(RefAdaAST _t) { + RefAdaAST variant_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t282 = _t; + RefAdaAST tmp189_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t282; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::choice_s(RefAdaAST _t) { + RefAdaAST choice_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + RefAdaAST __t285 = _t; + RefAdaAST tmp190_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + choice(_t); + _t = _retTree; + _t = __t285; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case OTHERS: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case RANGE_ATTRIBUTE_REFERENCE: + case AND_THEN: + case MARK_WITH_CONSTRAINT: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::choice(RefAdaAST _t) { + RefAdaAST choice_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + RefAdaAST tmp191_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case MARK_WITH_CONSTRAINT: + { + discrete_with_range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_with_range(RefAdaAST _t) { + RefAdaAST discrete_with_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case MARK_WITH_CONSTRAINT: + { + mark_with_constraint(_t); + _t = _retTree; + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::mark_with_constraint(RefAdaAST _t) { + RefAdaAST mark_with_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t289 = _t; + RefAdaAST tmp192_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MARK_WITH_CONSTRAINT); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + range_constraint(_t); + _t = _retTree; + _t = __t289; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_formal_parameter(RefAdaAST _t) { + RefAdaAST generic_formal_parameter_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case FORMAL_DISCRETE_TYPE_DECLARATION: + { + RefAdaAST __t299 = _t; + RefAdaAST tmp193_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_DISCRETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t299; + _t = _t->getNextSibling(); + break; + } + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + RefAdaAST __t300 = _t; + RefAdaAST tmp194_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t300; + _t = _t->getNextSibling(); + break; + } + case FORMAL_MODULAR_TYPE_DECLARATION: + { + RefAdaAST __t301 = _t; + RefAdaAST tmp195_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t301; + _t = _t->getNextSibling(); + break; + } + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + { + RefAdaAST __t302 = _t; + RefAdaAST tmp196_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t302; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + { + RefAdaAST __t303 = _t; + RefAdaAST tmp197_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t303; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FLOATING_POINT_DECLARATION: + { + RefAdaAST __t304 = _t; + RefAdaAST tmp198_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t304; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + formal_array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + formal_access_type_declaration(_t); + _t = _retTree; + break; + } + case FORMAL_PRIVATE_TYPE_DECLARATION: + { + RefAdaAST __t305 = _t; + RefAdaAST tmp199_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t305; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + { + RefAdaAST __t306 = _t; + RefAdaAST tmp200_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t306; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + { + RefAdaAST __t307 = _t; + RefAdaAST tmp201_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t307; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PROCEDURE_DECLARATION: + { + RefAdaAST __t308 = _t; + RefAdaAST tmp202_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t308; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FUNCTION_DECLARATION: + { + RefAdaAST __t309 = _t; + RefAdaAST tmp203_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t309; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PACKAGE_DECLARATION: + { + RefAdaAST __t310 = _t; + RefAdaAST tmp204_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + formal_package_actual_part_opt(_t); + _t = _retTree; + _t = __t310; + _t = _t->getNextSibling(); + break; + } + case PARAMETER_SPECIFICATION: + { + parameter_specification(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_array_type_declaration(RefAdaAST _t) { + RefAdaAST formal_array_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + array_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_access_type_declaration(RefAdaAST _t) { + RefAdaAST formal_access_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + access_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::id_part(RefAdaAST _t) { + RefAdaAST id_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprogram_default_opt(RefAdaAST _t) { + RefAdaAST subprogram_default_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp205_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_package_actual_part_opt(RefAdaAST _t) { + RefAdaAST formal_package_actual_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp206_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case DEFINING_IDENTIFIER_LIST: + { + defining_identifier_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::body_part(RefAdaAST _t) { + RefAdaAST body_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::declarative_part(RefAdaAST _t) { + RefAdaAST declarative_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t324 = _t; + RefAdaAST tmp207_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECLARATIVE_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_BODY: + case PACKAGE_BODY_STUB: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_BODY: + case PROTECTED_BODY_STUB: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_BODY: + case TASK_BODY_STUB: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + declarative_item(_t); + _t = _retTree; + break; + } + default: + { + goto _loop326; + } + } + } + _loop326:; + } // ( ... )* + _t = __t324; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::block_body(RefAdaAST _t) { + RefAdaAST block_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t343 = _t; + RefAdaAST tmp208_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_BODY); + _t = _t->getFirstChild(); + handled_stmt_s(_t); + _t = _retTree; + _t = __t343; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::declarative_item(RefAdaAST _t) { + RefAdaAST declarative_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_BODY_STUB: + { + RefAdaAST __t328 = _t; + RefAdaAST tmp209_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t328; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_BODY: + { + RefAdaAST __t329 = _t; + RefAdaAST tmp210_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t329; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case TASK_BODY_STUB: + { + RefAdaAST __t330 = _t; + RefAdaAST tmp211_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t330; + _t = _t->getNextSibling(); + break; + } + case TASK_BODY: + { + RefAdaAST __t331 = _t; + RefAdaAST tmp212_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t331; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY_STUB: + { + RefAdaAST __t332 = _t; + RefAdaAST tmp213_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t332; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_BODY: + { + RefAdaAST __t333 = _t; + RefAdaAST tmp214_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t333; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_op_bodies_opt(RefAdaAST _t) { + RefAdaAST prot_op_bodies_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t339 = _t; + RefAdaAST tmp215_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_OP_BODIES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ENTRY_BODY: + { + entry_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + case FUNCTION_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_DECLARATION: + { + subprog_decl_or_body(_t); + _t = _retTree; + break; + } + default: + { + goto _loop341; + } + } + } + _loop341:; + } // ( ... )* + _t = __t339; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::block_body_opt(RefAdaAST _t) { + RefAdaAST block_body_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t336 = _t; + RefAdaAST tmp216_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_BODY_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case HANDLED_SEQUENCE_OF_STATEMENTS: + { + handled_stmt_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t336; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::handled_stmt_s(RefAdaAST _t) { + RefAdaAST handled_stmt_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t345 = _t; + RefAdaAST tmp217_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),HANDLED_SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + _t = __t345; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_body(RefAdaAST _t) { + RefAdaAST entry_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t405 = _t; + RefAdaAST tmp218_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_body_formal_part(_t); + _t = _retTree; + entry_barrier(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t405; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::statements(RefAdaAST _t) { + RefAdaAST statements_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t350 = _t; + RefAdaAST tmp219_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt352=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt352>=1 ) { goto _loop352; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + } + _cnt352++; + } + _loop352:; + } // ( ... )+ + _t = __t350; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::except_handler_part_opt(RefAdaAST _t) { + RefAdaAST except_handler_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t455 = _t; + RefAdaAST tmp220_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPT_HANDLER_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == EXCEPTION_HANDLER)) { + exception_handler(_t); + _t = _retTree; + } + else { + goto _loop457; + } + + } + _loop457:; + } // ( ... )* + _t = __t455; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::handled_stmts_opt(RefAdaAST _t) { + RefAdaAST handled_stmts_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t347 = _t; + RefAdaAST tmp221_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),HANDLED_STMTS_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t347; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::statement(RefAdaAST _t) { + RefAdaAST statement_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t354 = _t; + RefAdaAST tmp222_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STATEMENT); + _t = _t->getFirstChild(); + def_label_opt(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NULL_STATEMENT: + { + null_stmt(_t); + _t = _retTree; + break; + } + case EXIT_STATEMENT: + { + exit_stmt(_t); + _t = _retTree; + break; + } + case RETURN_STATEMENT: + { + return_stmt(_t); + _t = _retTree; + break; + } + case GOTO_STATEMENT: + { + goto_stmt(_t); + _t = _retTree; + break; + } + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ABORT_STATEMENT: + { + abort_stmt(_t); + _t = _retTree; + break; + } + case RAISE_STATEMENT: + { + raise_stmt(_t); + _t = _retTree; + break; + } + case REQUEUE_STATEMENT: + { + requeue_stmt(_t); + _t = _retTree; + break; + } + case ACCEPT_STATEMENT: + { + accept_stmt(_t); + _t = _retTree; + break; + } + case ASYNCHRONOUS_SELECT: + case CONDITIONAL_ENTRY_CALL: + case SELECTIVE_ACCEPT: + case TIMED_ENTRY_CALL: + { + select_stmt(_t); + _t = _retTree; + break; + } + case IF_STATEMENT: + { + if_stmt(_t); + _t = _retTree; + break; + } + case CASE_STATEMENT: + { + case_stmt(_t); + _t = _retTree; + break; + } + case LOOP_STATEMENT: + { + loop_stmt(_t); + _t = _retTree; + id_opt(_t); + _t = _retTree; + break; + } + case BLOCK_STATEMENT: + { + block(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + break; + } + case ASSIGNMENT_STATEMENT: + case CALL_STATEMENT: + { + call_or_assignment(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t354; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::def_label_opt(RefAdaAST _t) { + RefAdaAST def_label_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t357 = _t; + RefAdaAST tmp223_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LABEL_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp224_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t357; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::null_stmt(RefAdaAST _t) { + RefAdaAST null_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp225_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NULL_STATEMENT); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::exit_stmt(RefAdaAST _t) { + RefAdaAST exit_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t392 = _t; + RefAdaAST tmp226_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXIT_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + label_name(_t); + _t = _retTree; + break; + } + case 3: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHEN: + { + RefAdaAST tmp227_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHEN); + _t = _t->getNextSibling(); + condition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t392; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::return_stmt(RefAdaAST _t) { + RefAdaAST return_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t397 = _t; + RefAdaAST tmp228_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RETURN_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t397; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::goto_stmt(RefAdaAST _t) { + RefAdaAST goto_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t400 = _t; + RefAdaAST tmp229_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GOTO_STATEMENT); + _t = _t->getFirstChild(); + label_name(_t); + _t = _retTree; + _t = __t400; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::delay_stmt(RefAdaAST _t) { + RefAdaAST delay_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t419 = _t; + RefAdaAST tmp230_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELAY_STATEMENT); + _t = _t->getFirstChild(); + modifiers(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t419; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::abort_stmt(RefAdaAST _t) { + RefAdaAST abort_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t451 = _t; + RefAdaAST tmp231_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORT_STATEMENT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt453=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_4.member(_t->getType()))) { + name(_t); + _t = _retTree; + } + else { + if ( _cnt453>=1 ) { goto _loop453; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt453++; + } + _loop453:; + } // ( ... )+ + _t = __t451; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::raise_stmt(RefAdaAST _t) { + RefAdaAST raise_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t467 = _t; + RefAdaAST tmp232_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RAISE_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t467; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::requeue_stmt(RefAdaAST _t) { + RefAdaAST requeue_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t470 = _t; + RefAdaAST tmp233_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REQUEUE_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABORT: + { + RefAdaAST tmp234_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORT); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t470; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::accept_stmt(RefAdaAST _t) { + RefAdaAST accept_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t414 = _t; + RefAdaAST tmp235_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCEPT_STATEMENT); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_index_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + handled_stmts_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t414; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::select_stmt(RefAdaAST _t) { + RefAdaAST select_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASYNCHRONOUS_SELECT: + { + RefAdaAST __t421 = _t; + RefAdaAST tmp236_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASYNCHRONOUS_SELECT); + _t = _t->getFirstChild(); + triggering_alternative(_t); + _t = _retTree; + abortable_part(_t); + _t = _retTree; + _t = __t421; + _t = _t->getNextSibling(); + break; + } + case SELECTIVE_ACCEPT: + { + RefAdaAST __t422 = _t; + RefAdaAST tmp237_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SELECTIVE_ACCEPT); + _t = _t->getFirstChild(); + selective_accept(_t); + _t = _retTree; + _t = __t422; + _t = _t->getNextSibling(); + break; + } + case TIMED_ENTRY_CALL: + { + RefAdaAST __t423 = _t; + RefAdaAST tmp238_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIMED_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + delay_alternative(_t); + _t = _retTree; + _t = __t423; + _t = _t->getNextSibling(); + break; + } + case CONDITIONAL_ENTRY_CALL: + { + RefAdaAST __t424 = _t; + RefAdaAST tmp239_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONDITIONAL_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t424; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::if_stmt(RefAdaAST _t) { + RefAdaAST if_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t361 = _t; + RefAdaAST tmp240_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IF_STATEMENT); + _t = _t->getFirstChild(); + cond_clause(_t); + _t = _retTree; + elsifs_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + _t = __t361; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::case_stmt(RefAdaAST _t) { + RefAdaAST case_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t373 = _t; + RefAdaAST tmp241_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_STATEMENT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + alternative_s(_t); + _t = _retTree; + _t = __t373; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::loop_stmt(RefAdaAST _t) { + RefAdaAST loop_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t380 = _t; + RefAdaAST tmp242_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LOOP_STATEMENT); + _t = _t->getFirstChild(); + iteration_scheme_opt(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t380; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::block(RefAdaAST _t) { + RefAdaAST block_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t387 = _t; + RefAdaAST tmp243_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_STATEMENT); + _t = _t->getFirstChild(); + declare_opt(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + _t = __t387; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::call_or_assignment(RefAdaAST _t) { + RefAdaAST call_or_assignment_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASSIGNMENT_STATEMENT: + { + RefAdaAST __t402 = _t; + RefAdaAST tmp244_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASSIGNMENT_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t402; + _t = _t->getNextSibling(); + break; + } + case CALL_STATEMENT: + { + RefAdaAST __t403 = _t; + RefAdaAST tmp245_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t403; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::cond_clause(RefAdaAST _t) { + RefAdaAST cond_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t363 = _t; + RefAdaAST tmp246_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COND_CLAUSE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t363; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::elsifs_opt(RefAdaAST _t) { + RefAdaAST elsifs_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t366 = _t; + RefAdaAST tmp247_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELSIFS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == COND_CLAUSE)) { + cond_clause(_t); + _t = _retTree; + } + else { + goto _loop368; + } + + } + _loop368:; + } // ( ... )* + _t = __t366; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::else_opt(RefAdaAST _t) { + RefAdaAST else_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t370 = _t; + RefAdaAST tmp248_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t370; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::condition(RefAdaAST _t) { + RefAdaAST condition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + expression(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::alternative_s(RefAdaAST _t) { + RefAdaAST alternative_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )+ + int _cnt376=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == CASE_STATEMENT_ALTERNATIVE)) { + case_statement_alternative(_t); + _t = _retTree; + } + else { + if ( _cnt376>=1 ) { goto _loop376; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt376++; + } + _loop376:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::case_statement_alternative(RefAdaAST _t) { + RefAdaAST case_statement_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t378 = _t; + RefAdaAST tmp249_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_STATEMENT_ALTERNATIVE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t378; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::iteration_scheme_opt(RefAdaAST _t) { + RefAdaAST iteration_scheme_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t382 = _t; + RefAdaAST tmp250_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ITERATION_SCHEME_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHILE: + { + RefAdaAST __t384 = _t; + RefAdaAST tmp251_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHILE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + _t = __t384; + _t = _t->getNextSibling(); + break; + } + case FOR: + { + RefAdaAST __t385 = _t; + RefAdaAST tmp252_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR); + _t = _t->getFirstChild(); + RefAdaAST tmp253_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + _t = __t385; + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t382; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::declare_opt(RefAdaAST _t) { + RefAdaAST declare_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t389 = _t; + RefAdaAST tmp254_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECLARE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DECLARATIVE_PART: + { + declarative_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t389; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::label_name(RefAdaAST _t) { + RefAdaAST label_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp255_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_body_formal_part(RefAdaAST _t) { + RefAdaAST entry_body_formal_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + entry_index_spec_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_barrier(RefAdaAST _t) { + RefAdaAST entry_barrier_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + condition(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_index_spec_opt(RefAdaAST _t) { + RefAdaAST entry_index_spec_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t408 = _t; + RefAdaAST tmp256_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_INDEX_SPECIFICATION); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + def_id(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t408; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_call_stmt(RefAdaAST _t) { + RefAdaAST entry_call_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t412 = _t; + RefAdaAST tmp257_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t412; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_index_opt(RefAdaAST _t) { + RefAdaAST entry_index_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t416 = _t; + RefAdaAST tmp258_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_INDEX_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t416; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::triggering_alternative(RefAdaAST _t) { + RefAdaAST triggering_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t426 = _t; + RefAdaAST tmp259_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TRIGGERING_ALTERNATIVE); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ENTRY_CALL_STATEMENT: + { + entry_call_stmt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + stmts_opt(_t); + _t = _retTree; + _t = __t426; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::abortable_part(RefAdaAST _t) { + RefAdaAST abortable_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t429 = _t; + RefAdaAST tmp260_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORTABLE_PART); + _t = _t->getFirstChild(); + stmts_opt(_t); + _t = _retTree; + _t = __t429; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::selective_accept(RefAdaAST _t) { + RefAdaAST selective_accept_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + or_select_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_call_alternative(RefAdaAST _t) { + RefAdaAST entry_call_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t431 = _t; + RefAdaAST tmp261_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_CALL_ALTERNATIVE); + _t = _t->getFirstChild(); + entry_call_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t431; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::delay_alternative(RefAdaAST _t) { + RefAdaAST delay_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t442 = _t; + RefAdaAST tmp262_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELAY_ALTERNATIVE); + _t = _t->getFirstChild(); + delay_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t442; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::stmts_opt(RefAdaAST _t) { + RefAdaAST stmts_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + goto _loop445; + } + } + } + _loop445:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::guard_opt(RefAdaAST _t) { + RefAdaAST guard_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t434 = _t; + RefAdaAST tmp263_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GUARD_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + condition(_t); + _t = _retTree; + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop437; + } + + } + _loop437:; + } // ( ... )* + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t434; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::select_alternative(RefAdaAST _t) { + RefAdaAST select_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCEPT_ALTERNATIVE: + { + accept_alternative(_t); + _t = _retTree; + break; + } + case DELAY_ALTERNATIVE: + { + delay_alternative(_t); + _t = _retTree; + break; + } + case TERMINATE_ALTERNATIVE: + { + RefAdaAST tmp264_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TERMINATE_ALTERNATIVE); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::or_select_opt(RefAdaAST _t) { + RefAdaAST or_select_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t447 = _t; + RefAdaAST tmp265_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR_SELECT_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == GUARD_OPT)) { + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + } + else { + goto _loop449; + } + + } + _loop449:; + } // ( ... )* + _t = __t447; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::accept_alternative(RefAdaAST _t) { + RefAdaAST accept_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t440 = _t; + RefAdaAST tmp266_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCEPT_ALTERNATIVE); + _t = _t->getFirstChild(); + accept_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t440; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::exception_handler(RefAdaAST _t) { + RefAdaAST exception_handler_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t459 = _t; + RefAdaAST tmp267_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_HANDLER); + _t = _t->getFirstChild(); + identifier_colon_opt(_t); + _t = _retTree; + except_choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t459; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::identifier_colon_opt(RefAdaAST _t) { + RefAdaAST identifier_colon_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t461 = _t; + RefAdaAST tmp268_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER_COLON_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp269_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t461; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::except_choice_s(RefAdaAST _t) { + RefAdaAST except_choice_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + RefAdaAST __t464 = _t; + RefAdaAST tmp270_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE); + _t = _t->getFirstChild(); + except_choice_s(_t); + _t = _retTree; + exception_choice(_t); + _t = _retTree; + _t = __t464; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case OTHERS: + { + exception_choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::exception_choice(RefAdaAST _t) { + RefAdaAST exception_choice_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case OTHERS: + { + RefAdaAST tmp271_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::operator_call(RefAdaAST _t) { + RefAdaAST operator_call_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t473 = _t; + RefAdaAST tmp272_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getFirstChild(); + value_s(_t); + _t = _retTree; + _t = __t473; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::relation(RefAdaAST _t) { + RefAdaAST relation_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IN: + { + RefAdaAST __t485 = _t; + RefAdaAST tmp273_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t485; + _t = _t->getNextSibling(); + break; + } + case NOT_IN: + { + RefAdaAST __t486 = _t; + RefAdaAST tmp274_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT_IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t486; + _t = _t->getNextSibling(); + break; + } + case EQ: + { + RefAdaAST __t487 = _t; + RefAdaAST tmp275_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EQ); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t487; + _t = _t->getNextSibling(); + break; + } + case NE: + { + RefAdaAST __t488 = _t; + RefAdaAST tmp276_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t488; + _t = _t->getNextSibling(); + break; + } + case LT_: + { + RefAdaAST __t489 = _t; + RefAdaAST tmp277_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LT_); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t489; + _t = _t->getNextSibling(); + break; + } + case LE: + { + RefAdaAST __t490 = _t; + RefAdaAST tmp278_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t490; + _t = _t->getNextSibling(); + break; + } + case GT: + { + RefAdaAST __t491 = _t; + RefAdaAST tmp279_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t491; + _t = _t->getNextSibling(); + break; + } + case GE: + { + RefAdaAST __t492 = _t; + RefAdaAST tmp280_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t492; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_or_mark(RefAdaAST _t) { + RefAdaAST range_or_mark_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::signed_term(RefAdaAST _t) { + RefAdaAST signed_term_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case UNARY_PLUS: + { + RefAdaAST __t499 = _t; + RefAdaAST tmp281_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_PLUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t499; + _t = _t->getNextSibling(); + break; + } + case UNARY_MINUS: + { + RefAdaAST __t500 = _t; + RefAdaAST tmp282_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_MINUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t500; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::term(RefAdaAST _t) { + RefAdaAST term_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case STAR: + { + RefAdaAST __t502 = _t; + RefAdaAST tmp283_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t502; + _t = _t->getNextSibling(); + break; + } + case DIV: + { + RefAdaAST __t503 = _t; + RefAdaAST tmp284_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIV); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t503; + _t = _t->getNextSibling(); + break; + } + case MOD: + { + RefAdaAST __t504 = _t; + RefAdaAST tmp285_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t504; + _t = _t->getNextSibling(); + break; + } + case REM: + { + RefAdaAST __t505 = _t; + RefAdaAST tmp286_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REM); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t505; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + factor(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::factor(RefAdaAST _t) { + RefAdaAST factor_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NOT: + { + RefAdaAST __t507 = _t; + RefAdaAST tmp287_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t507; + _t = _t->getNextSibling(); + break; + } + case ABS: + { + RefAdaAST __t508 = _t; + RefAdaAST tmp288_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABS); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t508; + _t = _t->getNextSibling(); + break; + } + case EXPON: + { + RefAdaAST __t509 = _t; + RefAdaAST tmp289_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXPON); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + primary(_t); + _t = _retTree; + _t = __t509; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + primary(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::primary(RefAdaAST _t) { + RefAdaAST primary_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name_or_qualified(_t); + _t = _retTree; + break; + } + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case ALLOCATOR: + { + allocator(_t); + _t = _retTree; + break; + } + case NuLL: + { + RefAdaAST tmp290_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL); + _t = _t->getNextSibling(); + break; + } + case NUMERIC_LIT: + { + RefAdaAST tmp291_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUMERIC_LIT); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp292_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case CHAR_STRING: + { + RefAdaAST tmp293_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHAR_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + operator_call(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::name_or_qualified(RefAdaAST _t) { + RefAdaAST name_or_qualified_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp294_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t513 = _t; + RefAdaAST tmp295_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + RefAdaAST tmp296_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp297_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp298_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + RefAdaAST tmp299_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t513; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + RefAdaAST __t515 = _t; + RefAdaAST tmp300_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t515; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + RefAdaAST __t516 = _t; + RefAdaAST tmp301_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case RANGE: + case DIGITS: + case DELTA: + case ACCESS: + { + attribute_id(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t516; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::allocator(RefAdaAST _t) { + RefAdaAST allocator_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t519 = _t; + RefAdaAST tmp302_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALLOCATOR); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + _t = __t519; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprogram_body(RefAdaAST _t) { + RefAdaAST subprogram_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_body(RefAdaAST _t) { + RefAdaAST task_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t525 = _t; + RefAdaAST tmp303_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t525; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::protected_body(RefAdaAST _t) { + RefAdaAST protected_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t527 = _t; + RefAdaAST tmp304_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + _t = __t527; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& ) +{ +} +const char* AdaStoreWalker::tokenNames[] = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"pragma\"", + "IDENTIFIER", + "SEMI", + "LPAREN", + "COMMA", + "RPAREN", + "RIGHT_SHAFT", + "\"with\"", + "DOT", + "\"use\"", + "\"type\"", + "TIC", + "\"range\"", + "\"digits\"", + "\"delta\"", + "\"access\"", + "\"private\"", + "\"package\"", + "\"body\"", + "\"is\"", + "\"procedure\"", + "\"function\"", + "\"new\"", + "\"others\"", + "PIPE", + "DOT_DOT", + "\"all\"", + "COLON", + "\"in\"", + "\"out\"", + "\"renames\"", + "CHARACTER_LITERAL", + "CHAR_STRING", + "\"null\"", + "\"record\"", + "\"separate\"", + "\"abstract\"", + "\"return\"", + "\"task\"", + "\"protected\"", + "BOX", + "ASSIGN", + "\"entry\"", + "\"for\"", + "\"end\"", + "\"at\"", + "\"mod\"", + "\"subtype\"", + "\"exception\"", + "\"constant\"", + "\"array\"", + "\"of\"", + "\"aliased\"", + "\"case\"", + "\"when\"", + "\"tagged\"", + "\"limited\"", + "\"generic\"", + "\"begin\"", + "LT_LT", + "GT_GT", + "\"if\"", + "\"then\"", + "\"elsif\"", + "\"else\"", + "\"loop\"", + "\"while\"", + "\"reverse\"", + "\"declare\"", + "\"exit\"", + "\"goto\"", + "\"accept\"", + "\"do\"", + "\"delay\"", + "\"until\"", + "\"select\"", + "\"abort\"", + "\"or\"", + "\"terminate\"", + "\"raise\"", + "\"requeue\"", + "\"and\"", + "\"xor\"", + "\"not\"", + "EQ", + "NE", + "LT_", + "LE", + "GT", + "GE", + "PLUS", + "MINUS", + "CONCAT", + "STAR", + "DIV", + "\"rem\"", + "\"abs\"", + "EXPON", + "NUMERIC_LIT", + "ABORTABLE_PART", + "ABORT_STATEMENT", + "ACCEPT_ALTERNATIVE", + "ACCEPT_STATEMENT", + "ALLOCATOR", + "ASSIGNMENT_STATEMENT", + "ASYNCHRONOUS_SELECT", + "ATTRIBUTE_DEFINITION_CLAUSE", + "AT_CLAUSE", + "BLOCK_STATEMENT", + "CASE_STATEMENT", + "CASE_STATEMENT_ALTERNATIVE", + "CODE_STATEMENT", + "COMPONENT_DECLARATION", + "CONDITIONAL_ENTRY_CALL", + "CONTEXT_CLAUSE", + "DECLARATIVE_PART", + "DEFINING_IDENTIFIER_LIST", + "DELAY_ALTERNATIVE", + "DELAY_STATEMENT", + "DELTA_CONSTRAINT", + "DIGITS_CONSTRAINT", + "DISCRIMINANT_ASSOCIATION", + "DISCRIMINANT_CONSTRAINT", + "DISCRIMINANT_SPECIFICATION", + "ENTRY_BODY", + "ENTRY_CALL_ALTERNATIVE", + "ENTRY_CALL_STATEMENT", + "ENTRY_DECLARATION", + "ENTRY_INDEX_SPECIFICATION", + "ENUMERATION_REPESENTATION_CLAUSE", + "EXCEPTION_DECLARATION", + "EXCEPTION_HANDLER", + "EXCEPTION_RENAMING_DECLARATION", + "EXIT_STATEMENT", + "FORMAL_PACKAGE_DECLARATION", + "GENERIC_FORMAL_PART", + "GENERIC_PACKAGE_DECLARATION", + "GOTO_STATEMENT", + "HANDLED_SEQUENCE_OF_STATEMENTS", + "HANDLED_STMTS_OPT", + "IF_STATEMENT", + "INCOMPLETE_TYPE_DECLARATION", + "INDEXED_COMPONENT", + "INDEX_CONSTRAINT", + "LIBRARY_ITEM", + "LOOP_STATEMENT", + "NAME", + "NULL_STATEMENT", + "NUMBER_DECLARATION", + "OBJECT_DECLARATION", + "OBJECT_RENAMING_DECLARATION", + "OPERATOR_SYMBOL", + "PACKAGE_BODY", + "PACKAGE_BODY_STUB", + "PACKAGE_RENAMING_DECLARATION", + "PACKAGE_SPECIFICATION", + "PARAMETER_SPECIFICATION", + "PRIVATE_EXTENSION_DECLARATION", + "PRIVATE_TYPE_DECLARATION", + "PROTECTED_BODY", + "PROTECTED_BODY_STUB", + "PROTECTED_TYPE_DECLARATION", + "RAISE_STATEMENT", + "RANGE_ATTRIBUTE_REFERENCE", + "RECORD_REPRESENTATION_CLAUSE", + "REQUEUE_STATEMENT", + "RETURN_STATEMENT", + "SELECTIVE_ACCEPT", + "SEQUENCE_OF_STATEMENTS", + "SINGLE_PROTECTED_DECLARATION", + "SINGLE_TASK_DECLARATION", + "STATEMENT", + "SUBTYPE_DECLARATION", + "SUBTYPE_INDICATION", + "SUBTYPE_MARK", + "SUBUNIT", + "TASK_BODY", + "TASK_BODY_STUB", + "TASK_TYPE_DECLARATION", + "TERMINATE_ALTERNATIVE", + "TIMED_ENTRY_CALL", + "TRIGGERING_ALTERNATIVE", + "USE_CLAUSE", + "USE_TYPE_CLAUSE", + "VARIANT", + "VARIANT_PART", + "WITH_CLAUSE", + "ABSTRACT_FUNCTION_DECLARATION", + "ABSTRACT_PROCEDURE_DECLARATION", + "ACCESS_TO_FUNCTION_DECLARATION", + "ACCESS_TO_OBJECT_DECLARATION", + "ACCESS_TO_PROCEDURE_DECLARATION", + "ARRAY_OBJECT_DECLARATION", + "ARRAY_TYPE_DECLARATION", + "AND_THEN", + "BASIC_DECLARATIVE_ITEMS_OPT", + "BLOCK_BODY", + "BLOCK_BODY_OPT", + "CALL_STATEMENT", + "COMPONENT_CLAUSES_OPT", + "COMPONENT_ITEMS", + "COND_CLAUSE", + "DECIMAL_FIXED_POINT_DECLARATION", + "DECLARE_OPT", + "DERIVED_RECORD_EXTENSION", + "DISCRETE_SUBTYPE_DEF_OPT", + "DISCRIMINANT_SPECIFICATIONS", + "DISCRIM_PART_OPT", + "ELSE_OPT", + "ELSIFS_OPT", + "END_ID_OPT", + "ENTRY_INDEX_OPT", + "ENUMERATION_TYPE_DECLARATION", + "EXCEPT_HANDLER_PART_OPT", + "EXTENSION_OPT", + "FLOATING_POINT_DECLARATION", + "FORMAL_DECIMAL_FIXED_POINT_DECLARATION", + "FORMAL_DISCRETE_TYPE_DECLARATION", + "FORMAL_FLOATING_POINT_DECLARATION", + "FORMAL_FUNCTION_DECLARATION", + "FORMAL_MODULAR_TYPE_DECLARATION", + "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION", + "FORMAL_ORDINARY_FIXED_POINT_DECLARATION", + "FORMAL_PART_OPT", + "FORMAL_PRIVATE_EXTENSION_DECLARATION", + "FORMAL_PRIVATE_TYPE_DECLARATION", + "FORMAL_PROCEDURE_DECLARATION", + "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION", + "FUNCTION_BODY", + "FUNCTION_BODY_STUB", + "FUNCTION_DECLARATION", + "FUNCTION_RENAMING_DECLARATION", + "GENERIC_FUNCTION_DECLARATION", + "GENERIC_FUNCTION_INSTANTIATION", + "GENERIC_FUNCTION_RENAMING", + "GENERIC_PACKAGE_INSTANTIATION", + "GENERIC_PACKAGE_RENAMING", + "GENERIC_PROCEDURE_DECLARATION", + "GENERIC_PROCEDURE_INSTANTIATION", + "GENERIC_PROCEDURE_RENAMING", + "GUARD_OPT", + "IDENTIFIER_COLON_OPT", + "ID_OPT", + "INIT_OPT", + "ITERATION_SCHEME_OPT", + "LABEL_OPT", + "MARK_WITH_CONSTRAINT", + "MODIFIERS", + "MODULAR_TYPE_DECLARATION", + "MOD_CLAUSE_OPT", + "NOT_IN", + "ORDINARY_DERIVED_TYPE_DECLARATION", + "ORDINARY_FIXED_POINT_DECLARATION", + "OR_ELSE", + "OR_SELECT_OPT", + "PARENTHESIZED_PRIMARY", + "PRIVATE_DECLARATIVE_ITEMS_OPT", + "PRIVATE_TASK_ITEMS_OPT", + "PROCEDURE_BODY", + "PROCEDURE_BODY_STUB", + "PROCEDURE_DECLARATION", + "PROCEDURE_RENAMING_DECLARATION", + "PROT_MEMBER_DECLARATIONS", + "PROT_OP_BODIES_OPT", + "PROT_OP_DECLARATIONS", + "PROT_PRIVATE_OPT", + "RANGED_EXPRS", + "RANGE_CONSTRAINT", + "RECORD_TYPE_DECLARATION", + "SELECTOR_NAMES_OPT", + "SIGNED_INTEGER_TYPE_DECLARATION", + "TASK_ITEMS_OPT", + "UNARY_MINUS", + "UNARY_PLUS", + "VALUE", + "VALUES", + "VARIANTS", + "COMMENT_INTRO", + "OX", + "TIC_OR_CHARACTER_LITERAL", + "DIGIT", + "EXPONENT", + "EXTENDED_DIGIT", + "BASED_INTEGER", + "WS_", + "COMMENT", + "CHARACTER_STRING", + 0 +}; + +const unsigned long AdaStoreWalker::_tokenSet_0_data_[] = { 37920UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "in" CHARACTER_LITERAL CHAR_STRING "null" +// "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR +// DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT OPERATOR_SYMBOL +// AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_0(_tokenSet_0_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_1_data_[] = { 0UL, 0UL, 0UL, 49152UL, 3338801504UL, 2353094950UL, 151076927UL, 2416967168UL, 328577UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENUMERATION_REPESENTATION_CLAUSE +// EXCEPTION_DECLARATION EXCEPTION_RENAMING_DECLARATION GENERIC_PACKAGE_DECLARATION +// INCOMPLETE_TYPE_DECLARATION NUMBER_DECLARATION OBJECT_DECLARATION OBJECT_RENAMING_DECLARATION +// PACKAGE_RENAMING_DECLARATION PACKAGE_SPECIFICATION PRIVATE_EXTENSION_DECLARATION +// PRIVATE_TYPE_DECLARATION PROTECTED_TYPE_DECLARATION RECORD_REPRESENTATION_CLAUSE +// SINGLE_PROTECTED_DECLARATION SINGLE_TASK_DECLARATION SUBTYPE_DECLARATION +// TASK_TYPE_DECLARATION USE_CLAUSE USE_TYPE_CLAUSE ABSTRACT_FUNCTION_DECLARATION +// ABSTRACT_PROCEDURE_DECLARATION ACCESS_TO_FUNCTION_DECLARATION ACCESS_TO_OBJECT_DECLARATION +// ACCESS_TO_PROCEDURE_DECLARATION ARRAY_OBJECT_DECLARATION ARRAY_TYPE_DECLARATION +// DECIMAL_FIXED_POINT_DECLARATION DERIVED_RECORD_EXTENSION ENUMERATION_TYPE_DECLARATION +// FLOATING_POINT_DECLARATION FUNCTION_BODY_STUB FUNCTION_DECLARATION FUNCTION_RENAMING_DECLARATION +// GENERIC_FUNCTION_DECLARATION GENERIC_FUNCTION_INSTANTIATION GENERIC_FUNCTION_RENAMING +// GENERIC_PACKAGE_INSTANTIATION GENERIC_PACKAGE_RENAMING GENERIC_PROCEDURE_DECLARATION +// GENERIC_PROCEDURE_INSTANTIATION GENERIC_PROCEDURE_RENAMING MODULAR_TYPE_DECLARATION +// ORDINARY_DERIVED_TYPE_DECLARATION ORDINARY_FIXED_POINT_DECLARATION PROCEDURE_BODY_STUB +// PROCEDURE_DECLARATION PROCEDURE_RENAMING_DECLARATION RECORD_TYPE_DECLARATION +// SIGNED_INTEGER_TYPE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_1(_tokenSet_1_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_2_data_[] = { 939627552UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "range" "others" PIPE DOT_DOT "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT +// OPERATOR_SYMBOL AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS +// UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_2(_tokenSet_2_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_3_data_[] = { 16UL, 0UL, 0UL, 49152UL, 40UL, 256UL, 0UL, 1024UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENTRY_DECLARATION ENUMERATION_REPESENTATION_CLAUSE +// RECORD_REPRESENTATION_CLAUSE FUNCTION_DECLARATION PROCEDURE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_3(_tokenSet_3_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_4_data_[] = { 36896UL, 0UL, 0UL, 0UL, 262144UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER DOT TIC INDEXED_COMPONENT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_4(_tokenSet_4_data_,12); + + diff --git a/languages/ada/AdaStoreWalker.hpp b/languages/ada/AdaStoreWalker.hpp new file mode 100644 index 00000000..6f108ff6 --- /dev/null +++ b/languages/ada/AdaStoreWalker.hpp @@ -0,0 +1,350 @@ +#ifndef INC_AdaStoreWalker_hpp_ +#define INC_AdaStoreWalker_hpp_ + +#line 1 "expandedada.store.g" + +#include <qstring.h> +#include <qstringlist.h> +#include <qfileinfo.h> + +#include <codemodel.h> +#include "AdaAST.hpp" +#include "ada_utils.hpp" + +#line 15 "AdaStoreWalker.hpp" +#include <antlr/config.hpp> +#include "AdaStoreWalkerTokenTypes.hpp" +/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalker.hpp"$ */ +#include <antlr/TreeParser.hpp> + +#line 10 "expandedada.store.g" + +#include <codemodel.h> +#include <kdebug.h> + +#line 26 "AdaStoreWalker.hpp" +class CUSTOM_API AdaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public AdaStoreWalkerTokenTypes +{ +#line 25 "expandedada.store.g" + +private: + QString m_fileName; + QValueList<NamespaceDom> m_scopeStack; + CodeModel* m_model; + QValueList<QStringList> m_imports; + NamespaceDom m_currentContainer; + int m_currentAccess; + bool m_addToStore; /* auxiliary variable: for the moment, this is `true' + only when we are in specs, not bodies. */ + bool m_isSubprogram; // auxiliary to def_id() + FileDom m_file; + +public: + void setCodeModel (CodeModel* model) { m_model = model; } + CodeModel* codeModel () { return m_model; } + const CodeModel* codeModel () const { return m_model; } + + QString fileName () const { return m_fileName; } + void setFileName (const QString& fileName) { m_fileName = fileName; } + + void init () { + m_scopeStack.clear (); + m_imports.clear (); + m_currentContainer = m_model->globalNamespace (); + m_scopeStack.append (m_currentContainer); + m_currentAccess = CodeModelItem::Public; + m_addToStore = false; + m_isSubprogram = false; + if (m_model->hasFile(m_fileName)) + m_model->removeFile (m_model->fileByName(m_fileName)); + m_file = m_model->create<FileModel>(); + m_file->setName(m_fileName); + m_model->addFile(m_file); + } + + void wipeout () { m_model->wipeout (); } +// void out () { m_store->out (); } + void removeWithReferences (const QString& fileName) { + m_model->removeFile (m_model->fileByName(fileName)); + } + NamespaceDom insertScopeContainer + (NamespaceDom scope, const QStringList & scopes ) { + QStringList::ConstIterator it = scopes.begin(); + QString prefix( *it ); + NamespaceDom ns = scope->namespaceByName( prefix ); +// kdDebug() << "insertScopeContainer begin with prefix " << prefix << endl; + if (!ns.data()) { +// kdDebug() << "insertScopeContainer: ns is empty" << endl; + ns = m_model->create<NamespaceModel>(); +// kdDebug() << "insertScopeContainer: ns created" << endl; + ns->setName( prefix ); +// kdDebug() << "insertScopeContainer: ns name set" << endl; + scope->addNamespace( ns ); +// kdDebug() << "insertScopeContainer: ns added to a scope" << endl; + + if (scope == m_model->globalNamespace()) + m_file->addNamespace( ns ); + } +// kdDebug() << "insertScopeContainer: while" << endl; + while ( ++it != scopes.end() ) { + QString nameSegment( *it ); + prefix += "." + nameSegment; +// kdDebug() << "insertScopeContainer: while prefix = " << prefix << endl; + NamespaceDom inner = scope->namespaceByName( prefix ); + if (!inner.data() ) { +// kdDebug() << "insertScopeContainer: inner is empty " << endl; + inner = m_model->create<NamespaceModel>(); +// kdDebug() << "insertScopeContainer: inner created " << endl; + inner->setName( nameSegment ); + ns->addNamespace( inner ); +// kdDebug() << "insertScopeContainer: inner added " << endl; + } + ns = inner; + } + return ns; + } + NamespaceDom defineScope( RefAdaAST namenode ) { + QStringList scopes( qnamelist( namenode ) ); +// kdDebug() << "defineScope: " << scopes.join(" ") << endl; + NamespaceDom psc = insertScopeContainer( m_currentContainer, scopes ); +// kdDebug() << "defineScope psc created" << endl; + psc->setStartPosition(namenode->getLine(), namenode->getColumn()); +// kdDebug() << "defineScope start position set" << endl; + psc->setFileName(m_fileName); +// kdDebug() << "defineScope file name set" << endl; + // psc->setEndPosition (endLine, 0); +// kdDebug() << "defineScope return" << endl; + return psc; + } +#line 30 "AdaStoreWalker.hpp" +public: + AdaStoreWalker(); + static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); + int getNumTokens() const + { + return AdaStoreWalker::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return AdaStoreWalker::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return AdaStoreWalker::tokenNames; + } + public: void compilation_unit(RefAdaAST _t); + public: void context_items_opt(RefAdaAST _t); + public: void library_item(RefAdaAST _t); + public: void subunit(RefAdaAST _t); + public: void pragma(RefAdaAST _t); + public: void with_clause(RefAdaAST _t); + public: void compound_name(RefAdaAST _t); + public: void use_clause(RefAdaAST _t); + public: void subtype_mark(RefAdaAST _t); + public: void lib_subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t); + public: void def_id(RefAdaAST _t); + public: void pkg_body_part(RefAdaAST _t); + public: void generic_inst(RefAdaAST _t); + public: void pkg_spec_part(RefAdaAST _t); + public: void renames(RefAdaAST _t); + public: void generic_decl(RefAdaAST _t); + public: void subprog_def_id(RefAdaAST _t); + public: void subprog_decl(RefAdaAST _t); + public: void formal_part_opt(RefAdaAST _t); + public: void def_designator(RefAdaAST _t); + public: void function_tail(RefAdaAST _t); + public: void definable_operator_symbol(RefAdaAST _t); + public: void spec_decl_part(RefAdaAST _t); + public: void basic_declarative_items_opt(RefAdaAST _t); + public: void private_declarative_items_opt(RefAdaAST _t); + public: void end_id_opt(RefAdaAST _t); + public: void basic_decl_item(RefAdaAST _t); + public: void generic_formal_part_opt(RefAdaAST _t); + public: void procedure_body(RefAdaAST _t); + public: void function_body(RefAdaAST _t); + public: void subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t); + public: void subprog_decl_or_body(RefAdaAST _t); + public: void package_body(RefAdaAST _t); + public: void pragma_arg(RefAdaAST _t); + public: void expression(RefAdaAST _t); + public: void attribute_id(RefAdaAST _t); + public: void modifiers(RefAdaAST _t); + public: void id_opt(RefAdaAST _t); + public: void value_s(RefAdaAST _t); + public: void value(RefAdaAST _t); + public: void ranged_expr_s(RefAdaAST _t); + public: void ranged_expr(RefAdaAST _t); + public: void simple_expression(RefAdaAST _t); + public: void range(RefAdaAST _t); + public: void range_constraint(RefAdaAST _t); + public: void range_dots(RefAdaAST _t); + public: void range_attrib_ref(RefAdaAST _t); + public: void prefix(RefAdaAST _t); + public: void parameter_specification(RefAdaAST _t); + public: void defining_identifier_list(RefAdaAST _t); + public: void init_opt(RefAdaAST _t); + public: void name(RefAdaAST _t); + public: void parenthesized_primary(RefAdaAST _t); + public: void extension_opt(RefAdaAST _t); + public: void task_type_or_single_decl(RefAdaAST _t); + public: void prot_type_or_single_decl(RefAdaAST _t); + public: void decl_common(RefAdaAST _t); + public: void discrim_part_opt(RefAdaAST _t); + public: void task_definition_opt(RefAdaAST _t); + public: void task_items_opt(RefAdaAST _t); + public: void private_task_items_opt(RefAdaAST _t); + public: void discriminant_specifications(RefAdaAST _t); + public: void discriminant_specification(RefAdaAST _t); + public: void entrydecls_repspecs_opt(RefAdaAST _t); + public: void entry_declaration(RefAdaAST _t); + public: void rep_spec(RefAdaAST _t); + public: void discrete_subtype_def_opt(RefAdaAST _t); + public: void discrete_subtype_definition(RefAdaAST _t); + public: void subtype_ind(RefAdaAST _t); + public: void align_opt(RefAdaAST _t); + public: void comp_loc_s(RefAdaAST _t); + public: void local_enum_name(RefAdaAST _t); + public: void enumeration_aggregate(RefAdaAST _t); + public: void protected_definition(RefAdaAST _t); + public: void prot_private_opt(RefAdaAST _t); + public: void prot_member_decl_s(RefAdaAST _t); + public: void prot_op_decl_s(RefAdaAST _t); + public: void prot_op_decl(RefAdaAST _t); + public: void comp_decl(RefAdaAST _t); + public: void component_subtype_def(RefAdaAST _t); + public: void enum_id_s(RefAdaAST _t); + public: void range_constraint_opt(RefAdaAST _t); + public: void array_type_declaration(RefAdaAST _t); + public: void access_type_declaration(RefAdaAST _t); + public: void id_and_discrim(RefAdaAST _t); + public: void record_definition(RefAdaAST _t); + public: void array_type_definition(RefAdaAST _t); + public: void enumeration_literal_specification(RefAdaAST _t); + public: void index_or_discrete_range_s(RefAdaAST _t); + public: void index_or_discrete_range(RefAdaAST _t); + public: void constraint_opt(RefAdaAST _t); + public: void digits_constraint(RefAdaAST _t); + public: void delta_constraint(RefAdaAST _t); + public: void index_constraint(RefAdaAST _t); + public: void discriminant_constraint(RefAdaAST _t); + public: void discrete_range(RefAdaAST _t); + public: void discriminant_association(RefAdaAST _t); + public: void selector_names_opt(RefAdaAST _t); + public: void selector_name(RefAdaAST _t); + public: void component_list(RefAdaAST _t); + public: void component_items(RefAdaAST _t); + public: void variant_part(RefAdaAST _t); + public: void discriminant_direct_name(RefAdaAST _t); + public: void variant_s(RefAdaAST _t); + public: void variant(RefAdaAST _t); + public: void choice_s(RefAdaAST _t); + public: void choice(RefAdaAST _t); + public: void discrete_with_range(RefAdaAST _t); + public: void mark_with_constraint(RefAdaAST _t); + public: void generic_formal_parameter(RefAdaAST _t); + public: void formal_array_type_declaration(RefAdaAST _t); + public: void formal_access_type_declaration(RefAdaAST _t); + public: void id_part(RefAdaAST _t); + public: void subprogram_default_opt(RefAdaAST _t); + public: void formal_package_actual_part_opt(RefAdaAST _t); + public: void body_part(RefAdaAST _t); + public: void declarative_part(RefAdaAST _t); + public: void block_body(RefAdaAST _t); + public: void declarative_item(RefAdaAST _t); + public: void prot_op_bodies_opt(RefAdaAST _t); + public: void block_body_opt(RefAdaAST _t); + public: void handled_stmt_s(RefAdaAST _t); + public: void entry_body(RefAdaAST _t); + public: void statements(RefAdaAST _t); + public: void except_handler_part_opt(RefAdaAST _t); + public: void handled_stmts_opt(RefAdaAST _t); + public: void statement(RefAdaAST _t); + public: void def_label_opt(RefAdaAST _t); + public: void null_stmt(RefAdaAST _t); + public: void exit_stmt(RefAdaAST _t); + public: void return_stmt(RefAdaAST _t); + public: void goto_stmt(RefAdaAST _t); + public: void delay_stmt(RefAdaAST _t); + public: void abort_stmt(RefAdaAST _t); + public: void raise_stmt(RefAdaAST _t); + public: void requeue_stmt(RefAdaAST _t); + public: void accept_stmt(RefAdaAST _t); + public: void select_stmt(RefAdaAST _t); + public: void if_stmt(RefAdaAST _t); + public: void case_stmt(RefAdaAST _t); + public: void loop_stmt(RefAdaAST _t); + public: void block(RefAdaAST _t); + public: void call_or_assignment(RefAdaAST _t); + public: void cond_clause(RefAdaAST _t); + public: void elsifs_opt(RefAdaAST _t); + public: void else_opt(RefAdaAST _t); + public: void condition(RefAdaAST _t); + public: void alternative_s(RefAdaAST _t); + public: void case_statement_alternative(RefAdaAST _t); + public: void iteration_scheme_opt(RefAdaAST _t); + public: void declare_opt(RefAdaAST _t); + public: void label_name(RefAdaAST _t); + public: void entry_body_formal_part(RefAdaAST _t); + public: void entry_barrier(RefAdaAST _t); + public: void entry_index_spec_opt(RefAdaAST _t); + public: void entry_call_stmt(RefAdaAST _t); + public: void entry_index_opt(RefAdaAST _t); + public: void triggering_alternative(RefAdaAST _t); + public: void abortable_part(RefAdaAST _t); + public: void selective_accept(RefAdaAST _t); + public: void entry_call_alternative(RefAdaAST _t); + public: void delay_alternative(RefAdaAST _t); + public: void stmts_opt(RefAdaAST _t); + public: void guard_opt(RefAdaAST _t); + public: void select_alternative(RefAdaAST _t); + public: void or_select_opt(RefAdaAST _t); + public: void accept_alternative(RefAdaAST _t); + public: void exception_handler(RefAdaAST _t); + public: void identifier_colon_opt(RefAdaAST _t); + public: void except_choice_s(RefAdaAST _t); + public: void exception_choice(RefAdaAST _t); + public: void operator_call(RefAdaAST _t); + public: void relation(RefAdaAST _t); + public: void range_or_mark(RefAdaAST _t); + public: void signed_term(RefAdaAST _t); + public: void term(RefAdaAST _t); + public: void factor(RefAdaAST _t); + public: void primary(RefAdaAST _t); + public: void name_or_qualified(RefAdaAST _t); + public: void allocator(RefAdaAST _t); + public: void subprogram_body(RefAdaAST _t); + public: void task_body(RefAdaAST _t); + public: void protected_body(RefAdaAST _t); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); + } + +protected: + RefAdaAST returnAST; + RefAdaAST _retTree; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 291; +#else + enum { + NUM_TOKENS = 291 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; +}; + +#endif /*INC_AdaStoreWalker_hpp_*/ diff --git a/languages/ada/AdaStoreWalkerTokenTypes.hpp b/languages/ada/AdaStoreWalkerTokenTypes.hpp new file mode 100644 index 00000000..daaa4b21 --- /dev/null +++ b/languages/ada/AdaStoreWalkerTokenTypes.hpp @@ -0,0 +1,307 @@ +#ifndef INC_AdaStoreWalkerTokenTypes_hpp_ +#define INC_AdaStoreWalkerTokenTypes_hpp_ + +/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalkerTokenTypes.hpp"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API AdaStoreWalkerTokenTypes { +#endif + enum { + EOF_ = 1, + PRAGMA = 4, + IDENTIFIER = 5, + SEMI = 6, + LPAREN = 7, + COMMA = 8, + RPAREN = 9, + RIGHT_SHAFT = 10, + WITH = 11, + DOT = 12, + USE = 13, + TYPE = 14, + TIC = 15, + RANGE = 16, + DIGITS = 17, + DELTA = 18, + ACCESS = 19, + PRIVATE = 20, + PACKAGE = 21, + BODY = 22, + IS = 23, + PROCEDURE = 24, + FUNCTION = 25, + NEW = 26, + OTHERS = 27, + PIPE = 28, + DOT_DOT = 29, + ALL = 30, + COLON = 31, + IN = 32, + OUT = 33, + RENAMES = 34, + CHARACTER_LITERAL = 35, + CHAR_STRING = 36, + NuLL = 37, + RECORD = 38, + SEPARATE = 39, + ABSTRACT = 40, + RETURN = 41, + TASK = 42, + PROTECTED = 43, + BOX = 44, + ASSIGN = 45, + ENTRY = 46, + FOR = 47, + END = 48, + AT = 49, + MOD = 50, + SUBTYPE = 51, + EXCEPTION = 52, + CONSTANT = 53, + ARRAY = 54, + OF = 55, + ALIASED = 56, + CASE = 57, + WHEN = 58, + TAGGED = 59, + LIMITED = 60, + GENERIC = 61, + BEGIN = 62, + LT_LT = 63, + GT_GT = 64, + IF = 65, + THEN = 66, + ELSIF = 67, + ELSE = 68, + LOOP = 69, + WHILE = 70, + REVERSE = 71, + DECLARE = 72, + EXIT = 73, + GOTO = 74, + ACCEPT = 75, + DO = 76, + DELAY = 77, + UNTIL = 78, + SELECT = 79, + ABORT = 80, + OR = 81, + TERMINATE = 82, + RAISE = 83, + REQUEUE = 84, + AND = 85, + XOR = 86, + NOT = 87, + EQ = 88, + NE = 89, + LT_ = 90, + LE = 91, + GT = 92, + GE = 93, + PLUS = 94, + MINUS = 95, + CONCAT = 96, + STAR = 97, + DIV = 98, + REM = 99, + ABS = 100, + EXPON = 101, + NUMERIC_LIT = 102, + ABORTABLE_PART = 103, + ABORT_STATEMENT = 104, + ACCEPT_ALTERNATIVE = 105, + ACCEPT_STATEMENT = 106, + ALLOCATOR = 107, + ASSIGNMENT_STATEMENT = 108, + ASYNCHRONOUS_SELECT = 109, + ATTRIBUTE_DEFINITION_CLAUSE = 110, + AT_CLAUSE = 111, + BLOCK_STATEMENT = 112, + CASE_STATEMENT = 113, + CASE_STATEMENT_ALTERNATIVE = 114, + CODE_STATEMENT = 115, + COMPONENT_DECLARATION = 116, + CONDITIONAL_ENTRY_CALL = 117, + CONTEXT_CLAUSE = 118, + DECLARATIVE_PART = 119, + DEFINING_IDENTIFIER_LIST = 120, + DELAY_ALTERNATIVE = 121, + DELAY_STATEMENT = 122, + DELTA_CONSTRAINT = 123, + DIGITS_CONSTRAINT = 124, + DISCRIMINANT_ASSOCIATION = 125, + DISCRIMINANT_CONSTRAINT = 126, + DISCRIMINANT_SPECIFICATION = 127, + ENTRY_BODY = 128, + ENTRY_CALL_ALTERNATIVE = 129, + ENTRY_CALL_STATEMENT = 130, + ENTRY_DECLARATION = 131, + ENTRY_INDEX_SPECIFICATION = 132, + ENUMERATION_REPESENTATION_CLAUSE = 133, + EXCEPTION_DECLARATION = 134, + EXCEPTION_HANDLER = 135, + EXCEPTION_RENAMING_DECLARATION = 136, + EXIT_STATEMENT = 137, + FORMAL_PACKAGE_DECLARATION = 138, + GENERIC_FORMAL_PART = 139, + GENERIC_PACKAGE_DECLARATION = 140, + GOTO_STATEMENT = 141, + HANDLED_SEQUENCE_OF_STATEMENTS = 142, + HANDLED_STMTS_OPT = 143, + IF_STATEMENT = 144, + INCOMPLETE_TYPE_DECLARATION = 145, + INDEXED_COMPONENT = 146, + INDEX_CONSTRAINT = 147, + LIBRARY_ITEM = 148, + LOOP_STATEMENT = 149, + NAME = 150, + NULL_STATEMENT = 151, + NUMBER_DECLARATION = 152, + OBJECT_DECLARATION = 153, + OBJECT_RENAMING_DECLARATION = 154, + OPERATOR_SYMBOL = 155, + PACKAGE_BODY = 156, + PACKAGE_BODY_STUB = 157, + PACKAGE_RENAMING_DECLARATION = 158, + PACKAGE_SPECIFICATION = 159, + PARAMETER_SPECIFICATION = 160, + PRIVATE_EXTENSION_DECLARATION = 161, + PRIVATE_TYPE_DECLARATION = 162, + PROTECTED_BODY = 163, + PROTECTED_BODY_STUB = 164, + PROTECTED_TYPE_DECLARATION = 165, + RAISE_STATEMENT = 166, + RANGE_ATTRIBUTE_REFERENCE = 167, + RECORD_REPRESENTATION_CLAUSE = 168, + REQUEUE_STATEMENT = 169, + RETURN_STATEMENT = 170, + SELECTIVE_ACCEPT = 171, + SEQUENCE_OF_STATEMENTS = 172, + SINGLE_PROTECTED_DECLARATION = 173, + SINGLE_TASK_DECLARATION = 174, + STATEMENT = 175, + SUBTYPE_DECLARATION = 176, + SUBTYPE_INDICATION = 177, + SUBTYPE_MARK = 178, + SUBUNIT = 179, + TASK_BODY = 180, + TASK_BODY_STUB = 181, + TASK_TYPE_DECLARATION = 182, + TERMINATE_ALTERNATIVE = 183, + TIMED_ENTRY_CALL = 184, + TRIGGERING_ALTERNATIVE = 185, + USE_CLAUSE = 186, + USE_TYPE_CLAUSE = 187, + VARIANT = 188, + VARIANT_PART = 189, + WITH_CLAUSE = 190, + ABSTRACT_FUNCTION_DECLARATION = 191, + ABSTRACT_PROCEDURE_DECLARATION = 192, + ACCESS_TO_FUNCTION_DECLARATION = 193, + ACCESS_TO_OBJECT_DECLARATION = 194, + ACCESS_TO_PROCEDURE_DECLARATION = 195, + ARRAY_OBJECT_DECLARATION = 196, + ARRAY_TYPE_DECLARATION = 197, + AND_THEN = 198, + BASIC_DECLARATIVE_ITEMS_OPT = 199, + BLOCK_BODY = 200, + BLOCK_BODY_OPT = 201, + CALL_STATEMENT = 202, + COMPONENT_CLAUSES_OPT = 203, + COMPONENT_ITEMS = 204, + COND_CLAUSE = 205, + DECIMAL_FIXED_POINT_DECLARATION = 206, + DECLARE_OPT = 207, + DERIVED_RECORD_EXTENSION = 208, + DISCRETE_SUBTYPE_DEF_OPT = 209, + DISCRIMINANT_SPECIFICATIONS = 210, + DISCRIM_PART_OPT = 211, + ELSE_OPT = 212, + ELSIFS_OPT = 213, + END_ID_OPT = 214, + ENTRY_INDEX_OPT = 215, + ENUMERATION_TYPE_DECLARATION = 216, + EXCEPT_HANDLER_PART_OPT = 217, + EXTENSION_OPT = 218, + FLOATING_POINT_DECLARATION = 219, + FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220, + FORMAL_DISCRETE_TYPE_DECLARATION = 221, + FORMAL_FLOATING_POINT_DECLARATION = 222, + FORMAL_FUNCTION_DECLARATION = 223, + FORMAL_MODULAR_TYPE_DECLARATION = 224, + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225, + FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226, + FORMAL_PART_OPT = 227, + FORMAL_PRIVATE_EXTENSION_DECLARATION = 228, + FORMAL_PRIVATE_TYPE_DECLARATION = 229, + FORMAL_PROCEDURE_DECLARATION = 230, + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231, + FUNCTION_BODY = 232, + FUNCTION_BODY_STUB = 233, + FUNCTION_DECLARATION = 234, + FUNCTION_RENAMING_DECLARATION = 235, + GENERIC_FUNCTION_DECLARATION = 236, + GENERIC_FUNCTION_INSTANTIATION = 237, + GENERIC_FUNCTION_RENAMING = 238, + GENERIC_PACKAGE_INSTANTIATION = 239, + GENERIC_PACKAGE_RENAMING = 240, + GENERIC_PROCEDURE_DECLARATION = 241, + GENERIC_PROCEDURE_INSTANTIATION = 242, + GENERIC_PROCEDURE_RENAMING = 243, + GUARD_OPT = 244, + IDENTIFIER_COLON_OPT = 245, + ID_OPT = 246, + INIT_OPT = 247, + ITERATION_SCHEME_OPT = 248, + LABEL_OPT = 249, + MARK_WITH_CONSTRAINT = 250, + MODIFIERS = 251, + MODULAR_TYPE_DECLARATION = 252, + MOD_CLAUSE_OPT = 253, + NOT_IN = 254, + ORDINARY_DERIVED_TYPE_DECLARATION = 255, + ORDINARY_FIXED_POINT_DECLARATION = 256, + OR_ELSE = 257, + OR_SELECT_OPT = 258, + PARENTHESIZED_PRIMARY = 259, + PRIVATE_DECLARATIVE_ITEMS_OPT = 260, + PRIVATE_TASK_ITEMS_OPT = 261, + PROCEDURE_BODY = 262, + PROCEDURE_BODY_STUB = 263, + PROCEDURE_DECLARATION = 264, + PROCEDURE_RENAMING_DECLARATION = 265, + PROT_MEMBER_DECLARATIONS = 266, + PROT_OP_BODIES_OPT = 267, + PROT_OP_DECLARATIONS = 268, + PROT_PRIVATE_OPT = 269, + RANGED_EXPRS = 270, + RANGE_CONSTRAINT = 271, + RECORD_TYPE_DECLARATION = 272, + SELECTOR_NAMES_OPT = 273, + SIGNED_INTEGER_TYPE_DECLARATION = 274, + TASK_ITEMS_OPT = 275, + UNARY_MINUS = 276, + UNARY_PLUS = 277, + VALUE = 278, + VALUES = 279, + VARIANTS = 280, + COMMENT_INTRO = 281, + OX = 282, + TIC_OR_CHARACTER_LITERAL = 283, + DIGIT = 284, + EXPONENT = 285, + EXTENDED_DIGIT = 286, + BASED_INTEGER = 287, + WS_ = 288, + COMMENT = 289, + CHARACTER_STRING = 290, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_AdaStoreWalkerTokenTypes_hpp_*/ diff --git a/languages/ada/AdaStoreWalkerTokenTypes.txt b/languages/ada/AdaStoreWalkerTokenTypes.txt new file mode 100644 index 00000000..e9ba489c --- /dev/null +++ b/languages/ada/AdaStoreWalkerTokenTypes.txt @@ -0,0 +1,289 @@ +// $ANTLR 2.7.7 (20070609): expandedada.store.g -> AdaStoreWalkerTokenTypes.txt$ +AdaStoreWalker // output token vocab name +PRAGMA="pragma"=4 +IDENTIFIER=5 +SEMI=6 +LPAREN=7 +COMMA=8 +RPAREN=9 +RIGHT_SHAFT=10 +WITH="with"=11 +DOT=12 +USE="use"=13 +TYPE="type"=14 +TIC=15 +RANGE="range"=16 +DIGITS="digits"=17 +DELTA="delta"=18 +ACCESS="access"=19 +PRIVATE="private"=20 +PACKAGE="package"=21 +BODY="body"=22 +IS="is"=23 +PROCEDURE="procedure"=24 +FUNCTION="function"=25 +NEW="new"=26 +OTHERS="others"=27 +PIPE=28 +DOT_DOT=29 +ALL="all"=30 +COLON=31 +IN="in"=32 +OUT="out"=33 +RENAMES="renames"=34 +CHARACTER_LITERAL=35 +CHAR_STRING=36 +NuLL="null"=37 +RECORD="record"=38 +SEPARATE="separate"=39 +ABSTRACT="abstract"=40 +RETURN="return"=41 +TASK="task"=42 +PROTECTED="protected"=43 +BOX=44 +ASSIGN=45 +ENTRY="entry"=46 +FOR="for"=47 +END="end"=48 +AT="at"=49 +MOD="mod"=50 +SUBTYPE="subtype"=51 +EXCEPTION="exception"=52 +CONSTANT="constant"=53 +ARRAY="array"=54 +OF="of"=55 +ALIASED="aliased"=56 +CASE="case"=57 +WHEN="when"=58 +TAGGED="tagged"=59 +LIMITED="limited"=60 +GENERIC="generic"=61 +BEGIN="begin"=62 +LT_LT=63 +GT_GT=64 +IF="if"=65 +THEN="then"=66 +ELSIF="elsif"=67 +ELSE="else"=68 +LOOP="loop"=69 +WHILE="while"=70 +REVERSE="reverse"=71 +DECLARE="declare"=72 +EXIT="exit"=73 +GOTO="goto"=74 +ACCEPT="accept"=75 +DO="do"=76 +DELAY="delay"=77 +UNTIL="until"=78 +SELECT="select"=79 +ABORT="abort"=80 +OR="or"=81 +TERMINATE="terminate"=82 +RAISE="raise"=83 +REQUEUE="requeue"=84 +AND="and"=85 +XOR="xor"=86 +NOT="not"=87 +EQ=88 +NE=89 +LT_=90 +LE=91 +GT=92 +GE=93 +PLUS=94 +MINUS=95 +CONCAT=96 +STAR=97 +DIV=98 +REM="rem"=99 +ABS="abs"=100 +EXPON=101 +NUMERIC_LIT=102 +ABORTABLE_PART=103 +ABORT_STATEMENT=104 +ACCEPT_ALTERNATIVE=105 +ACCEPT_STATEMENT=106 +ALLOCATOR=107 +ASSIGNMENT_STATEMENT=108 +ASYNCHRONOUS_SELECT=109 +ATTRIBUTE_DEFINITION_CLAUSE=110 +AT_CLAUSE=111 +BLOCK_STATEMENT=112 +CASE_STATEMENT=113 +CASE_STATEMENT_ALTERNATIVE=114 +CODE_STATEMENT=115 +COMPONENT_DECLARATION=116 +CONDITIONAL_ENTRY_CALL=117 +CONTEXT_CLAUSE=118 +DECLARATIVE_PART=119 +DEFINING_IDENTIFIER_LIST=120 +DELAY_ALTERNATIVE=121 +DELAY_STATEMENT=122 +DELTA_CONSTRAINT=123 +DIGITS_CONSTRAINT=124 +DISCRIMINANT_ASSOCIATION=125 +DISCRIMINANT_CONSTRAINT=126 +DISCRIMINANT_SPECIFICATION=127 +ENTRY_BODY=128 +ENTRY_CALL_ALTERNATIVE=129 +ENTRY_CALL_STATEMENT=130 +ENTRY_DECLARATION=131 +ENTRY_INDEX_SPECIFICATION=132 +ENUMERATION_REPESENTATION_CLAUSE=133 +EXCEPTION_DECLARATION=134 +EXCEPTION_HANDLER=135 +EXCEPTION_RENAMING_DECLARATION=136 +EXIT_STATEMENT=137 +FORMAL_PACKAGE_DECLARATION=138 +GENERIC_FORMAL_PART=139 +GENERIC_PACKAGE_DECLARATION=140 +GOTO_STATEMENT=141 +HANDLED_SEQUENCE_OF_STATEMENTS=142 +HANDLED_STMTS_OPT=143 +IF_STATEMENT=144 +INCOMPLETE_TYPE_DECLARATION=145 +INDEXED_COMPONENT=146 +INDEX_CONSTRAINT=147 +LIBRARY_ITEM=148 +LOOP_STATEMENT=149 +NAME=150 +NULL_STATEMENT=151 +NUMBER_DECLARATION=152 +OBJECT_DECLARATION=153 +OBJECT_RENAMING_DECLARATION=154 +OPERATOR_SYMBOL=155 +PACKAGE_BODY=156 +PACKAGE_BODY_STUB=157 +PACKAGE_RENAMING_DECLARATION=158 +PACKAGE_SPECIFICATION=159 +PARAMETER_SPECIFICATION=160 +PRIVATE_EXTENSION_DECLARATION=161 +PRIVATE_TYPE_DECLARATION=162 +PROTECTED_BODY=163 +PROTECTED_BODY_STUB=164 +PROTECTED_TYPE_DECLARATION=165 +RAISE_STATEMENT=166 +RANGE_ATTRIBUTE_REFERENCE=167 +RECORD_REPRESENTATION_CLAUSE=168 +REQUEUE_STATEMENT=169 +RETURN_STATEMENT=170 +SELECTIVE_ACCEPT=171 +SEQUENCE_OF_STATEMENTS=172 +SINGLE_PROTECTED_DECLARATION=173 +SINGLE_TASK_DECLARATION=174 +STATEMENT=175 +SUBTYPE_DECLARATION=176 +SUBTYPE_INDICATION=177 +SUBTYPE_MARK=178 +SUBUNIT=179 +TASK_BODY=180 +TASK_BODY_STUB=181 +TASK_TYPE_DECLARATION=182 +TERMINATE_ALTERNATIVE=183 +TIMED_ENTRY_CALL=184 +TRIGGERING_ALTERNATIVE=185 +USE_CLAUSE=186 +USE_TYPE_CLAUSE=187 +VARIANT=188 +VARIANT_PART=189 +WITH_CLAUSE=190 +ABSTRACT_FUNCTION_DECLARATION=191 +ABSTRACT_PROCEDURE_DECLARATION=192 +ACCESS_TO_FUNCTION_DECLARATION=193 +ACCESS_TO_OBJECT_DECLARATION=194 +ACCESS_TO_PROCEDURE_DECLARATION=195 +ARRAY_OBJECT_DECLARATION=196 +ARRAY_TYPE_DECLARATION=197 +AND_THEN=198 +BASIC_DECLARATIVE_ITEMS_OPT=199 +BLOCK_BODY=200 +BLOCK_BODY_OPT=201 +CALL_STATEMENT=202 +COMPONENT_CLAUSES_OPT=203 +COMPONENT_ITEMS=204 +COND_CLAUSE=205 +DECIMAL_FIXED_POINT_DECLARATION=206 +DECLARE_OPT=207 +DERIVED_RECORD_EXTENSION=208 +DISCRETE_SUBTYPE_DEF_OPT=209 +DISCRIMINANT_SPECIFICATIONS=210 +DISCRIM_PART_OPT=211 +ELSE_OPT=212 +ELSIFS_OPT=213 +END_ID_OPT=214 +ENTRY_INDEX_OPT=215 +ENUMERATION_TYPE_DECLARATION=216 +EXCEPT_HANDLER_PART_OPT=217 +EXTENSION_OPT=218 +FLOATING_POINT_DECLARATION=219 +FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220 +FORMAL_DISCRETE_TYPE_DECLARATION=221 +FORMAL_FLOATING_POINT_DECLARATION=222 +FORMAL_FUNCTION_DECLARATION=223 +FORMAL_MODULAR_TYPE_DECLARATION=224 +FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225 +FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226 +FORMAL_PART_OPT=227 +FORMAL_PRIVATE_EXTENSION_DECLARATION=228 +FORMAL_PRIVATE_TYPE_DECLARATION=229 +FORMAL_PROCEDURE_DECLARATION=230 +FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231 +FUNCTION_BODY=232 +FUNCTION_BODY_STUB=233 +FUNCTION_DECLARATION=234 +FUNCTION_RENAMING_DECLARATION=235 +GENERIC_FUNCTION_DECLARATION=236 +GENERIC_FUNCTION_INSTANTIATION=237 +GENERIC_FUNCTION_RENAMING=238 +GENERIC_PACKAGE_INSTANTIATION=239 +GENERIC_PACKAGE_RENAMING=240 +GENERIC_PROCEDURE_DECLARATION=241 +GENERIC_PROCEDURE_INSTANTIATION=242 +GENERIC_PROCEDURE_RENAMING=243 +GUARD_OPT=244 +IDENTIFIER_COLON_OPT=245 +ID_OPT=246 +INIT_OPT=247 +ITERATION_SCHEME_OPT=248 +LABEL_OPT=249 +MARK_WITH_CONSTRAINT=250 +MODIFIERS=251 +MODULAR_TYPE_DECLARATION=252 +MOD_CLAUSE_OPT=253 +NOT_IN=254 +ORDINARY_DERIVED_TYPE_DECLARATION=255 +ORDINARY_FIXED_POINT_DECLARATION=256 +OR_ELSE=257 +OR_SELECT_OPT=258 +PARENTHESIZED_PRIMARY=259 +PRIVATE_DECLARATIVE_ITEMS_OPT=260 +PRIVATE_TASK_ITEMS_OPT=261 +PROCEDURE_BODY=262 +PROCEDURE_BODY_STUB=263 +PROCEDURE_DECLARATION=264 +PROCEDURE_RENAMING_DECLARATION=265 +PROT_MEMBER_DECLARATIONS=266 +PROT_OP_BODIES_OPT=267 +PROT_OP_DECLARATIONS=268 +PROT_PRIVATE_OPT=269 +RANGED_EXPRS=270 +RANGE_CONSTRAINT=271 +RECORD_TYPE_DECLARATION=272 +SELECTOR_NAMES_OPT=273 +SIGNED_INTEGER_TYPE_DECLARATION=274 +TASK_ITEMS_OPT=275 +UNARY_MINUS=276 +UNARY_PLUS=277 +VALUE=278 +VALUES=279 +VARIANTS=280 +COMMENT_INTRO=281 +OX=282 +TIC_OR_CHARACTER_LITERAL=283 +DIGIT=284 +EXPONENT=285 +EXTENDED_DIGIT=286 +BASED_INTEGER=287 +WS_=288 +COMMENT=289 +CHARACTER_STRING=290 diff --git a/languages/ada/AdaTokenTypes.hpp b/languages/ada/AdaTokenTypes.hpp new file mode 100644 index 00000000..918b1cfd --- /dev/null +++ b/languages/ada/AdaTokenTypes.hpp @@ -0,0 +1,306 @@ +#ifndef INC_AdaTokenTypes_hpp_ +#define INC_AdaTokenTypes_hpp_ + +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaTokenTypes.hpp"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API AdaTokenTypes { +#endif + enum { + EOF_ = 1, + PRAGMA = 4, + IDENTIFIER = 5, + SEMI = 6, + LPAREN = 7, + COMMA = 8, + RPAREN = 9, + RIGHT_SHAFT = 10, + WITH = 11, + DOT = 12, + USE = 13, + TYPE = 14, + TIC = 15, + RANGE = 16, + DIGITS = 17, + DELTA = 18, + ACCESS = 19, + PRIVATE = 20, + PACKAGE = 21, + BODY = 22, + IS = 23, + PROCEDURE = 24, + FUNCTION = 25, + NEW = 26, + OTHERS = 27, + PIPE = 28, + DOT_DOT = 29, + ALL = 30, + COLON = 31, + IN = 32, + OUT = 33, + RENAMES = 34, + CHARACTER_LITERAL = 35, + CHAR_STRING = 36, + NuLL = 37, + RECORD = 38, + SEPARATE = 39, + ABSTRACT = 40, + RETURN = 41, + TASK = 42, + PROTECTED = 43, + BOX = 44, + ASSIGN = 45, + ENTRY = 46, + FOR = 47, + END = 48, + AT = 49, + MOD = 50, + SUBTYPE = 51, + EXCEPTION = 52, + CONSTANT = 53, + ARRAY = 54, + OF = 55, + ALIASED = 56, + CASE = 57, + WHEN = 58, + TAGGED = 59, + LIMITED = 60, + GENERIC = 61, + BEGIN = 62, + LT_LT = 63, + GT_GT = 64, + IF = 65, + THEN = 66, + ELSIF = 67, + ELSE = 68, + LOOP = 69, + WHILE = 70, + REVERSE = 71, + DECLARE = 72, + EXIT = 73, + GOTO = 74, + ACCEPT = 75, + DO = 76, + DELAY = 77, + UNTIL = 78, + SELECT = 79, + ABORT = 80, + OR = 81, + TERMINATE = 82, + RAISE = 83, + REQUEUE = 84, + AND = 85, + XOR = 86, + NOT = 87, + EQ = 88, + NE = 89, + LT_ = 90, + LE = 91, + GT = 92, + GE = 93, + PLUS = 94, + MINUS = 95, + CONCAT = 96, + STAR = 97, + DIV = 98, + REM = 99, + ABS = 100, + EXPON = 101, + NUMERIC_LIT = 102, + ABORTABLE_PART = 103, + ABORT_STATEMENT = 104, + ACCEPT_ALTERNATIVE = 105, + ACCEPT_STATEMENT = 106, + ALLOCATOR = 107, + ASSIGNMENT_STATEMENT = 108, + ASYNCHRONOUS_SELECT = 109, + ATTRIBUTE_DEFINITION_CLAUSE = 110, + AT_CLAUSE = 111, + BLOCK_STATEMENT = 112, + CASE_STATEMENT = 113, + CASE_STATEMENT_ALTERNATIVE = 114, + CODE_STATEMENT = 115, + COMPONENT_DECLARATION = 116, + CONDITIONAL_ENTRY_CALL = 117, + CONTEXT_CLAUSE = 118, + DECLARATIVE_PART = 119, + DEFINING_IDENTIFIER_LIST = 120, + DELAY_ALTERNATIVE = 121, + DELAY_STATEMENT = 122, + DELTA_CONSTRAINT = 123, + DIGITS_CONSTRAINT = 124, + DISCRIMINANT_ASSOCIATION = 125, + DISCRIMINANT_CONSTRAINT = 126, + DISCRIMINANT_SPECIFICATION = 127, + ENTRY_BODY = 128, + ENTRY_CALL_ALTERNATIVE = 129, + ENTRY_CALL_STATEMENT = 130, + ENTRY_DECLARATION = 131, + ENTRY_INDEX_SPECIFICATION = 132, + ENUMERATION_REPESENTATION_CLAUSE = 133, + EXCEPTION_DECLARATION = 134, + EXCEPTION_HANDLER = 135, + EXCEPTION_RENAMING_DECLARATION = 136, + EXIT_STATEMENT = 137, + FORMAL_PACKAGE_DECLARATION = 138, + GENERIC_FORMAL_PART = 139, + GENERIC_PACKAGE_DECLARATION = 140, + GOTO_STATEMENT = 141, + HANDLED_SEQUENCE_OF_STATEMENTS = 142, + HANDLED_STMTS_OPT = 143, + IF_STATEMENT = 144, + INCOMPLETE_TYPE_DECLARATION = 145, + INDEXED_COMPONENT = 146, + INDEX_CONSTRAINT = 147, + LIBRARY_ITEM = 148, + LOOP_STATEMENT = 149, + NAME = 150, + NULL_STATEMENT = 151, + NUMBER_DECLARATION = 152, + OBJECT_DECLARATION = 153, + OBJECT_RENAMING_DECLARATION = 154, + OPERATOR_SYMBOL = 155, + PACKAGE_BODY = 156, + PACKAGE_BODY_STUB = 157, + PACKAGE_RENAMING_DECLARATION = 158, + PACKAGE_SPECIFICATION = 159, + PARAMETER_SPECIFICATION = 160, + PRIVATE_EXTENSION_DECLARATION = 161, + PRIVATE_TYPE_DECLARATION = 162, + PROTECTED_BODY = 163, + PROTECTED_BODY_STUB = 164, + PROTECTED_TYPE_DECLARATION = 165, + RAISE_STATEMENT = 166, + RANGE_ATTRIBUTE_REFERENCE = 167, + RECORD_REPRESENTATION_CLAUSE = 168, + REQUEUE_STATEMENT = 169, + RETURN_STATEMENT = 170, + SELECTIVE_ACCEPT = 171, + SEQUENCE_OF_STATEMENTS = 172, + SINGLE_PROTECTED_DECLARATION = 173, + SINGLE_TASK_DECLARATION = 174, + STATEMENT = 175, + SUBTYPE_DECLARATION = 176, + SUBTYPE_INDICATION = 177, + SUBTYPE_MARK = 178, + SUBUNIT = 179, + TASK_BODY = 180, + TASK_BODY_STUB = 181, + TASK_TYPE_DECLARATION = 182, + TERMINATE_ALTERNATIVE = 183, + TIMED_ENTRY_CALL = 184, + TRIGGERING_ALTERNATIVE = 185, + USE_CLAUSE = 186, + USE_TYPE_CLAUSE = 187, + VARIANT = 188, + VARIANT_PART = 189, + WITH_CLAUSE = 190, + ABSTRACT_FUNCTION_DECLARATION = 191, + ABSTRACT_PROCEDURE_DECLARATION = 192, + ACCESS_TO_FUNCTION_DECLARATION = 193, + ACCESS_TO_OBJECT_DECLARATION = 194, + ACCESS_TO_PROCEDURE_DECLARATION = 195, + ARRAY_OBJECT_DECLARATION = 196, + ARRAY_TYPE_DECLARATION = 197, + AND_THEN = 198, + BASIC_DECLARATIVE_ITEMS_OPT = 199, + BLOCK_BODY = 200, + BLOCK_BODY_OPT = 201, + CALL_STATEMENT = 202, + COMPONENT_CLAUSES_OPT = 203, + COMPONENT_ITEMS = 204, + COND_CLAUSE = 205, + DECIMAL_FIXED_POINT_DECLARATION = 206, + DECLARE_OPT = 207, + DERIVED_RECORD_EXTENSION = 208, + DISCRETE_SUBTYPE_DEF_OPT = 209, + DISCRIMINANT_SPECIFICATIONS = 210, + DISCRIM_PART_OPT = 211, + ELSE_OPT = 212, + ELSIFS_OPT = 213, + END_ID_OPT = 214, + ENTRY_INDEX_OPT = 215, + ENUMERATION_TYPE_DECLARATION = 216, + EXCEPT_HANDLER_PART_OPT = 217, + EXTENSION_OPT = 218, + FLOATING_POINT_DECLARATION = 219, + FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220, + FORMAL_DISCRETE_TYPE_DECLARATION = 221, + FORMAL_FLOATING_POINT_DECLARATION = 222, + FORMAL_FUNCTION_DECLARATION = 223, + FORMAL_MODULAR_TYPE_DECLARATION = 224, + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225, + FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226, + FORMAL_PART_OPT = 227, + FORMAL_PRIVATE_EXTENSION_DECLARATION = 228, + FORMAL_PRIVATE_TYPE_DECLARATION = 229, + FORMAL_PROCEDURE_DECLARATION = 230, + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231, + FUNCTION_BODY = 232, + FUNCTION_BODY_STUB = 233, + FUNCTION_DECLARATION = 234, + FUNCTION_RENAMING_DECLARATION = 235, + GENERIC_FUNCTION_DECLARATION = 236, + GENERIC_FUNCTION_INSTANTIATION = 237, + GENERIC_FUNCTION_RENAMING = 238, + GENERIC_PACKAGE_INSTANTIATION = 239, + GENERIC_PACKAGE_RENAMING = 240, + GENERIC_PROCEDURE_DECLARATION = 241, + GENERIC_PROCEDURE_INSTANTIATION = 242, + GENERIC_PROCEDURE_RENAMING = 243, + GUARD_OPT = 244, + IDENTIFIER_COLON_OPT = 245, + ID_OPT = 246, + INIT_OPT = 247, + ITERATION_SCHEME_OPT = 248, + LABEL_OPT = 249, + MARK_WITH_CONSTRAINT = 250, + MODIFIERS = 251, + MODULAR_TYPE_DECLARATION = 252, + MOD_CLAUSE_OPT = 253, + NOT_IN = 254, + ORDINARY_DERIVED_TYPE_DECLARATION = 255, + ORDINARY_FIXED_POINT_DECLARATION = 256, + OR_ELSE = 257, + OR_SELECT_OPT = 258, + PARENTHESIZED_PRIMARY = 259, + PRIVATE_DECLARATIVE_ITEMS_OPT = 260, + PRIVATE_TASK_ITEMS_OPT = 261, + PROCEDURE_BODY = 262, + PROCEDURE_BODY_STUB = 263, + PROCEDURE_DECLARATION = 264, + PROCEDURE_RENAMING_DECLARATION = 265, + PROT_MEMBER_DECLARATIONS = 266, + PROT_OP_BODIES_OPT = 267, + PROT_OP_DECLARATIONS = 268, + PROT_PRIVATE_OPT = 269, + RANGED_EXPRS = 270, + RANGE_CONSTRAINT = 271, + RECORD_TYPE_DECLARATION = 272, + SELECTOR_NAMES_OPT = 273, + SIGNED_INTEGER_TYPE_DECLARATION = 274, + TASK_ITEMS_OPT = 275, + UNARY_MINUS = 276, + UNARY_PLUS = 277, + VALUE = 278, + VALUES = 279, + VARIANTS = 280, + COMMENT_INTRO = 281, + OX = 282, + TIC_OR_CHARACTER_LITERAL = 283, + DIGIT = 284, + EXPONENT = 285, + EXTENDED_DIGIT = 286, + BASED_INTEGER = 287, + WS_ = 288, + COMMENT = 289, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_AdaTokenTypes_hpp_*/ diff --git a/languages/ada/AdaTokenTypes.txt b/languages/ada/AdaTokenTypes.txt new file mode 100644 index 00000000..2415ea0c --- /dev/null +++ b/languages/ada/AdaTokenTypes.txt @@ -0,0 +1,288 @@ +// $ANTLR 2.7.7 (20070609): ada.g -> AdaTokenTypes.txt$ +Ada // output token vocab name +PRAGMA="pragma"=4 +IDENTIFIER=5 +SEMI=6 +LPAREN=7 +COMMA=8 +RPAREN=9 +RIGHT_SHAFT=10 +WITH="with"=11 +DOT=12 +USE="use"=13 +TYPE="type"=14 +TIC=15 +RANGE="range"=16 +DIGITS="digits"=17 +DELTA="delta"=18 +ACCESS="access"=19 +PRIVATE="private"=20 +PACKAGE="package"=21 +BODY="body"=22 +IS="is"=23 +PROCEDURE="procedure"=24 +FUNCTION="function"=25 +NEW="new"=26 +OTHERS="others"=27 +PIPE=28 +DOT_DOT=29 +ALL="all"=30 +COLON=31 +IN="in"=32 +OUT="out"=33 +RENAMES="renames"=34 +CHARACTER_LITERAL=35 +CHAR_STRING=36 +NuLL="null"=37 +RECORD="record"=38 +SEPARATE="separate"=39 +ABSTRACT="abstract"=40 +RETURN="return"=41 +TASK="task"=42 +PROTECTED="protected"=43 +BOX=44 +ASSIGN=45 +ENTRY="entry"=46 +FOR="for"=47 +END="end"=48 +AT="at"=49 +MOD="mod"=50 +SUBTYPE="subtype"=51 +EXCEPTION="exception"=52 +CONSTANT="constant"=53 +ARRAY="array"=54 +OF="of"=55 +ALIASED="aliased"=56 +CASE="case"=57 +WHEN="when"=58 +TAGGED="tagged"=59 +LIMITED="limited"=60 +GENERIC="generic"=61 +BEGIN="begin"=62 +LT_LT=63 +GT_GT=64 +IF="if"=65 +THEN="then"=66 +ELSIF="elsif"=67 +ELSE="else"=68 +LOOP="loop"=69 +WHILE="while"=70 +REVERSE="reverse"=71 +DECLARE="declare"=72 +EXIT="exit"=73 +GOTO="goto"=74 +ACCEPT="accept"=75 +DO="do"=76 +DELAY="delay"=77 +UNTIL="until"=78 +SELECT="select"=79 +ABORT="abort"=80 +OR="or"=81 +TERMINATE="terminate"=82 +RAISE="raise"=83 +REQUEUE="requeue"=84 +AND="and"=85 +XOR="xor"=86 +NOT="not"=87 +EQ=88 +NE=89 +LT_=90 +LE=91 +GT=92 +GE=93 +PLUS=94 +MINUS=95 +CONCAT=96 +STAR=97 +DIV=98 +REM="rem"=99 +ABS="abs"=100 +EXPON=101 +NUMERIC_LIT=102 +ABORTABLE_PART=103 +ABORT_STATEMENT=104 +ACCEPT_ALTERNATIVE=105 +ACCEPT_STATEMENT=106 +ALLOCATOR=107 +ASSIGNMENT_STATEMENT=108 +ASYNCHRONOUS_SELECT=109 +ATTRIBUTE_DEFINITION_CLAUSE=110 +AT_CLAUSE=111 +BLOCK_STATEMENT=112 +CASE_STATEMENT=113 +CASE_STATEMENT_ALTERNATIVE=114 +CODE_STATEMENT=115 +COMPONENT_DECLARATION=116 +CONDITIONAL_ENTRY_CALL=117 +CONTEXT_CLAUSE=118 +DECLARATIVE_PART=119 +DEFINING_IDENTIFIER_LIST=120 +DELAY_ALTERNATIVE=121 +DELAY_STATEMENT=122 +DELTA_CONSTRAINT=123 +DIGITS_CONSTRAINT=124 +DISCRIMINANT_ASSOCIATION=125 +DISCRIMINANT_CONSTRAINT=126 +DISCRIMINANT_SPECIFICATION=127 +ENTRY_BODY=128 +ENTRY_CALL_ALTERNATIVE=129 +ENTRY_CALL_STATEMENT=130 +ENTRY_DECLARATION=131 +ENTRY_INDEX_SPECIFICATION=132 +ENUMERATION_REPESENTATION_CLAUSE=133 +EXCEPTION_DECLARATION=134 +EXCEPTION_HANDLER=135 +EXCEPTION_RENAMING_DECLARATION=136 +EXIT_STATEMENT=137 +FORMAL_PACKAGE_DECLARATION=138 +GENERIC_FORMAL_PART=139 +GENERIC_PACKAGE_DECLARATION=140 +GOTO_STATEMENT=141 +HANDLED_SEQUENCE_OF_STATEMENTS=142 +HANDLED_STMTS_OPT=143 +IF_STATEMENT=144 +INCOMPLETE_TYPE_DECLARATION=145 +INDEXED_COMPONENT=146 +INDEX_CONSTRAINT=147 +LIBRARY_ITEM=148 +LOOP_STATEMENT=149 +NAME=150 +NULL_STATEMENT=151 +NUMBER_DECLARATION=152 +OBJECT_DECLARATION=153 +OBJECT_RENAMING_DECLARATION=154 +OPERATOR_SYMBOL=155 +PACKAGE_BODY=156 +PACKAGE_BODY_STUB=157 +PACKAGE_RENAMING_DECLARATION=158 +PACKAGE_SPECIFICATION=159 +PARAMETER_SPECIFICATION=160 +PRIVATE_EXTENSION_DECLARATION=161 +PRIVATE_TYPE_DECLARATION=162 +PROTECTED_BODY=163 +PROTECTED_BODY_STUB=164 +PROTECTED_TYPE_DECLARATION=165 +RAISE_STATEMENT=166 +RANGE_ATTRIBUTE_REFERENCE=167 +RECORD_REPRESENTATION_CLAUSE=168 +REQUEUE_STATEMENT=169 +RETURN_STATEMENT=170 +SELECTIVE_ACCEPT=171 +SEQUENCE_OF_STATEMENTS=172 +SINGLE_PROTECTED_DECLARATION=173 +SINGLE_TASK_DECLARATION=174 +STATEMENT=175 +SUBTYPE_DECLARATION=176 +SUBTYPE_INDICATION=177 +SUBTYPE_MARK=178 +SUBUNIT=179 +TASK_BODY=180 +TASK_BODY_STUB=181 +TASK_TYPE_DECLARATION=182 +TERMINATE_ALTERNATIVE=183 +TIMED_ENTRY_CALL=184 +TRIGGERING_ALTERNATIVE=185 +USE_CLAUSE=186 +USE_TYPE_CLAUSE=187 +VARIANT=188 +VARIANT_PART=189 +WITH_CLAUSE=190 +ABSTRACT_FUNCTION_DECLARATION=191 +ABSTRACT_PROCEDURE_DECLARATION=192 +ACCESS_TO_FUNCTION_DECLARATION=193 +ACCESS_TO_OBJECT_DECLARATION=194 +ACCESS_TO_PROCEDURE_DECLARATION=195 +ARRAY_OBJECT_DECLARATION=196 +ARRAY_TYPE_DECLARATION=197 +AND_THEN=198 +BASIC_DECLARATIVE_ITEMS_OPT=199 +BLOCK_BODY=200 +BLOCK_BODY_OPT=201 +CALL_STATEMENT=202 +COMPONENT_CLAUSES_OPT=203 +COMPONENT_ITEMS=204 +COND_CLAUSE=205 +DECIMAL_FIXED_POINT_DECLARATION=206 +DECLARE_OPT=207 +DERIVED_RECORD_EXTENSION=208 +DISCRETE_SUBTYPE_DEF_OPT=209 +DISCRIMINANT_SPECIFICATIONS=210 +DISCRIM_PART_OPT=211 +ELSE_OPT=212 +ELSIFS_OPT=213 +END_ID_OPT=214 +ENTRY_INDEX_OPT=215 +ENUMERATION_TYPE_DECLARATION=216 +EXCEPT_HANDLER_PART_OPT=217 +EXTENSION_OPT=218 +FLOATING_POINT_DECLARATION=219 +FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220 +FORMAL_DISCRETE_TYPE_DECLARATION=221 +FORMAL_FLOATING_POINT_DECLARATION=222 +FORMAL_FUNCTION_DECLARATION=223 +FORMAL_MODULAR_TYPE_DECLARATION=224 +FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225 +FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226 +FORMAL_PART_OPT=227 +FORMAL_PRIVATE_EXTENSION_DECLARATION=228 +FORMAL_PRIVATE_TYPE_DECLARATION=229 +FORMAL_PROCEDURE_DECLARATION=230 +FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231 +FUNCTION_BODY=232 +FUNCTION_BODY_STUB=233 +FUNCTION_DECLARATION=234 +FUNCTION_RENAMING_DECLARATION=235 +GENERIC_FUNCTION_DECLARATION=236 +GENERIC_FUNCTION_INSTANTIATION=237 +GENERIC_FUNCTION_RENAMING=238 +GENERIC_PACKAGE_INSTANTIATION=239 +GENERIC_PACKAGE_RENAMING=240 +GENERIC_PROCEDURE_DECLARATION=241 +GENERIC_PROCEDURE_INSTANTIATION=242 +GENERIC_PROCEDURE_RENAMING=243 +GUARD_OPT=244 +IDENTIFIER_COLON_OPT=245 +ID_OPT=246 +INIT_OPT=247 +ITERATION_SCHEME_OPT=248 +LABEL_OPT=249 +MARK_WITH_CONSTRAINT=250 +MODIFIERS=251 +MODULAR_TYPE_DECLARATION=252 +MOD_CLAUSE_OPT=253 +NOT_IN=254 +ORDINARY_DERIVED_TYPE_DECLARATION=255 +ORDINARY_FIXED_POINT_DECLARATION=256 +OR_ELSE=257 +OR_SELECT_OPT=258 +PARENTHESIZED_PRIMARY=259 +PRIVATE_DECLARATIVE_ITEMS_OPT=260 +PRIVATE_TASK_ITEMS_OPT=261 +PROCEDURE_BODY=262 +PROCEDURE_BODY_STUB=263 +PROCEDURE_DECLARATION=264 +PROCEDURE_RENAMING_DECLARATION=265 +PROT_MEMBER_DECLARATIONS=266 +PROT_OP_BODIES_OPT=267 +PROT_OP_DECLARATIONS=268 +PROT_PRIVATE_OPT=269 +RANGED_EXPRS=270 +RANGE_CONSTRAINT=271 +RECORD_TYPE_DECLARATION=272 +SELECTOR_NAMES_OPT=273 +SIGNED_INTEGER_TYPE_DECLARATION=274 +TASK_ITEMS_OPT=275 +UNARY_MINUS=276 +UNARY_PLUS=277 +VALUE=278 +VALUES=279 +VARIANTS=280 +COMMENT_INTRO=281 +OX=282 +TIC_OR_CHARACTER_LITERAL=283 +DIGIT=284 +EXPONENT=285 +EXTENDED_DIGIT=286 +BASED_INTEGER=287 +WS_=288 +COMMENT=289 diff --git a/languages/ada/AdaTreeParserSuper.cpp b/languages/ada/AdaTreeParserSuper.cpp new file mode 100644 index 00000000..be5f0623 --- /dev/null +++ b/languages/ada/AdaTreeParserSuper.cpp @@ -0,0 +1,9050 @@ +/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuper.cpp"$ */ +#include "AdaTreeParserSuper.hpp" +#include <antlr/Token.hpp> +#include <antlr/AST.hpp> +#include <antlr/NoViableAltException.hpp> +#include <antlr/MismatchedTokenException.hpp> +#include <antlr/SemanticException.hpp> +#include <antlr/BitSet.hpp> +#line 1 "ada.tree.g" +#line 11 "AdaTreeParserSuper.cpp" +AdaTreeParserSuper::AdaTreeParserSuper() + : ANTLR_USE_NAMESPACE(antlr)TreeParser() { +} + +void AdaTreeParserSuper::compilation_unit(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST compilation_unit_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + context_items_opt(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case LIBRARY_ITEM: + { + library_item(_t); + _t = _retTree; + break; + } + case SUBUNIT: + { + subunit(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop4; + } + + } + _loop4:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::context_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST context_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t12 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp1_AST_in = _t; + match(_t,CONTEXT_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case WITH_CLAUSE: + { + with_clause(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + default: + { + goto _loop14; + } + } + } + _loop14:; + } // ( ... )* + _t = __t12; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::library_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST library_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t32 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp2_AST_in = _t; + match(_t,LIBRARY_ITEM); + _t = _t->getFirstChild(); + modifiers(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t34 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp3_AST_in = _t; + match(_t,PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t34; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t35 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp4_AST_in = _t; + match(_t,GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t35; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t36 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp5_AST_in = _t; + match(_t,PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_spec_part(_t); + _t = _retTree; + _t = __t36; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t37 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp6_AST_in = _t; + match(_t,PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t37; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t32; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subunit(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subunit_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t514 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp7_AST_in = _t; + match(_t,SUBUNIT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case FUNCTION_BODY: + case PROCEDURE_BODY: + { + subprogram_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + package_body(_t); + _t = _retTree; + break; + } + case TASK_BODY: + { + task_body(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY: + { + protected_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t514; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pragma(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pragma_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t6 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp8_AST_in = _t; + match(_t,PRAGMA); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp9_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_0.member(_t->getType()))) { + pragma_arg(_t); + _t = _retTree; + } + else { + goto _loop8; + } + + } + _loop8:; + } // ( ... )* + _t = __t6; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pragma_arg(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pragma_arg_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RIGHT_SHAFT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t10 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp10_AST_in = _t; + match(_t,RIGHT_SHAFT); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp11_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t10; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST expression_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case AND: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t472 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp12_AST_in = _t; + match(_t,AND); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t472; + _t = _t->getNextSibling(); + break; + } + case AND_THEN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t473 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp13_AST_in = _t; + match(_t,AND_THEN); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t473; + _t = _t->getNextSibling(); + break; + } + case OR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t474 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp14_AST_in = _t; + match(_t,OR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t474; + _t = _t->getNextSibling(); + break; + } + case OR_ELSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t475 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp15_AST_in = _t; + match(_t,OR_ELSE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t475; + _t = _t->getNextSibling(); + break; + } + case XOR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t476 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp16_AST_in = _t; + match(_t,XOR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t476; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case NOT_IN: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + relation(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::with_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST with_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t16 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp17_AST_in = _t; + match(_t,WITH_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt18=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + compound_name(_t); + _t = _retTree; + } + else { + if ( _cnt18>=1 ) { goto _loop18; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt18++; + } + _loop18:; + } // ( ... )+ + _t = __t16; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::use_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST use_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case USE_TYPE_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t22 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp18_AST_in = _t; + match(_t,USE_TYPE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt24=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT || _t->getType() == TIC)) { + subtype_mark(_t); + _t = _retTree; + } + else { + if ( _cnt24>=1 ) { goto _loop24; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt24++; + } + _loop24:; + } // ( ... )+ + _t = __t22; + _t = _t->getNextSibling(); + break; + } + case USE_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t25 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp19_AST_in = _t; + match(_t,USE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt27=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + compound_name(_t); + _t = _retTree; + } + else { + if ( _cnt27>=1 ) { goto _loop27; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt27++; + } + _loop27:; + } // ( ... )+ + _t = __t25; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::compound_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST compound_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp20_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t20 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp21_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp22_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + _t = __t20; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subtype_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subtype_mark_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case TIC: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t29 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp23_AST_in = _t; + match(_t,TIC); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t29; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::attribute_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST attribute_id_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp24_AST_in = _t; + match(_t,RANGE); + _t = _t->getNextSibling(); + break; + } + case DIGITS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp25_AST_in = _t; + match(_t,DIGITS); + _t = _t->getNextSibling(); + break; + } + case DELTA: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp26_AST_in = _t; + match(_t,DELTA); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp27_AST_in = _t; + match(_t,ACCESS); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp28_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::modifiers(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST modifiers_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t39 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp29_AST_in = _t; + match(_t,MODIFIERS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp30_AST_in = _t; + match(_t,ABSTRACT); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp31_AST_in = _t; + match(_t,ACCESS); + _t = _t->getNextSibling(); + break; + } + case ALIASED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp32_AST_in = _t; + match(_t,ALIASED); + _t = _t->getNextSibling(); + break; + } + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp33_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case CONSTANT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp34_AST_in = _t; + match(_t,CONSTANT); + _t = _t->getNextSibling(); + break; + } + case IN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp35_AST_in = _t; + match(_t,IN); + _t = _t->getNextSibling(); + break; + } + case LIMITED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp36_AST_in = _t; + match(_t,LIMITED); + _t = _t->getNextSibling(); + break; + } + case OUT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp37_AST_in = _t; + match(_t,OUT); + _t = _t->getNextSibling(); + break; + } + case PRIVATE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp38_AST_in = _t; + match(_t,PRIVATE); + _t = _t->getNextSibling(); + break; + } + case PROTECTED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp39_AST_in = _t; + match(_t,PROTECTED); + _t = _t->getNextSibling(); + break; + } + case REVERSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp40_AST_in = _t; + match(_t,REVERSE); + _t = _t->getNextSibling(); + break; + } + case TAGGED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp41_AST_in = _t; + match(_t,TAGGED); + _t = _t->getNextSibling(); + break; + } + default: + { + goto _loop41; + } + } + } + _loop41:; + } // ( ... )* + _t = __t39; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprog_decl_or_rename_or_inst_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::def_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST def_id_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + compound_name(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pkg_body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pkg_body_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_inst(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_inst_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + compound_name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pkg_spec_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pkg_spec_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + basic_declarative_items_opt(_t); + _t = _retTree; + private_declarative_items_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::renames(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST renames_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case CHARACTER_STRING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp42_AST_in = _t; + match(_t,CHARACTER_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp43_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_RENAMING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t277 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp44_AST_in = _t; + match(_t,GENERIC_PACKAGE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t277; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t278 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp45_AST_in = _t; + match(_t,GENERIC_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + pkg_spec_part(_t); + _t = _retTree; + _t = __t278; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_RENAMING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t279 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp46_AST_in = _t; + match(_t,GENERIC_PROCEDURE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t279; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t280 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp47_AST_in = _t; + match(_t,GENERIC_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t280; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_RENAMING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t281 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp48_AST_in = _t; + match(_t,GENERIC_FUNCTION_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t281; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t282 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp49_AST_in = _t; + match(_t,GENERIC_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t282; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST id_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t43 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp50_AST_in = _t; + match(_t,ID_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t43; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::def_designator(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST def_designator_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case OPERATOR_SYMBOL: + { + definable_operator_symbol(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::end_id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST end_id_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t46 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp51_AST_in = _t; + match(_t,END); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t46; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprog_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PROCEDURE_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t49 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp52_AST_in = _t; + match(_t,GENERIC_PROCEDURE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t49; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t50 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp53_AST_in = _t; + match(_t,PROCEDURE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t50; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t51 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp54_AST_in = _t; + match(_t,PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t51; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t52 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp55_AST_in = _t; + match(_t,PROCEDURE_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t52; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t53 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp56_AST_in = _t; + match(_t,ABSTRACT_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t53; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t54 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp57_AST_in = _t; + match(_t,GENERIC_FUNCTION_INSTANTIATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t54; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t55 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp58_AST_in = _t; + match(_t,FUNCTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t55; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t56 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp59_AST_in = _t; + match(_t,FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t56; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t57 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp60_AST_in = _t; + match(_t,FUNCTION_BODY_STUB); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t57; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t58 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp61_AST_in = _t; + match(_t,ABSTRACT_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t58; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t84 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp62_AST_in = _t; + match(_t,FORMAL_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == PARAMETER_SPECIFICATION)) { + parameter_specification(_t); + _t = _retTree; + } + else { + goto _loop86; + } + + } + _loop86:; + } // ( ... )* + _t = __t84; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::function_tail(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST function_tail_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + formal_part_opt(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::value_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST value_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t468 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp63_AST_in = _t; + match(_t,VALUES); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt470=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_1.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + if ( _cnt470>=1 ) { goto _loop470; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt470++; + } + _loop470:; + } // ( ... )+ + _t = __t468; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::value(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST value_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t63 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp64_AST_in = _t; + match(_t,OTHERS); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + _t = __t63; + _t = _t->getNextSibling(); + break; + } + case RIGHT_SHAFT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t64 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp65_AST_in = _t; + match(_t,RIGHT_SHAFT); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t64; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case PIPE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr_s(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::ranged_expr_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST ranged_expr_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t66 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp66_AST_in = _t; + match(_t,PIPE); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + ranged_expr(_t); + _t = _retTree; + _t = __t66; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::ranged_expr(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST ranged_expr_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t68 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp67_AST_in = _t; + match(_t,DOT_DOT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t68; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t69 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp68_AST_in = _t; + match(_t,RANGE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t69; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::simple_expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST simple_expression_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PLUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t488 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp69_AST_in = _t; + match(_t,PLUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t488; + _t = _t->getNextSibling(); + break; + } + case MINUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t489 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp70_AST_in = _t; + match(_t,MINUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t489; + _t = _t->getNextSibling(); + break; + } + case CONCAT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t490 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp71_AST_in = _t; + match(_t,CONCAT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t490; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + signed_term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + range_dots(_t); + _t = _retTree; + break; + } + case RANGE_ATTRIBUTE_REFERENCE: + { + range_attrib_ref(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t71 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp72_AST_in = _t; + match(_t,RANGE_CONSTRAINT); + _t = _t->getFirstChild(); + range(_t); + _t = _retTree; + _t = __t71; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_dots(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_dots_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t75 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp73_AST_in = _t; + match(_t,DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t75; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_attrib_ref(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_attrib_ref_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t77 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp74_AST_in = _t; + match(_t,RANGE_ATTRIBUTE_REFERENCE); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t77; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prefix(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prefix_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp75_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t80 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp76_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp77_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp78_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t80; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t82 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp79_AST_in = _t; + match(_t,INDEXED_COMPONENT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t82; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::parameter_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST parameter_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t88 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp80_AST_in = _t; + match(_t,PARAMETER_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t88; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::defining_identifier_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST defining_identifier_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t90 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp81_AST_in = _t; + match(_t,DEFINING_IDENTIFIER_LIST); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt92=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp82_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + else { + if ( _cnt92>=1 ) { goto _loop92; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt92++; + } + _loop92:; + } // ( ... )+ + _t = __t90; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::init_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST init_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t136 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp83_AST_in = _t; + match(_t,INIT_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t136; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp84_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t95 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp85_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp86_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp87_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp88_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp89_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t95; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t97 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp90_AST_in = _t; + match(_t,INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t97; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t98 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp91_AST_in = _t; + match(_t,TIC); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t98; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::definable_operator_symbol(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST definable_operator_symbol_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp92_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::parenthesized_primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST parenthesized_primary_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t101 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp93_AST_in = _t; + match(_t,PARENTHESIZED_PRIMARY); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp94_AST_in = _t; + match(_t,NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + extension_opt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t101; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::extension_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST extension_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t104 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp95_AST_in = _t; + match(_t,EXTENSION_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp96_AST_in = _t; + match(_t,NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t104; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::spec_decl_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST spec_decl_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t109 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp97_AST_in = _t; + match(_t,GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t109; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t110 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp98_AST_in = _t; + match(_t,PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_spec_part(_t); + _t = _retTree; + _t = __t110; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t111 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp99_AST_in = _t; + match(_t,PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t111; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::basic_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST basic_declarative_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t114 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp100_AST_in = _t; + match(_t,BASIC_DECLARATIVE_ITEMS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + basic_decl_item(_t); + _t = _retTree; + } + else { + goto _loop116; + } + + } + _loop116:; + } // ( ... )* + _t = __t114; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::private_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST private_declarative_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t118 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp101_AST_in = _t; + match(_t,PRIVATE_DECLARATIVE_ITEMS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + basic_decl_item(_t); + _t = _retTree; + } + else { + goto _loop120; + } + + } + _loop120:; + } // ( ... )* + _t = __t118; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::basic_decl_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST basic_decl_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_type_or_single_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case TASK_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t123 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp102_AST_in = _t; + match(_t,TASK_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t123; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t124 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp103_AST_in = _t; + match(_t,SINGLE_TASK_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t124; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_type_or_single_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROTECTED_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t164 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp104_AST_in = _t; + match(_t,PROTECTED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t164; + _t = _t->getNextSibling(); + break; + } + case SINGLE_PROTECTED_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t165 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp105_AST_in = _t; + match(_t,SINGLE_PROTECTED_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t165; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::decl_common(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST decl_common_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENUMERATION_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t184 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp106_AST_in = _t; + match(_t,ENUMERATION_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp107_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + enum_id_s(_t); + _t = _retTree; + _t = __t184; + _t = _t->getNextSibling(); + break; + } + case SIGNED_INTEGER_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t185 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp108_AST_in = _t; + match(_t,SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp109_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + range(_t); + _t = _retTree; + _t = __t185; + _t = _t->getNextSibling(); + break; + } + case MODULAR_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t186 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp110_AST_in = _t; + match(_t,MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp111_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t186; + _t = _t->getNextSibling(); + break; + } + case FLOATING_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t187 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp112_AST_in = _t; + match(_t,FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp113_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t187; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t188 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp114_AST_in = _t; + match(_t,ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp115_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t188; + _t = _t->getNextSibling(); + break; + } + case DECIMAL_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t189 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp116_AST_in = _t; + match(_t,DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp117_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t189; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + access_type_declaration(_t); + _t = _retTree; + break; + } + case INCOMPLETE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t190 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp118_AST_in = _t; + match(_t,INCOMPLETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp119_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + _t = __t190; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_EXTENSION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t191 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp120_AST_in = _t; + match(_t,PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t191; + _t = _t->getNextSibling(); + break; + } + case DERIVED_RECORD_EXTENSION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t192 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp121_AST_in = _t; + match(_t,DERIVED_RECORD_EXTENSION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t192; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_DERIVED_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t193 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp122_AST_in = _t; + match(_t,ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t193; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t194 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp123_AST_in = _t; + match(_t,PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t194; + _t = _t->getNextSibling(); + break; + } + case RECORD_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t195 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp124_AST_in = _t; + match(_t,RECORD_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t195; + _t = _t->getNextSibling(); + break; + } + case SUBTYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t196 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp125_AST_in = _t; + match(_t,SUBTYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp126_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + subtype_ind(_t); + _t = _retTree; + _t = __t196; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case EXCEPTION_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t197 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp127_AST_in = _t; + match(_t,EXCEPTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + _t = __t197; + _t = _t->getNextSibling(); + break; + } + case OBJECT_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t198 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp128_AST_in = _t; + match(_t,OBJECT_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + name(_t); + _t = _retTree; + _t = __t198; + _t = _t->getNextSibling(); + break; + } + case EXCEPTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t199 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp129_AST_in = _t; + match(_t,EXCEPTION_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + _t = __t199; + _t = _t->getNextSibling(); + break; + } + case NUMBER_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t200 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp130_AST_in = _t; + match(_t,NUMBER_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t200; + _t = _t->getNextSibling(); + break; + } + case ARRAY_OBJECT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t201 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp131_AST_in = _t; + match(_t,ARRAY_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + array_type_definition(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t201; + _t = _t->getNextSibling(); + break; + } + case OBJECT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t202 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp132_AST_in = _t; + match(_t,OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t202; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrim_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrim_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t127 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp133_AST_in = _t; + match(_t,DISCRIM_PART_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp134_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case DISCRIMINANT_SPECIFICATIONS: + { + discriminant_specifications(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t127; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_definition_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_definition_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + task_items_opt(_t); + _t = _retTree; + private_task_items_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t139 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp135_AST_in = _t; + match(_t,TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t139; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::private_task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST private_task_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t162 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp136_AST_in = _t; + match(_t,PRIVATE_TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t162; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_specifications(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_specifications_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t130 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp137_AST_in = _t; + match(_t,DISCRIMINANT_SPECIFICATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_SPECIFICATION)) { + discriminant_specification(_t); + _t = _retTree; + } + else { + goto _loop132; + } + + } + _loop132:; + } // ( ... )* + _t = __t130; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t134 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp138_AST_in = _t; + match(_t,DISCRIMINANT_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t134; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entrydecls_repspecs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entrydecls_repspecs_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + default: + { + goto _loop142; + } + } + } + _loop142:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t144 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp139_AST_in = _t; + match(_t,ENTRY_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp140_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + discrete_subtype_def_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t144; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::rep_spec(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST rep_spec_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RECORD_REPRESENTATION_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t150 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp141_AST_in = _t; + match(_t,RECORD_REPRESENTATION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + align_opt(_t); + _t = _retTree; + comp_loc_s(_t); + _t = _retTree; + _t = __t150; + _t = _t->getNextSibling(); + break; + } + case AT_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t151 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp142_AST_in = _t; + match(_t,AT_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t151; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t152 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp143_AST_in = _t; + match(_t,ATTRIBUTE_DEFINITION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t152; + _t = _t->getNextSibling(); + break; + } + case ENUMERATION_REPESENTATION_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t153 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp144_AST_in = _t; + match(_t,ENUMERATION_REPESENTATION_CLAUSE); + _t = _t->getFirstChild(); + local_enum_name(_t); + _t = _retTree; + enumeration_aggregate(_t); + _t = _retTree; + _t = __t153; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_subtype_def_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_subtype_def_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t146 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp145_AST_in = _t; + match(_t,DISCRETE_SUBTYPE_DEF_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case SUBTYPE_INDICATION: + { + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t146; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_subtype_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_subtype_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subtype_ind(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subtype_ind_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t221 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp146_AST_in = _t; + match(_t,SUBTYPE_INDICATION); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + constraint_opt(_t); + _t = _retTree; + _t = __t221; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::align_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST align_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t155 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp147_AST_in = _t; + match(_t,MOD_CLAUSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t155; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::comp_loc_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST comp_loc_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t158 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp148_AST_in = _t; + match(_t,COMPONENT_CLAUSES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + break; + } + default: + { + goto _loop160; + } + } + } + _loop160:; + } // ( ... )* + _t = __t158; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::local_enum_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST local_enum_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp149_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::enumeration_aggregate(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST enumeration_aggregate_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_1.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + goto _loop275; + } + + } + _loop275:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::protected_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST protected_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + prot_op_decl_s(_t); + _t = _retTree; + prot_private_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_private_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_private_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t167 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp150_AST_in = _t; + match(_t,PROT_PRIVATE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROT_MEMBER_DECLARATIONS: + { + prot_member_decl_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t167; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_member_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_member_decl_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t178 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp151_AST_in = _t; + match(_t,PROT_MEMBER_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENTRY_DECLARATION: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + case FUNCTION_DECLARATION: + case PROCEDURE_DECLARATION: + { + prot_op_decl(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop180; + } + } + } + _loop180:; + } // ( ... )* + _t = __t178; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_op_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_decl_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t171 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp152_AST_in = _t; + match(_t,PROT_OP_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_3.member(_t->getType()))) { + prot_op_decl(_t); + _t = _retTree; + } + else { + goto _loop173; + } + + } + _loop173:; + } // ( ... )* + _t = __t171; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_op_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t175 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp153_AST_in = _t; + match(_t,PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t175; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t176 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp154_AST_in = _t; + match(_t,FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t176; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::comp_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST comp_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t182 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp155_AST_in = _t; + match(_t,COMPONENT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t182; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::component_subtype_def(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST component_subtype_def_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::enum_id_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST enum_id_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )+ + int _cnt206=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == CHARACTER_LITERAL)) { + enumeration_literal_specification(_t); + _t = _retTree; + } + else { + if ( _cnt206>=1 ) { goto _loop206; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt206++; + } + _loop206:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_constraint_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST array_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t212 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp156_AST_in = _t; + match(_t,ARRAY_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp157_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + array_type_definition(_t); + _t = _retTree; + _t = __t212; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST access_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCESS_TO_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t245 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp158_AST_in = _t; + match(_t,ACCESS_TO_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp159_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t245; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t246 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp160_AST_in = _t; + match(_t,ACCESS_TO_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp161_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t246; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_OBJECT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t247 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp162_AST_in = _t; + match(_t,ACCESS_TO_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp163_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t247; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::id_and_discrim(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST id_and_discrim_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp164_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::record_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST record_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::array_type_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST array_type_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + index_or_discrete_range_s(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::enumeration_literal_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST enumeration_literal_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp165_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp166_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::index_or_discrete_range_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST index_or_discrete_range_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + index_or_discrete_range(_t); + _t = _retTree; + break; + } + case COMMA: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t214 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp167_AST_in = _t; + match(_t,COMMA); + _t = _t->getFirstChild(); + index_or_discrete_range_s(_t); + _t = _retTree; + index_or_discrete_range(_t); + _t = _retTree; + _t = __t214; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::index_or_discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST index_or_discrete_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t216 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp168_AST_in = _t; + match(_t,DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t216; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t217 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp169_AST_in = _t; + match(_t,RANGE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp170_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t217; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST constraint_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case DIGITS_CONSTRAINT: + { + digits_constraint(_t); + _t = _retTree; + break; + } + case DELTA_CONSTRAINT: + { + delta_constraint(_t); + _t = _retTree; + break; + } + case INDEX_CONSTRAINT: + { + index_constraint(_t); + _t = _retTree; + break; + } + case DISCRIMINANT_CONSTRAINT: + { + discriminant_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::digits_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST digits_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t225 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp171_AST_in = _t; + match(_t,DIGITS_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t225; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::delta_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST delta_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t227 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp172_AST_in = _t; + match(_t,DELTA_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t227; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::index_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST index_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t229 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp173_AST_in = _t; + match(_t,INDEX_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt231=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == DOT_DOT || _t->getType() == RANGE_ATTRIBUTE_REFERENCE || _t->getType() == SUBTYPE_INDICATION)) { + discrete_range(_t); + _t = _retTree; + } + else { + if ( _cnt231>=1 ) { goto _loop231; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt231++; + } + _loop231:; + } // ( ... )+ + _t = __t229; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t234 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp174_AST_in = _t; + match(_t,DISCRIMINANT_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt236=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_ASSOCIATION)) { + discriminant_association(_t); + _t = _retTree; + } + else { + if ( _cnt236>=1 ) { goto _loop236; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt236++; + } + _loop236:; + } // ( ... )+ + _t = __t234; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_association(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_association_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t238 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp175_AST_in = _t; + match(_t,DISCRIMINANT_ASSOCIATION); + _t = _t->getFirstChild(); + selector_names_opt(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t238; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::selector_names_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST selector_names_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t240 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp176_AST_in = _t; + match(_t,SELECTOR_NAMES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + selector_name(_t); + _t = _retTree; + } + else { + goto _loop242; + } + + } + _loop242:; + } // ( ... )* + _t = __t240; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::selector_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST selector_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp177_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::component_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST component_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + component_items(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case VARIANT_PART: + { + variant_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::component_items(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST component_items_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t253 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp178_AST_in = _t; + match(_t,COMPONENT_ITEMS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop255; + } + } + } + _loop255:; + } // ( ... )* + _t = __t253; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::variant_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST variant_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t257 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp179_AST_in = _t; + match(_t,VARIANT_PART); + _t = _t->getFirstChild(); + discriminant_direct_name(_t); + _t = _retTree; + variant_s(_t); + _t = _retTree; + _t = __t257; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_direct_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_direct_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp180_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::variant_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST variant_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t260 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp181_AST_in = _t; + match(_t,VARIANTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt262=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == VARIANT)) { + variant(_t); + _t = _retTree; + } + else { + if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt262++; + } + _loop262:; + } // ( ... )+ + _t = __t260; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::variant(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST variant_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t264 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp182_AST_in = _t; + match(_t,VARIANT); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t264; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST choice_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t267 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp183_AST_in = _t; + match(_t,PIPE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + choice(_t); + _t = _retTree; + _t = __t267; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case OTHERS: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case RANGE_ATTRIBUTE_REFERENCE: + case AND_THEN: + case MARK_WITH_CONSTRAINT: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST choice_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp184_AST_in = _t; + match(_t,OTHERS); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case MARK_WITH_CONSTRAINT: + { + discrete_with_range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_with_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_with_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case MARK_WITH_CONSTRAINT: + { + mark_with_constraint(_t); + _t = _retTree; + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::mark_with_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST mark_with_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t271 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp185_AST_in = _t; + match(_t,MARK_WITH_CONSTRAINT); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + range_constraint(_t); + _t = _retTree; + _t = __t271; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_formal_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t284 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp186_AST_in = _t; + match(_t,GENERIC_FORMAL_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case FORMAL_PACKAGE_DECLARATION: + case PARAMETER_SPECIFICATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + case FORMAL_DISCRETE_TYPE_DECLARATION: + case FORMAL_FLOATING_POINT_DECLARATION: + case FORMAL_FUNCTION_DECLARATION: + case FORMAL_MODULAR_TYPE_DECLARATION: + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + case FORMAL_PRIVATE_TYPE_DECLARATION: + case FORMAL_PROCEDURE_DECLARATION: + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + generic_formal_parameter(_t); + _t = _retTree; + break; + } + default: + { + goto _loop286; + } + } + } + _loop286:; + } // ( ... )* + _t = __t284; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_formal_parameter(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_formal_parameter_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case FORMAL_DISCRETE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t288 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp187_AST_in = _t; + match(_t,FORMAL_DISCRETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t288; + _t = _t->getNextSibling(); + break; + } + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t289 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp188_AST_in = _t; + match(_t,FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t289; + _t = _t->getNextSibling(); + break; + } + case FORMAL_MODULAR_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t290 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp189_AST_in = _t; + match(_t,FORMAL_MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t290; + _t = _t->getNextSibling(); + break; + } + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t291 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp190_AST_in = _t; + match(_t,FORMAL_DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t291; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t292 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp191_AST_in = _t; + match(_t,FORMAL_ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t292; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FLOATING_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t293 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t; + match(_t,FORMAL_FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t293; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + formal_array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + formal_access_type_declaration(_t); + _t = _retTree; + break; + } + case FORMAL_PRIVATE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t294 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t; + match(_t,FORMAL_PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t294; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t295 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t; + match(_t,FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t295; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t296 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t; + match(_t,FORMAL_PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t296; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t297 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t; + match(_t,FORMAL_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t297; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t298 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t; + match(_t,FORMAL_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t298; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PACKAGE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t299 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t; + match(_t,FORMAL_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + formal_package_actual_part_opt(_t); + _t = _retTree; + _t = __t299; + _t = _t->getNextSibling(); + break; + } + case PARAMETER_SPECIFICATION: + { + parameter_specification(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_array_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + array_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_access_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + access_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::id_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST id_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprogram_default_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprogram_default_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_package_actual_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_package_actual_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case DEFINING_IDENTIFIER_LIST: + { + defining_identifier_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::procedure_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST procedure_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t309 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t; + match(_t,PROCEDURE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t309; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::function_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST function_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t311 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t; + match(_t,FUNCTION_BODY); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t311; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST body_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::declarative_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST declarative_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t314 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t; + match(_t,DECLARATIVE_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_BODY: + case PACKAGE_BODY_STUB: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_BODY: + case PROTECTED_BODY_STUB: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_BODY: + case TASK_BODY_STUB: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + declarative_item(_t); + _t = _retTree; + break; + } + default: + { + goto _loop316; + } + } + } + _loop316:; + } // ( ... )* + _t = __t314; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::block_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST block_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t336 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t; + match(_t,BLOCK_BODY); + _t = _t->getFirstChild(); + handled_stmt_s(_t); + _t = _retTree; + _t = __t336; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::declarative_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST declarative_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t318 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t; + match(_t,PACKAGE_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t318; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t319 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t; + match(_t,PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t319; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case TASK_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t320 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t; + match(_t,TASK_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t320; + _t = _t->getNextSibling(); + break; + } + case TASK_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t321 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t; + match(_t,TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t321; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t322 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t; + match(_t,PROTECTED_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t322; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t323 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t; + match(_t,PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t323; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_op_bodies_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_bodies_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t329 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t; + match(_t,PROT_OP_BODIES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ENTRY_BODY: + { + entry_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + case FUNCTION_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_DECLARATION: + { + subprog_decl_or_body(_t); + _t = _retTree; + break; + } + default: + { + goto _loop331; + } + } + } + _loop331:; + } // ( ... )* + _t = __t329; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::block_body_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST block_body_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t326 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t; + match(_t,BLOCK_BODY_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case HANDLED_SEQUENCE_OF_STATEMENTS: + { + handled_stmt_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t326; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::handled_stmt_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST handled_stmt_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t338 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t; + match(_t,HANDLED_SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + _t = __t338; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t398 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t; + match(_t,ENTRY_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_body_formal_part(_t); + _t = _retTree; + entry_barrier(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t398; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprog_decl_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_or_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t333 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t; + match(_t,PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t333; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + case FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t334 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t; + match(_t,FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t334; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST statements_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t343 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t; + match(_t,SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt345=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt345>=1 ) { goto _loop345; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + } + _cnt345++; + } + _loop345:; + } // ( ... )+ + _t = __t343; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::except_handler_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST except_handler_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t448 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t; + match(_t,EXCEPT_HANDLER_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == EXCEPTION_HANDLER)) { + exception_handler(_t); + _t = _retTree; + } + else { + goto _loop450; + } + + } + _loop450:; + } // ( ... )* + _t = __t448; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::handled_stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST handled_stmts_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t340 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t; + match(_t,HANDLED_STMTS_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t340; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST statement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t347 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t; + match(_t,STATEMENT); + _t = _t->getFirstChild(); + def_label_opt(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NULL_STATEMENT: + { + null_stmt(_t); + _t = _retTree; + break; + } + case EXIT_STATEMENT: + { + exit_stmt(_t); + _t = _retTree; + break; + } + case RETURN_STATEMENT: + { + return_stmt(_t); + _t = _retTree; + break; + } + case GOTO_STATEMENT: + { + goto_stmt(_t); + _t = _retTree; + break; + } + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ABORT_STATEMENT: + { + abort_stmt(_t); + _t = _retTree; + break; + } + case RAISE_STATEMENT: + { + raise_stmt(_t); + _t = _retTree; + break; + } + case REQUEUE_STATEMENT: + { + requeue_stmt(_t); + _t = _retTree; + break; + } + case ACCEPT_STATEMENT: + { + accept_stmt(_t); + _t = _retTree; + break; + } + case ASYNCHRONOUS_SELECT: + case CONDITIONAL_ENTRY_CALL: + case SELECTIVE_ACCEPT: + case TIMED_ENTRY_CALL: + { + select_stmt(_t); + _t = _retTree; + break; + } + case IF_STATEMENT: + { + if_stmt(_t); + _t = _retTree; + break; + } + case CASE_STATEMENT: + { + case_stmt(_t); + _t = _retTree; + break; + } + case LOOP_STATEMENT: + { + loop_stmt(_t); + _t = _retTree; + id_opt(_t); + _t = _retTree; + break; + } + case BLOCK_STATEMENT: + { + block(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + break; + } + case ASSIGNMENT_STATEMENT: + case CALL_STATEMENT: + { + call_or_assignment(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t347; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::def_label_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST def_label_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t350 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp221_AST_in = _t; + match(_t,LABEL_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp222_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t350; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::null_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST null_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp223_AST_in = _t; + match(_t,NULL_STATEMENT); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::exit_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST exit_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t385 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp224_AST_in = _t; + match(_t,EXIT_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + label_name(_t); + _t = _retTree; + break; + } + case 3: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHEN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp225_AST_in = _t; + match(_t,WHEN); + _t = _t->getNextSibling(); + condition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t385; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::return_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST return_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t390 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp226_AST_in = _t; + match(_t,RETURN_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t390; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::goto_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST goto_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t393 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp227_AST_in = _t; + match(_t,GOTO_STATEMENT); + _t = _t->getFirstChild(); + label_name(_t); + _t = _retTree; + _t = __t393; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::delay_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST delay_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t412 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp228_AST_in = _t; + match(_t,DELAY_STATEMENT); + _t = _t->getFirstChild(); + modifiers(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t412; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::abort_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST abort_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t444 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp229_AST_in = _t; + match(_t,ABORT_STATEMENT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt446=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_4.member(_t->getType()))) { + name(_t); + _t = _retTree; + } + else { + if ( _cnt446>=1 ) { goto _loop446; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt446++; + } + _loop446:; + } // ( ... )+ + _t = __t444; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::raise_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST raise_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t460 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp230_AST_in = _t; + match(_t,RAISE_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t460; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::requeue_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST requeue_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t463 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp231_AST_in = _t; + match(_t,REQUEUE_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABORT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp232_AST_in = _t; + match(_t,ABORT); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t463; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::accept_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST accept_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t407 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp233_AST_in = _t; + match(_t,ACCEPT_STATEMENT); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_index_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + handled_stmts_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t407; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::select_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST select_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASYNCHRONOUS_SELECT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t414 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp234_AST_in = _t; + match(_t,ASYNCHRONOUS_SELECT); + _t = _t->getFirstChild(); + triggering_alternative(_t); + _t = _retTree; + abortable_part(_t); + _t = _retTree; + _t = __t414; + _t = _t->getNextSibling(); + break; + } + case SELECTIVE_ACCEPT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t415 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp235_AST_in = _t; + match(_t,SELECTIVE_ACCEPT); + _t = _t->getFirstChild(); + selective_accept(_t); + _t = _retTree; + _t = __t415; + _t = _t->getNextSibling(); + break; + } + case TIMED_ENTRY_CALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t416 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp236_AST_in = _t; + match(_t,TIMED_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + delay_alternative(_t); + _t = _retTree; + _t = __t416; + _t = _t->getNextSibling(); + break; + } + case CONDITIONAL_ENTRY_CALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t417 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp237_AST_in = _t; + match(_t,CONDITIONAL_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t417; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::if_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST if_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t354 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp238_AST_in = _t; + match(_t,IF_STATEMENT); + _t = _t->getFirstChild(); + cond_clause(_t); + _t = _retTree; + elsifs_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + _t = __t354; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::case_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST case_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t366 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp239_AST_in = _t; + match(_t,CASE_STATEMENT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + alternative_s(_t); + _t = _retTree; + _t = __t366; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::loop_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST loop_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t373 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp240_AST_in = _t; + match(_t,LOOP_STATEMENT); + _t = _t->getFirstChild(); + iteration_scheme_opt(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t373; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::block(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST block_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t380 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp241_AST_in = _t; + match(_t,BLOCK_STATEMENT); + _t = _t->getFirstChild(); + declare_opt(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + _t = __t380; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::call_or_assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST call_or_assignment_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASSIGNMENT_STATEMENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t395 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp242_AST_in = _t; + match(_t,ASSIGNMENT_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t395; + _t = _t->getNextSibling(); + break; + } + case CALL_STATEMENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t396 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp243_AST_in = _t; + match(_t,CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t396; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::cond_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST cond_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t356 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp244_AST_in = _t; + match(_t,COND_CLAUSE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t356; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::elsifs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST elsifs_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp245_AST_in = _t; + match(_t,ELSIFS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == COND_CLAUSE)) { + cond_clause(_t); + _t = _retTree; + } + else { + goto _loop361; + } + + } + _loop361:; + } // ( ... )* + _t = __t359; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::else_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST else_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t363 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp246_AST_in = _t; + match(_t,ELSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t363; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::condition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST condition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + expression(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::alternative_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST alternative_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )+ + int _cnt369=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == CASE_STATEMENT_ALTERNATIVE)) { + case_statement_alternative(_t); + _t = _retTree; + } + else { + if ( _cnt369>=1 ) { goto _loop369; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt369++; + } + _loop369:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::case_statement_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST case_statement_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp247_AST_in = _t; + match(_t,CASE_STATEMENT_ALTERNATIVE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t371; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::iteration_scheme_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST iteration_scheme_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t375 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp248_AST_in = _t; + match(_t,ITERATION_SCHEME_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHILE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t377 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp249_AST_in = _t; + match(_t,WHILE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + _t = __t377; + _t = _t->getNextSibling(); + break; + } + case FOR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t378 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp250_AST_in = _t; + match(_t,FOR); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp251_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + _t = __t378; + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t375; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::declare_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST declare_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t382 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp252_AST_in = _t; + match(_t,DECLARE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DECLARATIVE_PART: + { + declarative_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t382; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::label_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST label_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp253_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_body_formal_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_body_formal_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + entry_index_spec_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_barrier(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_barrier_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + condition(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_index_spec_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_index_spec_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t401 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp254_AST_in = _t; + match(_t,ENTRY_INDEX_SPECIFICATION); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + def_id(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t401; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_call_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_call_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t405 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp255_AST_in = _t; + match(_t,ENTRY_CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t405; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_index_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_index_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t409 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp256_AST_in = _t; + match(_t,ENTRY_INDEX_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t409; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::triggering_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST triggering_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t419 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp257_AST_in = _t; + match(_t,TRIGGERING_ALTERNATIVE); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ENTRY_CALL_STATEMENT: + { + entry_call_stmt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + stmts_opt(_t); + _t = _retTree; + _t = __t419; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::abortable_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST abortable_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t422 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp258_AST_in = _t; + match(_t,ABORTABLE_PART); + _t = _t->getFirstChild(); + stmts_opt(_t); + _t = _retTree; + _t = __t422; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::selective_accept(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST selective_accept_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + or_select_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_call_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_call_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t424 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp259_AST_in = _t; + match(_t,ENTRY_CALL_ALTERNATIVE); + _t = _t->getFirstChild(); + entry_call_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t424; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::delay_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST delay_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t435 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp260_AST_in = _t; + match(_t,DELAY_ALTERNATIVE); + _t = _t->getFirstChild(); + delay_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t435; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST stmts_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + goto _loop438; + } + } + } + _loop438:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::guard_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST guard_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t427 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp261_AST_in = _t; + match(_t,GUARD_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + condition(_t); + _t = _retTree; + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop430; + } + + } + _loop430:; + } // ( ... )* + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t427; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::select_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST select_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCEPT_ALTERNATIVE: + { + accept_alternative(_t); + _t = _retTree; + break; + } + case DELAY_ALTERNATIVE: + { + delay_alternative(_t); + _t = _retTree; + break; + } + case TERMINATE_ALTERNATIVE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp262_AST_in = _t; + match(_t,TERMINATE_ALTERNATIVE); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::or_select_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST or_select_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t440 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp263_AST_in = _t; + match(_t,OR_SELECT_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == GUARD_OPT)) { + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + } + else { + goto _loop442; + } + + } + _loop442:; + } // ( ... )* + _t = __t440; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::accept_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST accept_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t433 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp264_AST_in = _t; + match(_t,ACCEPT_ALTERNATIVE); + _t = _t->getFirstChild(); + accept_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t433; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::exception_handler(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST exception_handler_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t452 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp265_AST_in = _t; + match(_t,EXCEPTION_HANDLER); + _t = _t->getFirstChild(); + identifier_colon_opt(_t); + _t = _retTree; + except_choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t452; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::identifier_colon_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST identifier_colon_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t454 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp266_AST_in = _t; + match(_t,IDENTIFIER_COLON_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp267_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t454; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::except_choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST except_choice_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t457 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp268_AST_in = _t; + match(_t,PIPE); + _t = _t->getFirstChild(); + except_choice_s(_t); + _t = _retTree; + exception_choice(_t); + _t = _retTree; + _t = __t457; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case OTHERS: + { + exception_choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::exception_choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST exception_choice_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case OTHERS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp269_AST_in = _t; + match(_t,OTHERS); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::operator_call(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST operator_call_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t466 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp270_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getFirstChild(); + value_s(_t); + _t = _retTree; + _t = __t466; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::relation(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST relation_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t478 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp271_AST_in = _t; + match(_t,IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t478; + _t = _t->getNextSibling(); + break; + } + case NOT_IN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t479 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp272_AST_in = _t; + match(_t,NOT_IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t479; + _t = _t->getNextSibling(); + break; + } + case EQ: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t480 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp273_AST_in = _t; + match(_t,EQ); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t480; + _t = _t->getNextSibling(); + break; + } + case NE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t481 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp274_AST_in = _t; + match(_t,NE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t481; + _t = _t->getNextSibling(); + break; + } + case LT_: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t482 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp275_AST_in = _t; + match(_t,LT_); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t482; + _t = _t->getNextSibling(); + break; + } + case LE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t483 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp276_AST_in = _t; + match(_t,LE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t483; + _t = _t->getNextSibling(); + break; + } + case GT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t484 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp277_AST_in = _t; + match(_t,GT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t484; + _t = _t->getNextSibling(); + break; + } + case GE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t485 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp278_AST_in = _t; + match(_t,GE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t485; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_or_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_or_mark_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::signed_term(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST signed_term_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case UNARY_PLUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t492 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp279_AST_in = _t; + match(_t,UNARY_PLUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t492; + _t = _t->getNextSibling(); + break; + } + case UNARY_MINUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t493 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp280_AST_in = _t; + match(_t,UNARY_MINUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t493; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::term(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST term_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case STAR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t495 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp281_AST_in = _t; + match(_t,STAR); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t495; + _t = _t->getNextSibling(); + break; + } + case DIV: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t496 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp282_AST_in = _t; + match(_t,DIV); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t496; + _t = _t->getNextSibling(); + break; + } + case MOD: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t497 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp283_AST_in = _t; + match(_t,MOD); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t497; + _t = _t->getNextSibling(); + break; + } + case REM: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t498 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp284_AST_in = _t; + match(_t,REM); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t498; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + factor(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::factor(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST factor_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t500 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp285_AST_in = _t; + match(_t,NOT); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t500; + _t = _t->getNextSibling(); + break; + } + case ABS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t501 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp286_AST_in = _t; + match(_t,ABS); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t501; + _t = _t->getNextSibling(); + break; + } + case EXPON: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t502 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp287_AST_in = _t; + match(_t,EXPON); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + primary(_t); + _t = _retTree; + _t = __t502; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + primary(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST primary_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name_or_qualified(_t); + _t = _retTree; + break; + } + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case ALLOCATOR: + { + allocator(_t); + _t = _retTree; + break; + } + case NuLL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp288_AST_in = _t; + match(_t,NuLL); + _t = _t->getNextSibling(); + break; + } + case NUMERIC_LIT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp289_AST_in = _t; + match(_t,NUMERIC_LIT); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp290_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case CHAR_STRING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp291_AST_in = _t; + match(_t,CHAR_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + operator_call(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::name_or_qualified(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST name_or_qualified_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp292_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t506 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp293_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp294_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp295_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp296_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp297_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t506; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t508 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp298_AST_in = _t; + match(_t,INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t508; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t509 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp299_AST_in = _t; + match(_t,TIC); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case RANGE: + case DIGITS: + case DELTA: + case ACCESS: + { + attribute_id(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t509; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::allocator(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST allocator_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t512 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp300_AST_in = _t; + match(_t,ALLOCATOR); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + _t = __t512; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprogram_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprogram_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::package_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST package_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t518 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp301_AST_in = _t; + match(_t,PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t518; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t520 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp302_AST_in = _t; + match(_t,TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t520; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::protected_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST protected_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t522 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp303_AST_in = _t; + match(_t,PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + _t = __t522; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& ) +{ +} +const char* AdaTreeParserSuper::tokenNames[] = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"pragma\"", + "IDENTIFIER", + "SEMI", + "LPAREN", + "COMMA", + "RPAREN", + "RIGHT_SHAFT", + "\"with\"", + "DOT", + "\"use\"", + "\"type\"", + "TIC", + "\"range\"", + "\"digits\"", + "\"delta\"", + "\"access\"", + "\"private\"", + "\"package\"", + "\"body\"", + "\"is\"", + "\"procedure\"", + "\"function\"", + "\"new\"", + "\"others\"", + "PIPE", + "DOT_DOT", + "\"all\"", + "COLON", + "\"in\"", + "\"out\"", + "\"renames\"", + "CHARACTER_LITERAL", + "CHAR_STRING", + "\"null\"", + "\"record\"", + "\"separate\"", + "\"abstract\"", + "\"return\"", + "\"task\"", + "\"protected\"", + "BOX", + "ASSIGN", + "\"entry\"", + "\"for\"", + "\"end\"", + "\"at\"", + "\"mod\"", + "\"subtype\"", + "\"exception\"", + "\"constant\"", + "\"array\"", + "\"of\"", + "\"aliased\"", + "\"case\"", + "\"when\"", + "\"tagged\"", + "\"limited\"", + "\"generic\"", + "\"begin\"", + "LT_LT", + "GT_GT", + "\"if\"", + "\"then\"", + "\"elsif\"", + "\"else\"", + "\"loop\"", + "\"while\"", + "\"reverse\"", + "\"declare\"", + "\"exit\"", + "\"goto\"", + "\"accept\"", + "\"do\"", + "\"delay\"", + "\"until\"", + "\"select\"", + "\"abort\"", + "\"or\"", + "\"terminate\"", + "\"raise\"", + "\"requeue\"", + "\"and\"", + "\"xor\"", + "\"not\"", + "EQ", + "NE", + "LT_", + "LE", + "GT", + "GE", + "PLUS", + "MINUS", + "CONCAT", + "STAR", + "DIV", + "\"rem\"", + "\"abs\"", + "EXPON", + "NUMERIC_LIT", + "ABORTABLE_PART", + "ABORT_STATEMENT", + "ACCEPT_ALTERNATIVE", + "ACCEPT_STATEMENT", + "ALLOCATOR", + "ASSIGNMENT_STATEMENT", + "ASYNCHRONOUS_SELECT", + "ATTRIBUTE_DEFINITION_CLAUSE", + "AT_CLAUSE", + "BLOCK_STATEMENT", + "CASE_STATEMENT", + "CASE_STATEMENT_ALTERNATIVE", + "CODE_STATEMENT", + "COMPONENT_DECLARATION", + "CONDITIONAL_ENTRY_CALL", + "CONTEXT_CLAUSE", + "DECLARATIVE_PART", + "DEFINING_IDENTIFIER_LIST", + "DELAY_ALTERNATIVE", + "DELAY_STATEMENT", + "DELTA_CONSTRAINT", + "DIGITS_CONSTRAINT", + "DISCRIMINANT_ASSOCIATION", + "DISCRIMINANT_CONSTRAINT", + "DISCRIMINANT_SPECIFICATION", + "ENTRY_BODY", + "ENTRY_CALL_ALTERNATIVE", + "ENTRY_CALL_STATEMENT", + "ENTRY_DECLARATION", + "ENTRY_INDEX_SPECIFICATION", + "ENUMERATION_REPESENTATION_CLAUSE", + "EXCEPTION_DECLARATION", + "EXCEPTION_HANDLER", + "EXCEPTION_RENAMING_DECLARATION", + "EXIT_STATEMENT", + "FORMAL_PACKAGE_DECLARATION", + "GENERIC_FORMAL_PART", + "GENERIC_PACKAGE_DECLARATION", + "GOTO_STATEMENT", + "HANDLED_SEQUENCE_OF_STATEMENTS", + "HANDLED_STMTS_OPT", + "IF_STATEMENT", + "INCOMPLETE_TYPE_DECLARATION", + "INDEXED_COMPONENT", + "INDEX_CONSTRAINT", + "LIBRARY_ITEM", + "LOOP_STATEMENT", + "NAME", + "NULL_STATEMENT", + "NUMBER_DECLARATION", + "OBJECT_DECLARATION", + "OBJECT_RENAMING_DECLARATION", + "OPERATOR_SYMBOL", + "PACKAGE_BODY", + "PACKAGE_BODY_STUB", + "PACKAGE_RENAMING_DECLARATION", + "PACKAGE_SPECIFICATION", + "PARAMETER_SPECIFICATION", + "PRIVATE_EXTENSION_DECLARATION", + "PRIVATE_TYPE_DECLARATION", + "PROTECTED_BODY", + "PROTECTED_BODY_STUB", + "PROTECTED_TYPE_DECLARATION", + "RAISE_STATEMENT", + "RANGE_ATTRIBUTE_REFERENCE", + "RECORD_REPRESENTATION_CLAUSE", + "REQUEUE_STATEMENT", + "RETURN_STATEMENT", + "SELECTIVE_ACCEPT", + "SEQUENCE_OF_STATEMENTS", + "SINGLE_PROTECTED_DECLARATION", + "SINGLE_TASK_DECLARATION", + "STATEMENT", + "SUBTYPE_DECLARATION", + "SUBTYPE_INDICATION", + "SUBTYPE_MARK", + "SUBUNIT", + "TASK_BODY", + "TASK_BODY_STUB", + "TASK_TYPE_DECLARATION", + "TERMINATE_ALTERNATIVE", + "TIMED_ENTRY_CALL", + "TRIGGERING_ALTERNATIVE", + "USE_CLAUSE", + "USE_TYPE_CLAUSE", + "VARIANT", + "VARIANT_PART", + "WITH_CLAUSE", + "ABSTRACT_FUNCTION_DECLARATION", + "ABSTRACT_PROCEDURE_DECLARATION", + "ACCESS_TO_FUNCTION_DECLARATION", + "ACCESS_TO_OBJECT_DECLARATION", + "ACCESS_TO_PROCEDURE_DECLARATION", + "ARRAY_OBJECT_DECLARATION", + "ARRAY_TYPE_DECLARATION", + "AND_THEN", + "BASIC_DECLARATIVE_ITEMS_OPT", + "BLOCK_BODY", + "BLOCK_BODY_OPT", + "CALL_STATEMENT", + "COMPONENT_CLAUSES_OPT", + "COMPONENT_ITEMS", + "COND_CLAUSE", + "DECIMAL_FIXED_POINT_DECLARATION", + "DECLARE_OPT", + "DERIVED_RECORD_EXTENSION", + "DISCRETE_SUBTYPE_DEF_OPT", + "DISCRIMINANT_SPECIFICATIONS", + "DISCRIM_PART_OPT", + "ELSE_OPT", + "ELSIFS_OPT", + "END_ID_OPT", + "ENTRY_INDEX_OPT", + "ENUMERATION_TYPE_DECLARATION", + "EXCEPT_HANDLER_PART_OPT", + "EXTENSION_OPT", + "FLOATING_POINT_DECLARATION", + "FORMAL_DECIMAL_FIXED_POINT_DECLARATION", + "FORMAL_DISCRETE_TYPE_DECLARATION", + "FORMAL_FLOATING_POINT_DECLARATION", + "FORMAL_FUNCTION_DECLARATION", + "FORMAL_MODULAR_TYPE_DECLARATION", + "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION", + "FORMAL_ORDINARY_FIXED_POINT_DECLARATION", + "FORMAL_PART_OPT", + "FORMAL_PRIVATE_EXTENSION_DECLARATION", + "FORMAL_PRIVATE_TYPE_DECLARATION", + "FORMAL_PROCEDURE_DECLARATION", + "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION", + "FUNCTION_BODY", + "FUNCTION_BODY_STUB", + "FUNCTION_DECLARATION", + "FUNCTION_RENAMING_DECLARATION", + "GENERIC_FUNCTION_DECLARATION", + "GENERIC_FUNCTION_INSTANTIATION", + "GENERIC_FUNCTION_RENAMING", + "GENERIC_PACKAGE_INSTANTIATION", + "GENERIC_PACKAGE_RENAMING", + "GENERIC_PROCEDURE_DECLARATION", + "GENERIC_PROCEDURE_INSTANTIATION", + "GENERIC_PROCEDURE_RENAMING", + "GUARD_OPT", + "IDENTIFIER_COLON_OPT", + "ID_OPT", + "INIT_OPT", + "ITERATION_SCHEME_OPT", + "LABEL_OPT", + "MARK_WITH_CONSTRAINT", + "MODIFIERS", + "MODULAR_TYPE_DECLARATION", + "MOD_CLAUSE_OPT", + "NOT_IN", + "ORDINARY_DERIVED_TYPE_DECLARATION", + "ORDINARY_FIXED_POINT_DECLARATION", + "OR_ELSE", + "OR_SELECT_OPT", + "PARENTHESIZED_PRIMARY", + "PRIVATE_DECLARATIVE_ITEMS_OPT", + "PRIVATE_TASK_ITEMS_OPT", + "PROCEDURE_BODY", + "PROCEDURE_BODY_STUB", + "PROCEDURE_DECLARATION", + "PROCEDURE_RENAMING_DECLARATION", + "PROT_MEMBER_DECLARATIONS", + "PROT_OP_BODIES_OPT", + "PROT_OP_DECLARATIONS", + "PROT_PRIVATE_OPT", + "RANGED_EXPRS", + "RANGE_CONSTRAINT", + "RECORD_TYPE_DECLARATION", + "SELECTOR_NAMES_OPT", + "SIGNED_INTEGER_TYPE_DECLARATION", + "TASK_ITEMS_OPT", + "UNARY_MINUS", + "UNARY_PLUS", + "VALUE", + "VALUES", + "VARIANTS", + "COMMENT_INTRO", + "OX", + "TIC_OR_CHARACTER_LITERAL", + "DIGIT", + "EXPONENT", + "EXTENDED_DIGIT", + "BASED_INTEGER", + "WS_", + "COMMENT", + "CHARACTER_STRING", + 0 +}; + +const unsigned long AdaTreeParserSuper::_tokenSet_0_data_[] = { 37920UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "in" CHARACTER_LITERAL CHAR_STRING "null" +// "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR +// DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT OPERATOR_SYMBOL +// AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_0(_tokenSet_0_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_1_data_[] = { 939627552UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "range" "others" PIPE DOT_DOT "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT +// OPERATOR_SYMBOL AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS +// UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_1(_tokenSet_1_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_2_data_[] = { 0UL, 0UL, 0UL, 49152UL, 3338801504UL, 2353094950UL, 151076927UL, 2416967168UL, 328577UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENUMERATION_REPESENTATION_CLAUSE +// EXCEPTION_DECLARATION EXCEPTION_RENAMING_DECLARATION GENERIC_PACKAGE_DECLARATION +// INCOMPLETE_TYPE_DECLARATION NUMBER_DECLARATION OBJECT_DECLARATION OBJECT_RENAMING_DECLARATION +// PACKAGE_RENAMING_DECLARATION PACKAGE_SPECIFICATION PRIVATE_EXTENSION_DECLARATION +// PRIVATE_TYPE_DECLARATION PROTECTED_TYPE_DECLARATION RECORD_REPRESENTATION_CLAUSE +// SINGLE_PROTECTED_DECLARATION SINGLE_TASK_DECLARATION SUBTYPE_DECLARATION +// TASK_TYPE_DECLARATION USE_CLAUSE USE_TYPE_CLAUSE ABSTRACT_FUNCTION_DECLARATION +// ABSTRACT_PROCEDURE_DECLARATION ACCESS_TO_FUNCTION_DECLARATION ACCESS_TO_OBJECT_DECLARATION +// ACCESS_TO_PROCEDURE_DECLARATION ARRAY_OBJECT_DECLARATION ARRAY_TYPE_DECLARATION +// DECIMAL_FIXED_POINT_DECLARATION DERIVED_RECORD_EXTENSION ENUMERATION_TYPE_DECLARATION +// FLOATING_POINT_DECLARATION FUNCTION_BODY_STUB FUNCTION_DECLARATION FUNCTION_RENAMING_DECLARATION +// GENERIC_FUNCTION_DECLARATION GENERIC_FUNCTION_INSTANTIATION GENERIC_FUNCTION_RENAMING +// GENERIC_PACKAGE_INSTANTIATION GENERIC_PACKAGE_RENAMING GENERIC_PROCEDURE_DECLARATION +// GENERIC_PROCEDURE_INSTANTIATION GENERIC_PROCEDURE_RENAMING MODULAR_TYPE_DECLARATION +// ORDINARY_DERIVED_TYPE_DECLARATION ORDINARY_FIXED_POINT_DECLARATION PROCEDURE_BODY_STUB +// PROCEDURE_DECLARATION PROCEDURE_RENAMING_DECLARATION RECORD_TYPE_DECLARATION +// SIGNED_INTEGER_TYPE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_2(_tokenSet_2_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_3_data_[] = { 16UL, 0UL, 0UL, 49152UL, 40UL, 256UL, 0UL, 1024UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENTRY_DECLARATION ENUMERATION_REPESENTATION_CLAUSE +// RECORD_REPRESENTATION_CLAUSE FUNCTION_DECLARATION PROCEDURE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_3(_tokenSet_3_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_4_data_[] = { 36896UL, 0UL, 0UL, 0UL, 262144UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER DOT TIC INDEXED_COMPONENT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_4(_tokenSet_4_data_,12); + + diff --git a/languages/ada/AdaTreeParserSuper.hpp b/languages/ada/AdaTreeParserSuper.hpp new file mode 100644 index 00000000..a4d164f0 --- /dev/null +++ b/languages/ada/AdaTreeParserSuper.hpp @@ -0,0 +1,241 @@ +#ifndef INC_AdaTreeParserSuper_hpp_ +#define INC_AdaTreeParserSuper_hpp_ + +#include <antlr/config.hpp> +#include "AdaTreeParserSuperTokenTypes.hpp" +/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuper.hpp"$ */ +#include <antlr/TreeParser.hpp> + +class CUSTOM_API AdaTreeParserSuper : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public AdaTreeParserSuperTokenTypes +{ +#line 1 "ada.tree.g" +#line 13 "AdaTreeParserSuper.hpp" +public: + AdaTreeParserSuper(); + static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); + int getNumTokens() const + { + return AdaTreeParserSuper::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return AdaTreeParserSuper::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return AdaTreeParserSuper::tokenNames; + } + public: void compilation_unit(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void context_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void library_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subunit(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pragma(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pragma_arg(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void with_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void use_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void compound_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subtype_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void attribute_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void modifiers(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprog_decl_or_rename_or_inst_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void def_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pkg_body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_inst(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pkg_spec_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void renames(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void def_designator(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void end_id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprog_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void function_tail(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void value_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void value(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void ranged_expr_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void ranged_expr(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void simple_expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_dots(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_attrib_ref(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prefix(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void parameter_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void defining_identifier_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void init_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void definable_operator_symbol(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void parenthesized_primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void extension_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void spec_decl_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void basic_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void private_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void basic_decl_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void decl_common(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrim_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_definition_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void private_task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_specifications(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entrydecls_repspecs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void rep_spec(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_subtype_def_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_subtype_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subtype_ind(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void align_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void comp_loc_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void local_enum_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void enumeration_aggregate(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void protected_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_private_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_member_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_op_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_op_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void comp_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void component_subtype_def(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void enum_id_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void id_and_discrim(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void record_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void array_type_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void enumeration_literal_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void index_or_discrete_range_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void index_or_discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void digits_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void delta_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void index_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_association(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void selector_names_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void selector_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void component_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void component_items(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void variant_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_direct_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void variant_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void variant(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_with_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void mark_with_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_formal_parameter(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void id_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprogram_default_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_package_actual_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void procedure_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void function_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void declarative_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void block_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void declarative_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_op_bodies_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void block_body_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void handled_stmt_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprog_decl_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void except_handler_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void handled_stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void def_label_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void null_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void exit_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void return_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void goto_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void delay_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void abort_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void raise_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void requeue_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void accept_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void select_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void if_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void case_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void loop_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void block(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void call_or_assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void cond_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void elsifs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void else_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void condition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void alternative_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void case_statement_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void iteration_scheme_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void declare_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void label_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_body_formal_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_barrier(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_index_spec_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_call_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_index_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void triggering_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void abortable_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void selective_accept(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_call_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void delay_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void guard_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void select_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void or_select_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void accept_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void exception_handler(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void identifier_colon_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void except_choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void exception_choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void operator_call(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void relation(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_or_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void signed_term(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void term(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void factor(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void name_or_qualified(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void allocator(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprogram_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void package_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void protected_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return returnAST; + } + +protected: + ANTLR_USE_NAMESPACE(antlr)RefAST returnAST; + ANTLR_USE_NAMESPACE(antlr)RefAST _retTree; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 291; +#else + enum { + NUM_TOKENS = 291 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; +}; + +#endif /*INC_AdaTreeParserSuper_hpp_*/ diff --git a/languages/ada/AdaTreeParserSuperTokenTypes.hpp b/languages/ada/AdaTreeParserSuperTokenTypes.hpp new file mode 100644 index 00000000..924b7415 --- /dev/null +++ b/languages/ada/AdaTreeParserSuperTokenTypes.hpp @@ -0,0 +1,307 @@ +#ifndef INC_AdaTreeParserSuperTokenTypes_hpp_ +#define INC_AdaTreeParserSuperTokenTypes_hpp_ + +/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuperTokenTypes.hpp"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API AdaTreeParserSuperTokenTypes { +#endif + enum { + EOF_ = 1, + PRAGMA = 4, + IDENTIFIER = 5, + SEMI = 6, + LPAREN = 7, + COMMA = 8, + RPAREN = 9, + RIGHT_SHAFT = 10, + WITH = 11, + DOT = 12, + USE = 13, + TYPE = 14, + TIC = 15, + RANGE = 16, + DIGITS = 17, + DELTA = 18, + ACCESS = 19, + PRIVATE = 20, + PACKAGE = 21, + BODY = 22, + IS = 23, + PROCEDURE = 24, + FUNCTION = 25, + NEW = 26, + OTHERS = 27, + PIPE = 28, + DOT_DOT = 29, + ALL = 30, + COLON = 31, + IN = 32, + OUT = 33, + RENAMES = 34, + CHARACTER_LITERAL = 35, + CHAR_STRING = 36, + NuLL = 37, + RECORD = 38, + SEPARATE = 39, + ABSTRACT = 40, + RETURN = 41, + TASK = 42, + PROTECTED = 43, + BOX = 44, + ASSIGN = 45, + ENTRY = 46, + FOR = 47, + END = 48, + AT = 49, + MOD = 50, + SUBTYPE = 51, + EXCEPTION = 52, + CONSTANT = 53, + ARRAY = 54, + OF = 55, + ALIASED = 56, + CASE = 57, + WHEN = 58, + TAGGED = 59, + LIMITED = 60, + GENERIC = 61, + BEGIN = 62, + LT_LT = 63, + GT_GT = 64, + IF = 65, + THEN = 66, + ELSIF = 67, + ELSE = 68, + LOOP = 69, + WHILE = 70, + REVERSE = 71, + DECLARE = 72, + EXIT = 73, + GOTO = 74, + ACCEPT = 75, + DO = 76, + DELAY = 77, + UNTIL = 78, + SELECT = 79, + ABORT = 80, + OR = 81, + TERMINATE = 82, + RAISE = 83, + REQUEUE = 84, + AND = 85, + XOR = 86, + NOT = 87, + EQ = 88, + NE = 89, + LT_ = 90, + LE = 91, + GT = 92, + GE = 93, + PLUS = 94, + MINUS = 95, + CONCAT = 96, + STAR = 97, + DIV = 98, + REM = 99, + ABS = 100, + EXPON = 101, + NUMERIC_LIT = 102, + ABORTABLE_PART = 103, + ABORT_STATEMENT = 104, + ACCEPT_ALTERNATIVE = 105, + ACCEPT_STATEMENT = 106, + ALLOCATOR = 107, + ASSIGNMENT_STATEMENT = 108, + ASYNCHRONOUS_SELECT = 109, + ATTRIBUTE_DEFINITION_CLAUSE = 110, + AT_CLAUSE = 111, + BLOCK_STATEMENT = 112, + CASE_STATEMENT = 113, + CASE_STATEMENT_ALTERNATIVE = 114, + CODE_STATEMENT = 115, + COMPONENT_DECLARATION = 116, + CONDITIONAL_ENTRY_CALL = 117, + CONTEXT_CLAUSE = 118, + DECLARATIVE_PART = 119, + DEFINING_IDENTIFIER_LIST = 120, + DELAY_ALTERNATIVE = 121, + DELAY_STATEMENT = 122, + DELTA_CONSTRAINT = 123, + DIGITS_CONSTRAINT = 124, + DISCRIMINANT_ASSOCIATION = 125, + DISCRIMINANT_CONSTRAINT = 126, + DISCRIMINANT_SPECIFICATION = 127, + ENTRY_BODY = 128, + ENTRY_CALL_ALTERNATIVE = 129, + ENTRY_CALL_STATEMENT = 130, + ENTRY_DECLARATION = 131, + ENTRY_INDEX_SPECIFICATION = 132, + ENUMERATION_REPESENTATION_CLAUSE = 133, + EXCEPTION_DECLARATION = 134, + EXCEPTION_HANDLER = 135, + EXCEPTION_RENAMING_DECLARATION = 136, + EXIT_STATEMENT = 137, + FORMAL_PACKAGE_DECLARATION = 138, + GENERIC_FORMAL_PART = 139, + GENERIC_PACKAGE_DECLARATION = 140, + GOTO_STATEMENT = 141, + HANDLED_SEQUENCE_OF_STATEMENTS = 142, + HANDLED_STMTS_OPT = 143, + IF_STATEMENT = 144, + INCOMPLETE_TYPE_DECLARATION = 145, + INDEXED_COMPONENT = 146, + INDEX_CONSTRAINT = 147, + LIBRARY_ITEM = 148, + LOOP_STATEMENT = 149, + NAME = 150, + NULL_STATEMENT = 151, + NUMBER_DECLARATION = 152, + OBJECT_DECLARATION = 153, + OBJECT_RENAMING_DECLARATION = 154, + OPERATOR_SYMBOL = 155, + PACKAGE_BODY = 156, + PACKAGE_BODY_STUB = 157, + PACKAGE_RENAMING_DECLARATION = 158, + PACKAGE_SPECIFICATION = 159, + PARAMETER_SPECIFICATION = 160, + PRIVATE_EXTENSION_DECLARATION = 161, + PRIVATE_TYPE_DECLARATION = 162, + PROTECTED_BODY = 163, + PROTECTED_BODY_STUB = 164, + PROTECTED_TYPE_DECLARATION = 165, + RAISE_STATEMENT = 166, + RANGE_ATTRIBUTE_REFERENCE = 167, + RECORD_REPRESENTATION_CLAUSE = 168, + REQUEUE_STATEMENT = 169, + RETURN_STATEMENT = 170, + SELECTIVE_ACCEPT = 171, + SEQUENCE_OF_STATEMENTS = 172, + SINGLE_PROTECTED_DECLARATION = 173, + SINGLE_TASK_DECLARATION = 174, + STATEMENT = 175, + SUBTYPE_DECLARATION = 176, + SUBTYPE_INDICATION = 177, + SUBTYPE_MARK = 178, + SUBUNIT = 179, + TASK_BODY = 180, + TASK_BODY_STUB = 181, + TASK_TYPE_DECLARATION = 182, + TERMINATE_ALTERNATIVE = 183, + TIMED_ENTRY_CALL = 184, + TRIGGERING_ALTERNATIVE = 185, + USE_CLAUSE = 186, + USE_TYPE_CLAUSE = 187, + VARIANT = 188, + VARIANT_PART = 189, + WITH_CLAUSE = 190, + ABSTRACT_FUNCTION_DECLARATION = 191, + ABSTRACT_PROCEDURE_DECLARATION = 192, + ACCESS_TO_FUNCTION_DECLARATION = 193, + ACCESS_TO_OBJECT_DECLARATION = 194, + ACCESS_TO_PROCEDURE_DECLARATION = 195, + ARRAY_OBJECT_DECLARATION = 196, + ARRAY_TYPE_DECLARATION = 197, + AND_THEN = 198, + BASIC_DECLARATIVE_ITEMS_OPT = 199, + BLOCK_BODY = 200, + BLOCK_BODY_OPT = 201, + CALL_STATEMENT = 202, + COMPONENT_CLAUSES_OPT = 203, + COMPONENT_ITEMS = 204, + COND_CLAUSE = 205, + DECIMAL_FIXED_POINT_DECLARATION = 206, + DECLARE_OPT = 207, + DERIVED_RECORD_EXTENSION = 208, + DISCRETE_SUBTYPE_DEF_OPT = 209, + DISCRIMINANT_SPECIFICATIONS = 210, + DISCRIM_PART_OPT = 211, + ELSE_OPT = 212, + ELSIFS_OPT = 213, + END_ID_OPT = 214, + ENTRY_INDEX_OPT = 215, + ENUMERATION_TYPE_DECLARATION = 216, + EXCEPT_HANDLER_PART_OPT = 217, + EXTENSION_OPT = 218, + FLOATING_POINT_DECLARATION = 219, + FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220, + FORMAL_DISCRETE_TYPE_DECLARATION = 221, + FORMAL_FLOATING_POINT_DECLARATION = 222, + FORMAL_FUNCTION_DECLARATION = 223, + FORMAL_MODULAR_TYPE_DECLARATION = 224, + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225, + FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226, + FORMAL_PART_OPT = 227, + FORMAL_PRIVATE_EXTENSION_DECLARATION = 228, + FORMAL_PRIVATE_TYPE_DECLARATION = 229, + FORMAL_PROCEDURE_DECLARATION = 230, + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231, + FUNCTION_BODY = 232, + FUNCTION_BODY_STUB = 233, + FUNCTION_DECLARATION = 234, + FUNCTION_RENAMING_DECLARATION = 235, + GENERIC_FUNCTION_DECLARATION = 236, + GENERIC_FUNCTION_INSTANTIATION = 237, + GENERIC_FUNCTION_RENAMING = 238, + GENERIC_PACKAGE_INSTANTIATION = 239, + GENERIC_PACKAGE_RENAMING = 240, + GENERIC_PROCEDURE_DECLARATION = 241, + GENERIC_PROCEDURE_INSTANTIATION = 242, + GENERIC_PROCEDURE_RENAMING = 243, + GUARD_OPT = 244, + IDENTIFIER_COLON_OPT = 245, + ID_OPT = 246, + INIT_OPT = 247, + ITERATION_SCHEME_OPT = 248, + LABEL_OPT = 249, + MARK_WITH_CONSTRAINT = 250, + MODIFIERS = 251, + MODULAR_TYPE_DECLARATION = 252, + MOD_CLAUSE_OPT = 253, + NOT_IN = 254, + ORDINARY_DERIVED_TYPE_DECLARATION = 255, + ORDINARY_FIXED_POINT_DECLARATION = 256, + OR_ELSE = 257, + OR_SELECT_OPT = 258, + PARENTHESIZED_PRIMARY = 259, + PRIVATE_DECLARATIVE_ITEMS_OPT = 260, + PRIVATE_TASK_ITEMS_OPT = 261, + PROCEDURE_BODY = 262, + PROCEDURE_BODY_STUB = 263, + PROCEDURE_DECLARATION = 264, + PROCEDURE_RENAMING_DECLARATION = 265, + PROT_MEMBER_DECLARATIONS = 266, + PROT_OP_BODIES_OPT = 267, + PROT_OP_DECLARATIONS = 268, + PROT_PRIVATE_OPT = 269, + RANGED_EXPRS = 270, + RANGE_CONSTRAINT = 271, + RECORD_TYPE_DECLARATION = 272, + SELECTOR_NAMES_OPT = 273, + SIGNED_INTEGER_TYPE_DECLARATION = 274, + TASK_ITEMS_OPT = 275, + UNARY_MINUS = 276, + UNARY_PLUS = 277, + VALUE = 278, + VALUES = 279, + VARIANTS = 280, + COMMENT_INTRO = 281, + OX = 282, + TIC_OR_CHARACTER_LITERAL = 283, + DIGIT = 284, + EXPONENT = 285, + EXTENDED_DIGIT = 286, + BASED_INTEGER = 287, + WS_ = 288, + COMMENT = 289, + CHARACTER_STRING = 290, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_AdaTreeParserSuperTokenTypes_hpp_*/ diff --git a/languages/ada/AdaTreeParserSuperTokenTypes.txt b/languages/ada/AdaTreeParserSuperTokenTypes.txt new file mode 100644 index 00000000..dfd0b0df --- /dev/null +++ b/languages/ada/AdaTreeParserSuperTokenTypes.txt @@ -0,0 +1,289 @@ +// $ANTLR 2.7.7 (20070609): ada.tree.g -> AdaTreeParserSuperTokenTypes.txt$ +AdaTreeParserSuper // output token vocab name +PRAGMA="pragma"=4 +IDENTIFIER=5 +SEMI=6 +LPAREN=7 +COMMA=8 +RPAREN=9 +RIGHT_SHAFT=10 +WITH="with"=11 +DOT=12 +USE="use"=13 +TYPE="type"=14 +TIC=15 +RANGE="range"=16 +DIGITS="digits"=17 +DELTA="delta"=18 +ACCESS="access"=19 +PRIVATE="private"=20 +PACKAGE="package"=21 +BODY="body"=22 +IS="is"=23 +PROCEDURE="procedure"=24 +FUNCTION="function"=25 +NEW="new"=26 +OTHERS="others"=27 +PIPE=28 +DOT_DOT=29 +ALL="all"=30 +COLON=31 +IN="in"=32 +OUT="out"=33 +RENAMES="renames"=34 +CHARACTER_LITERAL=35 +CHAR_STRING=36 +NuLL="null"=37 +RECORD="record"=38 +SEPARATE="separate"=39 +ABSTRACT="abstract"=40 +RETURN="return"=41 +TASK="task"=42 +PROTECTED="protected"=43 +BOX=44 +ASSIGN=45 +ENTRY="entry"=46 +FOR="for"=47 +END="end"=48 +AT="at"=49 +MOD="mod"=50 +SUBTYPE="subtype"=51 +EXCEPTION="exception"=52 +CONSTANT="constant"=53 +ARRAY="array"=54 +OF="of"=55 +ALIASED="aliased"=56 +CASE="case"=57 +WHEN="when"=58 +TAGGED="tagged"=59 +LIMITED="limited"=60 +GENERIC="generic"=61 +BEGIN="begin"=62 +LT_LT=63 +GT_GT=64 +IF="if"=65 +THEN="then"=66 +ELSIF="elsif"=67 +ELSE="else"=68 +LOOP="loop"=69 +WHILE="while"=70 +REVERSE="reverse"=71 +DECLARE="declare"=72 +EXIT="exit"=73 +GOTO="goto"=74 +ACCEPT="accept"=75 +DO="do"=76 +DELAY="delay"=77 +UNTIL="until"=78 +SELECT="select"=79 +ABORT="abort"=80 +OR="or"=81 +TERMINATE="terminate"=82 +RAISE="raise"=83 +REQUEUE="requeue"=84 +AND="and"=85 +XOR="xor"=86 +NOT="not"=87 +EQ=88 +NE=89 +LT_=90 +LE=91 +GT=92 +GE=93 +PLUS=94 +MINUS=95 +CONCAT=96 +STAR=97 +DIV=98 +REM="rem"=99 +ABS="abs"=100 +EXPON=101 +NUMERIC_LIT=102 +ABORTABLE_PART=103 +ABORT_STATEMENT=104 +ACCEPT_ALTERNATIVE=105 +ACCEPT_STATEMENT=106 +ALLOCATOR=107 +ASSIGNMENT_STATEMENT=108 +ASYNCHRONOUS_SELECT=109 +ATTRIBUTE_DEFINITION_CLAUSE=110 +AT_CLAUSE=111 +BLOCK_STATEMENT=112 +CASE_STATEMENT=113 +CASE_STATEMENT_ALTERNATIVE=114 +CODE_STATEMENT=115 +COMPONENT_DECLARATION=116 +CONDITIONAL_ENTRY_CALL=117 +CONTEXT_CLAUSE=118 +DECLARATIVE_PART=119 +DEFINING_IDENTIFIER_LIST=120 +DELAY_ALTERNATIVE=121 +DELAY_STATEMENT=122 +DELTA_CONSTRAINT=123 +DIGITS_CONSTRAINT=124 +DISCRIMINANT_ASSOCIATION=125 +DISCRIMINANT_CONSTRAINT=126 +DISCRIMINANT_SPECIFICATION=127 +ENTRY_BODY=128 +ENTRY_CALL_ALTERNATIVE=129 +ENTRY_CALL_STATEMENT=130 +ENTRY_DECLARATION=131 +ENTRY_INDEX_SPECIFICATION=132 +ENUMERATION_REPESENTATION_CLAUSE=133 +EXCEPTION_DECLARATION=134 +EXCEPTION_HANDLER=135 +EXCEPTION_RENAMING_DECLARATION=136 +EXIT_STATEMENT=137 +FORMAL_PACKAGE_DECLARATION=138 +GENERIC_FORMAL_PART=139 +GENERIC_PACKAGE_DECLARATION=140 +GOTO_STATEMENT=141 +HANDLED_SEQUENCE_OF_STATEMENTS=142 +HANDLED_STMTS_OPT=143 +IF_STATEMENT=144 +INCOMPLETE_TYPE_DECLARATION=145 +INDEXED_COMPONENT=146 +INDEX_CONSTRAINT=147 +LIBRARY_ITEM=148 +LOOP_STATEMENT=149 +NAME=150 +NULL_STATEMENT=151 +NUMBER_DECLARATION=152 +OBJECT_DECLARATION=153 +OBJECT_RENAMING_DECLARATION=154 +OPERATOR_SYMBOL=155 +PACKAGE_BODY=156 +PACKAGE_BODY_STUB=157 +PACKAGE_RENAMING_DECLARATION=158 +PACKAGE_SPECIFICATION=159 +PARAMETER_SPECIFICATION=160 +PRIVATE_EXTENSION_DECLARATION=161 +PRIVATE_TYPE_DECLARATION=162 +PROTECTED_BODY=163 +PROTECTED_BODY_STUB=164 +PROTECTED_TYPE_DECLARATION=165 +RAISE_STATEMENT=166 +RANGE_ATTRIBUTE_REFERENCE=167 +RECORD_REPRESENTATION_CLAUSE=168 +REQUEUE_STATEMENT=169 +RETURN_STATEMENT=170 +SELECTIVE_ACCEPT=171 +SEQUENCE_OF_STATEMENTS=172 +SINGLE_PROTECTED_DECLARATION=173 +SINGLE_TASK_DECLARATION=174 +STATEMENT=175 +SUBTYPE_DECLARATION=176 +SUBTYPE_INDICATION=177 +SUBTYPE_MARK=178 +SUBUNIT=179 +TASK_BODY=180 +TASK_BODY_STUB=181 +TASK_TYPE_DECLARATION=182 +TERMINATE_ALTERNATIVE=183 +TIMED_ENTRY_CALL=184 +TRIGGERING_ALTERNATIVE=185 +USE_CLAUSE=186 +USE_TYPE_CLAUSE=187 +VARIANT=188 +VARIANT_PART=189 +WITH_CLAUSE=190 +ABSTRACT_FUNCTION_DECLARATION=191 +ABSTRACT_PROCEDURE_DECLARATION=192 +ACCESS_TO_FUNCTION_DECLARATION=193 +ACCESS_TO_OBJECT_DECLARATION=194 +ACCESS_TO_PROCEDURE_DECLARATION=195 +ARRAY_OBJECT_DECLARATION=196 +ARRAY_TYPE_DECLARATION=197 +AND_THEN=198 +BASIC_DECLARATIVE_ITEMS_OPT=199 +BLOCK_BODY=200 +BLOCK_BODY_OPT=201 +CALL_STATEMENT=202 +COMPONENT_CLAUSES_OPT=203 +COMPONENT_ITEMS=204 +COND_CLAUSE=205 +DECIMAL_FIXED_POINT_DECLARATION=206 +DECLARE_OPT=207 +DERIVED_RECORD_EXTENSION=208 +DISCRETE_SUBTYPE_DEF_OPT=209 +DISCRIMINANT_SPECIFICATIONS=210 +DISCRIM_PART_OPT=211 +ELSE_OPT=212 +ELSIFS_OPT=213 +END_ID_OPT=214 +ENTRY_INDEX_OPT=215 +ENUMERATION_TYPE_DECLARATION=216 +EXCEPT_HANDLER_PART_OPT=217 +EXTENSION_OPT=218 +FLOATING_POINT_DECLARATION=219 +FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220 +FORMAL_DISCRETE_TYPE_DECLARATION=221 +FORMAL_FLOATING_POINT_DECLARATION=222 +FORMAL_FUNCTION_DECLARATION=223 +FORMAL_MODULAR_TYPE_DECLARATION=224 +FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225 +FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226 +FORMAL_PART_OPT=227 +FORMAL_PRIVATE_EXTENSION_DECLARATION=228 +FORMAL_PRIVATE_TYPE_DECLARATION=229 +FORMAL_PROCEDURE_DECLARATION=230 +FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231 +FUNCTION_BODY=232 +FUNCTION_BODY_STUB=233 +FUNCTION_DECLARATION=234 +FUNCTION_RENAMING_DECLARATION=235 +GENERIC_FUNCTION_DECLARATION=236 +GENERIC_FUNCTION_INSTANTIATION=237 +GENERIC_FUNCTION_RENAMING=238 +GENERIC_PACKAGE_INSTANTIATION=239 +GENERIC_PACKAGE_RENAMING=240 +GENERIC_PROCEDURE_DECLARATION=241 +GENERIC_PROCEDURE_INSTANTIATION=242 +GENERIC_PROCEDURE_RENAMING=243 +GUARD_OPT=244 +IDENTIFIER_COLON_OPT=245 +ID_OPT=246 +INIT_OPT=247 +ITERATION_SCHEME_OPT=248 +LABEL_OPT=249 +MARK_WITH_CONSTRAINT=250 +MODIFIERS=251 +MODULAR_TYPE_DECLARATION=252 +MOD_CLAUSE_OPT=253 +NOT_IN=254 +ORDINARY_DERIVED_TYPE_DECLARATION=255 +ORDINARY_FIXED_POINT_DECLARATION=256 +OR_ELSE=257 +OR_SELECT_OPT=258 +PARENTHESIZED_PRIMARY=259 +PRIVATE_DECLARATIVE_ITEMS_OPT=260 +PRIVATE_TASK_ITEMS_OPT=261 +PROCEDURE_BODY=262 +PROCEDURE_BODY_STUB=263 +PROCEDURE_DECLARATION=264 +PROCEDURE_RENAMING_DECLARATION=265 +PROT_MEMBER_DECLARATIONS=266 +PROT_OP_BODIES_OPT=267 +PROT_OP_DECLARATIONS=268 +PROT_PRIVATE_OPT=269 +RANGED_EXPRS=270 +RANGE_CONSTRAINT=271 +RECORD_TYPE_DECLARATION=272 +SELECTOR_NAMES_OPT=273 +SIGNED_INTEGER_TYPE_DECLARATION=274 +TASK_ITEMS_OPT=275 +UNARY_MINUS=276 +UNARY_PLUS=277 +VALUE=278 +VALUES=279 +VARIANTS=280 +COMMENT_INTRO=281 +OX=282 +TIC_OR_CHARACTER_LITERAL=283 +DIGIT=284 +EXPONENT=285 +EXTENDED_DIGIT=286 +BASED_INTEGER=287 +WS_=288 +COMMENT=289 +CHARACTER_STRING=290 diff --git a/languages/ada/Makefile.am b/languages/ada/Makefile.am new file mode 100644 index 00000000..4a7eb0c1 --- /dev/null +++ b/languages/ada/Makefile.am @@ -0,0 +1,41 @@ +# Here resides the Ada support part. +KDE_CXXFLAGS = $(USE_EXCEPTIONS) + +INCLUDES = -I$(top_srcdir)/lib/antlr -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \ + $(all_includes) +SUBDIRS = app_templates file_templates doc + + +kde_module_LTLIBRARIES = libkdevadasupport.la +libkdevadasupport_la_LDFLAGS = $(LEXLIB) $(all_libraries) $(KDE_PLUGIN) +libkdevadasupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/antlr/src/libantlr.la + +libkdevadasupport_la_SOURCES = adasupportpart.cpp problemreporter.cpp backgroundparser.cpp addclassdlg.ui addclass.cpp configproblemreporter.ui ada_utils.cpp adasupport.cpp AdaLexer.cpp AdaParser.cpp AdaTreeParserSuper.cpp AdaStoreWalker.cpp + +METASOURCES = AUTO + +EXTRA_DIST = ada.g ada.tree.g ada.store.g + +## The following three rules assume that you have Java installed, +## ANTLR installed, and you have the antlr jar in your CLASSPATH. + +#AdaLexer.hpp AdaLexer.cpp AdaParser.hpp AdaParser.cpp: ada.g +# antlr ada.g + +#AdaTreeParserSuper.hpp AdaTreeParserSuper.cpp: ada.tree.g +# antlr ada.tree.g + +#AdaStoreWalker.hpp AdaStoreWalker.cpp: ada.store.g +# antlr -glib ada.tree.g ada.store.g + +genparser: + antlr ada.g && antlr ada.tree.g && antlr -glib ada.tree.g ada.store.g + +servicedir = $(kde_servicesdir) +service_DATA = kdevadasupport.desktop + +rcdir = $(kde_datadir)/kdevadasupport +rc_DATA = kdevadasupport.rc + +KDE_OPTIONS = nofinal diff --git a/languages/ada/README b/languages/ada/README new file mode 100644 index 00000000..0146b60f --- /dev/null +++ b/languages/ada/README @@ -0,0 +1 @@ +Please read the README.dox file.
\ No newline at end of file diff --git a/languages/ada/README.dox b/languages/ada/README.dox new file mode 100644 index 00000000..e71e6d45 --- /dev/null +++ b/languages/ada/README.dox @@ -0,0 +1,31 @@ +/** \class AdaSupportPart +Ada Language Support + +The ANTLR Ada core support files are: + - ada.g -- contains AdaLexer and AdaParser, requires AdaAST.hpp and adasupport.cpp + - ada.tree.g -- contains the AdaTreeParserSuper + - AdaAST.hpp -- definition of the AST node used by ada.g + - adasupport.hpp -- general purpose utilities + - adasupport.cpp -- implementation of general purpose utilities and implementation of AdaParser class methods from ada.g + +These are ANTLR master files. +They only depend on the ANTLR C++ runtime support and on the C++ STL. +They should be kept free of all other dependencies. +In particular, they do not depend on Kdevelop, KDE, or Qt. + +In order to generate the parser by hand, antlr v2.7.2 is required. +There are parser compilation errors with some gcc versions. To avoid +them, replace file antlr/CppCodeGenerator.java in the antlr source code tree +with the one from <a href="ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerator.java.gz">ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerator.java.gz</a>. + +\unmaintained This part is currently un-maintained. + +\authors <a href="mailto:okellogg AT users.sourceforge.net">Oliver Kellogg</a> +\authors <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a> +\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a> + +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +\requirement Ada compiler + +*/ diff --git a/languages/ada/ada.g b/languages/ada/ada.g new file mode 100644 index 00000000..5f97952b --- /dev/null +++ b/languages/ada/ada.g @@ -0,0 +1,1982 @@ +/* + * Ada95 Grammar for ANTLR, target language C++ + * + * Copyright (C) 2003 Oliver M. Kellogg <okellogg@users.sourceforge.net> + * Modifications (C) 2005 Daniel Zuberbuehler <dzubi@users.sourceforge.net> + * + * Adapted from lexer9x.l/grammar9x.y, + * + ******* A YACC grammar for Ada 9X ********************************* + * Copyright (C) Intermetrics, Inc. 1994 Cambridge, MA USA * + * Copying permitted if accompanied by this statement. * + * Derivative works are permitted if accompanied by this statement.* + * This grammar is thought to be correct as of May 1, 1994 * + * but as usual there is *no warranty* to that effect. * + ******************************************************************* + * + * $Id$ + * + * Not all rules from the Ada95 Reference Manual (RM) Annex P, + * Syntax Summary, are mirrored as rules here. + * The tree nodes follow the RM grammar as closely as sensible. + * This applies in particular to the terminals. OTOH, trivially + * reconstructable non-terminal rules are not reflected in the tree. + * FIXME: Document the exact rationale of the tree design. + * + */ + + +header "pre_include_hpp" { +#include <antlr/SemanticException.hpp> // antlr wants this +#include "AdaAST.hpp" +#include "preambles.h" +} + +options { + language="Cpp"; +} + +//----------------------------------------------------------------------------- +// Define a Parser, calling it AdaParser +//----------------------------------------------------------------------------- +class AdaParser extends Parser; +options { + k = 2; // token lookahead + exportVocab=Ada; // Call its vocabulary "Ada" + // codeGenMakeSwitchThreshold = 2; // Some optimizations + // codeGenBitsetTestThreshold = 3; + defaultErrorHandler = false; // Generate parser error handlers + buildAST = true; + ASTLabelType = "RefAdaAST"; +} + +{ + ANTLR_PARSER_PREAMBLE + +public: + // Ada support stuff + void push_def_id (const RefAdaAST& defid); + const RefAdaAST& pop_def_id (); + bool end_id_matches_def_id (const RefAdaAST& endid); + bool definable_operator (const char *string); // operator_symbol sans "/=" + bool is_operator_symbol (const char *string); +} + +// Compilation Unit: This is the start rule for this parser. +// The rules in this grammar are listed in the order in which +// compilation_unit introduces them, depth first, with the +// exception of the expression related rules which are listed +// towards the end. +compilation_unit + : context_items_opt ( library_item | subunit ) ( pragma )* + ; + +// The pragma related rules are pulled up here to get them out of the way. + +pragma : PRAGMA^ IDENTIFIER pragma_args_opt SEMI! + ; + +pragma_args_opt : ( LPAREN! pragma_arg ( COMMA! pragma_arg )* RPAREN! )? + ; + +pragma_arg : ( IDENTIFIER RIGHT_SHAFT^ )? expression + ; + +context_items_opt : ( pragma | with_clause | use_clause )* + { #context_items_opt = + #(#[CONTEXT_CLAUSE, "CONTEXT_CLAUSE"], #context_items_opt); } + // RM Annex P neglects pragmas; we include them. + // The node should really be named CONTEXT_ITEMS_OPT but we + // stick with the RM wording. + ; + +with_clause : w:WITH^ c_name_list SEMI! + { Set(#w, WITH_CLAUSE); } + ; + +c_name_list : compound_name ( COMMA! compound_name )* + ; + +compound_name : IDENTIFIER ( DOT^ IDENTIFIER )* + // Strangely, the RM never defines this rule, which however is + // required for tightening up the syntax of certain names + // (library unit names etc.) + ; + +use_clause : u:USE^ + ( TYPE! subtype_mark ( COMMA! subtype_mark )* + { Set(#u, USE_TYPE_CLAUSE); } + | c_name_list { Set(#u, USE_CLAUSE); } + ) + SEMI! + ; + +subtype_mark : compound_name ( TIC^ attribute_id )? + // { #subtype_mark = #(#[SUBTYPE_MARK, "SUBTYPE_MARK"], #subtype_mark); } + ; + +attribute_id : RANGE + | DIGITS + | DELTA + | ACCESS + | IDENTIFIER + ; + +library_item : private_opt + /* Slightly loose; PRIVATE can only precede + {generic|package|subprog}_decl. + Semantic check required to ensure it.*/ + ( lib_pkg_spec_or_body + | subprog_decl_or_rename_or_inst_or_body[true] + | generic_decl[true] + ) + { #library_item = #(#[LIBRARY_ITEM, "LIBRARY_ITEM"], #library_item); } + ; + +private_opt : ( PRIVATE )? + { #private_opt = #(#[MODIFIERS, "MODIFIERS"], #private_opt); } + ; + +lib_pkg_spec_or_body + : pkg:PACKAGE^ + ( BODY! def_id[true] IS! pkg_body_part SEMI! + { Set(#pkg, PACKAGE_BODY); } + | def_id[true] spec_decl_part[#pkg] + ) + ; + +subprog_decl [boolean lib_level] + { RefAdaAST t; } + : p:PROCEDURE^ def_id[lib_level] + ( generic_subp_inst + { Set(#p, GENERIC_PROCEDURE_INSTANTIATION); } + | formal_part_opt + ( renames { Set(#p, PROCEDURE_RENAMING_DECLARATION); } + | is_separate_or_abstract_or_decl[#p] + ) + SEMI! + ) + | f:FUNCTION^ def_designator[lib_level] + ( generic_subp_inst + { Set(#f, GENERIC_FUNCTION_INSTANTIATION); } + | function_tail + ( renames { Set(#f, FUNCTION_RENAMING_DECLARATION); } + | is_separate_or_abstract_or_decl[#f] + ) + SEMI! + ) + ; + +def_id [boolean lib_level] + : { lib_level }? cn:compound_name { push_def_id(#cn); } + | { !lib_level }? n:IDENTIFIER { push_def_id(#n); } + ; + +generic_subp_inst : IS! generic_inst SEMI! + ; + +generic_inst : NEW! compound_name ( LPAREN! value_s RPAREN! )? + { pop_def_id(); } + ; + +parenth_values : LPAREN! value ( COMMA! value )* RPAREN! + ; + +value : ( OTHERS^ RIGHT_SHAFT! expression + | ranged_expr_s ( RIGHT_SHAFT^ expression )? + ) + // { #value = #(#[VALUE, "VALUE"], #value); } + ; + +ranged_expr_s : ranged_expr ( PIPE^ ranged_expr )* + // { #ranged_expr_s = + // #(#[RANGED_EXPRS, "RANGED_EXPRS"], #ranged_expr_s); } + ; + +ranged_expr : expression + ( DOT_DOT^ simple_expression + | RANGE^ range + )? + ; + +range_constraint : r:RANGE^ range + { Set(#r, RANGE_CONSTRAINT); } + ; + +range : ( (range_dots) => range_dots + | range_attrib_ref + ) + // Current assumption is we don't need an extra node for range, + // otherwise uncomment the following line: + // { #range = #(#[RANGE_EXPR, "RANGE_EXPR"], #range); } + ; + +range_dots : simple_expression DOT_DOT^ simple_expression + ; + +range_attrib_ref : // "name TIC RANGE" is ambiguous; instead: + prefix TIC! r:RANGE^ ( LPAREN! expression RPAREN! )? + { Set(#r, RANGE_ATTRIBUTE_REFERENCE); } + ; + +// Here, the definition of `prefix' deviates from the RM. +// This gives us some more strictness than `name' (which the RM uses to +// define `prefix'.) +prefix : IDENTIFIER + ( DOT^ ( ALL | IDENTIFIER ) + | p:LPAREN^ value_s RPAREN! + { Set(#p, INDEXED_COMPONENT); } + )* + ; + +formal_part_opt : ( LPAREN! parameter_specification + ( SEMI! parameter_specification )* + RPAREN! )? + { #formal_part_opt = #([FORMAL_PART_OPT, "FORMAL_PART_OPT"], + #formal_part_opt); } + ; + +parameter_specification : def_ids_colon mode_opt subtype_mark init_opt + { #parameter_specification = + #(#[PARAMETER_SPECIFICATION, + "PARAMETER_SPECIFICATION"], #parameter_specification); } + ; + +def_ids_colon : defining_identifier_list COLON! + ; + +defining_identifier_list : IDENTIFIER ( COMMA! IDENTIFIER )* + { #defining_identifier_list = + #(#[DEFINING_IDENTIFIER_LIST, + "DEFINING_IDENTIFIER_LIST"], #defining_identifier_list); } + ; + +mode_opt : ( IN ( OUT )? | OUT | ACCESS )? + { #mode_opt = #(#[MODIFIERS, "MODIFIERS"], #mode_opt); } + ; + +renames { RefAdaAST dummy; } + : RENAMES! ( name + | dummy=definable_operator_symbol + ) + { pop_def_id(); } + ; + +name { RefAdaAST dummy; } + : IDENTIFIER + ( DOT^ ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | dummy=is_operator + ) + | p:LPAREN^ value_s RPAREN! + { Set(#p, INDEXED_COMPONENT); } + | TIC^ attribute_id // must be in here because of e.g. + // Character'Pos (x) + )* + // { #name = #(#[NAME, "NAME"], #name); } + ; + +is_operator returns [RefAdaAST d] + : { is_operator_symbol(LT(1)->getText().c_str()) }? + op:CHAR_STRING { #op->setType(OPERATOR_SYMBOL); d=#op; } + ; + +definable_operator_symbol returns [RefAdaAST d] + : { definable_operator(LT(1)->getText().c_str()) }? + op:CHAR_STRING { #op->setType(OPERATOR_SYMBOL); d=#op; } + ; + +parenthesized_primary : pp:LPAREN^ + ( NuLL RECORD! + | value_s extension_opt + ) + RPAREN! + { Set(#pp, PARENTHESIZED_PRIMARY); } + ; + +extension_opt : ( WITH! ( NuLL RECORD! | value_s ) )? + { #extension_opt = + #(#[EXTENSION_OPT, "EXTENSION_OPT"], #extension_opt); } + ; + +is_separate_or_abstract_or_decl! [RefAdaAST t] + : IS! separate_or_abstract[t] + | { pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_DECLARATION); + else + Set(t, FUNCTION_DECLARATION); + } + ; + +separate_or_abstract! [RefAdaAST t] + : SEPARATE! + { pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_BODY_STUB); + else + Set(t, FUNCTION_BODY_STUB); + } + | ABSTRACT! + { pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, ABSTRACT_PROCEDURE_DECLARATION); + else + Set(t, ABSTRACT_FUNCTION_DECLARATION); + } + ; + +def_designator [boolean lib_level] + { RefAdaAST d; } + : { lib_level }? n:compound_name { push_def_id(#n); } + | { !lib_level }? d=designator { push_def_id(d); } + ; + +designator returns [RefAdaAST d] + { RefAdaAST op; } + : op=definable_operator_symbol { d = op; } + | n:IDENTIFIER { d = #n; } + ; + +function_tail : func_formal_part_opt RETURN! subtype_mark + ; + +// formal_part_opt is not strict enough for functions, i.e. it permits +// "in out" and "out" as modes, thus we make an extra rule: +func_formal_part_opt : ( LPAREN! func_param ( SEMI! func_param )* RPAREN! )? + { #func_formal_part_opt = + #([FORMAL_PART_OPT, + "FORMAL_PART_OPT"], #func_formal_part_opt); } + ; + +func_param : def_ids_colon in_access_opt subtype_mark init_opt + { #func_param = + #(#[PARAMETER_SPECIFICATION, + "PARAMETER_SPECIFICATION"], #func_param); } + ; + +in_access_opt : ( IN | ACCESS )? + { #in_access_opt = #(#[MODIFIERS, "MODIFIERS"], #in_access_opt); } + ; + +spec_decl_part [RefAdaAST pkg] + : ( IS! ( generic_inst { Set(pkg, GENERIC_PACKAGE_INSTANTIATION); } + | pkg_spec_part { Set(pkg, PACKAGE_SPECIFICATION); } + ) + | renames { Set(pkg, PACKAGE_RENAMING_DECLARATION); } + ) + SEMI! + ; + +pkg_spec_part : basic_declarative_items_opt + private_declarative_items_opt + end_id_opt + ; + +private_declarative_items_opt : ( PRIVATE! ( basic_decl_item | pragma )* )? + { #private_declarative_items_opt = + #(#[PRIVATE_DECLARATIVE_ITEMS_OPT, + "PRIVATE_DECLARATIVE_ITEMS_OPT"], + #private_declarative_items_opt); } + ; + +basic_declarative_items_opt : ( basic_decl_item | pragma )* + { #basic_declarative_items_opt = + #(#[BASIC_DECLARATIVE_ITEMS_OPT, + "BASIC_DECLARATIVE_ITEMS_OPT"], + #basic_declarative_items_opt); } + ; + +basic_declarative_items : ( basic_decl_item | pragma )+ + { #basic_declarative_items = + #(#[BASIC_DECLARATIVE_ITEMS_OPT, + "BASIC_DECLARATIVE_ITEMS_OPT"], + #basic_declarative_items); } + ; + +basic_decl_item + : pkg:PACKAGE^ def_id[false] spec_decl_part[#pkg] + | tsk:TASK^ task_type_or_single_decl[#tsk] + | pro:PROTECTED^ prot_type_or_single_decl[#pro] SEMI! + | subprog_decl[false] + | decl_common + ; + +task_type_or_single_decl [RefAdaAST tsk] + : TYPE! def_id[false] discrim_part_opt task_definition_opt + { Set(tsk, TASK_TYPE_DECLARATION); } + | def_id[false] task_definition_opt + { Set(tsk, SINGLE_TASK_DECLARATION); } + ; + +task_definition_opt + : IS! task_items_opt private_task_items_opt end_id_opt SEMI! + | SEMI! { pop_def_id(); } + ; + +discrim_part_opt + : ( discrim_part_text )? + { #discrim_part_opt = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #discrim_part_opt); } + ; + +discrim_part_text : LPAREN! (BOX | discriminant_specifications) RPAREN! + ; + +known_discrim_part + : LPAREN! discriminant_specifications RPAREN! + { #known_discrim_part = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #known_discrim_part); } + ; + +empty_discrim_opt : /* empty */ + { #empty_discrim_opt = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #empty_discrim_opt); } + ; + +discrim_part + : discrim_part_text + { #discrim_part = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #discrim_part); } + ; + +discriminant_specifications : discriminant_specification + ( SEMI! discriminant_specification )* + { #discriminant_specifications = + #(#[DISCRIMINANT_SPECIFICATIONS, + "DISCRIMINANT_SPECIFICATIONS"], + #discriminant_specifications); } + ; + +discriminant_specification : def_ids_colon access_opt subtype_mark init_opt + { #discriminant_specification = + #(#[DISCRIMINANT_SPECIFICATION, + "DISCRIMINANT_SPECIFICATION"], + #discriminant_specification); } + ; + +access_opt : ( ACCESS )? + { #access_opt = #(#[MODIFIERS, "MODIFIERS"], #access_opt); } + ; + +init_opt : ( ASSIGN! expression )? + { #init_opt = #(#[INIT_OPT, "INIT_OPT"], #init_opt); } + ; // `expression' is of course much too loose; + // semantic checks are required in the usage contexts. + +task_items_opt : ( pragma )* entrydecls_repspecs_opt + { #task_items_opt = + #(#[TASK_ITEMS_OPT, "TASK_ITEMS_OPT"], #task_items_opt); } + ; + +entrydecls_repspecs_opt : ( entry_declaration ( pragma | rep_spec )* )* + ; + +entry_declaration : e:ENTRY^ IDENTIFIER + discrete_subtype_def_opt formal_part_opt SEMI! + { Set (#e, ENTRY_DECLARATION); } + ; + +discrete_subtype_def_opt : ( (LPAREN discrete_subtype_definition RPAREN) => + LPAREN! discrete_subtype_definition RPAREN! + | /* empty */ + ) + { #discrete_subtype_def_opt = + #(#[DISCRETE_SUBTYPE_DEF_OPT, + "DISCRETE_SUBTYPE_DEF_OPT"], #discrete_subtype_def_opt); } + ; + +discrete_subtype_definition : ( (range) => range + | subtype_ind + ) + // Looks alot like discrete_range, but it's not + // (as soon as we start doing semantics.) + /* TBC: No need for extra node, just use the inner nodes? + { #discrete_subtype_definition = + #(#[DISCRETE_SUBTYPE_DEFINITION, + "DISCRETE_SUBTYPE_DEFINITION"], + #discrete_subtype_definition); } + */ + ; + +rep_spec : r:FOR^ subtype_mark USE! rep_spec_part[#r] SEMI! + ; + +rep_spec_part [RefAdaAST t] + : RECORD! align_opt comp_loc_s END! RECORD! // record_type_spec + { Set(t, RECORD_REPRESENTATION_CLAUSE); } + | AT! expression // address_spec (Ada83) + { Set(t, AT_CLAUSE); } + | expression // attrib_def. Semantic check must ensure that the + // respective subtype_mark contains an attribute reference. + { Set(t, ATTRIBUTE_DEFINITION_CLAUSE); } + ; + +align_opt : ( AT! MOD! expression SEMI! )? + { #align_opt = #(#[MOD_CLAUSE_OPT, "MOD_CLAUSE_OPT"], #align_opt); } + ; + +comp_loc_s : ( pragma | subtype_mark AT! expression RANGE! range SEMI! )* + { #comp_loc_s = #(#[COMPONENT_CLAUSES_OPT, "COMPONENT_CLAUSES_OPT"], + #comp_loc_s); } + ; + +private_task_items_opt : ( PRIVATE! ( pragma )* entrydecls_repspecs_opt )? + { #private_task_items_opt = + #(#[PRIVATE_TASK_ITEMS_OPT, + "PRIVATE_TASK_ITEMS_OPT"], #private_task_items_opt); } + // Maybe we could just reuse TASK_ITEMS_OPT here instead of + // making a separate node type. + ; + +prot_type_or_single_decl [RefAdaAST pro] + : TYPE! def_id[false] discrim_part_opt protected_definition + { Set(pro, PROTECTED_TYPE_DECLARATION); } + | def_id[false] protected_definition + { Set(pro, SINGLE_PROTECTED_DECLARATION); } + ; + +prot_private_opt : ( PRIVATE! ( prot_op_decl | comp_decl )* )? + { #prot_private_opt = + #(#[PROT_PRIVATE_OPT, + "PROT_PRIVATE_OPT"], #prot_private_opt); } + ; + +protected_definition + : IS! prot_op_decl_s prot_private_opt end_id_opt + ; + +prot_op_decl_s : ( prot_op_decl )* + { #prot_op_decl_s = #(#[PROT_OP_DECLARATIONS, + "PROT_OP_DECLARATIONS"], #prot_op_decl_s); } + ; + +prot_op_decl : entry_declaration + | p:PROCEDURE^ def_id[false] formal_part_opt SEMI! + { pop_def_id(); Set(#p, PROCEDURE_DECLARATION); } + | f:FUNCTION^ def_designator[false] function_tail SEMI! + { pop_def_id(); Set(#f, FUNCTION_DECLARATION); } + | rep_spec + | pragma + ; + +prot_member_decl_s : ( prot_op_decl | comp_decl )* + { #prot_member_decl_s = + #(#[PROT_MEMBER_DECLARATIONS, + "PROT_MEMBER_DECLARATIONS"], #prot_member_decl_s); } + ; + +comp_decl : def_ids_colon component_subtype_def init_opt SEMI! + { #comp_decl = + #(#[COMPONENT_DECLARATION, + "COMPONENT_DECLARATION"], #comp_decl); } + ; + +// decl_common is shared between declarative_item and basic_decl_item. +// decl_common only contains specifications. +decl_common + : t:TYPE^ IDENTIFIER + ( IS! type_def[#t] + | ( discrim_part + ( IS! derived_or_private_or_record[#t, true] + | { Set(#t, INCOMPLETE_TYPE_DECLARATION); } + ) + | empty_discrim_opt + { Set(#t, INCOMPLETE_TYPE_DECLARATION); } + // NB: In this case, the discrim_part_opt does not + // appear in the INCOMPLETE_TYPE_DECLARATION node. + ) + /* The artificial derived_or_private_or_record rule + gives us some syntax-level control over where a + discrim_part may appear. + However, a semantic check is still necessary to make + sure the discrim_part is not given for a derived type + of an elementary type, or for the full view of a + private type that turns out to be such. */ + ) + SEMI! + | s:SUBTYPE^ IDENTIFIER IS! subtype_ind SEMI! // subtype_decl + { Set(#s, SUBTYPE_DECLARATION); } + | generic_decl[false] + | use_clause + | r:FOR^ ( (local_enum_name USE LPAREN) => local_enum_name USE! + enumeration_aggregate + { Set(#r, ENUMERATION_REPESENTATION_CLAUSE); } + | subtype_mark USE! rep_spec_part[#r] + ) + SEMI! + | (IDENTIFIER COLON EXCEPTION RENAMES) => + IDENTIFIER erd:COLON^ EXCEPTION! RENAMES! compound_name SEMI! + { Set(#erd, EXCEPTION_RENAMING_DECLARATION); } + | (IDENTIFIER COLON subtype_mark RENAMES) => + IDENTIFIER ord:COLON^ subtype_mark RENAMES! name SEMI! + { Set(#ord, OBJECT_RENAMING_DECLARATION); } + | defining_identifier_list od:COLON^ // object_declaration + ( EXCEPTION! + { Set(#od, EXCEPTION_DECLARATION); } + | (CONSTANT ASSIGN) => CONSTANT! ASSIGN! expression + { Set(#od, NUMBER_DECLARATION); } + | aliased_constant_opt + ( array_type_definition[#od] init_opt + { Set(#od, ARRAY_OBJECT_DECLARATION); } + // Not an RM rule, but simplifies distinction + // from the non-array object_declaration. + | subtype_ind init_opt + { Set(#od, OBJECT_DECLARATION); } + ) + ) + SEMI! + ; + +type_def [RefAdaAST t] + : LPAREN! enum_id_s RPAREN! + { Set(t, ENUMERATION_TYPE_DECLARATION); } + | RANGE! range + { Set(t, SIGNED_INTEGER_TYPE_DECLARATION); } + | MOD! expression + { Set(t, MODULAR_TYPE_DECLARATION); } + | DIGITS! expression range_constraint_opt + { Set(t, FLOATING_POINT_DECLARATION); } + | DELTA! expression + ( RANGE! range + { Set(t, ORDINARY_FIXED_POINT_DECLARATION); } + | DIGITS! expression range_constraint_opt + { Set(t, DECIMAL_FIXED_POINT_DECLARATION); } + ) + | array_type_definition[t] + | access_type_definition[t] + | empty_discrim_opt derived_or_private_or_record[t, false] + ; + +enum_id_s : enumeration_literal_specification + ( COMMA! enumeration_literal_specification )* + ; + +enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL + ; + +range_constraint_opt : ( range_constraint )? + ; + +array_type_definition [RefAdaAST t] + : ARRAY! LPAREN! index_or_discrete_range_s RPAREN! + OF! component_subtype_def + { Set(t, ARRAY_TYPE_DECLARATION); } + ; + +index_or_discrete_range_s + : index_or_discrete_range ( COMMA^ index_or_discrete_range )* + ; + +index_or_discrete_range + : simple_expression + ( DOT_DOT^ simple_expression // constrained + | RANGE^ ( BOX // unconstrained + | range // constrained + ) + )? + ; + +component_subtype_def : aliased_opt subtype_ind + ; + +aliased_opt : ( ALIASED )? + { #aliased_opt = #(#[MODIFIERS, "MODIFIERS"], #aliased_opt); } + ; + +subtype_ind : subtype_mark constraint_opt + { #subtype_ind = #(#[SUBTYPE_INDICATION, "SUBTYPE_INDICATION"], + #subtype_ind); } + ; + +constraint_opt : ( range_constraint + | digits_constraint + | delta_constraint + | (index_constraint) => index_constraint + | discriminant_constraint + )? + ; + +digits_constraint : d:DIGITS^ expression range_constraint_opt + { Set(#d, DIGITS_CONSTRAINT); } + ; + +delta_constraint : d:DELTA^ expression range_constraint_opt + { Set(#d, DELTA_CONSTRAINT); } + ; + +index_constraint : p:LPAREN^ discrete_range ( COMMA! discrete_range )* RPAREN! + { Set(#p, INDEX_CONSTRAINT); } + ; + +discrete_range + : (range) => range + | subtype_ind + ; + +discriminant_constraint : p:LPAREN^ discriminant_association + ( COMMA! discriminant_association )* RPAREN! + { Set(#p, DISCRIMINANT_CONSTRAINT); } + ; + +discriminant_association : selector_names_opt expression + { #discriminant_association = + #(#[DISCRIMINANT_ASSOCIATION, + "DISCRIMINANT_ASSOCIATION"], #discriminant_association); } + ; + +selector_names_opt : ( (association_head) => association_head + | /* empty */ + ) + { #selector_names_opt = + #(#[SELECTOR_NAMES_OPT, + "SELECTOR_NAMES_OPT"], #selector_names_opt); } + ; + +association_head : selector_name ( PIPE! selector_name )* RIGHT_SHAFT! + ; + +selector_name : IDENTIFIER // TBD: sem pred + ; + +access_type_definition [RefAdaAST t] + : ACCESS! + ( protected_opt + ( PROCEDURE! formal_part_opt + { Set(t, ACCESS_TO_PROCEDURE_DECLARATION); } + | FUNCTION! func_formal_part_opt RETURN! subtype_mark + { Set(t, ACCESS_TO_FUNCTION_DECLARATION); } + ) + | constant_all_opt subtype_ind + { Set(t, ACCESS_TO_OBJECT_DECLARATION); } + ) + ; + +protected_opt : ( PROTECTED )? + { #protected_opt = #(#[MODIFIERS, "MODIFIERS"], #protected_opt); } + ; + +constant_all_opt : ( CONSTANT | ALL )? + { #constant_all_opt = + #(#[MODIFIERS, "MODIFIERS"], #constant_all_opt); } + ; + +derived_or_private_or_record [RefAdaAST t, boolean has_discrim] + : ( ( ABSTRACT )? NEW subtype_ind WITH ) => + abstract_opt NEW! subtype_ind WITH! + ( PRIVATE! { Set(t, PRIVATE_EXTENSION_DECLARATION); } + | record_definition[has_discrim] + { Set(t, DERIVED_RECORD_EXTENSION); } + ) + | NEW! subtype_ind { Set(t, ORDINARY_DERIVED_TYPE_DECLARATION); } + | abstract_tagged_limited_opt + ( PRIVATE! { Set(t, PRIVATE_TYPE_DECLARATION); } + | record_definition[has_discrim] + { Set(t, RECORD_TYPE_DECLARATION); } + ) + ; + +abstract_opt : ( ABSTRACT )? + { #abstract_opt = #(#[MODIFIERS, "MODIFIERS"], #abstract_opt); } + ; + +record_definition [boolean has_discrim] + : RECORD! component_list[has_discrim] END! RECORD! + | NuLL! RECORD! // Thus the component_list is optional in the tree. + ; + +component_list [boolean has_discrim] + : NuLL! SEMI! // Thus the component_list is optional in the tree. + | component_items ( variant_part { has_discrim }? )? + | empty_component_items variant_part { has_discrim }? + ; + +component_items : ( pragma | comp_decl )+ + { #component_items = + #(#[COMPONENT_ITEMS, + "COMPONENT_ITEMS"], #component_items); } + ; + +empty_component_items : + { #empty_component_items = + #(#[COMPONENT_ITEMS, + "COMPONENT_ITEMS"], #empty_component_items); } + ; + +variant_part : c:CASE^ discriminant_direct_name IS! variant_s END! CASE! SEMI! + { Set (#c, VARIANT_PART); } + ; + +discriminant_direct_name : IDENTIFIER // TBD: symtab lookup. + ; + +variant_s : ( variant )+ + { #variant_s = #(#[VARIANTS, "VARIANTS"], #variant_s); } + ; + +variant : w:WHEN^ choice_s RIGHT_SHAFT! component_list[true] + { Set (#w, VARIANT); } + ; + +choice_s : choice ( PIPE^ choice )* + ; + +choice : OTHERS + | (discrete_with_range) => discrete_with_range + | expression // ( DOT_DOT^ simple_expression )? + ; // No, that's already in discrete_with_range + +discrete_with_range : (mark_with_constraint) => mark_with_constraint + | range + ; + +mark_with_constraint : subtype_mark range_constraint + { #mark_with_constraint = + #(#[MARK_WITH_CONSTRAINT, + "MARK_WITH_CONSTRAINT"], #mark_with_constraint); } + ; + +abstract_tagged_limited_opt + : ( ABSTRACT TAGGED! | TAGGED )? + ( LIMITED )? + { #abstract_tagged_limited_opt = + #(#[MODIFIERS, "MODIFIERS"], #abstract_tagged_limited_opt); } + ; + +local_enum_name : IDENTIFIER // to be refined: do a symbol table lookup + ; + +enumeration_aggregate : parenth_values + ; + +aliased_constant_opt : ( ALIASED )? ( CONSTANT )? + { #aliased_constant_opt = + #(#[MODIFIERS, "MODIFIERS"], #aliased_constant_opt); } + ; + +generic_decl [boolean lib_level] + : g:GENERIC^ generic_formal_part_opt + ( PACKAGE! def_id[lib_level] + ( renames { Set(#g, GENERIC_PACKAGE_RENAMING); } + | IS! pkg_spec_part { Set(#g, GENERIC_PACKAGE_DECLARATION); } + ) + | PROCEDURE! def_id[lib_level] formal_part_opt + ( renames { Set(#g, GENERIC_PROCEDURE_RENAMING); } + // ^^^ Semantic check must ensure that the (generic_formal)* + // after GENERIC is not given here. + | { Set(#g, GENERIC_PROCEDURE_DECLARATION); pop_def_id(); } + ) + | FUNCTION! def_designator[lib_level] function_tail + ( renames { Set(#g, GENERIC_FUNCTION_RENAMING); } + // ^^^ Semantic check must ensure that the (generic_formal)* + // after GENERIC is not given here. + | { Set(#g, GENERIC_FUNCTION_DECLARATION); pop_def_id(); } + ) + ) + SEMI! + ; + +generic_formal_part_opt : ( use_clause | pragma | generic_formal_parameter )* + { #generic_formal_part_opt = + #(#[GENERIC_FORMAL_PART, + "GENERIC_FORMAL_PART"], + #generic_formal_part_opt); } + ; + +generic_formal_parameter : + ( t:TYPE^ def_id[false] + ( IS! + ( LPAREN! BOX! RPAREN! + { Set (#t, FORMAL_DISCRETE_TYPE_DECLARATION); } + | RANGE! BOX! + { Set (#t, FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); } + | MOD! BOX! + { Set (#t, FORMAL_MODULAR_TYPE_DECLARATION); } + | DELTA! BOX! + ( DIGITS! BOX! + { Set (#t, FORMAL_DECIMAL_FIXED_POINT_DECLARATION); } + | { Set (#t, FORMAL_ORDINARY_FIXED_POINT_DECLARATION); } + ) + | DIGITS! BOX! + { Set (#t, FORMAL_FLOATING_POINT_DECLARATION); } + | array_type_definition[#t] + | access_type_definition[#t] + | empty_discrim_opt discriminable_type_definition[#t] + ) + | discrim_part IS! discriminable_type_definition[#t] + ) + { pop_def_id(); } + | w:WITH^ ( PROCEDURE! def_id[false] formal_part_opt subprogram_default_opt + { Set(#w, FORMAL_PROCEDURE_DECLARATION); } + | FUNCTION! def_designator[false] function_tail subprogram_default_opt + { Set(#w, FORMAL_FUNCTION_DECLARATION); } + | PACKAGE! def_id[false] IS! NEW! compound_name formal_package_actual_part_opt + { Set(#w, FORMAL_PACKAGE_DECLARATION); } + ) + { pop_def_id(); } + | parameter_specification + ) + SEMI! + ; + +discriminable_type_definition [RefAdaAST t] + : ( ( ABSTRACT )? NEW subtype_ind WITH ) => + abstract_opt NEW! subtype_ind WITH! PRIVATE! + { Set (t, FORMAL_PRIVATE_EXTENSION_DECLARATION); } + | NEW! subtype_ind + { Set (t, FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); } + | abstract_tagged_limited_opt PRIVATE! + { Set (t, FORMAL_PRIVATE_TYPE_DECLARATION); } + ; + +subprogram_default_opt : ( IS! ( BOX | name ) )? + ; + +formal_package_actual_part_opt + : ( LPAREN! ( BOX | defining_identifier_list ) RPAREN! )? + ; + +subprog_decl_or_rename_or_inst_or_body [boolean lib_level] + { RefAdaAST t; } + : p:PROCEDURE^ def_id[lib_level] + ( generic_subp_inst + { Set(#p, GENERIC_PROCEDURE_INSTANTIATION); } + | formal_part_opt + ( renames { Set(#p, PROCEDURE_RENAMING_DECLARATION); } + | IS! ( separate_or_abstract[#p] + | body_part { Set(#p, PROCEDURE_BODY); } + ) + | { pop_def_id(); + Set(#p, PROCEDURE_DECLARATION); } + ) + SEMI! + ) + | f:FUNCTION^ def_designator[lib_level] + ( generic_subp_inst + { Set(#f, GENERIC_FUNCTION_INSTANTIATION); } + | function_tail + ( renames { Set(#f, FUNCTION_RENAMING_DECLARATION); } + | IS! ( separate_or_abstract[#f] + | body_part { Set(#f, FUNCTION_BODY); } + ) + | { pop_def_id(); + Set(#f, FUNCTION_DECLARATION); } + ) + SEMI! + ) + ; + +body_part : declarative_part block_body end_id_opt + ; + +declarative_part : ( pragma | declarative_item )* + { #declarative_part = + #(#[DECLARATIVE_PART, "DECLARATIVE_PART"], + #declarative_part); } + ; + +// A declarative_item may appear in the declarative part of any body. +declarative_item : + ( pkg:PACKAGE^ ( body_is + ( separate { Set(#pkg, PACKAGE_BODY_STUB); } + | pkg_body_part + { Set(#pkg, PACKAGE_BODY); } + ) + SEMI! + | def_id[false] spec_decl_part[#pkg] + ) + | tsk:TASK^ ( body_is + ( separate { Set(#tsk, TASK_BODY_STUB); } + | body_part { Set(#tsk, TASK_BODY); } + ) + SEMI! + | task_type_or_single_decl[#tsk] + ) + | pro:PROTECTED^ + ( body_is + ( separate { Set(#pro, PROTECTED_BODY_STUB); } + | prot_op_bodies_opt end_id_opt + { Set(#pro, PROTECTED_BODY); } + ) + | prot_type_or_single_decl[#pro] + ) + SEMI! + | subprog_decl_or_rename_or_inst_or_body[false] + | decl_common + ) + /* DECLARATIVE_ITEM is just a pass-thru node so we omit it. + Objections anybody? + { #declarative_item = + #(#[DECLARATIVE_ITEM, + "DECLARATIVE_ITEM"], #declarative_item); } + */ + ; + +body_is : BODY! def_id[false] IS! + ; + +separate : SEPARATE! { pop_def_id(); } + ; + +pkg_body_part : declarative_part block_body_opt end_id_opt + ; + +block_body_opt : ( BEGIN! handled_stmt_s )? + { #block_body_opt = + #(#[BLOCK_BODY_OPT, + "BLOCK_BODY_OPT"], #block_body_opt); } + ; + +prot_op_bodies_opt : ( entry_body + | subprog_decl_or_body + | pragma + )* + { #prot_op_bodies_opt = + #(#[PROT_OP_BODIES_OPT, + "PROT_OP_BODIES_OPT"], #prot_op_bodies_opt); } + ; + +subprog_decl_or_body + : p:PROCEDURE^ def_id[false] formal_part_opt + ( IS! body_part { Set(#p, PROCEDURE_BODY); } + | { pop_def_id(); Set(#p, PROCEDURE_DECLARATION); } + ) + SEMI! + | f:FUNCTION^ def_designator[false] function_tail + ( IS! body_part { Set(#f, FUNCTION_BODY); } + | { pop_def_id(); Set(#f, FUNCTION_DECLARATION); } + ) + SEMI! + ; + +block_body : b:BEGIN^ handled_stmt_s + { Set(#b, BLOCK_BODY); } + ; + +handled_stmt_s : statements except_handler_part_opt + { #handled_stmt_s = + #(#[HANDLED_SEQUENCE_OF_STATEMENTS, + "HANDLED_SEQUENCE_OF_STATEMENTS"], #handled_stmt_s); } + ; + +handled_stmts_opt : ( statements except_handler_part_opt )? + { #handled_stmts_opt = + #(#[HANDLED_STMTS_OPT, + "HANDLED_STMTS_OPT"], #handled_stmts_opt); } + ; + +statements : ( pragma | statement )+ + { #statements = #(#[SEQUENCE_OF_STATEMENTS, + "SEQUENCE_OF_STATEMENTS"], #statements); } + ; + +statement : def_label_opt + ( null_stmt + | exit_stmt + | return_stmt + | goto_stmt + | delay_stmt + | abort_stmt + | raise_stmt + | requeue_stmt + | accept_stmt + | select_stmt + | if_stmt + | case_stmt + | loop_stmt SEMI! + | block END! SEMI! + | statement_identifier + ( loop_stmt id_opt SEMI! + | block end_id_opt SEMI! + ) + | call_or_assignment + // | code_stmt // TBD: resolve ambiguity + ) + { #statement = #(#[STATEMENT, "STATEMENT"], #statement); } + ; + +def_label_opt : ( LT_LT! IDENTIFIER GT_GT! )? + { #def_label_opt = #(#[LABEL_OPT, "LABEL_OPT"], #def_label_opt); } + ; + +null_stmt : s:NuLL SEMI! + { Set(#s, NULL_STATEMENT); } + ; + +if_stmt : s:IF^ cond_clause elsifs_opt + else_opt + END! IF! SEMI! + { Set(#s, IF_STATEMENT); } + ; + +cond_clause : condition c:THEN^ statements + { Set(#c, COND_CLAUSE); } + ; + +condition : expression + // { #condition = #(#[CONDITION, "CONDITION"], #condition); } + ; + +elsifs_opt : ( ELSIF! cond_clause )* + { #elsifs_opt = #(#[ELSIFS_OPT, "ELSIFS_OPT"], #elsifs_opt); } + ; + +else_opt : ( ELSE! statements )? + { #else_opt = #(#[ELSE_OPT, "ELSE_OPT"], #else_opt); } + ; + +case_stmt : s:CASE^ expression IS! alternative_s END! CASE! SEMI! + { Set(#s, CASE_STATEMENT); } + ; + +alternative_s : ( case_statement_alternative )+ + ; + +case_statement_alternative : s:WHEN^ choice_s RIGHT_SHAFT! statements + { Set(#s, CASE_STATEMENT_ALTERNATIVE); } + ; + +loop_stmt : iteration_scheme_opt + l:LOOP^ statements END! LOOP! // basic_loop + { Set(#l, LOOP_STATEMENT); } + ; + +iteration_scheme_opt : ( WHILE^ condition + | FOR^ IDENTIFIER IN! reverse_opt discrete_subtype_definition + )? + { #iteration_scheme_opt = + #(#[ITERATION_SCHEME_OPT, + "ITERATION_SCHEME_OPT"], #iteration_scheme_opt); } + ; + +reverse_opt : ( REVERSE )? + { #reverse_opt = #(#[MODIFIERS, "MODIFIERS"], #reverse_opt); } + ; + +id_opt_aux { RefAdaAST endid; } : + endid=definable_operator_symbol { end_id_matches_def_id (endid) }? + | n:compound_name { end_id_matches_def_id (#n) }? + /* Ordinarily we would need to be stricter here, i.e. + match compound_name only for the library-level case + (and IDENTIFIER otherwise), but end_id_matches_def_id + does the right thing for us. */ + | { pop_def_id(); } + ; + +id_opt : id_opt_aux + { #id_opt = #(#[ID_OPT, "ID_OPT"], #id_opt); } + ; + +end_id_opt : e:END^ id_opt_aux + { Set(#e, END_ID_OPT); } + ; + +/* Note: This rule should really be `statement_identifier_opt'. + However, manual disambiguation of `loop_stmt' from `block' + in the presence of the statement_identifier in `statement' + results in this rule. The case of loop_stmt/block given + without the statement_identifier is directly coded in + `statement'. */ +statement_identifier! : n:IDENTIFIER COLON! + { push_def_id(#n); } + ; + +/* +statement_identifier_opt : ( n:IDENTIFIER COLON! { push_def_id(#n); } )? + { #statement_identifier_opt = + #(#[STATEMENT_IDENTIFIER_OPT, + "STATEMENT_IDENTIFIER_OPT"], #statement_identifier_opt); } + ; + */ + +block : declare_opt block_body + { #block = #(#[BLOCK_STATEMENT, "BLOCK_STATEMENT"], #block); } + ; + +declare_opt : ( DECLARE! declarative_part )? + { #declare_opt = #(#[DECLARE_OPT, "DECLARE_OPT"], #declare_opt); } + ; + +exit_stmt : s:EXIT^ ( label_name )? ( WHEN condition )? SEMI! + { Set(#s, EXIT_STATEMENT); } + ; + +label_name : IDENTIFIER + ; + +return_stmt : s:RETURN^ ( expression )? SEMI! + { Set(#s, RETURN_STATEMENT); } + ; + +goto_stmt : s:GOTO^ label_name SEMI! + { Set(#s, GOTO_STATEMENT); } + ; + +call_or_assignment : // procedure_call is in here. + name ( ASSIGN! expression + { #call_or_assignment = + #(#[ASSIGNMENT_STATEMENT, + "ASSIGNMENT_STATEMENT"], #call_or_assignment); } + | { #call_or_assignment = + #(#[CALL_STATEMENT, + "CALL_STATEMENT"], #call_or_assignment); } + /* Preliminary. Use semantic analysis to produce + {PROCEDURE|ENTRY}_CALL_STATEMENT. */ + ) + SEMI! + ; + +entry_body : e:ENTRY^ def_id[false] entry_body_formal_part entry_barrier IS! + body_part SEMI! + { Set (#e, ENTRY_BODY); } + ; + +entry_body_formal_part : entry_index_spec_opt formal_part_opt + ; + +entry_index_spec_opt : + ( (LPAREN FOR) => + LPAREN! FOR! def_id[false] IN! discrete_subtype_definition RPAREN! + | /* empty */ + ) + { #entry_index_spec_opt = + #(#[ENTRY_INDEX_SPECIFICATION, + "ENTRY_INDEX_SPECIFICATION"], #entry_index_spec_opt); } + ; + +entry_barrier : WHEN! condition + ; + +entry_call_stmt : name SEMI! // Semantic analysis required, for example + // to ensure `name' is an entry. + { #entry_call_stmt = + #(#[ENTRY_CALL_STATEMENT, + "ENTRY_CALL_STATEMENT"], #entry_call_stmt); } + ; + +accept_stmt : a:ACCEPT^ def_id[false] entry_index_opt formal_part_opt + ( DO! handled_stmts_opt end_id_opt SEMI! + | SEMI! { pop_def_id(); } + ) + { Set (#a, ACCEPT_STATEMENT); } + ; + +entry_index_opt : ( (LPAREN expression RPAREN) => LPAREN! expression RPAREN! + // Looks alot like parenthesized_expr_opt, but it's not. + // We need the syn pred for the usage context in accept_stmt. + // The formal_part_opt that follows the entry_index_opt there + // creates ambiguity (due to the opening LPAREN.) + | /* empty */ + ) + { #entry_index_opt = + #(#[ENTRY_INDEX_OPT, + "ENTRY_INDEX_OPT"], #entry_index_opt); } + ; + +delay_stmt : d:DELAY^ until_opt expression SEMI! + { Set (#d, DELAY_STATEMENT); } + ; + +until_opt : ( UNTIL )? + { #until_opt = #(#[MODIFIERS, "MODIFIERS"], #until_opt); } + ; + +// SELECT_STATEMENT itself is not modeled since it is trivially +// reconstructed: +// select_statement ::= selective_accept | timed_entry_call +// | conditional_entry_call | asynchronous_select +// +select_stmt : s:SELECT^ + ( (triggering_alternative THEN ABORT) => + triggering_alternative THEN! ABORT! abortable_part + { Set (#s, ASYNCHRONOUS_SELECT); } + | selective_accept + { Set (#s, SELECTIVE_ACCEPT); } + | entry_call_alternative + ( OR! delay_alternative { Set (#s, TIMED_ENTRY_CALL); } + | ELSE! statements { Set (#s, CONDITIONAL_ENTRY_CALL); } + ) + ) + END! SELECT! SEMI! + // { Set (#s, SELECT_STATEMENT); } + ; + +triggering_alternative : ( delay_stmt | entry_call_stmt ) stmts_opt + { #triggering_alternative = + #(#[TRIGGERING_ALTERNATIVE, + "TRIGGERING_ALTERNATIVE"], #triggering_alternative); } + ; + +abortable_part : stmts_opt + { #abortable_part = + #(#[ABORTABLE_PART, + "ABORTABLE_PART"], #abortable_part); } + ; + +entry_call_alternative : entry_call_stmt stmts_opt + { #entry_call_alternative = + #(#[ENTRY_CALL_ALTERNATIVE, + "ENTRY_CALL_ALTERNATIVE"], #entry_call_alternative); } + ; + +selective_accept : guard_opt select_alternative or_select_opt else_opt + ; + +guard_opt : ( w:WHEN^ condition RIGHT_SHAFT! ( pragma )* )? + { Set(#w, GUARD_OPT); } + ; + +select_alternative // Not modeled since it's just a pass-through. + : accept_alternative + | delay_alternative + | t:TERMINATE SEMI! { Set(#t, TERMINATE_ALTERNATIVE); } + ; + +accept_alternative : accept_stmt stmts_opt + { #accept_alternative = + #(#[ACCEPT_ALTERNATIVE, + "ACCEPT_ALTERNATIVE"], #accept_alternative); } + ; + +delay_alternative : delay_stmt stmts_opt + { #delay_alternative = + #(#[DELAY_ALTERNATIVE, + "DELAY_ALTERNATIVE"], #delay_alternative); } + ; + +stmts_opt : ( pragma | statement )* + ; + +or_select_opt : ( OR! guard_opt select_alternative )* + { #or_select_opt = + #(#[OR_SELECT_OPT, "OR_SELECT_OPT"], #or_select_opt); } + ; + +abort_stmt : a:ABORT^ name ( COMMA! name )* SEMI! + { Set (#a, ABORT_STATEMENT); } + ; + +except_handler_part_opt : ( EXCEPTION! ( exception_handler )+ )? + { #except_handler_part_opt = + #(#[EXCEPT_HANDLER_PART_OPT, + "EXCEPT_HANDLER_PART_OPT"], #except_handler_part_opt); } + ; + +exception_handler : w:WHEN^ identifier_colon_opt except_choice_s RIGHT_SHAFT! + statements + { Set (#w, EXCEPTION_HANDLER); } + ; + +identifier_colon_opt : ( IDENTIFIER COLON! )? + { #identifier_colon_opt = + #(#[IDENTIFIER_COLON_OPT, + "IDENTIFIER_COLON_OPT"], #identifier_colon_opt); } + ; + +except_choice_s : exception_choice ( PIPE^ exception_choice )* + ; + +exception_choice : compound_name + | OTHERS + ; + +raise_stmt : r:RAISE^ ( compound_name )? SEMI! + { Set (#r, RAISE_STATEMENT); } + ; + +requeue_stmt : r:REQUEUE^ name ( WITH! ABORT )? SEMI! + { Set (#r, REQUEUE_STATEMENT); } + ; + +operator_call : cs:CHAR_STRING^ operator_call_tail[#cs] + ; + +operator_call_tail [RefAdaAST opstr] + : LPAREN! { is_operator_symbol(opstr->getText().c_str()) }? + value_s RPAREN! { opstr->setType(OPERATOR_SYMBOL); } + ; + +value_s : value ( COMMA! value )* + { #value_s = #(#[VALUES, "VALUES"], #value_s); } + ; + +/* +literal : NUMERIC_LIT + | CHARACTER_LITERAL + | CHAR_STRING + | NuLL + ; + */ + +expression : relation + ( a:AND^ ( THEN! { Set (#a, AND_THEN); } )? relation + | o:OR^ ( ELSE! { Set (#o, OR_ELSE); } )? relation + | XOR^ relation + )* + ; + +relation : simple_expression + ( IN^ range_or_mark + | n:NOT^ IN! range_or_mark { Set (#n, NOT_IN); } + | EQ^ simple_expression + | NE^ simple_expression + | LT_^ simple_expression + | LE^ simple_expression + | GT^ simple_expression + | GE^ simple_expression + )? + ; + +range_or_mark : (range) => range + | subtype_mark + ; + +simple_expression : signed_term + ( PLUS^ signed_term + | MINUS^ signed_term + | CONCAT^ signed_term + )* + ; + +signed_term + : p:PLUS^ term { Set(#p, UNARY_PLUS); } + | m:MINUS^ term { Set(#m, UNARY_MINUS); } + | term + ; + +term : factor ( STAR^ factor + | DIV^ factor + | MOD^ factor + | REM^ factor + )* + ; + +factor : ( NOT^ primary + | ABS^ primary + | primary ( EXPON^ primary )? + ) + ; + +primary : ( name_or_qualified + | parenthesized_primary + | allocator + | NuLL + | NUMERIC_LIT + | CHARACTER_LITERAL + | cs:CHAR_STRING^ ( operator_call_tail[#cs] )? + ) + ; + +// Temporary, to be turned into just `qualified'. +// We get away with it because `qualified' is always mentioned +// together with `name'. +// Only exception: `code_stmt', which is not yet implemented. +name_or_qualified { RefAdaAST dummy; } + : IDENTIFIER + ( DOT^ ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | dummy=is_operator + ) + | p:LPAREN^ value_s RPAREN! + { Set(#p, INDEXED_COMPONENT); } + | TIC^ ( parenthesized_primary | attribute_id ) + )* + ; + +allocator : n:NEW^ name_or_qualified + { Set(#n, ALLOCATOR); } + ; + +subunit : sep:SEPARATE^ LPAREN! compound_name RPAREN! + { Set(#sep, SUBUNIT); } + ( subprogram_body + | package_body + | task_body + | protected_body + ) + ; + +subprogram_body + : p:PROCEDURE^ def_id[false] formal_part_opt IS! body_part SEMI! + { pop_def_id(); Set(#p, PROCEDURE_BODY); } + | f:FUNCTION^ def_designator[false] function_tail IS! body_part SEMI! + { pop_def_id(); Set(#f, FUNCTION_BODY); } + ; + +package_body : p:PACKAGE^ body_is pkg_body_part SEMI! + { Set(#p, PACKAGE_BODY); } + ; + +task_body : t:TASK^ body_is body_part SEMI! + { Set(#t, TASK_BODY); } + ; + +protected_body : p:PROTECTED^ body_is prot_op_bodies_opt end_id_opt SEMI! + { Set(#p, PROTECTED_BODY); } + ; + +// TBD +// code_stmt : qualified SEMI! +// ; + +//---------------------------------------------------------------------------- +// The Ada scanner +//---------------------------------------------------------------------------- +{ +#include "preambles.h" +} +class AdaLexer extends Lexer; + +options { + charVocabulary = '\3'..'\377'; + exportVocab = Ada; // call the vocabulary "Ada" + testLiterals = false; // don't automatically test for literals + k = 4; // number of characters of lookahead + caseSensitive = false; + caseSensitiveLiterals = false; + ///defaultErrorHandler = true; +} + +tokens { + // part 1: keywords + ABORT = "abort" ; + ABS = "abs" ; + ABSTRACT = "abstract" ; + ACCEPT = "accept" ; + ACCESS = "access" ; + ALIASED = "aliased" ; + ALL = "all" ; + AND = "and" ; + ARRAY = "array" ; + AT = "at" ; + BEGIN = "begin" ; + BODY = "body" ; + CASE = "case" ; + CONSTANT = "constant" ; + DECLARE = "declare" ; + DELAY = "delay" ; + DELTA = "delta" ; + DIGITS = "digits" ; + DO = "do" ; + ELSE = "else" ; + ELSIF = "elsif" ; + END = "end" ; + ENTRY = "entry" ; + EXCEPTION = "exception" ; + EXIT = "exit" ; + FOR = "for" ; + FUNCTION = "function" ; + GENERIC = "generic" ; + GOTO = "goto" ; + IF = "if" ; + IN = "in" ; + IS = "is" ; + LIMITED = "limited" ; + LOOP = "loop" ; + MOD = "mod" ; + NEW = "new" ; + NOT = "not" ; + NuLL = "null" ; + OF = "of" ; + OR = "or" ; + OTHERS = "others" ; + OUT = "out" ; + PACKAGE = "package" ; + PRAGMA = "pragma" ; + PRIVATE = "private" ; + PROCEDURE = "procedure" ; + PROTECTED = "protected" ; + RAISE = "raise" ; + RANGE = "range" ; + RECORD = "record" ; + REM = "rem" ; + RENAMES = "renames" ; + REQUEUE = "requeue" ; + RETURN = "return" ; + REVERSE = "reverse" ; + SELECT = "select" ; + SEPARATE = "separate" ; + SUBTYPE = "subtype" ; + TAGGED = "tagged" ; + TASK = "task" ; + TERMINATE = "terminate" ; + THEN = "then" ; + TYPE = "type" ; + UNTIL = "until" ; + USE = "use" ; + WHEN = "when" ; + WHILE = "while" ; + WITH = "with" ; + XOR = "xor" ; + + // part 2: RM tokens (synthetic) + ABORTABLE_PART; + ABORT_STATEMENT; + /*ABSTRACT_SUBPROGRAM_DECLARATION; => + ABSTRACT_{FUNCTION|PROCEDURE}_DECLARATION */ + ACCEPT_ALTERNATIVE; + ACCEPT_STATEMENT; + /* ACCESS_TO_FUNCTION_DEFINITION => ACCESS_TO_FUNCTION_DECLARATION */ + /* ACCESS_TO_OBJECT_DEFINITION => ACCESS_TO_OBJECT_DECLARATION */ + /* ACCESS_TO_PROCEDURE_DEFINITION => ACCESS_TO_PROCEDURE_DECLARATION */ + /* ACCESS_TYPE_DEFINITION => ACCESS_TYPE_DECLARATION */ + ALLOCATOR; + /* ARRAY_TYPE_DEFINITION => ARRAY_TYPE_DECLARATION */ + ASSIGNMENT_STATEMENT; + ASYNCHRONOUS_SELECT; + ATTRIBUTE_DEFINITION_CLAUSE; + AT_CLAUSE; + BLOCK_STATEMENT; + CASE_STATEMENT; + CASE_STATEMENT_ALTERNATIVE; + CODE_STATEMENT; + COMPONENT_DECLARATION; + // COMPONENT_LIST; // not currently used as an explicit node + // CONDITION; // not currently used + CONDITIONAL_ENTRY_CALL; + CONTEXT_CLAUSE; + /* DECIMAL_FIXED_POINT_DEFINITION => DECIMAL_FIXED_POINT_DECLARATION */ + // DECLARATIVE_ITEM; // not currently used + DECLARATIVE_PART; + DEFINING_IDENTIFIER_LIST; + DELAY_ALTERNATIVE; + DELAY_STATEMENT; + DELTA_CONSTRAINT; + /* DERIVED_TYPE_DEFINITION; => + DERIVED_RECORD_EXTENSION, ORDINARY_DERIVED_TYPE_DECLARATION */ + DIGITS_CONSTRAINT; + // DISCRETE_RANGE; // Not used; instead, directly use its RHS alternatives. + DISCRIMINANT_ASSOCIATION; + DISCRIMINANT_CONSTRAINT; + DISCRIMINANT_SPECIFICATION; + ENTRY_BODY; + ENTRY_CALL_ALTERNATIVE; + ENTRY_CALL_STATEMENT; + ENTRY_DECLARATION; + ENTRY_INDEX_SPECIFICATION; + ENUMERATION_REPESENTATION_CLAUSE; + /* ENUMERATION_TYPE_DEFINITION => ENUMERATION_TYPE_DECLARATION */ + EXCEPTION_DECLARATION; + EXCEPTION_HANDLER; + EXCEPTION_RENAMING_DECLARATION; + EXIT_STATEMENT; + /* FLOATING_POINT_DEFINITION => FLOATING_POINT_DECLARATION */ + /* FORMAL_ACCESS_TYPE_DEFINITION => FORMAL_ACCESS_TYPE_DECLARATION */ + /* FORMAL_ARRAY_TYPE_DEFINITION => FORMAL_ARRAY_TYPE_DECLARATION */ + /* FORMAL_DECIMAL_FIXED_POINT_DEFINITION => + FORMAL_DECIMAL_FIXED_POINT_DECLARATION */ + /* FORMAL_DERIVED_TYPE_DEFINITION => + FORMAL_{ORDINARY_DERIVED_TYPE|PRIVATE_EXTENSION}_DECLARATION */ + /* FORMAL_DISCRETE_TYPE_DEFINITION => FORMAL_DISCRETE_TYPE_DECLARATION */ + /* FORMAL_FLOATING_POINT_DEFINITION => + FORMAL_FLOATING_POINT_DECLARATION */ + /* FORMAL_MODULAR_TYPE_DEFINITION => FORMAL_MODULAR_TYPE_DECLARATION */ + /* FORMAL_ORDINARY_FIXED_POINT_DEFINITION => + FORMAL_ORDINARY_FIXED_POINT_DECLARATION */ + FORMAL_PACKAGE_DECLARATION; + /* FORMAL_PRIVATE_TYPE_DEFINITION => FORMAL_PRIVATE_TYPE_DECLARATION */ + /* FORMAL_SIGNED_INTEGER_TYPE_DEFINITION => + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION */ + /* FORMAL_SUBPROGRAM_DECLARATION; => + FORMAL_{FUNCTION|PROCEDURE}_DECLARATION */ + /* FORMAL_TYPE_DECLARATION; not used, replaced by the corresponding + finer grained declarations */ + /* FORMAL_TYPE_DEFINITION; not used at all; we use declarations + not definitions */ + /* FULL_TYPE_DECLARATION; not used, replaced by the corresponding + finer grained declarations */ + GENERIC_FORMAL_PART; + /* GENERIC_INSTANTIATION; => + GENERIC_{FUNCTION|PACKAGE|PROCEDURE}_INSTANTIATION */ + GENERIC_PACKAGE_DECLARATION; + /* GENERIC_RENAMING_DECLARATION; => + GENERIC_{FUNCTION|PACKAGE|PROCEDURE}_RENAMING */ + /* GENERIC_SUBPROGRAM_DECLARATION; => + GENERIC_{FUNCTION|PROCEDURE}_DECLARATION */ + GOTO_STATEMENT; + HANDLED_SEQUENCE_OF_STATEMENTS; + HANDLED_STMTS_OPT; + IF_STATEMENT; + INCOMPLETE_TYPE_DECLARATION; + INDEXED_COMPONENT; + INDEX_CONSTRAINT; + LIBRARY_ITEM; + LOOP_STATEMENT; + /* MODULAR_TYPE_DEFINITION => MODULAR_TYPE_DECLARATION */ + NAME; + NULL_STATEMENT; + NUMBER_DECLARATION; + OBJECT_DECLARATION; + OBJECT_RENAMING_DECLARATION; + OPERATOR_SYMBOL; + /* ORDINARY_FIXED_POINT_DEFINITION => ORDINARY_FIXED_POINT_DECLARATION */ + PACKAGE_BODY; + PACKAGE_BODY_STUB; + PACKAGE_RENAMING_DECLARATION; + PACKAGE_SPECIFICATION; + PARAMETER_SPECIFICATION; + // PREFIX; // not used + // PRIMARY; // not used + PRIVATE_EXTENSION_DECLARATION; + PRIVATE_TYPE_DECLARATION; + // PROCEDURE_CALL_STATEMENT; // NYI, using CALL_STATEMENT for now. + PROTECTED_BODY; + PROTECTED_BODY_STUB; + PROTECTED_TYPE_DECLARATION; + RAISE_STATEMENT; + RANGE_ATTRIBUTE_REFERENCE; + RECORD_REPRESENTATION_CLAUSE; + /* RECORD_TYPE_DEFINITION => RECORD_TYPE_DECLARATION */ + REQUEUE_STATEMENT; + RETURN_STATEMENT; + SELECTIVE_ACCEPT; + /* SELECT_ALTERNATIVE; Not used - instead, we use the finer grained rules + ACCEPT_ALTERNATIVE | DELAY_ALTERNATIVE + | TERMINATE_ALTERNATIVE */ + /* SELECT_STATEMENT; Not used - instead, we use the finer grained rules + SELECTIVE_ACCEPT | TIMED_ENTRY_CALL + | CONDITIONAL_ENTRY_CALL | ASYNCHRONOUS_SELECT */ + SEQUENCE_OF_STATEMENTS; + /* SIGNED_INTEGER_TYPE_DEFINITION => SIGNED_INTEGER_TYPE_DECLARATION */ + SINGLE_PROTECTED_DECLARATION; + SINGLE_TASK_DECLARATION; + STATEMENT; + /* SUBPROGRAM_BODY; => {FUNCTION|PROCEDURE}_BODY */ + /* SUBPROGRAM_BODY_STUB; => {FUNCTION|PROCEDURE}_BODY_STUB */ + /* SUBPROGRAM_DECLARATION; => {FUNCTION|PROCEDURE}_DECLARATION */ + /* SUBPROGRAM_RENAMING_DECLARATION; => + {FUNCTION|PROCEDURE}_RENAMING_DECLARATION */ + SUBTYPE_DECLARATION; + SUBTYPE_INDICATION; + SUBTYPE_MARK; + SUBUNIT; + TASK_BODY; + TASK_BODY_STUB; + TASK_TYPE_DECLARATION; + TERMINATE_ALTERNATIVE; + TIMED_ENTRY_CALL; + TRIGGERING_ALTERNATIVE; + /* TYPE_DECLARATION; not used, replaced by the corresponding + finer grained declarations */ + USE_CLAUSE; + USE_TYPE_CLAUSE; + VARIANT; + VARIANT_PART; + WITH_CLAUSE; + + // part 3: Non-RM synthetic tokens. + // They exist mainly to normalize the node structure with respect to + // optional items. (Without them, the presence or absence of an optional + // item would change the node layout, but we want a fixed layout.) + ABSTRACT_FUNCTION_DECLARATION; + ABSTRACT_PROCEDURE_DECLARATION; + ACCESS_TO_FUNCTION_DECLARATION; + ACCESS_TO_OBJECT_DECLARATION; + ACCESS_TO_PROCEDURE_DECLARATION; + /* ACCESS_TYPE_DECLARATION; not used, replaced by + ACCESS_TO_{FUNCTION|OBJECT|PROCEDURE}_DECLARATION + */ + ARRAY_OBJECT_DECLARATION; + ARRAY_TYPE_DECLARATION; + AND_THEN; + BASIC_DECLARATIVE_ITEMS_OPT; + BLOCK_BODY; + BLOCK_BODY_OPT; + CALL_STATEMENT; // See {PROCEDURE|ENTRY}_CALL_STATEMENT + COMPONENT_CLAUSES_OPT; + COMPONENT_ITEMS; + COND_CLAUSE; + DECIMAL_FIXED_POINT_DECLARATION; + DECLARE_OPT; + DERIVED_RECORD_EXTENSION; + // DERIVED_TYPE_DECLARATION; // not used + DISCRETE_SUBTYPE_DEF_OPT; + DISCRIMINANT_SPECIFICATIONS; + DISCRIM_PART_OPT; + ELSE_OPT; + ELSIFS_OPT; + END_ID_OPT; + ENTRY_INDEX_OPT; + ENUMERATION_TYPE_DECLARATION; + EXCEPT_HANDLER_PART_OPT; + EXTENSION_OPT; + FLOATING_POINT_DECLARATION; + /* FORMAL_ACCESS_TYPE_DECLARATION => ACCESS_TYPE_DECLARATION */ + /* FORMAL_ARRAY_TYPE_DECLARATION => ARRAY_TYPE_DECLARATION */ + FORMAL_DECIMAL_FIXED_POINT_DECLARATION; + FORMAL_DISCRETE_TYPE_DECLARATION; + FORMAL_FLOATING_POINT_DECLARATION; + FORMAL_FUNCTION_DECLARATION; + FORMAL_MODULAR_TYPE_DECLARATION; + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION; + FORMAL_ORDINARY_FIXED_POINT_DECLARATION; + FORMAL_PART_OPT; + FORMAL_PRIVATE_EXTENSION_DECLARATION; + FORMAL_PRIVATE_TYPE_DECLARATION; + FORMAL_PROCEDURE_DECLARATION; + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION; + FUNCTION_BODY; + FUNCTION_BODY_STUB; + FUNCTION_DECLARATION; + FUNCTION_RENAMING_DECLARATION; + GENERIC_FUNCTION_DECLARATION; + GENERIC_FUNCTION_INSTANTIATION; + GENERIC_FUNCTION_RENAMING; + GENERIC_PACKAGE_INSTANTIATION; + GENERIC_PACKAGE_RENAMING; + GENERIC_PROCEDURE_DECLARATION; + GENERIC_PROCEDURE_INSTANTIATION; + GENERIC_PROCEDURE_RENAMING; + GUARD_OPT; + IDENTIFIER_COLON_OPT; + ID_OPT; + INIT_OPT; + ITERATION_SCHEME_OPT; + LABEL_OPT; + MARK_WITH_CONSTRAINT; + MODIFIERS; /* Possible values: abstract access aliased all constant in + limited out private protected reverse tagged */ + MODULAR_TYPE_DECLARATION; + MOD_CLAUSE_OPT; + // NAME_OR_QUALIFIED; + NOT_IN; + ORDINARY_DERIVED_TYPE_DECLARATION; + ORDINARY_FIXED_POINT_DECLARATION; + OR_ELSE; + OR_SELECT_OPT; + PARENTHESIZED_PRIMARY; + // PARENTHESIZED_VALUES; + // PARENTHESIZED_VALUES_OPT; + PRIVATE_DECLARATIVE_ITEMS_OPT; + PRIVATE_TASK_ITEMS_OPT; + PROCEDURE_BODY; + PROCEDURE_BODY_STUB; + PROCEDURE_DECLARATION; + PROCEDURE_RENAMING_DECLARATION; + PROT_MEMBER_DECLARATIONS; + PROT_OP_BODIES_OPT; + PROT_OP_DECLARATIONS; + PROT_PRIVATE_OPT; + RANGED_EXPRS; // ugh, what an ugly name + RANGE_CONSTRAINT; + RECORD_TYPE_DECLARATION; + SELECTOR_NAMES_OPT; + SIGNED_INTEGER_TYPE_DECLARATION; + TASK_ITEMS_OPT; + UNARY_MINUS; + UNARY_PLUS; + VALUE; + VALUES; + VARIANTS; +} + +{ + ANTLR_LEXER_PREAMBLE + private: + bool lastTokenWasTicCompatible; +} + +//---------------------------------------------------------------------------- +// OPERATORS +//---------------------------------------------------------------------------- +COMMENT_INTRO : "--" {lastTokenWasTicCompatible=false;}; +DOT_DOT : ".." {lastTokenWasTicCompatible=false;}; +LT_LT : "<<" {lastTokenWasTicCompatible=false;}; +OX : "<>" {lastTokenWasTicCompatible=false;}; +GT_GT : ">>" {lastTokenWasTicCompatible=false;}; +ASSIGN : ":=" {lastTokenWasTicCompatible=false;}; +RIGHT_SHAFT : "=>" {lastTokenWasTicCompatible=false;}; +NE : "/=" {lastTokenWasTicCompatible=false;}; +LE : "<=" {lastTokenWasTicCompatible=false;}; +GE : ">=" {lastTokenWasTicCompatible=false;}; +EXPON : "**" {lastTokenWasTicCompatible=false;}; +PIPE : '|' {lastTokenWasTicCompatible=false;}; +CONCAT : '&' {lastTokenWasTicCompatible=false;}; +DOT : '.' {lastTokenWasTicCompatible=false;}; +EQ : '=' {lastTokenWasTicCompatible=false;}; +LT_ : '<' {lastTokenWasTicCompatible=false;}; +GT : '>' {lastTokenWasTicCompatible=false;}; +PLUS : '+' {lastTokenWasTicCompatible=false;}; +MINUS : '-' {lastTokenWasTicCompatible=false;}; +STAR : '*' {lastTokenWasTicCompatible=false;}; +DIV : '/' {lastTokenWasTicCompatible=false;}; +LPAREN : '(' {lastTokenWasTicCompatible=false;}; +RPAREN : ')' {lastTokenWasTicCompatible=true;}; +COLON : ':' {lastTokenWasTicCompatible=false;}; +COMMA : ',' {lastTokenWasTicCompatible=false;}; +SEMI : ';' {lastTokenWasTicCompatible=false;}; + + +// Literals. + +// Rule for IDENTIFIER: testLiterals is set to true. This means that +// after we match the rule, we look in the literals table to see if +// it's a keyword or really an identifier. +IDENTIFIER + options {testLiterals=true;} + : ( 'a'..'z' ) ( ('_')? ( 'a'..'z'|'0'..'9' ) )* + ; + +TIC_OR_CHARACTER_LITERAL : + "'"! { $setType(TIC); } ( + { ! lastTokenWasTicCompatible }? . "'"! + { $setType(CHARACTER_LITERAL); } + )? + {lastTokenWasTicCompatible=false;}; + +CHAR_STRING : '"'! ("\"\"" | ~('"'))* '"'! + {lastTokenWasTicCompatible=true;}; + +NUMERIC_LIT : ( DIGIT )+ + ( '#' BASED_INTEGER ( '.' BASED_INTEGER )? '#' + | ( '_' ( DIGIT )+ )+ // INTEGER + )? + ( { LA(2)!='.' }? //&& LA(3)!='.' }? + ( '.' ( DIGIT )+ ( '_' ( DIGIT )+ )* ( EXPONENT )? + | EXPONENT + ) + )? + {lastTokenWasTicCompatible=false;}; + +// a couple protected methods to assist in matching the various numbers + +protected +DIGIT : ( '0'..'9' ) {lastTokenWasTicCompatible=false;}; + +protected +EXPONENT : ('e') ('+'|'-')? ( DIGIT )+ {lastTokenWasTicCompatible=false;}; + +protected +EXTENDED_DIGIT : ( DIGIT | 'a'..'f' ) {lastTokenWasTicCompatible=false;}; + +protected +BASED_INTEGER : ( EXTENDED_DIGIT ) ( ('_')? EXTENDED_DIGIT )* {lastTokenWasTicCompatible=false;}; + + +// Whitespace -- ignored +WS_ : ( ' ' + | '\t' + | '\f' + // handle newlines + | ( "\r\n" // Evil DOS + | '\r' // Macintosh + | '\n' // Unix (the right way) + ) + { newline(); } + ) + { $setType(antlr::Token::SKIP); } + ; + +// Single-line comments +COMMENT : COMMENT_INTRO (~('\n'|'\r'))* ('\n'|'\r'('\n')?) + { $setType(antlr::Token::SKIP); + newline(); + lastTokenWasTicCompatible=false; } + ; + diff --git a/languages/ada/ada.store.g b/languages/ada/ada.store.g new file mode 100644 index 00000000..dbca7312 --- /dev/null +++ b/languages/ada/ada.store.g @@ -0,0 +1,610 @@ +/* $Id$ + * ANTLR Ada tree walker for building the Kdevelop class store + * Copyright (C) 2003 Oliver Kellogg <okellogg@users.sourceforge.net> + */ + +header "pre_include_hpp" { +#include <qstring.h> +#include <qstringlist.h> +#include <qfileinfo.h> + +#include <codemodel.h> +#include "AdaAST.hpp" +#include "ada_utils.hpp" +} + +header "post_include_hpp" { +#include <codemodel.h> +#include <kdebug.h> +} + +options { + language="Cpp"; +} + +class AdaStoreWalker extends AdaTreeParserSuper; +options { + importVocab = Ada; + ASTLabelType = "RefAdaAST"; +} + +{ +private: + QString m_fileName; + QValueList<NamespaceDom> m_scopeStack; + CodeModel* m_model; + QValueList<QStringList> m_imports; + NamespaceDom m_currentContainer; + int m_currentAccess; + bool m_addToStore; /* auxiliary variable: for the moment, this is `true' + only when we are in specs, not bodies. */ + bool m_isSubprogram; // auxiliary to def_id() + FileDom m_file; + +public: + void setCodeModel (CodeModel* model) { m_model = model; } + CodeModel* codeModel () { return m_model; } + const CodeModel* codeModel () const { return m_model; } + + QString fileName () const { return m_fileName; } + void setFileName (const QString& fileName) { m_fileName = fileName; } + + void init () { + m_scopeStack.clear (); + m_imports.clear (); + m_currentContainer = m_model->globalNamespace (); + m_scopeStack.append (m_currentContainer); + m_currentAccess = CodeModelItem::Public; + m_addToStore = false; + m_isSubprogram = false; + if (m_model->hasFile(m_fileName)) + m_model->removeFile (m_model->fileByName(m_fileName)); + m_file = m_model->create<FileModel>(); + m_file->setName(m_fileName); + m_model->addFile(m_file); + } + + void wipeout () { m_model->wipeout (); } +// void out () { m_store->out (); } + void removeWithReferences (const QString& fileName) { + m_model->removeFile (m_model->fileByName(fileName)); + } + NamespaceDom insertScopeContainer + (NamespaceDom scope, const QStringList & scopes ) { + QStringList::ConstIterator it = scopes.begin(); + QString prefix( *it ); + NamespaceDom ns = scope->namespaceByName( prefix ); +// kdDebug() << "insertScopeContainer begin with prefix " << prefix << endl; + if (!ns.data()) { +// kdDebug() << "insertScopeContainer: ns is empty" << endl; + ns = m_model->create<NamespaceModel>(); +// kdDebug() << "insertScopeContainer: ns created" << endl; + ns->setName( prefix ); +// kdDebug() << "insertScopeContainer: ns name set" << endl; + scope->addNamespace( ns ); +// kdDebug() << "insertScopeContainer: ns added to a scope" << endl; + + if (scope == m_model->globalNamespace()) + m_file->addNamespace( ns ); + } +// kdDebug() << "insertScopeContainer: while" << endl; + while ( ++it != scopes.end() ) { + QString nameSegment( *it ); + prefix += "." + nameSegment; +// kdDebug() << "insertScopeContainer: while prefix = " << prefix << endl; + NamespaceDom inner = scope->namespaceByName( prefix ); + if (!inner.data() ) { +// kdDebug() << "insertScopeContainer: inner is empty " << endl; + inner = m_model->create<NamespaceModel>(); +// kdDebug() << "insertScopeContainer: inner created " << endl; + inner->setName( nameSegment ); + ns->addNamespace( inner ); +// kdDebug() << "insertScopeContainer: inner added " << endl; + } + ns = inner; + } + return ns; + } + NamespaceDom defineScope( RefAdaAST namenode ) { + QStringList scopes( qnamelist( namenode ) ); +// kdDebug() << "defineScope: " << scopes.join(" ") << endl; + NamespaceDom psc = insertScopeContainer( m_currentContainer, scopes ); +// kdDebug() << "defineScope psc created" << endl; + psc->setStartPosition(namenode->getLine(), namenode->getColumn()); +// kdDebug() << "defineScope start position set" << endl; + psc->setFileName(m_fileName); +// kdDebug() << "defineScope file name set" << endl; + // psc->setEndPosition (endLine, 0); +// kdDebug() << "defineScope return" << endl; + return psc; + } +} + +/* + * Only those rules that require specific action for the kdevelop + * class store are overloaded here. + */ + +compilation_unit + : { init(); } + context_items_opt ( library_item | subunit ) ( pragma )* + ; + + +with_clause + : #(WITH_CLAUSE ( compound_name + // TBD: slurp in the actual files + )+ ) + ; + +/* +compound_name + : IDENTIFIER + | #(DOT compound_name IDENTIFIER) + ; + */ + +use_clause + : #(USE_TYPE_CLAUSE ( subtype_mark )+ ) + | #(USE_CLAUSE ( c:compound_name + { m_imports.back ().push_back (qtext (#c)); } + )+ ) + ; + + +library_item : + #(LIBRARY_ITEM + #(MODIFIERS ( PRIVATE { m_currentAccess = CodeModelItem::Protected; } )? ) + ( lib_subprog_decl_or_rename_or_inst_or_body + | #(PACKAGE_BODY pb:def_id pkg_body_part) + | #(GENERIC_PACKAGE_INSTANTIATION gpi:def_id + { + defineScope( #gpi ); + } + generic_inst + ) + | #(PACKAGE_SPECIFICATION ps:def_id + { + NamespaceDom psc = defineScope( #ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + } + pkg_spec_part + { + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setEndPosition (endLine, 0); + m_addToStore = false; + } + ) + | #(PACKAGE_RENAMING_DECLARATION prd:def_id + { + defineScope( #prd ); + } + renames + ) + | generic_decl + ) + ) + ; + + +subprog_def_id + : { m_isSubprogram = true; } + def_id + { m_isSubprogram = false; } + ; + +subprog_decl + : #(GENERIC_PROCEDURE_INSTANTIATION subprog_def_id generic_inst) + | #(PROCEDURE_RENAMING_DECLARATION subprog_def_id formal_part_opt renames) + | #(PROCEDURE_DECLARATION subprog_def_id formal_part_opt) + | #(PROCEDURE_BODY_STUB subprog_def_id formal_part_opt) + | #(ABSTRACT_PROCEDURE_DECLARATION subprog_def_id formal_part_opt) + | #(GENERIC_FUNCTION_INSTANTIATION def_designator generic_inst) + | #(FUNCTION_RENAMING_DECLARATION def_designator function_tail renames) + | #(FUNCTION_DECLARATION def_designator function_tail) + | #(FUNCTION_BODY_STUB def_designator function_tail) + | #(ABSTRACT_FUNCTION_DECLARATION subprog_def_id function_tail) + ; + + +def_id + : cn:compound_name + { +// kdDebug() << "cn:compound_name started " << endl; + if (m_addToStore) { +// kdDebug() << "cn:compound_name m_addToStore " << endl; + if (m_isSubprogram) { +// kdDebug() << "cn:compound_name m_isSubprogram " << endl; + FunctionDom method = m_model->create<FunctionModel>(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); +// kdDebug() << "cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(#cn->getLine(), #cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel +/* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete (method); + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } else { + // TBC: what about other declarations? + } + } + } + ; + +/* +generic_inst : compound_name ( value_s )? + ; + */ + +/* +formal_part_opt : #(FORMAL_PART_OPT ( parameter_specification )* ) + ; + */ + +/* +parameter_specification + : #(PARAMETER_SPECIFICATION defining_identifier_list modifiers + subtype_mark init_opt) + ; + */ + +/* +defining_identifier_list : #(DEFINING_IDENTIFIER_LIST ( IDENTIFIER )+ ) + ; + */ + +/* +renames : CHARACTER_STRING // CHARACTER_STRING should not really be there. + | OPERATOR_SYMBOL // OPERATOR_SYMBOL should be used instead. + | name + ; + */ + +/* +name : IDENTIFIER + | #(DOT name + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name value_s) + | #(TIC name attribute_id) + ; + */ + +def_designator + : cn:compound_name + { +// kdDebug() << "def_designator cn:compound_name started" << endl; + if (m_addToStore) { +// kdDebug() << "def_designator cn:compound_name m_addToStore" << endl; + FunctionDom method = m_model->create<FunctionModel>(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); +// kdDebug() << "def_designator cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(#cn->getLine(), #cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel +/* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete method; + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } + } + | definable_operator_symbol + ; + +/* +function_tail : formal_part_opt subtype_mark + ; + */ + +spec_decl_part + : #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst) + | #(PACKAGE_SPECIFICATION ps:def_id + { + NamespaceDom psc = defineScope( #ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + } + pkg_spec_part + { + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + } + ) + | #(PACKAGE_RENAMING_DECLARATION def_id renames) + ; + +pkg_spec_part : + basic_declarative_items_opt + private_declarative_items_opt + end_id_opt + ; + +private_declarative_items_opt + : ( { m_currentAccess = CodeModelItem::Protected; } + ( basic_decl_item | pragma )+ + { m_currentAccess = CodeModelItem::Public; } + )? + ; + +/* +task_type_or_single_decl + : #(TASK_TYPE_DECLARATION def_id discrim_part_opt task_definition_opt) + | #(SINGLE_TASK_DECLARATION def_id task_definition_opt) + ; + */ + +/* +discriminant_specification + : #(DISCRIMINANT_SPECIFICATION defining_identifier_list + modifiers subtype_mark init_opt) + ; + */ + +/* +entry_declaration + : #(ENTRY_DECLARATION IDENTIFIER + discrete_subtype_def_opt formal_part_opt) + ; + */ + +/* +prot_op_decl + : entry_declaration + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | #(FUNCTION_DECLARATION def_designator function_tail) + | rep_spec + | pragma + ; + */ + +/* +prot_member_decl_s + : #(PROT_MEMBER_DECLARATIONS ( prot_op_decl | comp_decl )* ) + ; + +comp_decl + : #(COMPONENT_DECLARATION defining_identifier_list component_subtype_def init_opt) + ; + */ + +/* +// decl_common is shared between declarative_item and basic_decl_item. +// decl_common only contains specifications. +decl_common + : // type_def: + #(ENUMERATION_TYPE_DECLARATION IDENTIFIER enum_id_s) + | #(SIGNED_INTEGER_TYPE_DECLARATION IDENTIFIER range) + | #(MODULAR_TYPE_DECLARATION IDENTIFIER expression) + | #(FLOATING_POINT_DECLARATION IDENTIFIER expression range_constraint_opt) + | #(ORDINARY_FIXED_POINT_DECLARATION IDENTIFIER expression range) + | #(DECIMAL_FIXED_POINT_DECLARATION IDENTIFIER expression expression range_constraint_opt) + | array_type_declaration + | access_type_declaration + // + | #(INCOMPLETE_TYPE_DECLARATION IDENTIFIER discrim_part_opt) + // derived_or_private_or_record + | #(PRIVATE_EXTENSION_DECLARATION id_and_discrim modifiers subtype_ind) + | #(DERIVED_RECORD_EXTENSION id_and_discrim modifiers subtype_ind record_definition) + | #(ORDINARY_DERIVED_TYPE_DECLARATION id_and_discrim subtype_ind) + | #(PRIVATE_TYPE_DECLARATION id_and_discrim modifiers) + | #(RECORD_TYPE_DECLARATION id_and_discrim modifiers record_definition) + // + | #(SUBTYPE_DECLARATION IDENTIFIER subtype_ind) + | generic_decl + | use_clause + | rep_spec // enumeration_representation_clause only + | #(EXCEPTION_RENAMING_DECLARATION def_id compound_name) + | #(OBJECT_RENAMING_DECLARATION def_id subtype_mark name) + | #(EXCEPTION_DECLARATION defining_identifier_list) + | #(NUMBER_DECLARATION defining_identifier_list expression) + | #(ARRAY_OBJECT_DECLARATION defining_identifier_list modifiers + array_type_definition init_opt) + | #(OBJECT_DECLARATION defining_identifier_list modifiers + subtype_ind init_opt) + ; + */ + +/* +id_and_discrim + : IDENTIFIER discrim_part_opt + ; + */ + +/* +enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL + ; + */ + +/* +array_type_declaration + : #(ARRAY_TYPE_DECLARATION IDENTIFIER array_type_definition) + ; + */ + +/* +access_type_declaration + : #(ACCESS_TO_PROCEDURE_DECLARATION IDENTIFIER modifiers formal_part_opt) + | #(ACCESS_TO_FUNCTION_DECLARATION IDENTIFIER modifiers function_tail) + | #(ACCESS_TO_OBJECT_DECLARATION IDENTIFIER modifiers subtype_ind) + ; + */ + + +generic_decl + : #(GENERIC_PACKAGE_RENAMING generic_formal_part_opt def_id renames) + | #(GENERIC_PACKAGE_DECLARATION generic_formal_part_opt gpd:def_id + { + NamespaceDom psc = defineScope( #gpd ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + } + pkg_spec_part + { + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) + m_scopeStack.append( m_model->globalNamespace() ); + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + } + ) + | #(GENERIC_PROCEDURE_RENAMING generic_formal_part_opt def_id + formal_part_opt renames) + | #(GENERIC_PROCEDURE_DECLARATION generic_formal_part_opt subprog_def_id + formal_part_opt) + | #(GENERIC_FUNCTION_RENAMING generic_formal_part_opt def_designator + function_tail renames) + | #(GENERIC_FUNCTION_DECLARATION generic_formal_part_opt subprog_def_id + function_tail) + ; + +/* +generic_formal_part_opt + : #(GENERIC_FORMAL_PART + ( pragma | use_clause | generic_formal_parameter )* + ) + ; + */ + +/* +generic_formal_parameter + : // FORMAL_TYPE_DECLARATIONs: + #(FORMAL_DISCRETE_TYPE_DECLARATION def_id) + | #(FORMAL_SIGNED_INTEGER_TYPE_DECLARATION def_id) + | #(FORMAL_MODULAR_TYPE_DECLARATION def_id) + | #(FORMAL_DECIMAL_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_ORDINARY_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_FLOATING_POINT_DECLARATION def_id) + | formal_array_type_declaration + | formal_access_type_declaration + | #(FORMAL_PRIVATE_TYPE_DECLARATION id_part modifiers) + | #(FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION id_part subtype_ind) + | #(FORMAL_PRIVATE_EXTENSION_DECLARATION id_part modifiers subtype_ind) + | #(FORMAL_PROCEDURE_DECLARATION def_id formal_part_opt + subprogram_default_opt) + | #(FORMAL_FUNCTION_DECLARATION def_designator function_tail + subprogram_default_opt) + | #(FORMAL_PACKAGE_DECLARATION def_id compound_name formal_package_actual_part_opt) + | parameter_specification + ; + */ + +lib_subprog_decl_or_rename_or_inst_or_body + : { m_addToStore = true; } + ( subprog_decl + | procedure_body + | function_body + ) + { m_addToStore = false; } + ; + +subprog_decl_or_rename_or_inst_or_body + : subprog_decl + | procedure_body + | function_body + ; + + +/* +// A declarative_item may appear in the declarative part of any body. +declarative_item + : #(PACKAGE_BODY_STUB def_id) + | #(PACKAGE_BODY def_id pkg_body_part) + | spec_decl_part + | #(TASK_BODY_STUB def_id) + | #(TASK_BODY def_id body_part) + | task_type_or_single_decl + | #(PROTECTED_BODY_STUB def_id) + | #(PROTECTED_BODY def_id prot_op_bodies_opt) + | prot_type_or_single_decl + | subprog_decl_or_rename_or_inst_or_body + | decl_common + ; + */ + + +subprog_decl_or_body + : procedure_body + | #(PROCEDURE_DECLARATION subprog_def_id formal_part_opt) + | function_body + | #(FUNCTION_DECLARATION def_designator function_tail) + ; + +/* +// Temporary, to be turned into just `qualified'. +// We get away with it because `qualified' is always mentioned +// together with `name'. +// Only exception: `code_stmt', which is not yet implemented. +name_or_qualified + : IDENTIFIER + | #(DOT name_or_qualified + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name_or_qualified value_s) + | #(TIC name_or_qualified + ( parenthesized_primary + | attribute_id + ) + ) + ; + */ + +package_body + : #(PACKAGE_BODY id:def_id + /* TBD + { QString name (qtext (id)); + } + */ + pkg_body_part) + ; + +/* +task_body : #(TASK_BODY def_id body_part) + ; + */ + +/* +protected_body : #(PROTECTED_BODY def_id prot_op_bodies_opt) + ; + */ + diff --git a/languages/ada/ada.tree.g b/languages/ada/ada.tree.g new file mode 100644 index 00000000..df167dcd --- /dev/null +++ b/languages/ada/ada.tree.g @@ -0,0 +1,964 @@ +/* + * ANTLR Ada95 tree super grammar (base class) + * + * Oliver M. Kellogg <okellogg@users.sourceforge.net> + * + * $Id$ + * + */ + + +options { + language="Cpp"; +} + +class AdaTreeParserSuper extends TreeParser; +options { + importVocab=Ada; +} + +// Compilation Unit: This is the start rule. + +compilation_unit + : context_items_opt ( library_item | subunit ) ( pragma )* + ; + +pragma : #(PRAGMA IDENTIFIER ( pragma_arg )* ) + ; + +pragma_arg + : #(RIGHT_SHAFT IDENTIFIER expression) + | expression + ; + +context_items_opt + : #(CONTEXT_CLAUSE ( pragma | with_clause | use_clause )* ) + ; + +with_clause + : #(WITH_CLAUSE ( compound_name )+ ) + ; + +compound_name + : IDENTIFIER + | #(DOT compound_name IDENTIFIER) + ; + +use_clause + : #(USE_TYPE_CLAUSE ( subtype_mark )+ ) + | #(USE_CLAUSE ( compound_name )+ ) + ; + +subtype_mark + : compound_name + | #(TIC compound_name attribute_id) + ; + +attribute_id : RANGE + | DIGITS + | DELTA + | ACCESS + | IDENTIFIER + ; + +library_item : + #(LIBRARY_ITEM modifiers + ( subprog_decl_or_rename_or_inst_or_body + | #(PACKAGE_BODY def_id pkg_body_part) + | #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst) + | #(PACKAGE_SPECIFICATION def_id pkg_spec_part) + | #(PACKAGE_RENAMING_DECLARATION def_id renames) + | generic_decl + ) + ) + ; + +modifiers : #(MODIFIERS + ( ABSTRACT + | ACCESS + | ALIASED + | ALL + | CONSTANT + | IN + | LIMITED + | OUT + | PRIVATE + | PROTECTED + | REVERSE + | TAGGED + )* + // We can afford to be this loose because the parser + // has already fended off illegal usages, i.e. we can + // be sure that we are only dealing with permissible + // values for each usage context here. + // Only exception: PRIVATE as the prefix of private + // {generic|package|subprogram} library-level decl. + // The parser has let this in for bodies as well + // (which is not legal), so we need a semantic check. + ) + ; + +id_opt : #(ID_OPT ( def_designator )? ) + ; + +end_id_opt : #(END ( def_designator )? ) + ; + +subprog_decl + : #(GENERIC_PROCEDURE_INSTANTIATION def_id generic_inst) + | #(PROCEDURE_RENAMING_DECLARATION def_id formal_part_opt renames) + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | #(PROCEDURE_BODY_STUB def_id formal_part_opt) + | #(ABSTRACT_PROCEDURE_DECLARATION def_id formal_part_opt) + | #(GENERIC_FUNCTION_INSTANTIATION def_designator generic_inst) + | #(FUNCTION_RENAMING_DECLARATION def_designator function_tail renames) + | #(FUNCTION_DECLARATION def_designator function_tail) + | #(FUNCTION_BODY_STUB def_designator function_tail) + | #(ABSTRACT_FUNCTION_DECLARATION def_id function_tail) + ; + +def_id : compound_name // Can afford looseness because parser is tight. + ; + +generic_inst : compound_name ( value_s )? + ; + +value : #(OTHERS expression) + | #(RIGHT_SHAFT ranged_expr_s expression) + | ranged_expr_s + ; + +ranged_expr_s + : #(PIPE ranged_expr_s ranged_expr) + | ranged_expr + ; + +ranged_expr + : #(DOT_DOT expression simple_expression) + | #(RANGE expression range) + | expression + ; + +range_constraint : #(RANGE_CONSTRAINT range) + ; + +range : ( range_dots + | range_attrib_ref + ) + ; + +range_dots : #(DOT_DOT simple_expression simple_expression) + ; + +range_attrib_ref : #(RANGE_ATTRIBUTE_REFERENCE prefix ( expression )? ) + ; + +prefix : IDENTIFIER + | #(DOT prefix ( ALL | IDENTIFIER ) ) + | #(INDEXED_COMPONENT prefix value_s ) + ; + +formal_part_opt : #(FORMAL_PART_OPT ( parameter_specification )* ) + ; + +parameter_specification + : #(PARAMETER_SPECIFICATION defining_identifier_list modifiers + subtype_mark init_opt) + ; + +defining_identifier_list : #(DEFINING_IDENTIFIER_LIST ( IDENTIFIER )+ ) + ; + +renames : CHARACTER_STRING // CHARACTER_STRING should not really be there. + | OPERATOR_SYMBOL // OPERATOR_SYMBOL should be used instead. + | name + ; + +name : IDENTIFIER + | #(DOT name + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name value_s) + | #(TIC name attribute_id) + ; + +definable_operator_symbol : OPERATOR_SYMBOL + ; + +parenthesized_primary + : #(PARENTHESIZED_PRIMARY ( NuLL | value_s extension_opt ) ) + ; + +extension_opt : #(EXTENSION_OPT ( NuLL | value_s )? ) + ; + +def_designator + : compound_name + | definable_operator_symbol + ; + +function_tail : formal_part_opt subtype_mark + ; + +spec_decl_part + : #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst) + | #(PACKAGE_SPECIFICATION def_id pkg_spec_part) + | #(PACKAGE_RENAMING_DECLARATION def_id renames) + ; + +pkg_spec_part + : basic_declarative_items_opt + private_declarative_items_opt + end_id_opt + ; + +basic_declarative_items_opt + : #(BASIC_DECLARATIVE_ITEMS_OPT ( basic_decl_item )* ) + ; + +private_declarative_items_opt + : #(PRIVATE_DECLARATIVE_ITEMS_OPT ( basic_decl_item )* ) + ; + +basic_decl_item + : spec_decl_part + | task_type_or_single_decl + | prot_type_or_single_decl + | subprog_decl + | decl_common + ; + +task_type_or_single_decl + : #(TASK_TYPE_DECLARATION def_id discrim_part_opt task_definition_opt) + | #(SINGLE_TASK_DECLARATION def_id task_definition_opt) + ; + +task_definition_opt + : task_items_opt private_task_items_opt + ; + +discrim_part_opt + : #(DISCRIM_PART_OPT ( BOX | discriminant_specifications )? ) + ; + +discriminant_specifications + : #(DISCRIMINANT_SPECIFICATIONS ( discriminant_specification )* ) + ; + +discriminant_specification + : #(DISCRIMINANT_SPECIFICATION defining_identifier_list + modifiers subtype_mark init_opt) + ; + +init_opt : #(INIT_OPT ( expression )? ) + ; // `expression' is of course much too loose; + // semantic checks are required in the usage contexts. + +task_items_opt + : #(TASK_ITEMS_OPT entrydecls_repspecs_opt) + ; + +entrydecls_repspecs_opt + : ( entry_declaration | pragma | rep_spec )* + ; + +entry_declaration + : #(ENTRY_DECLARATION IDENTIFIER + discrete_subtype_def_opt formal_part_opt) + ; + +discrete_subtype_def_opt + : #(DISCRETE_SUBTYPE_DEF_OPT ( discrete_subtype_definition )? ) + ; + +discrete_subtype_definition // TBD + : range + | subtype_ind + ; + +rep_spec : #(RECORD_REPRESENTATION_CLAUSE subtype_mark align_opt comp_loc_s) + | #(AT_CLAUSE subtype_mark expression) + | #(ATTRIBUTE_DEFINITION_CLAUSE subtype_mark expression) + // attrib_def. Semantic check must ensure that the + // subtype_mark contains an attribute reference. + | #(ENUMERATION_REPESENTATION_CLAUSE local_enum_name enumeration_aggregate) + ; + +align_opt : #(MOD_CLAUSE_OPT ( expression )? ) + ; + +comp_loc_s + : #(COMPONENT_CLAUSES_OPT + ( pragma + | subtype_mark expression range + )* + ) + ; + +private_task_items_opt + : #(PRIVATE_TASK_ITEMS_OPT entrydecls_repspecs_opt ) + ; + +prot_type_or_single_decl + : #(PROTECTED_TYPE_DECLARATION def_id discrim_part_opt protected_definition) + | #(SINGLE_PROTECTED_DECLARATION def_id protected_definition) + ; + +prot_private_opt : #(PROT_PRIVATE_OPT ( prot_member_decl_s )? ) + ; + +protected_definition + : prot_op_decl_s prot_private_opt end_id_opt + ; + +prot_op_decl_s + : #(PROT_OP_DECLARATIONS ( prot_op_decl )* ) + ; + +prot_op_decl + : entry_declaration + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | #(FUNCTION_DECLARATION def_designator function_tail) + | rep_spec + | pragma + ; + +prot_member_decl_s + : #(PROT_MEMBER_DECLARATIONS ( prot_op_decl | comp_decl )* ) + ; + +comp_decl + : #(COMPONENT_DECLARATION defining_identifier_list component_subtype_def init_opt) + ; + +// decl_common is shared between declarative_item and basic_decl_item. +// decl_common only contains specifications. +decl_common + : // type_def: + #(ENUMERATION_TYPE_DECLARATION IDENTIFIER enum_id_s) + | #(SIGNED_INTEGER_TYPE_DECLARATION IDENTIFIER range) + | #(MODULAR_TYPE_DECLARATION IDENTIFIER expression) + | #(FLOATING_POINT_DECLARATION IDENTIFIER expression range_constraint_opt) + | #(ORDINARY_FIXED_POINT_DECLARATION IDENTIFIER expression range) + | #(DECIMAL_FIXED_POINT_DECLARATION IDENTIFIER expression expression range_constraint_opt) + | array_type_declaration + | access_type_declaration + // + | #(INCOMPLETE_TYPE_DECLARATION IDENTIFIER discrim_part_opt) + // derived_or_private_or_record + | #(PRIVATE_EXTENSION_DECLARATION id_and_discrim modifiers subtype_ind) + | #(DERIVED_RECORD_EXTENSION id_and_discrim modifiers subtype_ind record_definition) + | #(ORDINARY_DERIVED_TYPE_DECLARATION id_and_discrim subtype_ind) + | #(PRIVATE_TYPE_DECLARATION id_and_discrim modifiers) + | #(RECORD_TYPE_DECLARATION id_and_discrim modifiers record_definition) + // + | #(SUBTYPE_DECLARATION IDENTIFIER subtype_ind) + | generic_decl + | use_clause + | rep_spec // enumeration_representation_clause only + | #(EXCEPTION_RENAMING_DECLARATION def_id compound_name) + | #(OBJECT_RENAMING_DECLARATION def_id subtype_mark name) + | #(EXCEPTION_DECLARATION defining_identifier_list) + | #(NUMBER_DECLARATION defining_identifier_list expression) + | #(ARRAY_OBJECT_DECLARATION defining_identifier_list modifiers + array_type_definition init_opt) + | #(OBJECT_DECLARATION defining_identifier_list modifiers + subtype_ind init_opt) + ; + +id_and_discrim + : IDENTIFIER discrim_part_opt + ; + +enum_id_s : ( enumeration_literal_specification )+ + ; + +enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL + ; + +array_type_definition + : index_or_discrete_range_s component_subtype_def + ; + +range_constraint_opt : ( range_constraint )? + ; + +array_type_declaration + : #(ARRAY_TYPE_DECLARATION IDENTIFIER array_type_definition) + ; + +index_or_discrete_range_s + : index_or_discrete_range + | #(COMMA index_or_discrete_range_s index_or_discrete_range) + ; + +index_or_discrete_range + : #(DOT_DOT simple_expression simple_expression) + | #(RANGE simple_expression ( BOX | range) ) + | simple_expression + ; + +component_subtype_def : modifiers subtype_ind // mod=aliased_opt + ; + +subtype_ind + : #(SUBTYPE_INDICATION subtype_mark constraint_opt) + ; + +constraint_opt + : ( range_constraint + | digits_constraint + | delta_constraint + | index_constraint + | discriminant_constraint + )? + ; + +digits_constraint + : #(DIGITS_CONSTRAINT expression range_constraint_opt) + ; + +delta_constraint + : #(DELTA_CONSTRAINT expression range_constraint_opt) + ; + +index_constraint + : #(INDEX_CONSTRAINT ( discrete_range )+ ) + ; + +discrete_range + : range + | subtype_ind + ; + +discriminant_constraint + : #(DISCRIMINANT_CONSTRAINT ( discriminant_association )+ ) + ; + +discriminant_association + : #(DISCRIMINANT_ASSOCIATION selector_names_opt expression) + ; + +selector_names_opt + : #(SELECTOR_NAMES_OPT ( selector_name )* ) + ; + +selector_name : IDENTIFIER // TBD: sem pred + ; + +access_type_declaration + : #(ACCESS_TO_PROCEDURE_DECLARATION IDENTIFIER modifiers formal_part_opt) + | #(ACCESS_TO_FUNCTION_DECLARATION IDENTIFIER modifiers function_tail) + | #(ACCESS_TO_OBJECT_DECLARATION IDENTIFIER modifiers subtype_ind) + ; + +record_definition : ( component_list )? + ; + +component_list + : component_items ( variant_part )? + ; + +component_items + : #(COMPONENT_ITEMS ( pragma | comp_decl )* ) + ; + +variant_part + : #(VARIANT_PART discriminant_direct_name variant_s) + ; + +discriminant_direct_name : IDENTIFIER // TBD: symtab lookup. + ; + +variant_s : #(VARIANTS ( variant )+ ) + ; + +variant : #(VARIANT choice_s ( component_list )? ) + ; + +choice_s : #(PIPE choice_s choice ) + | choice + ; + +choice : OTHERS + | discrete_with_range + | expression + ; + +discrete_with_range : mark_with_constraint | range + ; + +mark_with_constraint + : #(MARK_WITH_CONSTRAINT subtype_mark range_constraint) + ; + +local_enum_name : IDENTIFIER // to be refined: do a symbol table lookup + ; + +enumeration_aggregate : ( value )* + ; + +generic_decl + : #(GENERIC_PACKAGE_RENAMING generic_formal_part_opt def_id renames) + | #(GENERIC_PACKAGE_DECLARATION generic_formal_part_opt def_id + pkg_spec_part) + | #(GENERIC_PROCEDURE_RENAMING generic_formal_part_opt def_id + formal_part_opt renames) + | #(GENERIC_PROCEDURE_DECLARATION generic_formal_part_opt def_id + formal_part_opt) + | #(GENERIC_FUNCTION_RENAMING generic_formal_part_opt def_designator + function_tail renames) + | #(GENERIC_FUNCTION_DECLARATION generic_formal_part_opt def_id + function_tail) + ; + +generic_formal_part_opt + : #(GENERIC_FORMAL_PART + ( pragma | use_clause | generic_formal_parameter )* + ) + ; + +generic_formal_parameter + : // FORMAL_TYPE_DECLARATIONs: + #(FORMAL_DISCRETE_TYPE_DECLARATION def_id) + | #(FORMAL_SIGNED_INTEGER_TYPE_DECLARATION def_id) + | #(FORMAL_MODULAR_TYPE_DECLARATION def_id) + | #(FORMAL_DECIMAL_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_ORDINARY_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_FLOATING_POINT_DECLARATION def_id) + | formal_array_type_declaration + | formal_access_type_declaration + | #(FORMAL_PRIVATE_TYPE_DECLARATION id_part modifiers) + | #(FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION id_part subtype_ind) + | #(FORMAL_PRIVATE_EXTENSION_DECLARATION id_part modifiers subtype_ind) + | #(FORMAL_PROCEDURE_DECLARATION def_id formal_part_opt + subprogram_default_opt) + | #(FORMAL_FUNCTION_DECLARATION def_designator function_tail + subprogram_default_opt) + | #(FORMAL_PACKAGE_DECLARATION def_id compound_name formal_package_actual_part_opt) + | parameter_specification + ; + + +id_part : def_id discrim_part_opt + ; + +formal_array_type_declaration : array_type_declaration + ; + +formal_access_type_declaration : access_type_declaration + ; + +subprogram_default_opt : ( BOX | name )? + // #(SUBPROGRAM_DEFAULT_OPT ( BOX | name )? ) + ; + +formal_package_actual_part_opt + : ( BOX | defining_identifier_list )? + ; + +subprog_decl_or_rename_or_inst_or_body + : subprog_decl + | procedure_body + | function_body + ; + +procedure_body + : #(PROCEDURE_BODY def_id formal_part_opt body_part) + ; + +function_body + : #(FUNCTION_BODY def_designator function_tail body_part) + ; + +body_part : declarative_part block_body end_id_opt + ; + +declarative_part + : #(DECLARATIVE_PART ( pragma | declarative_item )* ) + ; + +// A declarative_item may appear in the declarative part of any body. +declarative_item + : #(PACKAGE_BODY_STUB def_id) + | #(PACKAGE_BODY def_id pkg_body_part) + | spec_decl_part + | #(TASK_BODY_STUB def_id) + | #(TASK_BODY def_id body_part end_id_opt) + | task_type_or_single_decl + | #(PROTECTED_BODY_STUB def_id) + | #(PROTECTED_BODY def_id prot_op_bodies_opt end_id_opt) + | prot_type_or_single_decl + | subprog_decl_or_rename_or_inst_or_body + | decl_common + ; + +pkg_body_part : declarative_part block_body_opt end_id_opt + ; + +block_body_opt + : #(BLOCK_BODY_OPT ( handled_stmt_s )? ) + ; + +prot_op_bodies_opt + : #(PROT_OP_BODIES_OPT + ( pragma | entry_body | subprog_decl_or_body )* + ) + ; + +subprog_decl_or_body + : procedure_body + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | function_body + | #(FUNCTION_DECLARATION def_designator function_tail) + ; + +block_body : #(BLOCK_BODY handled_stmt_s) + ; + +handled_stmt_s + : #(HANDLED_SEQUENCE_OF_STATEMENTS statements except_handler_part_opt) + ; + +handled_stmts_opt + : #(HANDLED_STMTS_OPT ( statements except_handler_part_opt )? ) + ; + +statements + : #(SEQUENCE_OF_STATEMENTS ( pragma | statement )+ ) + ; + +statement : #(STATEMENT def_label_opt + ( null_stmt + | exit_stmt + | return_stmt + | goto_stmt + | delay_stmt + | abort_stmt + | raise_stmt + | requeue_stmt + | accept_stmt + | select_stmt + | if_stmt + | case_stmt + | loop_stmt id_opt + | block end_id_opt + | call_or_assignment + // | code_stmt // not yet implemented in parser + ) + ) + ; + +def_label_opt : #(LABEL_OPT ( IDENTIFIER )? ) + ; + +null_stmt : NULL_STATEMENT + ; + +if_stmt : #(IF_STATEMENT cond_clause elsifs_opt else_opt) + ; + +cond_clause : #(COND_CLAUSE condition statements) + ; + +condition : expression + ; + +elsifs_opt : #(ELSIFS_OPT ( cond_clause )* ) + ; + +else_opt : #(ELSE_OPT ( statements )? ) + ; + +case_stmt : #(CASE_STATEMENT expression alternative_s) + ; + +alternative_s : ( case_statement_alternative )+ + ; + +case_statement_alternative + : #(CASE_STATEMENT_ALTERNATIVE choice_s statements) + ; + +loop_stmt + : #(LOOP_STATEMENT iteration_scheme_opt statements) + ; + +iteration_scheme_opt + : #(ITERATION_SCHEME_OPT + ( #(WHILE condition) + | #(FOR IDENTIFIER modifiers discrete_subtype_definition) + )? // mod=reverse_opt + ) + ; + +block : #(BLOCK_STATEMENT declare_opt block_body) + ; + +declare_opt + : #(DECLARE_OPT ( declarative_part )? ) + ; + +exit_stmt + : #(EXIT_STATEMENT ( label_name )? ( WHEN condition )? ) // TBD !!! + ; + +label_name : IDENTIFIER + ; + +return_stmt + : #(RETURN_STATEMENT ( expression )? ) + ; + +goto_stmt : #(GOTO_STATEMENT label_name) + ; + +call_or_assignment + : #(ASSIGNMENT_STATEMENT name expression) + | #(CALL_STATEMENT name) + ; + +entry_body + : #(ENTRY_BODY def_id entry_body_formal_part entry_barrier body_part) + ; + +entry_body_formal_part : entry_index_spec_opt formal_part_opt + ; + +entry_index_spec_opt + : #(ENTRY_INDEX_SPECIFICATION ( def_id discrete_subtype_definition )? ) + ; + +entry_barrier : condition + ; + +entry_call_stmt + : #(ENTRY_CALL_STATEMENT name) + ; + +accept_stmt + : #(ACCEPT_STATEMENT def_id entry_index_opt formal_part_opt + handled_stmts_opt end_id_opt ) + ; + +entry_index_opt + : #(ENTRY_INDEX_OPT ( expression )? ) + ; + +delay_stmt + : #(DELAY_STATEMENT modifiers expression) //mod=until_opt + ; + +// SELECT_STATEMENT itself is not modeled since it is trivially +// reconstructed: +// select_statement ::= selective_accept | timed_entry_call +// | conditional_entry_call | asynchronous_select +// +select_stmt + : #(ASYNCHRONOUS_SELECT triggering_alternative abortable_part) + | #(SELECTIVE_ACCEPT selective_accept) + | #(TIMED_ENTRY_CALL entry_call_alternative delay_alternative) + | #(CONDITIONAL_ENTRY_CALL entry_call_alternative statements) + ; + +triggering_alternative + : #(TRIGGERING_ALTERNATIVE + ( delay_stmt | entry_call_stmt ) stmts_opt + ) + ; + +abortable_part + : #(ABORTABLE_PART stmts_opt) + ; + +entry_call_alternative + : #(ENTRY_CALL_ALTERNATIVE entry_call_stmt stmts_opt) + ; + +selective_accept : guard_opt select_alternative or_select_opt else_opt + ; + +guard_opt : #(GUARD_OPT ( condition ( pragma )* )? ) + ; + +select_alternative + : accept_alternative + | delay_alternative + | TERMINATE_ALTERNATIVE + ; + +accept_alternative + : #(ACCEPT_ALTERNATIVE accept_stmt stmts_opt) + ; + +delay_alternative + : #(DELAY_ALTERNATIVE delay_stmt stmts_opt) + ; + +stmts_opt : ( pragma | statement )* + ; + +or_select_opt + : #(OR_SELECT_OPT ( guard_opt select_alternative )* ) + ; + +abort_stmt + : #(ABORT_STATEMENT ( name )+ ) + ; + +except_handler_part_opt + : #(EXCEPT_HANDLER_PART_OPT ( exception_handler )* ) + ; + +exception_handler + : #(EXCEPTION_HANDLER identifier_colon_opt except_choice_s + statements + ) + ; + +identifier_colon_opt + : #(IDENTIFIER_COLON_OPT ( IDENTIFIER )? ) + ; + +except_choice_s + : #(PIPE except_choice_s exception_choice) + | exception_choice + ; + +exception_choice : compound_name + | OTHERS + ; + +raise_stmt + : #(RAISE_STATEMENT ( compound_name )? ) + ; + +requeue_stmt + : #(REQUEUE_STATEMENT name ( ABORT )? ) + ; + +operator_call : #(OPERATOR_SYMBOL value_s) + ; + +value_s : #(VALUES ( value )+ ) + ; + +expression + : #(AND expression relation) + | #(AND_THEN expression relation) + | #(OR expression relation) + | #(OR_ELSE expression relation) + | #(XOR expression relation) + | relation + ; + +relation + : #(IN simple_expression range_or_mark) + | #(NOT_IN simple_expression range_or_mark) + | #(EQ simple_expression simple_expression) + | #(NE simple_expression simple_expression) + | #(LT_ simple_expression simple_expression) + | #(LE simple_expression simple_expression) + | #(GT simple_expression simple_expression) + | #(GE simple_expression simple_expression) + | simple_expression + ; + +range_or_mark + : range + | subtype_mark + ; + +simple_expression + : #(PLUS simple_expression signed_term) + | #(MINUS simple_expression signed_term) + | #(CONCAT simple_expression signed_term) + | signed_term + ; + +signed_term + : #(UNARY_PLUS term) + | #(UNARY_MINUS term) + | term + ; + +term : #(STAR term factor) + | #(DIV term factor) + | #(MOD term factor) + | #(REM term factor) + | factor + ; + +factor : #(NOT primary) + | #(ABS primary) + | #(EXPON primary primary) + | primary + ; + +primary : + ( name_or_qualified + | parenthesized_primary + | allocator + | NuLL + | NUMERIC_LIT + | CHARACTER_LITERAL + | CHAR_STRING + | operator_call + ) + ; + +// Temporary, to be turned into just `qualified'. +// We get away with it because `qualified' is always mentioned +// together with `name'. +// Only exception: `code_stmt', which is not yet implemented. +name_or_qualified + : IDENTIFIER + | #(DOT name_or_qualified + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name_or_qualified value_s) + | #(TIC name_or_qualified + ( parenthesized_primary + | attribute_id + ) + ) + ; + +allocator : #(ALLOCATOR name_or_qualified) + ; + +subunit : #(SUBUNIT compound_name + ( subprogram_body + | package_body + | task_body + | protected_body + ) + ) + ; + +subprogram_body + : procedure_body + | function_body + ; + +package_body : #(PACKAGE_BODY def_id pkg_body_part) + ; + +task_body : #(TASK_BODY def_id body_part) + ; + +protected_body : #(PROTECTED_BODY def_id prot_op_bodies_opt) + ; + +// TBD +// code_stmt : #(CODE_STATEMENT qualified) +// ; + diff --git a/languages/ada/ada_utils.cpp b/languages/ada/ada_utils.cpp new file mode 100644 index 00000000..9630f058 --- /dev/null +++ b/languages/ada/ada_utils.cpp @@ -0,0 +1,69 @@ +/* + */ +#include <stdlib.h> +#include <unistd.h> +#include <iostream> + +#include <qstring.h> +#include <qstringlist.h> +#include <qfile.h> +#include <qregexp.h> + +#include <kdebug.h> + +#include "ada_utils.hpp" +#include "adasupport.hpp" + +QString qtext (const RefAdaAST& n) +{ + return QString::fromLatin1 (text (n).c_str ()); +} + +QStringList qnamelist (const RefAdaAST& n) +{ + QString txt = qtext (n); + // kdDebug() << "qnamelist: input is " << txt << endl; + return QStringList::split ('.', txt); +} + +QString ada_spec_filename (const QString& comp_unit_name) +{ + QString fn (comp_unit_name.lower ()); + + fn.replace (QRegExp("."), "-"); + fn += ".ads"; + return fn; +} + +QString fq_specfilename (const QString& comp_unit_name) +{ + QString fname = ada_spec_filename (comp_unit_name); + + if (QFile::exists (fname)) + return fname; + + QString adaincpath = getenv ("ADA_INCLUDE_PATH"); + if (adaincpath.isNull ()) + return QString::null; + + QStringList dirs = QStringList::split (':', adaincpath); + QString fq_filename; + for (QStringList::Iterator it = dirs.begin (); it != dirs.end (); it++) { + fq_filename = *it; + if (! fq_filename.endsWith ("/")) + fq_filename += "/"; + fq_filename += fname; + if (QFile::exists (fq_filename)) + return fq_filename; + } + if (fname.startsWith ("ada-") || + fname.startsWith ("text_io") || + fname.startsWith ("system") || + fname.startsWith ("unchecked_")) { + kdDebug () << "resolution of Ada predefined library is TBD" << endl; + } else { + kdDebug () << "Cannot find file " << fname << endl; + } + return QString::null; +} + diff --git a/languages/ada/ada_utils.hpp b/languages/ada/ada_utils.hpp new file mode 100644 index 00000000..b1df43dd --- /dev/null +++ b/languages/ada/ada_utils.hpp @@ -0,0 +1,15 @@ +/* + */ +#ifndef ADA_UTILS_H +#define ADA_UTILS_H + +#include <qstring.h> +#include "AdaAST.hpp" + +QString qtext (const RefAdaAST& n); +QStringList qnamelist (const RefAdaAST& n); +QString ada_spec_filename (const QString& comp_unit_name); +QString fq_specfilename (const QString& comp_unit_name); + +#endif + diff --git a/languages/ada/adasupport.cpp b/languages/ada/adasupport.cpp new file mode 100644 index 00000000..6b877b7b --- /dev/null +++ b/languages/ada/adasupport.cpp @@ -0,0 +1,168 @@ +#include <ctype.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <stack> +#include <string> +#include <antlr/AST.hpp> +#include "AdaParser.hpp" +#include "AdaTokenTypes.hpp" +#include "adasupport.hpp" + +#define eq !strcmp + +using namespace std; + +const RefAdaAST AdaAST::nullAdaAST(antlr::nullAST.get() ); + +using namespace std; + +string text (const RefAdaAST& n) +{ + if (n == 0 || n == AdaAST::nullAdaAST) + return ""; + string retval; + int type = n->getType(); + if (type == AdaTokenTypes::DOT) { + const RefAdaAST& sibs = n->down (); + retval = text (sibs); + retval.append ("."); + retval.append (text (sibs->right())); + } else { + retval = n->getText(); + } + /* + const RefAdaAST& r = n->right(); + if (r != 0 && r->getType () == AdaTokenTypes::DOT) { + retval.append ("."); + retval.append (text (r->right())); + } + */ + return retval; +} + +int txteq (RefAdaAST n1, RefAdaAST n2) +{ + if (!n1 || !n2 || n1 == antlr::nullAST || n2 == antlr::nullAST) + return 0; + const char* s1 = n1->getText().c_str(); + const char* s2 = n2->getText().c_str(); + if (strcasecmp (s1, s2) != 0) + return 0; + n1 = n1->right (); + n2 = n2->right (); + if (!n1 || !n2 || n1 == antlr::nullAST || n2 == antlr::nullAST) + return 1; + if (n1->getType () == AdaTokenTypes::DOT) + if (n2->getType () == AdaTokenTypes::DOT) + return txteq (n1->right (), n2->right ()); + else + return 0; + else if (n2->getType () == AdaTokenTypes::DOT) + return 0; + return 1; +} + +std::stack<RefAdaAST> defid_stack; + +void AdaParser::push_def_id (const RefAdaAST& defid) +{ +#ifdef __DEBUG__ + string txt (text (defid)); + printf ("push_def_id: pushing %s\n", txt.c_str()); +#endif + defid_stack.push (defid); +} + +const RefAdaAST& AdaParser::pop_def_id () +{ + if (defid_stack.size() == 0) { + fprintf (stderr, "pop_def_id() called on empty stack\n"); + // return static_cast<RefAdaAST>(antlr::nullAST); + return AdaAST::nullAdaAST; + } + RefAdaAST& top = defid_stack.top (); +#ifdef __DEBUG__ + string txt (text (top)); + printf ("pop_def_id: popping %s\n", txt.c_str()); +#endif + defid_stack.pop (); + return top; +} + +bool AdaParser::end_id_matches_def_id (const RefAdaAST& endid) +{ + if (defid_stack.size() == 0) + return false; + RefAdaAST& top = defid_stack.top (); + string defid (text (top)); + defid_stack.pop(); + if (endid == 0 || endid == antlr::nullAST) + return false; + string txt (text (endid)); + if (strcasecmp (defid.c_str (), txt.c_str ()) != 0) { + string errtxt ("End id "); + errtxt.append (txt); + errtxt.append (" does not match "); + errtxt.append (defid); + reportError (errtxt); + return false; + } +#ifdef __DEBUG__ + printf ("end_id_matches_def_id: popped %s\n", txt.c_str()); +#endif + return true; +} + +char * strtolower (char *string) +{ + char *p = string; + if (!p) + return NULL; + while (*p) + { + if (isupper (*p)) + *p = tolower (*p); + p++; + } + return string; +} + +char * extracted_operator (const char *string) +{ + int len = strlen (string); + static char op[10]; + + if (len < 4 && len > 5 || *string != '"' || *(string + len - 1) != '"') + return NULL; + + strcpy (op, string + 1); + op[len - 2] = '\0'; /* discard ending quotation mark */ + strtolower (op); + return op; +} + +bool AdaParser::definable_operator (const char *string) +{ // operator_symbol sans "/=" + char *op = extracted_operator (string); + if (op == NULL) + return false; + return + (eq (op, "=") || + eq (op, "<") || eq (op, ">") || + eq (op, "<=") || eq (op, ">=") || + eq (op, "&") || eq (op, "**") || + eq (op, "*") || eq (op, "/") || eq (op, "+") || eq (op, "-") || + eq (op, "abs") || eq (op, "rem") || eq (op, "mod") || + eq (op, "and") || eq (op, "or") || eq (op, "xor") || eq (op, "not")); +} + +bool AdaParser::is_operator_symbol (const char *string) +{ + char *op; + if (definable_operator (string)) + return true; + op = extracted_operator (string); + return (eq (op, "/=")); +} + diff --git a/languages/ada/adasupport.hpp b/languages/ada/adasupport.hpp new file mode 100644 index 00000000..9d65e0e5 --- /dev/null +++ b/languages/ada/adasupport.hpp @@ -0,0 +1,13 @@ +/* + */ +#ifndef ADASUPPORT_H +#define ADASUPPORT_H + +#include <string> +#include "AdaAST.hpp" + +std::string text (const RefAdaAST& n); +int txteq (RefAdaAST n1, RefAdaAST n2); + +#endif + diff --git a/languages/ada/adasupportpart.cpp b/languages/ada/adasupportpart.cpp new file mode 100644 index 00000000..39ead02a --- /dev/null +++ b/languages/ada/adasupportpart.cpp @@ -0,0 +1,376 @@ + +#include <qfileinfo.h> +#include <qlistview.h> +#include <qstringlist.h> +#include <qtimer.h> +#include <qvbox.h> +#include <qprogressbar.h> +#include <qwhatsthis.h> + +#include <kgenericfactory.h> +#include <kapplication.h> +#include <kdebug.h> +#include <klocale.h> +#include <kstatusbar.h> +#include <kdialogbase.h> +#include <kiconloader.h> + +#include <fstream> +#include <sstream> + +#include "kdevgenericfactory.h" +#include "kdevcore.h" +#include "kdevproject.h" +#include "kdevmainwindow.h" +#include "kdevpartcontroller.h" +#include "codemodel.h" +#include "adasupportpart.h" +#include "problemreporter.h" +#include "backgroundparser.h" + +#include "AdaLexer.hpp" +#include "AdaParser.hpp" +#include "AdaStoreWalker.hpp" +#include "AdaAST.hpp" + +#include <kdevplugininfo.h> + +enum { KDEV_DB_VERSION = 6 }; +enum { KDEV_PCS_VERSION = 6 }; + +typedef KDevGenericFactory<AdaSupportPart> AdaSupportPartFactory; + +static const KDevPluginInfo data("kdevadasupport"); +K_EXPORT_COMPONENT_FACTORY (libkdevadasupport, AdaSupportPartFactory (data)) + + +struct AdaSupportPartData { + ProblemReporter* problemReporter; + + AdaSupportPartData () : problemReporter (0) {} +}; + +AdaSupportPart::AdaSupportPart (QObject *parent, const char *name, const QStringList &) + : KDevLanguageSupport (&data, parent, name ? name : "AdaSupportPart"), d (new AdaSupportPartData()) +{ + setInstance (AdaSupportPartFactory::instance ()); + + d->problemReporter = new ProblemReporter (this); +// connect (core (), SIGNAL (configWidget (KDialogBase*)), +// d->problemReporter, SLOT (configWidget (KDialogBase*))); + d->problemReporter->setIcon( SmallIcon("info") ); + mainWindow( )->embedOutputView( d->problemReporter, i18n("Problems"), i18n("Problem reporter")); + QWhatsThis::add(d->problemReporter, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. " + "It displays errors reported by a language parser.")); + + setXMLFile ("adasupportpart.rc"); + + connect (core (), SIGNAL (projectOpened ()), this, SLOT (projectOpened ())); + connect (core (), SIGNAL (projectClosed ()), this, SLOT (projectClosed ())); + + connect (partController (), SIGNAL (savedFile (const KURL&)), + this, SLOT (savedFile (const KURL&))); + +// connect (core (), SIGNAL (configWidget (KDialogBase*)), this, SLOT (configWidget (KDialogBase*))); + connect( core(), SIGNAL(configWidget(KDialogBase*)), + d->problemReporter, SLOT(configWidget(KDialogBase*)) ); + + // a small hack (robe) + //classStore ()->globalScope ()->setName ("(default packages)"); + //classStore ()->addScope (classStore ()->globalScope ()); + //classStore ()->globalScope ()->setName (QString::null); +} + + +AdaSupportPart::~AdaSupportPart () +{ + mainWindow ()->removeView (d->problemReporter); + delete (d->problemReporter); + d->problemReporter = 0; + + delete (d); + d = 0; +} + + +KDevLanguageSupport::Features AdaSupportPart::features () +{ + return KDevLanguageSupport::Features + ( // TBD: Classes | + Functions | Namespaces); +} + +void AdaSupportPart::projectOpened () +{ + connect (project (), SIGNAL (addedFilesToProject (const QStringList &)), + this, SLOT (addedFilesToProject (const QStringList &))); + connect (project (), SIGNAL (removedFilesFromProject (const QStringList &)), + this, SLOT (removedFilesFromProject (const QStringList &))); + connect( project( ), SIGNAL( changedFilesInProject( const QStringList & ) ), + this, SLOT( changedFilesInProject( const QStringList & ) ) ); + + QTimer::singleShot (0, this, SLOT (initialParse ())); +} + + +void AdaSupportPart::projectClosed () +{ + saveProjectSourceInfo(); +} + + +void AdaSupportPart::initialParse () +{ + kdDebug () << "------------------------------------------> initialParse ()" << endl; + + if (project ()) + { + mainWindow()->statusBar()->message( i18n("Updating...") ); + kapp->processEvents( ); + kapp->setOverrideCursor (waitCursor); + + int n = 0; + QStringList files = project ()->allFiles (); + + QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) ); + bar->setMinimumWidth( 120 ); + bar->setCenterIndicator( true ); + mainWindow( )->statusBar( )->addWidget( bar ); + bar->show( ); + + for (QStringList::Iterator it = files.begin (); it != files.end (); ++it) { + bar->setProgress( n++ ); + + QString fn = project ()->projectDirectory () + "/" + *it; + maybeParse (fn); + kapp->processEvents (500); + } + + emit updatedSourceInfo(); + + mainWindow( )->statusBar( )->removeWidget( bar ); + delete bar; + + kapp->restoreOverrideCursor (); + mainWindow( )->statusBar( )->message( i18n( "Done" ), 2000 ); +/* mainWindow ()->statusBar ()->message + (i18n ("Found 1 problem", "Found %n problems", d->problemReporter->childCount ()));*/ + } +} + +QStringList AdaSupportPart::fileExtensions () +{ + return QStringList () << "ads" << "adb"; +} + +void AdaSupportPart::maybeParse (const QString &fileName) +{ + kdDebug () << "AdaSupportPart::maybeParse: " << fileName << endl; + + if (!fileExtensions ().contains (QFileInfo (fileName).extension ())) + return; + +// mainWindow ()->statusBar ()->message (i18n ("Parsing file: %1").arg (fileName)); + parse (fileName); +} + + +void AdaSupportPart::addedFilesToProject (const QStringList &fileList) +{ + QStringList::ConstIterator it; + + for (it = fileList.begin (); it != fileList.end (); ++it) + { + QString path = project ()->projectDirectory () + "/" + (*it); + maybeParse (path); + emit addedSourceInfo( path ); + } +} + + +void AdaSupportPart::removedFilesFromProject (const QStringList &fileList) +{ + QStringList::ConstIterator it; + + for (it = fileList.begin (); it != fileList.end (); ++it) + { + kdDebug () << "AdaSupportPart::removedFileFromProject () -- " << (*it) << endl; + QString path = project ()->projectDirectory () + "/" + (*it); + + if( codeModel()->hasFile(path) ) + { + emit aboutToRemoveSourceInfo( path ); + codeModel()->removeFile( codeModel()->fileByName(path) ); + } + } + +// emit updatedSourceInfo(); +} + + +void AdaSupportPart::parse (const QString &fileName) +{ + kdDebug () << "AdaSupportPart::parse () -- " << fileName << endl; + + std::ifstream stream (QFile::encodeName( fileName ).data()); + QCString _fn = fileName.utf8 (); + std::string fn (_fn.data ()); + + AdaLexer lexer (stream); + lexer.setFilename (fn); + lexer.setProblemReporter (d->problemReporter); + + AdaParser parser (lexer); + parser.setFilename (fn); + parser.setProblemReporter (d->problemReporter); + + // make an ast factory + antlr::ASTFactory ast_factory; + // initialize and put it in the parser... + parser.initializeASTFactory (ast_factory); + parser.setASTFactory (&ast_factory); + // parser.setASTNodeType ("RefAdaAST"); + + try { + // old: parser.setASTNodeFactory (AdaAST::factory); + lexer.resetErrors (); + parser.resetErrors (); + + parser.compilation_unit (); + int errors = lexer.numberOfErrors () + parser.numberOfErrors (); + + RefAdaAST ast = RefAdaAST (parser.getAST ()); + + if (errors == 0 && ast != antlr::nullAST) { + kdDebug () << "-------------------> start StoreWalker" << endl; + AdaStoreWalker walker; + walker.setFileName (fileName); + walker.setCodeModel (codeModel ()); + walker.compilation_unit (ast); + } + } catch (antlr::ANTLRException& ex) { + kdDebug () << "*exception*: " << ex.toString ().c_str () << endl; + d->problemReporter->reportError (QString::fromLatin1( ex.getMessage ().c_str() ), + fileName, + lexer.getLine (), + lexer.getColumn ()); + } +} + +void AdaSupportPart::parseContents (const QString& contents, const QString& fileName) +{ + kdDebug () << "AdaSupportPart::parseContents () -- " << fileName << endl; + + QCString _fn = QFile::encodeName (fileName); + std::string fn (_fn.data ()); + + QCString text = contents.utf8 (); + std::istringstream stream ((const char *)text); + + AdaLexer lexer (stream); + lexer.setFilename (fn); + lexer.setProblemReporter (d->problemReporter); + + AdaParser parser (lexer); + parser.setFilename (fn); + parser.setProblemReporter (d->problemReporter); + + try { + lexer.resetErrors (); + parser.resetErrors (); + + parser.compilation_unit (); + int errors = lexer.numberOfErrors () + parser.numberOfErrors (); + Q_UNUSED( errors ); + + } catch (antlr::ANTLRException& ex) { + kdDebug () << "*exception*: " << ex.toString ().c_str () << endl; + d->problemReporter->reportError (QString::fromLatin1( ex.getMessage().c_str() ), + fileName, + lexer.getLine (), + lexer.getColumn ()); + } +} + + + +void AdaSupportPart::savedFile (const KURL& fileName) +{ + kdDebug () << "AdaSupportPart::savedFile ()" << endl; + + if (project ()->allFiles ().contains (fileName.path().mid (project ()->projectDirectory ().length () + 1))) { + maybeParse (fileName.path()); + emit updatedSourceInfo(); + } +} + +KMimeType::List AdaSupportPart::mimeTypes( ) +{ + KMimeType::List list; + + list << KMimeType::mimeType( "text/x-adasrc" ); + + return list; +} + +//@todo adymo: implement source info loading and saving +//hint: check javasupport for an example +// and modify initialParse() method +void AdaSupportPart::saveProjectSourceInfo( ) +{ +/* const FileList fileList = codeModel()->fileList(); + + if( !project() || fileList.isEmpty() ) + return; + + QFile f( project()->projectDirectory() + "/" + project()->projectName() + ".pcs" ); + if( !f.open( IO_WriteOnly ) ) + return; + + QDataStream stream( &f ); + QMap<QString, Q_ULONG> offsets; + + QString pcs( "PCS" ); + stream << pcs << KDEV_PCS_VERSION; + + stream << int( fileList.size() ); + for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){ + const FileDom dom = (*it); +#if QT_VERSION >= 0x030100 + stream << dom->name() << m_timestamp[ dom->name() ].toTime_t(); +#else + stream << dom->name() << toTime_t(m_timestamp[ dom->name() ]); +#endif + offsets.insert( dom->name(), stream.device()->at() ); + stream << (Q_ULONG)0; // dummy offset + } + + for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){ + const FileDom dom = (*it); + int offset = stream.device()->at(); + + dom->write( stream ); + + int end = stream.device()->at(); + + stream.device()->at( offsets[dom->name()] ); + stream << offset; + stream.device()->at( end ); + }*/ +} + +void AdaSupportPart::changedFilesInProject( const QStringList & fileList ) +{ + QStringList files = fileList; + + for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) + { + QString path = project ()->projectDirectory () + "/" + *it ; + + maybeParse( path ); + emit addedSourceInfo( path ); + } +} + + +#include "adasupportpart.moc" diff --git a/languages/ada/adasupportpart.h b/languages/ada/adasupportpart.h new file mode 100644 index 00000000..d9f2c45d --- /dev/null +++ b/languages/ada/adasupportpart.h @@ -0,0 +1,50 @@ +// +#ifndef __ADASUPPORTPART_H__ +#define __ADASUPPORTPART_H__ + +#include "kdevlanguagesupport.h" + +#include <qwaitcondition.h> + +class AdaSupportPartData; +class KDialogBase; +class QStringList; + +class AdaSupportPart : public KDevLanguageSupport +{ + Q_OBJECT +public: + AdaSupportPart (QObject *parent, const char *name, const QStringList &); + ~AdaSupportPart (); + + void parseContents (const QString& contents, const QString& fileName); + +protected: + Features features (); + KMimeType::List mimeTypes (); + QStringList fileExtensions (); + +private slots: + void projectOpened (); + void projectClosed (); + + void addedFilesToProject (const QStringList &fileList); + void removedFilesFromProject (const QStringList &fileList); + void changedFilesInProject( const QStringList &fileList ); + + void initialParse (); + void savedFile (const KURL&); + +private: + void maybeParse (const QString &fileName); + void parse (const QString &fileName); + + void saveProjectSourceInfo( ); +private: + AdaSupportPartData* d; + +friend class ProblemReporter; +}; + + +#endif diff --git a/languages/ada/addclass.cpp b/languages/ada/addclass.cpp new file mode 100644 index 00000000..5a5ccb13 --- /dev/null +++ b/languages/ada/addclass.cpp @@ -0,0 +1,351 @@ +#include <sys/stat.h> +#include <sys/types.h> + + +#include <qcheckbox.h> +#include <qradiobutton.h> +#include <qtextedit.h> +#include <qtextstream.h> +#include <qregexp.h> +#include <qfile.h> +#include <qfileinfo.h> + + +#include <klineedit.h> +#include <kcombobox.h> +#include <keditlistbox.h> +#include <kdebug.h> + + +#include "addclassdlg.h" + + +#include "addclass.h" + + +AddClassInfo::AddClassInfo() + : interfaceOpt(false), abstractOpt(false), finalOpt(false), + createConstructor(true), createMain(false) +{ +} + + +QString AddClassInfo::adaFileName() const +{ + QString dest = className; + dest.replace(QRegExp("\\."), "/"); + return sourceDir + "/" + dest + ".ada"; +} + + +AddClass::AddClass() +{ +} + + +void AddClass::setInfo(const AddClassInfo &info) +{ + m_info = info; +} + + +AddClassInfo &AddClass::info() +{ + return m_info; +} + + +void AddClass::setBaseClasses(const QStringList &classes) +{ + m_baseClasses = classes; +} + + +bool AddClass::showDialog() +{ + AddClassDlg dlg; + + QString dir = m_info.projectDir; + if (m_info.sourceDir.isEmpty()) + m_info.sourceDir = "src"; + if (dir.isEmpty()) + dir = m_info.sourceDir; + else + dir = dir + "/" + m_info.sourceDir; + + dlg.SourcePath->setText(dir); + dlg.ClassName->setText(m_info.className); + dlg.Extends->insertStringList(m_baseClasses); + dlg.Extends->setEditText(m_info.extends); + dlg.Interface->setChecked(m_info.interfaceOpt); + dlg.Abstract->setChecked(m_info.abstractOpt); + dlg.Final->setChecked(m_info.finalOpt); + + switch (m_info.visibility) + { + case AddClassInfo::ProtectedClass: + dlg.Protected->setChecked(true); + break; + case AddClassInfo::PrivateClass: + dlg.Private->setChecked(true); + break; + default: + dlg.Public->setChecked(true); + break; + } + + dlg.Implements->insertStringList(m_info.implements); + dlg.Constructor->setChecked(m_info.createConstructor); + dlg.Main->setChecked(m_info.createMain); + dlg.Documentation->setText(m_info.documentation); + dlg.License->setEditText(m_info.license); + + if (dlg.exec() == QDialog::Accepted) + { + m_info.projectDir = ""; + m_info.sourceDir = dlg.SourcePath->text(); + m_info.className = dlg.ClassName->text(); + m_info.extends = dlg.Extends->currentText(); + m_info.interfaceOpt = dlg.Interface->isChecked(); + m_info.abstractOpt = dlg.Abstract->isChecked(); + m_info.finalOpt = dlg.Final->isChecked(); + + if (dlg.Protected->isChecked()) + m_info.visibility = AddClassInfo::ProtectedClass; + else if (dlg.Private->isChecked()) + m_info.visibility = AddClassInfo::PrivateClass; + else + m_info.visibility = AddClassInfo::PublicClass; + + m_info.implements = dlg.Implements->items(); + m_info.createConstructor = dlg.Constructor->isChecked(); + m_info.createMain = dlg.Main->isChecked(); + m_info.documentation = dlg.Documentation->text(); + m_info.license = dlg.License->currentText(); + + return true; + } + + return false; +} + + +static bool makeDirs(const QString &dest) +{ + QStringList dirs = QStringList::split("/", dest); + + QString d = ""; + + for (QStringList::Iterator it=dirs.begin(); it != dirs.end(); ++it) + { + d = d + "/" + *it; + + QFileInfo fi(d); + + if (fi.exists() && !fi.isDir()) + { + /// @todo message to user! + return false; + } + + if (!fi.exists()) + if (::mkdir(QFile::encodeName(d), 0755) != 0) + return false; + } + + return true; +} + + +bool AddClass::generate() +{ + QString code; + + // license + + if (!m_info.license.isEmpty()) + { + code += "/*\n"; + + if (m_info.license == "GPL") + { + code += + " * This program is free software; you can redistribute it and/or modify\n" + " * it under the terms of the GNU General Public License as published by\n" + " * the Free Software Foundation; either version 2 of the License, or\n" + " * (at your option) any later version.\n"; + } + else if (m_info.license == "LGPL") + { + code += + " * This program is free software; you can redistribute it and/or modify\n" + " * it under the terms of the GNU Library General Public License as\n" + " * published by the Free Software Foundation; either version 2 of the\n" + " * License, or (at your option) any later version.\n"; + } + else if (m_info.license == "QPL") + { + code += + " * This program may be distributed under the terms of the Q Public\n" + " * License as defined by Trolltech AS of Norway and appearing in the\n" + " * file LICENSE.QPL included in the packaging of this file.\n" + " *\n" + " * This program is distributed in the hope that it will be useful,\n" + " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; + } + else + { + code += " * This program is licensed under the " + m_info.license + ".\n"; + code += " * Please see the documentation for details.\n"; + } + + code += " */\n\n\n"; + } + + // find class and package name + QString className, packageName; + + int i = m_info.className.findRev('.'); + if (i == -1) + { + packageName = ""; + className = m_info.className; + } + else + { + packageName = m_info.className.left(i); + className = m_info.className.mid(i+1); + } + + // package + if (!packageName.isEmpty()) + code += "package " + packageName + ";\n\n\n"; + + // documentation + + if (!m_info.documentation.isEmpty()) + { + code += "/**\n"; + + QTextStream ts(&m_info.documentation, IO_ReadOnly); + + while (!ts.eof()) + code += " * " + ts.readLine() + "\n"; + + code += " */\n\n"; + } + + // visibility + + switch (m_info.visibility) + { + case AddClassInfo::PrivateClass: + code += "private"; + break; + case AddClassInfo::ProtectedClass: + code += "protected"; + break; + default: + code += "public"; + break; + } + + // abstract, final + + if (!m_info.interfaceOpt) + { + if (m_info.abstractOpt) + code += " abstract"; + if (m_info.finalOpt) + code += " final"; + } + + // generate class/interface declaration + + if (m_info.interfaceOpt) + code += " interface "; + else + code += " class "; + + // classname + + code += className; + + // extends + + if (!m_info.extends.isEmpty()) + code += " extends " + m_info.extends; + + // implements + + if ((m_info.implements.count() > 0) && !m_info.interfaceOpt) + { + code += " implements "; + unsigned int c=0; + for (QStringList::Iterator it = m_info.implements.begin(); it != m_info.implements.end(); ++it, c++) + { + code += *it; + if (c+1 < m_info.implements.count()) + code += ", "; + } + } + + // body start + + code += "\n{\n\n"; + + // default constructor + + if (m_info.createConstructor && !m_info.interfaceOpt) + { + code += " " + className + "()\n"; + code += " {\n"; + if (!m_info.extends.isEmpty()) + code += " super();\n"; + code += " }\n\n"; + } + + // main method + + if (m_info.createMain && !m_info.interfaceOpt) + { + code += " public static void main(String[] args)\n"; + code += " {\n"; + code += " }\n\n"; + } + + // body end + + code += "};\n"; + + // create directories + + QString dest = packageName; + dest.replace(QRegExp("\\."), "/"); + dest = m_info.sourceDir + "/" + dest; + + if (!makeDirs(dest)) + return false; + + // write out the file + + if (QFile::exists(m_info.adaFileName())) + { + /// @todo ask before overwriting! + } + + QFile of(m_info.adaFileName()); + if (!of.open(IO_WriteOnly)) + { + /// @todo message to user + return false; + } + + QTextStream os(&of); + os << code; + + of.close(); + + return true; +} diff --git a/languages/ada/addclass.h b/languages/ada/addclass.h new file mode 100644 index 00000000..7bcfd370 --- /dev/null +++ b/languages/ada/addclass.h @@ -0,0 +1,55 @@ +#ifndef __ADDCLASS_H__ +#define __ADDCLASS_H__ + + +#include <qstring.h> +#include <qstringlist.h> + + +class AddClassInfo +{ +public: + + AddClassInfo(); + + enum Visibility { PublicClass, ProtectedClass, PrivateClass}; + + QString className; + QString extends; + bool interfaceOpt, abstractOpt, finalOpt; + QString projectDir, sourceDir; + Visibility visibility; + QStringList implements; + bool createConstructor, createMain; + QString documentation; + QString license; + + QString adaFileName() const; + +}; + + +class AddClass +{ +public: + + AddClass(); + + void setInfo(const AddClassInfo &info); + AddClassInfo &info(); + + void setBaseClasses(const QStringList &classes); + bool showDialog(); + + bool generate(); + + +private: + + AddClassInfo m_info; + QStringList m_baseClasses; + +}; + + +#endif diff --git a/languages/ada/addclassdlg.ui b/languages/ada/addclassdlg.ui new file mode 100644 index 00000000..49900786 --- /dev/null +++ b/languages/ada/addclassdlg.ui @@ -0,0 +1,434 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>AddClassDlg</class> +<widget class="QDialog"> + <property name="name"> + <cstring>AddClassDlg</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>656</width> + <height>684</height> + </rect> + </property> + <property name="caption"> + <string>Add Class</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KEditListBox" row="1" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>Implements</cstring> + </property> + <property name="lineWidth"> + <number>1</number> + </property> + <property name="title"> + <string>&Implements</string> + </property> + </widget> + <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>GroupBox1</cstring> + </property> + <property name="title"> + <string>&Class</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + + <widget class="KComboBox" row="2" column="1" rowspan="1" colspan="5"> + <property name="name"> + <cstring>Extends</cstring> + </property> + <property name="editable"> + <bool>true</bool> + </property> + <property name="autoCompletion"> + <bool>false</bool> + </property> + </widget> + <spacer row="4" column="4" rowspan="1" colspan="2"> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + <widget class="QCheckBox" row="3" column="2"> + <property name="name"> + <cstring>Abstract</cstring> + </property> + <property name="text"> + <string>&Abstract</string> + </property> + </widget> + <widget class="QCheckBox" row="3" column="1"> + <property name="name"> + <cstring>Interface</cstring> + </property> + <property name="text"> + <string>&Interface</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>&Name:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>ClassName</cstring> + </property> + </widget> + <widget class="QButtonGroup" row="4" column="1" rowspan="1" colspan="3"> + <property name="name"> + <cstring>ButtonGroup1</cstring> + </property> + <property name="lineWidth"> + <number>0</number> + </property> + <property name="title"> + <string></string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + + <widget class="QRadioButton"> + <property name="name"> + <cstring>Public</cstring> + </property> + <property name="text"> + <string>&Public</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>Protected</cstring> + </property> + <property name="text"> + <string>P&rotected</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>Private</cstring> + </property> + <property name="text"> + <string>Pri&vate</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QCheckBox" row="3" column="3"> + <property name="name"> + <cstring>Final</cstring> + </property> + <property name="text"> + <string>&Final</string> + </property> + </widget> + <widget class="KLineEdit" row="1" column="1" rowspan="1" colspan="5"> + <property name="name"> + <cstring>ClassName</cstring> + </property> + </widget> + <spacer row="3" column="4" rowspan="1" colspan="2"> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>&Extends:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>Extends</cstring> + </property> + </widget> + <widget class="QPushButton" row="0" column="5"> + <property name="name"> + <cstring>BrowseSourcePath</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>...</string> + </property> + </widget> + <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="4"> + <property name="name"> + <cstring>SourcePath</cstring> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel1_2</cstring> + </property> + <property name="text"> + <string>&Source path:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>SourcePath</cstring> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>GroupBox3</cstring> + </property> + <property name="title"> + <string>&Options</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + + <widget class="QCheckBox"> + <property name="name"> + <cstring>Constructor</cstring> + </property> + <property name="text"> + <string>&Create default constructor</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>Main</cstring> + </property> + <property name="text"> + <string>Create &main method</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>GroupBox4</cstring> + </property> + <property name="title"> + <string>&Documentation</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel5</cstring> + </property> + <property name="text"> + <string>&License:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>License</cstring> + </property> + </widget> + <widget class="KComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>LGPL</string> + </property> + </item> + <item> + <property name="text"> + <string>GPL</string> + </property> + </item> + <item> + <property name="text"> + <string>QPL</string> + </property> + </item> + <property name="name"> + <cstring>License</cstring> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + <widget class="QTextEdit" row="0" column="0" rowspan="1" colspan="3"> + <property name="name"> + <cstring>Documentation</cstring> + </property> + </widget> + <spacer row="1" column="2"> + <property name="name"> + <cstring>Spacer4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + </grid> + </widget> + <widget class="Line" row="4" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>Line1</cstring> + </property> + <property name="frameShape"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QPushButton" row="5" column="3"> + <property name="name"> + <cstring>PushButton3</cstring> + </property> + <property name="text"> + <string>&Help</string> + </property> + </widget> + <spacer row="5" column="2"> + <property name="name"> + <cstring>Spacer5</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + <widget class="QPushButton" row="5" column="0"> + <property name="name"> + <cstring>PushButton1</cstring> + </property> + <property name="text"> + <string>&Add</string> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="5" column="1"> + <property name="name"> + <cstring>PushButton2</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>Interface</sender> + <signal>toggled(bool)</signal> + <receiver>Abstract</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>Interface</sender> + <signal>toggled(bool)</signal> + <receiver>Final</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>PushButton1</sender> + <signal>clicked()</signal> + <receiver>AddClassDlg</receiver> + <slot>accept()</slot> + </connection> + <connection> + <sender>PushButton2</sender> + <signal>clicked()</signal> + <receiver>AddClassDlg</receiver> + <slot>reject()</slot> + </connection> + <connection> + <sender>Interface</sender> + <signal>toggled(bool)</signal> + <receiver>Constructor</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>Interface</sender> + <signal>toggled(bool)</signal> + <receiver>Main</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>Interface</sender> + <signal>toggled(bool)</signal> + <receiver>Implements</receiver> + <slot>setDisabled(bool)</slot> + </connection> +</connections> +<tabstops> + <tabstop>SourcePath</tabstop> + <tabstop>BrowseSourcePath</tabstop> + <tabstop>ClassName</tabstop> + <tabstop>Extends</tabstop> + <tabstop>Interface</tabstop> + <tabstop>Abstract</tabstop> + <tabstop>Final</tabstop> + <tabstop>Public</tabstop> + <tabstop>Protected</tabstop> + <tabstop>Private</tabstop> + <tabstop>Constructor</tabstop> + <tabstop>Main</tabstop> + <tabstop>License</tabstop> + <tabstop>PushButton1</tabstop> + <tabstop>PushButton2</tabstop> + <tabstop>PushButton3</tabstop> +</tabstops> +<slots> + <slot>Public_toggled( bool )</slot> +</slots> +<includes> + <include location="global" impldecl="in implementation">keditlistbox.h</include> + <include location="global" impldecl="in implementation">kcombobox.h</include> + <include location="global" impldecl="in implementation">klineedit.h</include> + <include location="global" impldecl="in implementation">kdialog.h</include> +</includes> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> diff --git a/languages/ada/app_templates/Makefile.am b/languages/ada/app_templates/Makefile.am new file mode 100644 index 00000000..3da5006f --- /dev/null +++ b/languages/ada/app_templates/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = adahello + +profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/AdaIDE +profiles_DATA = ada.appwizard + diff --git a/languages/ada/app_templates/ada.appwizard b/languages/ada/app_templates/ada.appwizard new file mode 100644 index 00000000..2c31ec96 --- /dev/null +++ b/languages/ada/app_templates/ada.appwizard @@ -0,0 +1,2 @@ +[General] +List=adahello diff --git a/languages/ada/app_templates/adahello/.kdev_ignore b/languages/ada/app_templates/adahello/.kdev_ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/languages/ada/app_templates/adahello/.kdev_ignore diff --git a/languages/ada/app_templates/adahello/Makefile.am b/languages/ada/app_templates/adahello/Makefile.am new file mode 100644 index 00000000..45e04df7 --- /dev/null +++ b/languages/ada/app_templates/adahello/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = main.adb app.kdevelop ada-Makefile app.kdevelop.filelist + +### no need to change below: +template_DATA = adahello.kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +adahello.tar.gz: + $(TAR) -cf adahello.tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 adahello.tar + +archivedir = ${appwizarddatadir} +archive_DATA = adahello.tar.gz adahello.png + +CLEANFILES = *.tar.gz + diff --git a/languages/ada/app_templates/adahello/ada-Makefile b/languages/ada/app_templates/adahello/ada-Makefile new file mode 100644 index 00000000..134ffab6 --- /dev/null +++ b/languages/ada/app_templates/adahello/ada-Makefile @@ -0,0 +1,2 @@ +all: + gnatmake src/%{APPNAMELC}.adb -o %{APPNAMELC} diff --git a/languages/ada/app_templates/adahello/ada-Makefile.am b/languages/ada/app_templates/adahello/ada-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/ada/app_templates/adahello/ada-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/ada/app_templates/adahello/ada-Makefile.cvs b/languages/ada/app_templates/adahello/ada-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/ada/app_templates/adahello/ada-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/ada/app_templates/adahello/adahello b/languages/ada/app_templates/adahello/adahello new file mode 100644 index 00000000..73d82f8d --- /dev/null +++ b/languages/ada/app_templates/adahello/adahello @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[fr]=Un simple programme de test Hello world +Icon=adahello.png +Category=Ada +Comment=Generates a simple Hello world program in Ada +Comment[fr]=Gnre un simple programme de test du type Hello world dans le language ADA. +FileTemplates=adb,AdaStyle +ShowFilesAfterGeneration=src/APPNAMELC.adb diff --git a/languages/ada/app_templates/adahello/adahello.kdevtemplate b/languages/ada/app_templates/adahello/adahello.kdevtemplate new file mode 100644 index 00000000..380f739b --- /dev/null +++ b/languages/ada/app_templates/adahello/adahello.kdevtemplate @@ -0,0 +1,132 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[ca]=Simple programa Hello world +Name[da]=Simpelt Goddag verden program +Name[de]=Ein einfaches "Hello World"-Programm +Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» sencillo +Name[et]=Lihtne "Tere, maailm" programm +Name[eu]="Kaixo mundua" programa sinplea +Name[fa]=برنامۀ سادۀ Hello world +Name[fr]=Programme « Bonjour monde » simple +Name[ga]=Ríomhchlár simplí "Hello World" +Name[gl]=Programa sinxelo Ola mundo +Name[hu]=Egyszerű Hello world program +Name[it]=Semplice programma di "Hello world" +Name[ja]=簡単な Hello world プログラム +Name[ms]=Program Hello World mudah +Name[nds]=En eenfach "Moin Welt"-Programm +Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम +Name[nl]=Eenvoudig 'Hello World' programma +Name[pl]=Prosty program witaj świecie +Name[pt]=Programa simples Olá Mundo +Name[pt_BR]=Programa simples Olá Mundo +Name[ru]=Простая программа Hello world +Name[sk]=Jednoduchý "Ahoj svet" program +Name[sl]=Preprost program Hello world +Name[sr]=Једноставан „Здраво свете“ програм +Name[sr@Latn]=Jednostavan „Zdravo svete“ program +Name[sv]=Enkelt Hello world-program +Name[tr]=Basit Merhaba dünya programı +Name[zh_CN]=简单的 Hello world 程序 +Name[zh_TW]=簡單的 Hello world 程式 +Icon=adahello.png +Category=Ada +Comment=Generates a simple Hello world program in Ada +Comment[ca]=Genera un simple programa de Hello world en Ada +Comment[da]=Genererer et simpelt Goddag verden program i Ada +Comment[de]=Erstellt ein einfaches "Hello World"-Program in Ada +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε Ada +Comment[es]=Genera un programa «Hola mundo» sencillo en Ada +Comment[et]=Lihtsa "Tere, maailm" programmi loomine ADA-s +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Adan +Comment[fa]=یک برنامۀ سادۀ Hello world در آدا تولید میکند +Comment[fr]=Génère un programme « Bonjour monde » simple en Ada +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí "Hello World" in Ada +Comment[gl]=Xera un programa sinxelo Hello world en Ada +Comment[hu]=Létrehoz egy egyszerű Hello world programot ADA nyelven +Comment[it]=Genera un semplice programma di "Hello world" in Ada +Comment[ja]=Ada で簡単な Hello world プログラムを作成します +Comment[ms]=Menjana program Hello World mudah dalam Ada +Comment[nds]=Stellt in Ada en eenfach "Moin Welt"-Programm op +Comment[ne]=एडामा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig Hello World programma in Ada +Comment[pl]=Generuje prosty program Witaj świecie w Adzie +Comment[pt]=Gera um programa simples de Olá Mundo em Ada +Comment[pt_BR]=Gera um programa simples de Olá Mundo em Ada +Comment[ru]=Создание простой программы Hello world на Ada +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Ada +Comment[sl]=Ustvari preprost program Hello world v Adi +Comment[sr]=Прави једноставан „Здраво свете“ у Ada-и +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Ada-i +Comment[sv]=Skapar ett enkelt Hello world-program i Ada +Comment[tr]=Ada dilinde basit bir Merhaba Dünya programı üretir. +Comment[zh_CN]=以 Ada 语言生成简单的 Hello world 程序 +Comment[zh_TW]=產生 Ada 的 Hello world 程式 +FileTemplates=adb,AdaStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.adb +Archive=adahello.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/ada-Makefile +Dest=%{dest}/Makefile + +[FILE3] +Type=install +Source=%{src}/app.kdevelop.filelist +Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE4] +Type=install +Source=%{src}/main.adb +Dest=%{dest}/src/%{APPNAMELC}.adb + +[MSG] +Type=message +Comment=A simple "Hello world" program in ADA was created in %{dest} +Comment[ca]=Un simple programa de "Hello world" en ADA ha estat creat en %{dest} +Comment[da]=Et simpelt "Goddag verden" program i ADA blev oprettet i %{dest} +Comment[de]=Ein einfaches "Hello world" Programm in Ada wurde in %{dest} erstellt +Comment[el]=Ένα απλό πρόγραμμα "Γεια σου Κόσμε" σε ADA δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» sencillo en ADA ha sido creado en %{dest} +Comment[et]=Lihtne "Tere, maailm" programm ADA-s loodi asukohta %{dest} +Comment[eu]="Kaixo mundua" programa sinple bat sortu da ADAn hemen: %{dest} +Comment[fa]=یک برنامۀ سادۀ «Hello world» در آدا در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » simple en ADA a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" ADA i %{dest} +Comment[gl]=Creouse un programa sinxelo "Ola mundo" en ADA en %{dest} +Comment[hu]=Létrejött egy egyszerű Hello world program ADA nyelven itt: %{dest} +Comment[it]=È stato creato un semplice programma di "Hello world" in ADA in %{dest} +Comment[ja]=Ada で記述された "Hello world" プログラムを %{dest} に作成しました +Comment[ms]=Program "Hello World" mudah dalam ada telah dicipta dalam %{dest} +Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm in Ada opstellt +Comment[ne]=एउटा साधारण "हेल्लो वोल्ड" कार्यक्रम एडामा %{dest} सिर्जना गरिएको थियो +Comment[nl]=Een eenvoudig "Hello World" programma in Ada is aangemaakt in %{dest} +Comment[pl]=Prosty program "Witaj świecie" w języku ADA został utworzony w %{dest} +Comment[pt]=Foi criado um programa simples "Olá mundo" em ADA em %{dest} +Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em ADA em %{dest} +Comment[ru]=Простая программа "Hello world" на ADA создана в %{dest} +Comment[sk]=Jednoduchý "Ahoj svet" program v Ada bol vytvorený v %{dest} +Comment[sl]=Preprost program »Hello world« v jeziku ADA je bil ustvarjen v %{dest} +Comment[sr]=Једноставан „Здраво свете“ програм у Ada-и је направљен у %{dest} +Comment[sr@Latn]=Jednostavan „Zdravo svete“ program u Ada-i je napravljen u %{dest} +Comment[sv]=Ett enkelt "Hello world"-program in Ada skapades i %{dest} +Comment[tr]=ADA'da basit bir "Merhaba Dünya" programı %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了 Ada 语言的“Hello world”程序 +Comment[zh_TW]=Ada 的 Hello world 程式已產生在 ${dest} diff --git a/languages/ada/app_templates/adahello/adahello.png b/languages/ada/app_templates/adahello/adahello.png Binary files differnew file mode 100644 index 00000000..888d4f13 --- /dev/null +++ b/languages/ada/app_templates/adahello/adahello.png diff --git a/languages/ada/app_templates/adahello/app.kdevelop b/languages/ada/app_templates/adahello/app.kdevelop new file mode 100644 index 00000000..b430f6e8 --- /dev/null +++ b/languages/ada/app_templates/adahello/app.kdevelop @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<kdevelop> + <general> + <author>%{AUTHOR}</author> + <email>%{EMAIL}</email> + <version>%{VERSION}</version> + <projectmanagement>KDevCustomProject</projectmanagement> + <primarylanguage>Ada</primarylanguage> + <keywords> + <keyword>Ada</keyword> + <keyword>Code</keyword> + </keywords> + </general> + <kdevcustomproject> + <run> + <directoryradio>build</directoryradio> + <customdirectory>/</customdirectory> + <mainprogram>%{APPNAMELC}</mainprogram> + <programargs/> + <terminal>false</terminal> + <autocompile>false</autocompile> + <envvars/> + </run> + <build> + <buildtool>make</buildtool> + <builddir/> + </build> + </kdevcustomproject> + <kdevdoctreeview> + <ignoretocs> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>c++_bugs_gcc</toc> + <toc>clanlib</toc> + <toc>w3c-dom-level2-html</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>java_bugs_gcc</toc> + <toc>java_bugs_sun</toc> + <toc>kde2book</toc> + <toc>libc</toc> + <toc>libstdc++</toc> + <toc>opengl</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>qt-kdev3</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>sdl</toc> + <toc>stl</toc> + <toc>w3c-svg</toc> + <toc>sw</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoreqt_xml> + <toc>Guide to the Qt Translation Tools</toc> + <toc>Qt Assistant Manual</toc> + <toc>Qt Designer Manual</toc> + <toc>Qt Reference Documentation</toc> + <toc>qmake User Guide</toc> + </ignoreqt_xml> + <ignoredoxygen> + <toc>KDE Libraries (Doxygen)</toc> + </ignoredoxygen> + </kdevdoctreeview> + <kdevfilecreate> + <useglobaltypes> + <type ext="ads"/> + <type ext="adb"/> + <type ext="ada"/> + </useglobaltypes> + </kdevfilecreate> +</kdevelop> diff --git a/languages/ada/app_templates/adahello/app.kdevelop.filelist b/languages/ada/app_templates/adahello/app.kdevelop.filelist new file mode 100644 index 00000000..e5b69ca2 --- /dev/null +++ b/languages/ada/app_templates/adahello/app.kdevelop.filelist @@ -0,0 +1 @@ +src/%{APPNAMELC}.adb
\ No newline at end of file diff --git a/languages/ada/app_templates/adahello/configure.in b/languages/ada/app_templates/adahello/configure.in new file mode 100644 index 00000000..a8f81958 --- /dev/null +++ b/languages/ada/app_templates/adahello/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AM_CONFIG_HEADER(config.h) + +AC_LANG_ADA +AC_PROG_ADA +AC_ADA_LIBRARY_LDFLAGS + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/ada/app_templates/adahello/main.adb b/languages/ada/app_templates/adahello/main.adb new file mode 100644 index 00000000..e2c6f5da --- /dev/null +++ b/languages/ada/app_templates/adahello/main.adb @@ -0,0 +1,8 @@ +with Text_IO; + +procedure Main is + +begin + Text_IO.Put_Line ("Hello World"); +end Main; + diff --git a/languages/ada/app_templates/adahello/src-Makefile.am b/languages/ada/app_templates/adahello/src-Makefile.am new file mode 100644 index 00000000..06291dbf --- /dev/null +++ b/languages/ada/app_templates/adahello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.adb + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/ada/backgroundparser.cpp b/languages/ada/backgroundparser.cpp new file mode 100644 index 00000000..f94f3216 --- /dev/null +++ b/languages/ada/backgroundparser.cpp @@ -0,0 +1,77 @@ +/*************************************************************************** + * Copyright (C) 2002 by Roberto Raggi * + * roberto@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "backgroundparser.h" +#include "problemreporter.h" +#include "AdaLexer.hpp" +#include "AdaParser.hpp" +#include "AdaAST.hpp" +#include <kdebug.h> +#include <qfile.h> + +#include <config.h> + +#include <sstream> + +BackgroundParser::BackgroundParser( ProblemReporter* reporter, + const QString& source, + const QString& filename ) + : m_reporter( reporter ), + m_source( source.unicode(), source.length() ), + m_fileName( filename ) +{ +} + +BackgroundParser::~BackgroundParser() +{ +} + +void BackgroundParser::run() +{ + QCString _fn = QFile::encodeName(m_fileName); + std::string fn( _fn.data() ); + + std::istringstream stream( m_source.utf8().data() ); + + AdaLexer lexer( stream ); + lexer.setFilename( fn ); + lexer.setProblemReporter( m_reporter ); + + AdaParser parser( lexer ); + parser.setFilename( fn ); + parser.setProblemReporter( m_reporter ); + + // make an ast factory + antlr::ASTFactory ast_factory; + // initialize and put it in the parser... + parser.initializeASTFactory (ast_factory); + parser.setASTFactory (&ast_factory); + // parser.setASTNodeType ("RefAdaAST"); + + try{ + lexer.resetErrors(); + parser.resetErrors(); + + parser.compilation_unit(); + + } catch( antlr::ANTLRException& ex ){ + kdDebug() << "*exception*: " << ex.toString().c_str() << endl; + m_reporter->reportError( QString::fromLatin1( ex.getMessage().c_str() ), + m_fileName, + lexer.getLine(), + lexer.getColumn() ); + } + + kdDebug() << "BackgroundParser::run() FINISHED." << endl; +} + + + diff --git a/languages/ada/backgroundparser.h b/languages/ada/backgroundparser.h new file mode 100644 index 00000000..0b4eef16 --- /dev/null +++ b/languages/ada/backgroundparser.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2002 by Roberto Raggi + * roberto@kdevelop.org + * Copyright (C) 2003 Oliver Kellogg + * okellogg@users.sourceforge.net + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef BACKGROUNDPARSER_H +#define BACKGROUNDPARSER_H + +#include <qthread.h> +#include <qstring.h> +#include <kdebug.h> + +class ProblemReporter; + +class BackgroundParser: public QThread{ +public: + BackgroundParser( ProblemReporter* reporter, + const QString& source, + const QString& filename ); + virtual ~BackgroundParser(); + + virtual void run(); + +private: + ProblemReporter* m_reporter; + QString m_source; + QString m_fileName; +}; + +#endif diff --git a/languages/ada/configproblemreporter.ui b/languages/ada/configproblemreporter.ui new file mode 100644 index 00000000..75f35b1f --- /dev/null +++ b/languages/ada/configproblemreporter.ui @@ -0,0 +1,89 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>ConfigureProblemReporter</class> +<widget class="QWidget"> + <property name="name"> + <cstring>ConfigureProblemReporter</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>390</width> + <height>304</height> + </rect> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>bgParserCheckbox</cstring> + </property> + <property name="text"> + <string>&Enable background parsing</string> + </property> + </widget> + <widget class="QSlider"> + <property name="name"> + <cstring>delaySlider</cstring> + </property> + <property name="maxValue"> + <number>2000</number> + </property> + <property name="lineStep"> + <number>250</number> + </property> + <property name="pageStep"> + <number>500</number> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="tickmarks"> + <enum>Right</enum> + </property> + <property name="tickInterval"> + <number>250</number> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>0</width> + <height>101</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<connections> + <connection> + <sender>bgParserCheckbox</sender> + <signal>toggled(bool)</signal> + <receiver>ConfigureProblemReporter</receiver> + <slot>bgParserCheckbox_toggled(bool)</slot> + </connection> +</connections> +<includes> + <include location="global" impldecl="in implementation">kdialog.h</include> + <include location="local" impldecl="in implementation">configproblemreporter.ui.h</include> +</includes> +<slots> + <slot>init()</slot> + <slot>destroy()</slot> + <slot>accept()</slot> + <slot>bgParserCheckbox_toggled( bool b )</slot> +</slots> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> diff --git a/languages/ada/configproblemreporter.ui.h b/languages/ada/configproblemreporter.ui.h new file mode 100644 index 00000000..a336965c --- /dev/null +++ b/languages/ada/configproblemreporter.ui.h @@ -0,0 +1,39 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + +#include <kconfig.h> +#include <kapplication.h> + +void ConfigureProblemReporter::init() +{ + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + bgParserCheckbox->setChecked( config->readBoolEntry("EnableAdaBgParser", true) ); + delaySlider->setEnabled( bgParserCheckbox->isChecked() ); + delaySlider->setValue( config->readNumEntry("BgParserDelay", 500) ); +} + +void ConfigureProblemReporter::destroy() +{ +} + +void ConfigureProblemReporter::accept() +{ + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + config->writeEntry( "EnableAdaBgParser", bgParserCheckbox->isChecked() ); + if( bgParserCheckbox->isChecked() ) + config->writeEntry( "BgParserDelay", delaySlider->value() ); + config->sync(); +} + + +void ConfigureProblemReporter::bgParserCheckbox_toggled( bool b ) +{ + delaySlider->setEnabled( b ); +} diff --git a/languages/ada/configure.in.in b/languages/ada/configure.in.in new file mode 100644 index 00000000..be677e4b --- /dev/null +++ b/languages/ada/configure.in.in @@ -0,0 +1,4 @@ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS(sstream) +AC_LANG_RESTORE diff --git a/languages/ada/doc/Makefile.am b/languages/ada/doc/Makefile.am new file mode 100644 index 00000000..ff5f8a32 --- /dev/null +++ b/languages/ada/doc/Makefile.am @@ -0,0 +1,6 @@ +tocdir = ${kde_datadir}/kdevdocumentation/tocs +toc_DATA = ada.toc ada_bugs_gcc.toc + +#indexdir = ${kde_datadir}/devdoctreeview/indices +#index_DATA = + diff --git a/languages/ada/doc/ada.toc b/languages/ada/doc/ada.toc new file mode 100644 index 00000000..434a5b6a --- /dev/null +++ b/languages/ada/doc/ada.toc @@ -0,0 +1,130 @@ +<!DOCTYPE kdeveloptoc> +<kdeveloptoc> +<title>Ada</title> +<base href="http://www.adahome.com/rm95"/> +<tocsect1 name="General" url="rm9x-01.html"> + <tocsect2 name="Scope" url="rm9x-01-01.html"></tocsect2> + <tocsect2 name="Normative References" url="rm9x-01-02.html"></tocsect2> + <tocsect2 name="Definitions" url="rm9x-01-03.html"></tocsect2> +</tocsect1> +<tocsect1 name="Lexical Elements" url="rm9x-02.html"> + <tocsect2 name="Character Set" url="rm9x-02-01.html"></tocsect2> + <tocsect2 name="Lexical Elements, Separators, and Delimiters" url="rm9x-02-02.html"></tocsect2> + <tocsect2 name="Identifiers" url="rm9x-02-03.html"></tocsect2> + <tocsect2 name="Numeric Literals" url="rm9x-02-04.html"></tocsect2> + <tocsect2 name="Character Literals" url="rm9x-02-05.html"></tocsect2> + <tocsect2 name="String Literals" url="rm9x-02-06.html"></tocsect2> + <tocsect2 name="Comments" url="rm9x-02-07.html"></tocsect2> + <tocsect2 name="Pragmas" url="rm9x-02-08.html"></tocsect2> + <tocsect2 name="Reserved Words" url="rm9x-02-09.html"></tocsect2> +</tocsect1> +<tocsect1 name="Declarations and Types" url="rm9x-03.html"> + <tocsect2 name="Declarations" url="rm9x-03-01.html"></tocsect2> + <tocsect2 name="Types and Subtypes" url="rm9x-03-02.html"></tocsect2> + <tocsect2 name="Objects and Named Numbers" url="rm9x-03-03.html"></tocsect2> + <tocsect2 name="Derived Types and Classes" url="rm9x-03-04.html"></tocsect2> + <tocsect2 name="Scalar Types" url="rm9x-03-05.html"></tocsect2> + <tocsect2 name="Array Types" url="rm9x-03-06.html"></tocsect2> + <tocsect2 name="Discriminants" url="rm9x-03-07.html"></tocsect2> + <tocsect2 name="Record Types" url="rm9x-03-08.html"></tocsect2> + <tocsect2 name="Tagged Types and Type Extensions" url="rm9x-03-09.html"></tocsect2> + <tocsect2 name="Access Types" url="rm9x-03-10.html"></tocsect2> + <tocsect2 name="Declarative Parts" url="rm9x-03-11.html"></tocsect2> +</tocsect1> +<tocsect1 name="Names and Expressions" url="rm9x-04.html"> + <tocsect2 name="Names" url="rm9x-04-01.html"></tocsect2> + <tocsect2 name="Literals" url="rm9x-04-02.html"></tocsect2> + <tocsect2 name="Aggregates" url="rm9x-04-03.html"></tocsect2> + <tocsect2 name="Expressions" url="rm9x-04-04.html"></tocsect2> + <tocsect2 name="Operators and Expression Evaluation" url="rm9x-04-05.html"></tocsect2> + <tocsect2 name="Type Conversions" url="rm9x-04-06.html"></tocsect2> + <tocsect2 name="Qualified Expressions" url="rm9x-04-07.html"></tocsect2> + <tocsect2 name="Allocators" url="rm9x-04-08.html"></tocsect2> + <tocsect2 name="Static Expressions and Static Subtypes" url="rm9x-04-09.html"></tocsect2> +</tocsect1> +<tocsect1 name="Statements" url="rm9x-05.html"> + <tocsect2 name="Simple and Compound Statements - Sequences of Statements" url="rm9x-05-01.html"></tocsect2> + <tocsect2 name="Assignment Statements" url="rm9x-05-02.html"></tocsect2> + <tocsect2 name="If Statements" url="rm9x-05-03.html"></tocsect2> + <tocsect2 name="Case Statements" url="rm9x-05-04.html"></tocsect2> + <tocsect2 name="Loop Statements" url="rm9x-05-05.html"></tocsect2> + <tocsect2 name="Block Statements" url="rm9x-05-06.html"></tocsect2> + <tocsect2 name="Exit Statements" url="rm9x-05-07.html"></tocsect2> + <tocsect2 name="Goto Statements" url="rm9x-05-08.html"></tocsect2> +</tocsect1> +<tocsect1 name="Subprograms" url="rm9x-06.html"> + <tocsect2 name="Subprogram Declarations" url="rm9x-06-01.html"></tocsect2> + <tocsect2 name="Formal Parameter Modes" url="rm9x-06-02.html"></tocsect2> + <tocsect2 name="Subprogram Bodies" url="rm9x-06-03.html"></tocsect2> + <tocsect2 name="Subprogram Calls" url="rm9x-06-04.html"></tocsect2> + <tocsect2 name="Return Statements" url="rm9x-06-05.html"></tocsect2> + <tocsect2 name="Overloading of Operators" url="rm9x-06-06.html"></tocsect2> +</tocsect1> +<tocsect1 name="Packages" url="rm9x-07.html"> + <tocsect2 name="Package Specifications and Declarations" url="rm9x-07-01.html"></tocsect2> + <tocsect2 name="Package Bodies" url="rm9x-07-02.html"></tocsect2> + <tocsect2 name="Private Types and Private Extensions" url="rm9x-07-03.html"></tocsect2> + <tocsect2 name="Deferred Constants" url="rm9x-07-04.html"></tocsect2> + <tocsect2 name="Limited Types" url="rm9x-07-05.html"></tocsect2> + <tocsect2 name="User-Defined Assignment and Finalization" url="rm9x-07-06.html"></tocsect2> +</tocsect1> +<tocsect1 name="Visibility Rules" url="rm9x-08.html"> + <tocsect2 name="Declarative Region" url="rm9x-08-01.html"></tocsect2> + <tocsect2 name="Scope of Declarations" url="rm9x-08-02.html"></tocsect2> + <tocsect2 name="Visibility" url="rm9x-08-03.html"></tocsect2> + <tocsect2 name="Use Clauses" url="rm9x-08-04.html"></tocsect2> + <tocsect2 name="Renaming Declarations" url="rm9x-08-05.html"></tocsect2> + <tocsect2 name="The Context of Overload Resolution" url="rm9x-08-06.html"></tocsect2> +</tocsect1> +<tocsect1 name="Tasks and Synchronization" url="rm9x-09.html"> + <tocsect2 name="Task Units and Task Objects" url="rm9x-09-01.html"></tocsect2> + <tocsect2 name="Task Execution - Task Activation" url="rm9x-09-02.html"></tocsect2> + <tocsect2 name="Task Dependence - Termination of Tasks" url="rm9x-09-03.html"></tocsect2> + <tocsect2 name="Protected Units and Protected Objects" url="rm9x-09-04.html"></tocsect2> + <tocsect2 name="Intertask Communication" url="rm9x-09-05.html"></tocsect2> + <tocsect2 name="Delay Statements, Duration, and Time" url="rm9x-09-06.html"></tocsect2> + <tocsect2 name="Select Statements" url="rm9x-09-07.html"></tocsect2> + <tocsect2 name="Abort of a Task - Abort of a Sequence of Statements" url="rm9x-09-08.html"></tocsect2> + <tocsect2 name="Task and Entry Attributes" url="rm9x-09-09.html"></tocsect2> + <tocsect2 name="Shared Variables" url="rm9x-09-10.html"></tocsect2> + <tocsect2 name="Example of Tasking and Synchronization " url="rm9x-09-11.html"></tocsect2> +</tocsect1> +<tocsect1 name="Program Structure and Compilation Issues" url="rm9x-10.html"> + <tocsect2 name="Separate Compilation" url="rm9x-10-01.html"></tocsect2> + <tocsect2 name="Program Execution" url="rm9x-10-02.html"></tocsect2> +</tocsect1> +<tocsect1 name="Exceptions" url="rm9x-11.html"> + <tocsect2 name="Exception Declarations" url="rm9x-11-01.html"></tocsect2> + <tocsect2 name="Exception Handlers" url="rm9x-11-02.html"></tocsect2> + <tocsect2 name="Raise Statements" url="rm9x-11-03.html"></tocsect2> + <tocsect2 name="Exception Handling" url="rm9x-11-04.html"></tocsect2> + <tocsect2 name="Suppressing Checks" url="rm9x-11-05.html"></tocsect2> + <tocsect2 name="Exceptions and Optimization" url="rm9x-11-06.html"></tocsect2> +</tocsect1> +<tocsect1 name="Generic Units" url="rm9x-12.html"> + <tocsect2 name="Generic Declarations" url="rm9x-12-01.html"></tocsect2> + <tocsect2 name="Generic Bodies" url="rm9x-12-02.html"></tocsect2> + <tocsect2 name="Generic Instantiation" url="rm9x-12-03.html"></tocsect2> + <tocsect2 name="Formal Objects" url="rm9x-12-04.html"></tocsect2> + <tocsect2 name="Formal Types" url="rm9x-12-05.html"></tocsect2> + <tocsect2 name="Formal Subprograms" url="rm9x-12-06.html"></tocsect2> + <tocsect2 name="Formal Packages" url="rm9x-12-07.html"></tocsect2> + <tocsect2 name="Example of a Generic Package" url="rm9x-12-08.html"></tocsect2> +</tocsect1> +<tocsect1 name="Representation Issues" url="rm9x-13.html"> + <tocsect2 name="Representation Items" url="rm9x-13-01.html"></tocsect2> + <tocsect2 name="Pragma Pack" url="rm9x-13" url="rm9x-13-02.html"></tocsect2> + <tocsect2 name="Representation Attributes" url="rm9x-13-03.html"></tocsect2> + <tocsect2 name="Enumeration Representation Clauses" url="rm9x-13-04.html"></tocsect2> + <tocsect2 name="Record Layout" url="rm9x-13-05.html"></tocsect2> + <tocsect2 name="Change of Representation" url="rm9x-13-06.html"></tocsect2> + <tocsect2 name="The Package System" url="rm9x-13-07.html"></tocsect2> + <tocsect2 name="Machine Code Insertions" url="rm9x-13-08.html"></tocsect2> + <tocsect2 name="Unchecked Type Conversions" url="rm9x-13-09.html"></tocsect2> + <tocsect2 name="Unchecked Access Value Creation" url="rm9x-13-10.html"></tocsect2> + <tocsect2 name="Storage Management" url="rm9x-13-11.html"></tocsect2> + <tocsect2 name="Pragma Restrictions" url="rm9x-13-12.html"></tocsect2> + <tocsect2 name="Streams" url="rm9x-13-13.html"></tocsect2> + <tocsect2 name="Freezing Rules" url="rm9x-13-14.html"></tocsect2> +</tocsect1> +</kdeveloptoc> diff --git a/languages/ada/doc/ada_bugs_gcc.toc b/languages/ada/doc/ada_bugs_gcc.toc new file mode 100644 index 00000000..9c543f0c --- /dev/null +++ b/languages/ada/doc/ada_bugs_gcc.toc @@ -0,0 +1,7 @@ +<!DOCTYPE kdeveloptoc> +<kdeveloptoc> +<title>Ada bugs (GCC)</title> +<base href="http://gcc.gnu.org/bugzilla/"/> +<tocsect1 name="Query" url="query.cgi"> +</tocsect1> +</kdeveloptoc> diff --git a/languages/ada/file_templates/Makefile.am b/languages/ada/file_templates/Makefile.am new file mode 100644 index 00000000..58bbd907 --- /dev/null +++ b/languages/ada/file_templates/Makefile.am @@ -0,0 +1,3 @@ +templatedir = $(kde_datadir)/kdevfilecreate/file-templates +template_DATA = adb ads + diff --git a/languages/ada/file_templates/adb b/languages/ada/file_templates/adb new file mode 100644 index 00000000..0306105a --- /dev/null +++ b/languages/ada/file_templates/adb @@ -0,0 +1,12 @@ +-- +-- +-- Ada Body: $MODULE$ +-- +-- Description: +-- +-- +-- Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +-- +-- Copyright: See COPYING file that comes with this distribution +-- +-- diff --git a/languages/ada/file_templates/ads b/languages/ada/file_templates/ads new file mode 100644 index 00000000..46463d47 --- /dev/null +++ b/languages/ada/file_templates/ads @@ -0,0 +1,12 @@ +-- +-- +-- Ada Spec: $MODULE$ +-- +-- Description: +-- +-- +-- Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +-- +-- Copyright: See COPYING file that comes with this distribution +-- +-- diff --git a/languages/ada/kdevadasupport.desktop b/languages/ada/kdevadasupport.desktop new file mode 100644 index 00000000..4f99e10c --- /dev/null +++ b/languages/ada/kdevadasupport.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=Ada Language Support +Comment[ca]=Suport per al llenguatge Ada +Comment[da]=Ada sprogunderstøttelse +Comment[de]=Sprachunterstützung für Ada +Comment[el]=Υποστήριξη γλώσσας Ada +Comment[es]=Soporte para lenguaje Ada +Comment[et]=ADA keele toetus +Comment[eu]=Ada lenguaiaren euskarria +Comment[fa]=پشتیبانی زبان آدا +Comment[fr]=Prise en charge du langage ADA +Comment[ga]=Tacaíocht Ada +Comment[gl]=Soporte da linguaxe Ada +Comment[hi]=एडीए भाषा समर्थन +Comment[hu]=Ada nyelvi támogatás +Comment[is]=Stuðningur við Ada forritunarmálið +Comment[it]=Supporto al linguaggio Ada +Comment[ja]=Ada 言語サポート +Comment[ms]=Sokongan Bahasa Ada +Comment[nds]=Spraakünnerstütten för Ada +Comment[ne]=एडा भाषा समर्थन +Comment[nl]=Ondersteuning voor Ada +Comment[pl]=Obsługa języka Ada +Comment[pt]=Suporte à Linguagem Ada +Comment[pt_BR]=Suporte à Linguagem Ada +Comment[ru]=Поддержка языка Ada +Comment[sk]=Podpora jazyka Ada +Comment[sl]=Podpora jeziku ada +Comment[sr]=Ada језичка подршка +Comment[sr@Latn]=Ada jezička podrška +Comment[sv]=Stöd för språket Ada +Comment[ta]=அடா மொழி ஆதரவு +Comment[tg]=Ёри намудани забони Ada +Comment[tr]=Ada Dil Desteği +Comment[zh_CN]=Ada 语言支持 +Comment[zh_TW]=Ada 語言支援 +Name=KDevAdaSupport +Name[da]=KDevelop Ada-understøttelse +Name[de]=Unterstützung für Ada (KDevelop) +Name[hi]=के-डेव-एडीए-समर्थन +Name[nds]=Ada-Ünnerstütten för KDevelop +Name[ne]=केडीई विकास एडा समर्थन +Name[pl]=KDevObsługaAdy +Name[sk]=KDevAdaPodpora +Name[sv]=KDevelop Ada-stöd +Name[ta]=கெடெவ் அடா ஆதரவு +Name[zh_TW]=KDevelop Ada 支援 +GenericName=Ada Language Support +GenericName[ca]=Suport per al llenguatge Ada +GenericName[da]=Ada sprogunderstøttelse +GenericName[de]=Sprachunterstützung für Ada +GenericName[el]=Υποστήριξη γλώσσας Ada +GenericName[es]=Soporte para lenguaje Ada +GenericName[et]=ADA keele toetus +GenericName[eu]=Ada lenguaiaren euskarria +GenericName[fa]=پشتیبانی زبان آدا +GenericName[fr]=Prise en charge du langage ADA +GenericName[ga]=Tacaíocht Ada +GenericName[gl]=Soporte da linguaxe Ada +GenericName[hi]=एडीए भाषा समर्थन +GenericName[hu]=Ada-támogatás +GenericName[it]=Supporto al linguaggio Ada +GenericName[ja]=Ada 言語サポート +GenericName[ms]=Sokongan Bahasa Ada +GenericName[nds]=Ünnerstütten för de Spraak Ada +GenericName[ne]=एडा भाषा समर्थन +GenericName[nl]=Ondersteuning voor Ada +GenericName[pl]=Obsługa języka Ada +GenericName[pt]=Suporte à Linguagem Ada +GenericName[pt_BR]=Suporte à Linguagem Ada +GenericName[ru]=Поддержка языка Ada +GenericName[sk]=Podpora jazyka Ada +GenericName[sl]=Podpora jeziku ada +GenericName[sr]=Ada језичка подршка +GenericName[sr@Latn]=Ada jezička podrška +GenericName[sv]=Stöd för språket Ada +GenericName[ta]=அடா மொழி ஆதரவு +GenericName[tg]=Ёри намудани забони Ada +GenericName[tr]=Ada Dil Desteği +GenericName[zh_CN]=Ada 语言支持 +GenericName[zh_TW]=Ada 語言支援 +ServiceTypes=KDevelop/LanguageSupport +X-KDE-Library=libkdevadasupport +X-KDevelop-Version=5 +X-KDevelop-Language=Ada diff --git a/languages/ada/kdevadasupport.rc b/languages/ada/kdevadasupport.rc new file mode 100644 index 00000000..23b705db --- /dev/null +++ b/languages/ada/kdevadasupport.rc @@ -0,0 +1,11 @@ +<!DOCTYPE kpartgui> +<kpartplugin name="KDevAdaSupport" version="1"> +<MenuBar> + <Menu name="tools"><Text>&Tools</Text> + <Action name="plugin_action"/> + </Menu> +</MenuBar> +<ToolBar name="extraToolBar"> + <Action name="plugin_action"/> +</ToolBar> +</kpartplugin> diff --git a/languages/ada/preambles.h b/languages/ada/preambles.h new file mode 100644 index 00000000..e9ea460b --- /dev/null +++ b/languages/ada/preambles.h @@ -0,0 +1,89 @@ +/* + * Two macros are defined here: ANTLR_PARSER_PREAMBLE and ANTLR_LEXER_PREAMBLE. + * They encapsulate the application specific extensions for the classes + * AdaParser and AdaLexer which are defined in ada.g. + * This keeps ada.g independent of the application. + * + * Kdevelop version: + * (C) 2003 Oliver M. Kellogg (okellogg@users.sourceforge.net) + */ +#ifndef _PREAMBLES_H_ +#define _PREAMBLES_H_ + +#include <string> +#include "problemreporter.h" + +#define ANTLR_PARSER_PREAMBLE \ + private: \ + unsigned int m_numberOfErrors; \ + ProblemReporter* m_problemReporter; \ + \ + public: \ + void resetErrors () { m_numberOfErrors = 0; } \ + unsigned int numberOfErrors () const { return m_numberOfErrors; } \ + void setProblemReporter (ProblemReporter* r) { m_problemReporter = r; } \ + \ + void reportError (const antlr::RecognitionException& ex) { \ + m_problemReporter->reportError \ + (ex.toString().c_str (), \ + ex.getFilename().c_str (), \ + ex.getLine (), \ + ex.getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportError (const std::string& errorMessage) { \ + m_problemReporter->reportError \ + (errorMessage.c_str(), \ + getFilename ().c_str(), \ + LT(1)->getLine (), \ + LT(1)->getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportMessage (const std::string& message) { \ + m_problemReporter->reportMessage \ + (message.c_str (), \ + getFilename ().c_str (), \ + LT(1)->getLine (), \ + LT(1)->getColumn ()); \ + } + +#define ANTLR_LEXER_PREAMBLE \ + private: \ + unsigned int m_numberOfErrors; \ + ProblemReporter* m_problemReporter; \ + \ + public: \ + void resetErrors () { m_numberOfErrors = 0; } \ + unsigned int numberOfErrors () const { return m_numberOfErrors; } \ + void setProblemReporter (ProblemReporter* r) { m_problemReporter = r; } \ + \ + void reportError (const antlr::RecognitionException& ex) { \ + m_problemReporter->reportError \ + (ex.toString ().c_str (), \ + ex.getFilename ().c_str (), \ + ex.getLine (), \ + ex.getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportError (const std::string& errorMessage) { \ + m_problemReporter->reportError \ + (errorMessage.c_str (), \ + getFilename().c_str (), \ + getLine (), \ + getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportWarning (const std::string& warnMessage) { \ + m_problemReporter->reportWarning \ + (warnMessage.c_str (), \ + getFilename ().c_str (), \ + getLine (), \ + getColumn ()); \ + } + +#endif // _PREAMBLES_H_ + diff --git a/languages/ada/problemreporter.cpp b/languages/ada/problemreporter.cpp new file mode 100644 index 00000000..36ac6186 --- /dev/null +++ b/languages/ada/problemreporter.cpp @@ -0,0 +1,282 @@ +/* + Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org> + Copyright (C) 2003 Oliver Kellogg <okellogg@users.sourceforge.net> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include "problemreporter.h" +#include "adasupportpart.h" +#include "kdevpartcontroller.h" +#include "kdevmainwindow.h" +#include "configproblemreporter.h" +#include "backgroundparser.h" + +#include <qfileinfo.h> + +#include <kdeversion.h> +#include <kparts/part.h> +#include <ktexteditor/editinterface.h> +#include <ktexteditor/document.h> +#include <ktexteditor/markinterface.h> + +#include <ktexteditor/markinterfaceextension.h> + +#include <kdebug.h> +#include <klocale.h> +#include <kstatusbar.h> +#include <kurl.h> +#include <kapplication.h> +#include <kiconloader.h> + +#include <kconfig.h> + +#include <qtimer.h> +#include <qregexp.h> +#include <qvbox.h> +#include <qwhatsthis.h> +#include <kdialogbase.h> + + +class ProblemItem: public QListViewItem{ +public: + ProblemItem( QListView* parent, const QString& level, const QString& problem, + const QString& file, const QString& line, const QString& column ) + : QListViewItem( parent, level, problem, file, line, column ) {} + + ProblemItem( QListViewItem* parent, const QString& level, const QString& problem, + const QString& file, const QString& line, const QString& column ) + : QListViewItem( parent, level, problem, file, line, column ) {} + + int compare( QListViewItem* item, int column, bool ascending ) const { + if( column == 3 || column == 4 ){ + int a = text( column ).toInt(); + int b = item->text( column ).toInt(); + if( a == b ) + return 0; + return( a > b ? -1 : 1 ); + } + return QListViewItem::compare( item, column, ascending ); + } + +}; + +ProblemReporter::ProblemReporter( AdaSupportPart* part, QWidget* parent, const char* name ) + : QListView( parent, name ), + m_adaSupport( part ), + m_editor( 0 ), + m_document( 0 ), + m_markIface( 0 ), + m_bgParser( 0 ) +{ + QWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows errors reported by a language parser.")); + + addColumn( i18n("Level") ); + addColumn( i18n("Problem") ); + addColumn( i18n("File") ); + addColumn( i18n("Line") ); + //addColumn( i18n("Column") ); + setAllColumnsShowFocus( TRUE ); + + m_timer = new QTimer( this ); + + connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)), + this, SLOT(slotActivePartChanged(KParts::Part*)) ); + connect( part->partController(), SIGNAL(partAdded(KParts::Part*)), + this, SLOT(slotPartAdded(KParts::Part*)) ); + connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)), + this, SLOT(slotPartRemoved(KParts::Part*)) ); + + connect( m_timer, SIGNAL(timeout()), this, SLOT(reparse()) ); + + connect( this, SIGNAL(doubleClicked(QListViewItem*)), + this, SLOT(slotSelected(QListViewItem*)) ); + connect( this, SIGNAL(returnPressed(QListViewItem*)), + this, SLOT(slotSelected(QListViewItem*)) ); + + configure(); +} + +ProblemReporter::~ProblemReporter() +{ + if( m_bgParser ) { + m_bgParser->wait(); + } + + delete( m_bgParser ); + m_bgParser = 0; +} + +void ProblemReporter::slotActivePartChanged( KParts::Part* part ) +{ + if( !part ) + return; + + if( m_editor ) + reparse(); + + m_document = dynamic_cast<KTextEditor::Document*>( part ); + if( m_document ){ + m_filename = m_document->url().path(); + } + + m_editor = dynamic_cast<KTextEditor::EditInterface*>( part ); + if( m_editor ) + connect( m_document, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) ); + + m_markIface = dynamic_cast<KTextEditor::MarkInterface*>( part ); + + m_timer->changeInterval( m_delay ); +} + +void ProblemReporter::slotTextChanged() +{ + if( m_active ) + m_timer->changeInterval( m_delay ); +} + +void ProblemReporter::reparse() +{ + kdDebug() << "ProblemReporter::reparse()" << endl; + + if( !m_editor ) + return; + + m_timer->stop(); + + if( m_bgParser ) { + if( m_bgParser->running() ) { + m_timer->changeInterval( m_delay ); + return; + } + + delete( m_bgParser ); + m_bgParser = 0; + } + + QListViewItem* current = firstChild(); + while( current ){ + QListViewItem* i = current; + current = current->nextSibling(); + + if( i->text(2) == m_filename ) + delete( i ); + } + + if( m_markIface ){ + QPtrList<KTextEditor::Mark> marks = m_markIface->marks(); + QPtrListIterator<KTextEditor::Mark> it( marks ); + while( it.current() ){ + m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 ); + ++it; + } + } + +/* Temporarily deactivated (crashes)*/ + if (!m_adaSupport->fileExtensions ().contains (QFileInfo (m_filename).extension ())) + { + m_bgParser = new BackgroundParser( this, m_editor->text(), m_filename ); + m_bgParser->start(); + } + /**/ +} + +void ProblemReporter::slotSelected( QListViewItem* item ) +{ + KURL url( item->text(2) ); + int line = item->text( 3 ).toInt(); + // int column = item->text( 4 ).toInt(); + m_adaSupport->partController()->editDocument( url, line-1 ); +} + +void ProblemReporter::reportError( QString message, + QString filename, + int line, int column ) +{ + if( m_markIface ){ + m_markIface->addMark( line-1, KTextEditor::MarkInterface::markType07 ); + } + + new ProblemItem( this, + "error", + message.replace( QRegExp("\n"), "" ), + filename, + QString::number( line ), + QString::number( column ) ); +} + +void ProblemReporter::reportWarning( QString message, + QString filename, + int line, int column ) +{ + new ProblemItem( this, + "warning", + message.replace( QRegExp("\n"), "" ), + filename, + QString::number( line ), + QString::number( column ) ); +} + +void ProblemReporter::reportMessage( QString message, + QString filename, + int line, int column ) +{ + new QListViewItem( this, + "message", + message.replace( QRegExp("\n"), "" ), + filename, + QString::number( line ), + QString::number( column ) ); +} + +void ProblemReporter::configure() +{ + kdDebug() << "ProblemReporter::configure()" << endl; + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + m_active = config->readBoolEntry( "EnableAdaBgParser", TRUE ); + m_delay = config->readNumEntry( "BgParserDelay", 500 ); +} + +void ProblemReporter::configWidget( KDialogBase* dlg ) +{ + kdDebug() << "ProblemReporter::configWidget()" << endl; + QVBox *vbox = dlg->addVBoxPage(i18n("Ada Parsing"), i18n("Ada Parsing"), BarIcon( "source", KIcon::SizeMedium )); + ConfigureProblemReporter* w = new ConfigureProblemReporter( vbox ); + connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + connect(dlg, SIGNAL(okClicked()), this, SLOT(configure())); +} + +void ProblemReporter::slotPartAdded( KParts::Part* part ) +{ + KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( part ); + + if( !iface ) + return; + + iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") ); +} + +void ProblemReporter::slotPartRemoved( KParts::Part* part ) +{ + kdDebug() << "ProblemReporter::slotPartRemoved()" << endl; + if( part == m_document ){ + m_document = 0; + m_editor = 0; + m_timer->stop(); + } +} + +#include "problemreporter.moc" diff --git a/languages/ada/problemreporter.h b/languages/ada/problemreporter.h new file mode 100644 index 00000000..b42a6ad3 --- /dev/null +++ b/languages/ada/problemreporter.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org> + Copyright (C) 2003 Oliver Kellogg <okellogg@users.sourceforge.net> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef PROBLEMSREPORTER_H +#define PROBLEMSREPORTER_H + +#include <qlistview.h> + +class AdaSupportPart; +class QTimer; +class KDialogBase; +class BackgroundParser; + +namespace KParts{ + class Part; +} + +namespace KTextEditor{ + class EditInterface; + class MarkInterface; + class Document; +} + +class ProblemReporter: public QListView{ + Q_OBJECT +public: + ProblemReporter( AdaSupportPart* part, QWidget* parent=0, const char* name=0 ); + virtual ~ProblemReporter(); + + virtual void reportError( QString message, QString filename, + int line, int column ); + + virtual void reportWarning( QString message, QString filename, + int line, int column ); + + virtual void reportMessage( QString message, QString filename, + int line, int column ); + +public slots: + void reparse(); + void configure(); + void configWidget( KDialogBase* ); + +private slots: + void slotPartAdded( KParts::Part* ); + void slotPartRemoved( KParts::Part* ); + void slotActivePartChanged( KParts::Part* ); + void slotTextChanged(); + void slotSelected( QListViewItem* ); + +private: + AdaSupportPart* m_adaSupport; + KTextEditor::EditInterface* m_editor; + KTextEditor::Document* m_document; + KTextEditor::MarkInterface* m_markIface; + QTimer* m_timer; + QString m_filename; + int m_active; + int m_delay; + BackgroundParser* m_bgParser; +}; + +#endif |