2008-12-02 12:01:29 +01:00
|
|
|
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
|
|
|
|
|
//
|
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
|
//
|
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
|
//
|
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
// THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
#include "AST.h"
|
|
|
|
|
#include "ASTVisitor.h"
|
2009-11-12 17:35:48 +01:00
|
|
|
#include "ASTMatcher.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "MemoryPool.h"
|
|
|
|
|
|
2013-05-13 10:20:00 +02:00
|
|
|
#include "cppassert.h"
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <algorithm>
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
|
|
|
|
|
/*
|
2013-10-07 13:34:40 +02:00
|
|
|
All firstToken/lastToken functions below which have a doxygen comment with
|
2012-10-29 13:54:33 +01:00
|
|
|
\generated in it, will be re-generated when the tool "cplusplus-update-frontend" is run.
|
2010-06-23 16:50:11 +02:00
|
|
|
|
2013-10-07 13:34:40 +02:00
|
|
|
For functions which are hand-coded, or which should not be changed, make sure that
|
2010-06-23 16:50:11 +02:00
|
|
|
the comment is gone.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2009-10-20 11:21:25 +02:00
|
|
|
using namespace CPlusPlus;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
AST::AST()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
AST::~AST()
|
2013-05-13 10:20:00 +02:00
|
|
|
{ CPP_CHECK(0); }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
void AST::accept(ASTVisitor *visitor)
|
|
|
|
|
{
|
|
|
|
|
if (visitor->preVisit(this))
|
|
|
|
|
accept0(visitor);
|
|
|
|
|
visitor->postVisit(this);
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-12 17:35:48 +01:00
|
|
|
bool AST::match(AST *ast, AST *pattern, ASTMatcher *matcher)
|
|
|
|
|
{
|
|
|
|
|
if (ast == pattern)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
else if (! ast || ! pattern)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return ast->match(pattern, matcher);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool AST::match(AST *pattern, ASTMatcher *matcher)
|
|
|
|
|
{
|
|
|
|
|
return match0(pattern, matcher);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-24 18:40:10 +02:00
|
|
|
int GnuAttributeSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return attribute_token;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-14 23:07:05 +03:00
|
|
|
int MsvcDeclspecSpecifierAST::firstToken() const
|
|
|
|
|
{
|
|
|
|
|
return attribute_token;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StdAttributeSpecifierAST::firstToken() const
|
|
|
|
|
{
|
|
|
|
|
return first_lbracket_token;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-24 18:40:10 +02:00
|
|
|
int BaseSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (virtual_token && access_specifier_token)
|
|
|
|
|
return std::min(virtual_token, access_specifier_token);
|
|
|
|
|
if (virtual_token)
|
|
|
|
|
return virtual_token;
|
|
|
|
|
if (access_specifier_token)
|
|
|
|
|
return access_specifier_token;
|
2010-07-05 17:07:49 +02:00
|
|
|
if (name)
|
2011-08-08 09:54:06 +02:00
|
|
|
return name->firstToken();
|
2010-07-05 17:07:49 +02:00
|
|
|
// assert?
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2019-07-24 18:40:10 +02:00
|
|
|
int BaseSpecifierAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2015-02-25 21:22:16 +01:00
|
|
|
if (ellipsis_token)
|
|
|
|
|
return ellipsis_token;
|
|
|
|
|
else if (name)
|
2010-06-23 16:50:11 +02:00
|
|
|
return name->lastToken();
|
|
|
|
|
else if (virtual_token && access_specifier_token)
|
|
|
|
|
return std::max(virtual_token, access_specifier_token) + 1;
|
|
|
|
|
else if (virtual_token)
|
|
|
|
|
return virtual_token + 1;
|
|
|
|
|
else if (access_specifier_token)
|
|
|
|
|
return access_specifier_token + 1;
|
|
|
|
|
// assert?
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AccessDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (access_specifier_token)
|
|
|
|
|
return access_specifier_token;
|
|
|
|
|
if (slots_token)
|
|
|
|
|
return slots_token;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AccessDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (slots_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return slots_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (access_specifier_token)
|
|
|
|
|
return access_specifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-16 17:29:40 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ArrayAccessAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 14:38:41 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ArrayAccessAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-06-23 14:38:41 +02:00
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ArrayDeclaratorAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ArrayDeclaratorAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ArrayInitializerAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ArrayInitializerAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AsmDefinitionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (asm_token)
|
|
|
|
|
return asm_token;
|
|
|
|
|
if (volatile_token)
|
|
|
|
|
return volatile_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AsmDefinitionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (volatile_token)
|
2009-02-05 11:37:51 +01:00
|
|
|
return volatile_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (asm_token)
|
|
|
|
|
return asm_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int GnuAttributeAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (tag_token)
|
|
|
|
|
return tag_token;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rparen_token)
|
2010-06-23 16:50:11 +02:00
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2009-11-30 16:30:21 +01:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int GnuAttributeAST::lastToken() const
|
2009-11-30 16:30:21 +01:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (tag_token)
|
|
|
|
|
return tag_token + 1;
|
|
|
|
|
if (lparen_token)
|
2009-11-30 16:30:21 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-11-30 16:30:21 +01:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BinaryExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (left_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = left_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (binary_op_token)
|
|
|
|
|
return binary_op_token;
|
|
|
|
|
if (right_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = right_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BinaryExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (right_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = right_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (binary_op_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return binary_op_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (left_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = left_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BoolLiteralAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BoolLiteralAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-02-04 14:55:18 +01:00
|
|
|
}
|
2009-01-13 14:58:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BracedInitializerAST::firstToken() const
|
2009-01-13 14:58:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token;
|
|
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2009-01-13 14:58:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BracedInitializerAST::lastToken() const
|
2009-01-13 14:58:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token + 1;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-01-13 14:58:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BreakStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (break_token)
|
|
|
|
|
return break_token;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BreakStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (break_token)
|
|
|
|
|
return break_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CallAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 14:38:41 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CallAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-06-23 14:38:41 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2010-06-23 14:38:41 +02:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CaptureAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
2012-10-25 16:22:42 +02:00
|
|
|
if (amper_token)
|
|
|
|
|
return amper_token;
|
|
|
|
|
if (identifier)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier->firstToken())
|
2012-10-25 16:22:42 +02:00
|
|
|
return candidate;
|
2010-06-23 16:50:11 +02:00
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CaptureAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
2012-10-25 16:22:42 +02:00
|
|
|
if (identifier)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier->lastToken())
|
2012-10-25 16:22:42 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (amper_token)
|
|
|
|
|
return amper_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CaseStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (case_token)
|
|
|
|
|
return case_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CaseStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return colon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (case_token)
|
|
|
|
|
return case_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CastExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CastExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CatchClauseAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (catch_token)
|
|
|
|
|
return catch_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (exception_declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = exception_declaration->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CatchClauseAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return rparen_token + 1;
|
2009-06-17 16:08:01 +02:00
|
|
|
if (exception_declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = exception_declaration->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-01-02 17:36:08 +01:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (catch_token)
|
|
|
|
|
return catch_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ClassSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (classkey_token)
|
|
|
|
|
return classkey_token;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-06-25 23:49:17 +04:00
|
|
|
if (final_token)
|
|
|
|
|
return final_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (base_clause_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_clause_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (member_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ClassSpecifierAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (member_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbrace_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return lbrace_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (dot_dot_dot_token)
|
2010-03-23 13:52:24 +01:00
|
|
|
return dot_dot_dot_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (base_clause_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_clause_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-06-01 11:42:49 +02:00
|
|
|
if (colon_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return colon_token + 1;
|
2012-06-25 23:49:17 +04:00
|
|
|
if (final_token)
|
|
|
|
|
return final_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (classkey_token)
|
|
|
|
|
return classkey_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2009-01-02 17:36:08 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CompoundExpressionAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CompoundExpressionAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2009-01-02 17:36:08 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CompoundLiteralAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2009-01-02 17:36:08 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CompoundLiteralAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CompoundStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (statement_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CompoundStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (statement_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ConditionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-10 16:47:16 +01:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ConditionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ConditionalExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (question_token)
|
|
|
|
|
return question_token;
|
|
|
|
|
if (left_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = left_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (right_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = right_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ConditionalExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (right_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = right_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return colon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (left_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = left_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (question_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return question_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ContinueStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (continue_token)
|
|
|
|
|
return continue_token;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ContinueStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (continue_token)
|
|
|
|
|
return continue_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ConversionFunctionIdAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (operator_token)
|
|
|
|
|
return operator_token;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ptr_operator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ptr_operator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ConversionFunctionIdAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-10 16:47:16 +01:00
|
|
|
if (ptr_operator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ptr_operator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (operator_token)
|
|
|
|
|
return operator_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CppCastExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (cast_token)
|
|
|
|
|
return cast_token;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CppCastExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:36:08 +01:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (greater_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return greater_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (less_token)
|
2009-01-02 17:36:08 +01:00
|
|
|
return less_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (cast_token)
|
|
|
|
|
return cast_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CtorInitializerAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (member_initializer_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_initializer_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int CtorInitializerAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-03-23 13:43:18 +01:00
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (member_initializer_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_initializer_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeclarationStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2008-12-02 12:01:29 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeclarationStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeclaratorAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ptr_operator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ptr_operator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (core_declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = core_declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (postfix_declarator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = postfix_declarator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (post_attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = post_attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-08-16 11:38:34 +02:00
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeclaratorAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-08-16 11:38:34 +02:00
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token + 1;
|
2023-02-28 11:09:50 +01:00
|
|
|
if (requiresClause)
|
|
|
|
|
return requiresClause->lastToken();
|
2010-06-23 16:50:11 +02:00
|
|
|
if (post_attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = post_attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (postfix_declarator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = postfix_declarator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (core_declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = core_declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ptr_operator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ptr_operator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeclaratorIdAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-03-25 10:26:33 +01:00
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeclaratorIdAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-03-25 10:26:33 +01:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
2010-03-25 10:26:33 +01:00
|
|
|
return dot_dot_dot_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeleteExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (scope_token)
|
|
|
|
|
return scope_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (delete_token)
|
|
|
|
|
return delete_token;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DeleteExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
2008-12-02 12:01:29 +01:00
|
|
|
return rbracket_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbracket_token)
|
2009-01-02 17:48:31 +01:00
|
|
|
return lbracket_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (delete_token)
|
2009-01-02 17:48:31 +01:00
|
|
|
return delete_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (scope_token)
|
|
|
|
|
return scope_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DestructorNameAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (tilde_token)
|
|
|
|
|
return tilde_token;
|
2012-02-16 10:54:44 +01:00
|
|
|
if (unqualified_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = unqualified_name->firstToken())
|
2012-02-16 10:54:44 +01:00
|
|
|
return candidate;
|
2010-06-23 16:50:11 +02:00
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DestructorNameAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-02-16 10:54:44 +01:00
|
|
|
if (unqualified_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = unqualified_name->lastToken())
|
2012-02-16 10:54:44 +01:00
|
|
|
return candidate;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (tilde_token)
|
|
|
|
|
return tilde_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DoStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (do_token)
|
|
|
|
|
return do_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (while_token)
|
|
|
|
|
return while_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DoStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:51:48 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
2009-01-02 17:51:48 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-01-02 17:51:48 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (while_token)
|
2009-01-02 17:51:48 +01:00
|
|
|
return while_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (do_token)
|
|
|
|
|
return do_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ElaboratedTypeSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (classkey_token)
|
|
|
|
|
return classkey_token;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ElaboratedTypeSpecifierAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-03-22 18:23:17 +01:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (classkey_token)
|
|
|
|
|
return classkey_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int EmptyDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int EmptyDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int EnumSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (enum_token)
|
|
|
|
|
return enum_token;
|
2012-09-18 11:17:29 +02:00
|
|
|
if (key_token)
|
|
|
|
|
return key_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-09-18 11:17:29 +02:00
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2012-09-18 11:17:29 +02:00
|
|
|
return candidate;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (enumerator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = enumerator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-12-16 12:25:51 +01:00
|
|
|
if (stray_comma_token)
|
|
|
|
|
return stray_comma_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int EnumSpecifierAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:54:01 +01:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
2010-12-16 12:25:51 +01:00
|
|
|
if (stray_comma_token)
|
|
|
|
|
return stray_comma_token + 1;
|
2009-11-10 16:47:16 +01:00
|
|
|
if (enumerator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = enumerator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-01-02 17:54:01 +01:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token + 1;
|
2012-09-18 11:17:29 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2012-09-18 11:17:29 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token + 1;
|
2009-01-02 17:54:01 +01:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-09-18 11:17:29 +02:00
|
|
|
if (key_token)
|
|
|
|
|
return key_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (enum_token)
|
|
|
|
|
return enum_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int EnumeratorAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int EnumeratorAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
2008-12-02 12:01:29 +01:00
|
|
|
return equal_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExceptionDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-10 16:47:16 +01:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-01-02 17:57:28 +01:00
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExceptionDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DynamicExceptionSpecificationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (throw_token)
|
|
|
|
|
return throw_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
if (type_id_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DynamicExceptionSpecificationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-02 17:59:27 +01:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
2009-01-02 17:59:27 +01:00
|
|
|
return dot_dot_dot_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
2009-01-02 17:59:27 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (throw_token)
|
|
|
|
|
return throw_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExpressionOrDeclarationStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExpressionOrDeclarationStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExpressionStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExpressionStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-05 10:18:16 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ForStatementAST::firstToken() const
|
2009-07-03 09:11:52 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (for_token)
|
|
|
|
|
return for_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-03 09:11:52 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ForStatementAST::lastToken() const
|
2009-07-03 09:11:52 +02:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
2009-07-03 09:11:52 +02:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (for_token)
|
|
|
|
|
return for_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-03 09:11:52 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ForeachStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (foreach_token)
|
|
|
|
|
return foreach_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ForeachStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
2009-01-05 10:18:16 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token + 1;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-01-05 10:18:16 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (foreach_token)
|
|
|
|
|
return foreach_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2019-07-24 18:40:10 +02:00
|
|
|
int FunctionDeclaratorAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (parameter_declaration_clause)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_declaration_clause->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
2022-04-04 18:05:31 +02:00
|
|
|
const int firstQualListToken = cv_qualifier_list ? cv_qualifier_list->firstToken() : 0;
|
|
|
|
|
const auto isBeforeFirstQualListToken = [firstQualListToken](int token) {
|
|
|
|
|
return token && (!firstQualListToken || token < firstQualListToken);
|
|
|
|
|
};
|
|
|
|
|
if (isBeforeFirstQualListToken(ref_qualifier_token))
|
2012-09-17 12:26:49 +02:00
|
|
|
return ref_qualifier_token;
|
2022-04-04 18:05:31 +02:00
|
|
|
if (exception_specification) {
|
|
|
|
|
const int candidate = exception_specification->firstToken();
|
|
|
|
|
if (isBeforeFirstQualListToken(candidate))
|
|
|
|
|
return candidate;
|
|
|
|
|
}
|
|
|
|
|
if (trailing_return_type) {
|
|
|
|
|
const int candidate = trailing_return_type->firstToken();
|
|
|
|
|
if (isBeforeFirstQualListToken(candidate))
|
|
|
|
|
return candidate;
|
|
|
|
|
}
|
|
|
|
|
if (firstQualListToken)
|
|
|
|
|
return firstQualListToken;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (as_cpp_initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = as_cpp_initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2019-07-24 18:40:10 +02:00
|
|
|
int FunctionDeclaratorAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (as_cpp_initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = as_cpp_initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2022-04-04 18:05:31 +02:00
|
|
|
const int lastQualListToken = cv_qualifier_list ? cv_qualifier_list->lastToken() : 0;
|
|
|
|
|
const auto tokenOrLastQualListToken = [lastQualListToken](int token) {
|
|
|
|
|
return std::max(token ? token + 1 : 0, lastQualListToken);
|
|
|
|
|
};
|
|
|
|
|
const auto tokenFromAstOrLastQualListToken = [lastQualListToken](const AST *ast) {
|
|
|
|
|
return std::max(ast ? ast->lastToken() : 0, lastQualListToken);
|
|
|
|
|
};
|
|
|
|
|
if (int candidate = tokenFromAstOrLastQualListToken(trailing_return_type))
|
|
|
|
|
return candidate;
|
|
|
|
|
if (int candidate = tokenFromAstOrLastQualListToken(exception_specification))
|
|
|
|
|
return candidate;
|
|
|
|
|
if (int candidate = tokenOrLastQualListToken(ref_qualifier_token))
|
|
|
|
|
return candidate;
|
|
|
|
|
if (lastQualListToken)
|
|
|
|
|
return lastQualListToken;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
2009-01-05 10:20:58 +01:00
|
|
|
return rparen_token + 1;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (parameter_declaration_clause)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_declaration_clause->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int FunctionDefinitionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (qt_invokable_token)
|
|
|
|
|
return qt_invokable_token;
|
2009-11-10 16:47:16 +01:00
|
|
|
if (decl_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = decl_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ctor_initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ctor_initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (function_body)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = function_body->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int FunctionDefinitionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (function_body)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = function_body->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ctor_initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ctor_initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (decl_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = decl_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (qt_invokable_token)
|
|
|
|
|
return qt_invokable_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int GotoStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (goto_token)
|
|
|
|
|
return goto_token;
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int GotoStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-05 10:24:09 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
2009-01-05 10:24:09 +01:00
|
|
|
return identifier_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (goto_token)
|
2009-01-05 10:24:09 +01:00
|
|
|
return goto_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int IdExpressionAST::firstToken() const
|
2010-09-09 15:18:17 +02:00
|
|
|
{
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-09-09 15:18:17 +02:00
|
|
|
return candidate;
|
2009-01-05 10:24:09 +01:00
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-09-09 15:18:17 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int IdExpressionAST::lastToken() const
|
2010-09-09 15:18:17 +02:00
|
|
|
{
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-09-09 15:18:17 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int IfStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (if_token)
|
|
|
|
|
return if_token;
|
2020-05-14 23:07:05 +03:00
|
|
|
if (constexpr_token)
|
|
|
|
|
return constexpr_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (else_token)
|
|
|
|
|
return else_token;
|
|
|
|
|
if (else_statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = else_statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int IfStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (else_statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = else_statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (else_token)
|
2008-12-02 12:01:29 +01:00
|
|
|
return else_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
2009-01-05 10:26:20 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-01-05 10:26:20 +01:00
|
|
|
return lparen_token + 1;
|
2020-05-14 23:07:05 +03:00
|
|
|
if (constexpr_token)
|
|
|
|
|
return constexpr_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (if_token)
|
|
|
|
|
return if_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LabeledStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (label_token)
|
|
|
|
|
return label_token;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LabeledStatementAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
2009-01-05 10:27:49 +01:00
|
|
|
return colon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (label_token)
|
|
|
|
|
return label_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaCaptureAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (default_capture_token)
|
|
|
|
|
return default_capture_token;
|
|
|
|
|
if (capture_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = capture_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaCaptureAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (capture_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = capture_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (default_capture_token)
|
|
|
|
|
return default_capture_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaDeclaratorAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (parameter_declaration_clause)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_declaration_clause->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (attributes)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attributes->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (mutable_token)
|
|
|
|
|
return mutable_token;
|
|
|
|
|
if (exception_specification)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = exception_specification->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (trailing_return_type)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = trailing_return_type->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaDeclaratorAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (trailing_return_type)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = trailing_return_type->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (exception_specification)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = exception_specification->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (mutable_token)
|
|
|
|
|
return mutable_token + 1;
|
|
|
|
|
if (attributes)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attributes->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (parameter_declaration_clause)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_declaration_clause->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaExpressionAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (lambda_introducer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = lambda_introducer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lambda_declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = lambda_declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaExpressionAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lambda_declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = lambda_declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lambda_introducer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = lambda_introducer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaIntroducerAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (lambda_capture)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = lambda_capture->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LambdaIntroducerAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token + 1;
|
|
|
|
|
if (lambda_capture)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = lambda_capture->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LinkageBodyAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LinkageBodyAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-05 10:29:12 +01:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LinkageSpecificationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (extern_token)
|
|
|
|
|
return extern_token;
|
|
|
|
|
if (extern_type_token)
|
|
|
|
|
return extern_type_token;
|
|
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int LinkageSpecificationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (extern_type_token)
|
2009-06-05 09:44:25 +02:00
|
|
|
return extern_type_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (extern_token)
|
|
|
|
|
return extern_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int MemInitializerAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-09-17 09:58:09 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int MemInitializerAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-09-17 09:58:09 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int MemberAccessAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 14:38:41 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (access_token)
|
|
|
|
|
return access_token;
|
|
|
|
|
if (template_token)
|
|
|
|
|
return template_token;
|
|
|
|
|
if (member_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int MemberAccessAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (member_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (template_token)
|
2009-01-05 10:32:28 +01:00
|
|
|
return template_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (access_token)
|
2010-06-23 14:38:41 +02:00
|
|
|
return access_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NamedTypeSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NamedTypeSpecifierAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NamespaceAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-02-02 10:19:58 +01:00
|
|
|
if (inline_token)
|
|
|
|
|
return inline_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (namespace_token)
|
|
|
|
|
return namespace_token;
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (linkage_body)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = linkage_body->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NamespaceAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (linkage_body)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = linkage_body->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (identifier_token)
|
2008-12-02 12:01:29 +01:00
|
|
|
return identifier_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (namespace_token)
|
|
|
|
|
return namespace_token + 1;
|
2012-02-02 10:19:58 +01:00
|
|
|
if (inline_token)
|
|
|
|
|
return inline_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NamespaceAliasDefinitionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (namespace_token)
|
|
|
|
|
return namespace_token;
|
|
|
|
|
if (namespace_name_token)
|
|
|
|
|
return namespace_name_token;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NamespaceAliasDefinitionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-05 10:40:11 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
2009-01-05 10:40:11 +01:00
|
|
|
return equal_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (namespace_name_token)
|
2009-06-05 09:44:25 +02:00
|
|
|
return namespace_name_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (namespace_token)
|
|
|
|
|
return namespace_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NestedDeclaratorAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NestedDeclaratorAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-05 10:41:26 +01:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NestedExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NestedExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-05 14:07:57 +01:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NestedNameSpecifierAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (class_or_namespace_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = class_or_namespace_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-01-05 14:07:57 +01:00
|
|
|
if (scope_token)
|
2010-06-23 16:50:11 +02:00
|
|
|
return scope_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NestedNameSpecifierAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (scope_token)
|
|
|
|
|
return scope_token + 1;
|
|
|
|
|
if (class_or_namespace_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = class_or_namespace_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-02-10 14:43:19 +01:00
|
|
|
}
|
2009-01-06 12:13:49 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NewArrayDeclaratorAST::firstToken() const
|
2009-02-10 14:43:19 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
return 0;
|
2009-02-10 14:43:19 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NewArrayDeclaratorAST::lastToken() const
|
2009-02-10 14:43:19 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NewExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
if (scope_token)
|
|
|
|
|
return scope_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (new_token)
|
|
|
|
|
return new_token;
|
|
|
|
|
if (new_placement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_placement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (new_type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (new_initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NewExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (new_initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (new_type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (new_placement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_placement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-02-10 14:43:19 +01:00
|
|
|
if (new_token)
|
2009-01-06 11:30:42 +01:00
|
|
|
return new_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (scope_token)
|
2009-01-06 11:30:42 +01:00
|
|
|
return scope_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExpressionListParenAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ExpressionListParenAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (expression_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NewTypeIdAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ptr_operator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ptr_operator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (new_array_declarator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_array_declarator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NewTypeIdAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-10 16:47:16 +01:00
|
|
|
if (new_array_declarator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = new_array_declarator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ptr_operator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = ptr_operator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NumericLiteralAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NumericLiteralAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCClassDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (interface_token)
|
|
|
|
|
return interface_token;
|
|
|
|
|
if (implementation_token)
|
|
|
|
|
return implementation_token;
|
|
|
|
|
if (class_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = class_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (category_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = category_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (superclass)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = superclass->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_refs)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = protocol_refs->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (inst_vars_decl)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = inst_vars_decl->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (member_declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_declaration_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (end_token)
|
|
|
|
|
return end_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCClassDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (end_token)
|
|
|
|
|
return end_token + 1;
|
|
|
|
|
if (member_declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_declaration_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (inst_vars_decl)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = inst_vars_decl->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_refs)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = protocol_refs->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (superclass)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = superclass->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token + 1;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (category_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = category_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (class_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = class_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (implementation_token)
|
|
|
|
|
return implementation_token + 1;
|
|
|
|
|
if (interface_token)
|
|
|
|
|
return interface_token + 1;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCClassForwardDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (class_token)
|
|
|
|
|
return class_token;
|
|
|
|
|
if (identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCClassForwardDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (class_token)
|
|
|
|
|
return class_token + 1;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCDynamicPropertiesDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (dynamic_token)
|
|
|
|
|
return dynamic_token;
|
|
|
|
|
if (property_identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_identifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCDynamicPropertiesDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (property_identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_identifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dynamic_token)
|
|
|
|
|
return dynamic_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCEncodeExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (encode_token)
|
|
|
|
|
return encode_token;
|
|
|
|
|
if (type_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCEncodeExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (encode_token)
|
|
|
|
|
return encode_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCFastEnumerationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (for_token)
|
|
|
|
|
return for_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (in_token)
|
|
|
|
|
return in_token;
|
|
|
|
|
if (fast_enumeratable_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = fast_enumeratable_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCFastEnumerationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (fast_enumeratable_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = fast_enumeratable_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (in_token)
|
|
|
|
|
return in_token + 1;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (for_token)
|
|
|
|
|
return for_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCInstanceVariablesDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token;
|
|
|
|
|
if (instance_variable_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = instance_variable_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCInstanceVariablesDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rbrace_token)
|
|
|
|
|
return rbrace_token + 1;
|
|
|
|
|
if (instance_variable_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = instance_variable_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbrace_token)
|
|
|
|
|
return lbrace_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMessageArgumentAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (parameter_value_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_value_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMessageArgumentAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (parameter_value_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_value_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMessageArgumentDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (param_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = param_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMessageArgumentDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (param_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = param_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMessageExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (receiver_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = receiver_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = argument_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMessageExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token + 1;
|
|
|
|
|
if (argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = argument_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (receiver_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = receiver_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMethodDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (method_prototype)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = method_prototype->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (function_body)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = function_body->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMethodDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-01-06 11:48:39 +01:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (function_body)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = function_body->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (method_prototype)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = method_prototype->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMethodPrototypeAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (method_type_token)
|
|
|
|
|
return method_type_token;
|
|
|
|
|
if (type_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = argument_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCMethodPrototypeAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
|
|
|
|
if (argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = argument_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (method_type_token)
|
|
|
|
|
return method_type_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCPropertyAttributeAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_identifier_token)
|
|
|
|
|
return attribute_identifier_token;
|
|
|
|
|
if (equals_token)
|
|
|
|
|
return equals_token;
|
|
|
|
|
if (method_selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = method_selector->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCPropertyAttributeAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (method_selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = method_selector->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equals_token)
|
|
|
|
|
return equals_token + 1;
|
|
|
|
|
if (attribute_identifier_token)
|
|
|
|
|
return attribute_identifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCPropertyDeclarationAST::firstToken() const
|
2010-02-23 17:43:40 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (property_token)
|
|
|
|
|
return property_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (property_attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (simple_declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = simple_declaration->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2010-02-23 17:43:40 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCPropertyDeclarationAST::lastToken() const
|
2010-02-23 17:43:40 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (simple_declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = simple_declaration->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (property_attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (property_token)
|
|
|
|
|
return property_token + 1;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-02-23 17:43:40 +01:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_token)
|
|
|
|
|
return protocol_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_refs)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = protocol_refs->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (member_declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_declaration_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (end_token)
|
|
|
|
|
return end_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (end_token)
|
|
|
|
|
return end_token + 1;
|
|
|
|
|
if (member_declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = member_declaration_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_refs)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = protocol_refs->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_token)
|
|
|
|
|
return protocol_token + 1;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolExpressionAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (protocol_token)
|
|
|
|
|
return protocol_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token + 1;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (protocol_token)
|
|
|
|
|
return protocol_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolForwardDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_token)
|
|
|
|
|
return protocol_token;
|
|
|
|
|
if (identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolForwardDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (protocol_token)
|
|
|
|
|
return protocol_token + 1;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2010-03-25 10:43:16 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolRefsAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token;
|
|
|
|
|
if (identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2010-03-25 10:43:16 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCProtocolRefsAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token + 1;
|
|
|
|
|
if (identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = identifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2010-03-25 10:43:16 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSelectorAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (selector_argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector_argument_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSelectorAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (selector_argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector_argument_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSelectorArgumentAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (name_token)
|
|
|
|
|
return name_token;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSelectorArgumentAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token + 1;
|
|
|
|
|
if (name_token)
|
|
|
|
|
return name_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSelectorExpressionAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (selector_token)
|
|
|
|
|
return selector_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSelectorExpressionAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (selector)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = selector->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (selector_token)
|
|
|
|
|
return selector_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSynchronizedStatementAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (synchronized_token)
|
|
|
|
|
return synchronized_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (synchronized_object)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = synchronized_object->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
2008-12-02 12:01:29 +01:00
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2009-11-10 16:19:52 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSynchronizedStatementAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
2009-01-06 11:51:30 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (synchronized_object)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = synchronized_object->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-01-06 11:51:30 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (synchronized_token)
|
|
|
|
|
return synchronized_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSynthesizedPropertiesDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (synthesized_token)
|
|
|
|
|
return synthesized_token;
|
|
|
|
|
if (property_identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_identifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSynthesizedPropertiesDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (property_identifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_identifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (synthesized_token)
|
|
|
|
|
return synthesized_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSynthesizedPropertyAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (property_identifier_token)
|
|
|
|
|
return property_identifier_token;
|
|
|
|
|
if (equals_token)
|
|
|
|
|
return equals_token;
|
|
|
|
|
if (alias_identifier_token)
|
|
|
|
|
return alias_identifier_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCSynthesizedPropertyAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (alias_identifier_token)
|
|
|
|
|
return alias_identifier_token + 1;
|
|
|
|
|
if (equals_token)
|
|
|
|
|
return equals_token + 1;
|
|
|
|
|
if (property_identifier_token)
|
|
|
|
|
return property_identifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCTypeNameAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_qualifier_token)
|
|
|
|
|
return type_qualifier_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCTypeNameAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_qualifier_token)
|
|
|
|
|
return type_qualifier_token + 1;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCVisibilityDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (visibility_token)
|
|
|
|
|
return visibility_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ObjCVisibilityDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (visibility_token)
|
|
|
|
|
return visibility_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int OperatorAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (op_token)
|
|
|
|
|
return op_token;
|
|
|
|
|
if (open_token)
|
|
|
|
|
return open_token;
|
|
|
|
|
if (close_token)
|
|
|
|
|
return close_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int OperatorAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (close_token)
|
|
|
|
|
return close_token + 1;
|
|
|
|
|
if (open_token)
|
|
|
|
|
return open_token + 1;
|
|
|
|
|
if (op_token)
|
|
|
|
|
return op_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int OperatorFunctionIdAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (operator_token)
|
|
|
|
|
return operator_token;
|
|
|
|
|
if (op)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = op->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-01-19 15:26:08 +10:00
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int OperatorFunctionIdAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (op)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = op->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (operator_token)
|
|
|
|
|
return operator_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ParameterDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ParameterDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token + 1;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ParameterDeclarationClauseAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (parameter_declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_declaration_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ParameterDeclarationClauseAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
|
|
|
|
if (parameter_declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = parameter_declaration_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PointerAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (star_token)
|
|
|
|
|
return star_token;
|
|
|
|
|
if (cv_qualifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = cv_qualifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PointerAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (cv_qualifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = cv_qualifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (star_token)
|
|
|
|
|
return star_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PointerToMemberAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (global_scope_token)
|
|
|
|
|
return global_scope_token;
|
|
|
|
|
if (nested_name_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = nested_name_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (star_token)
|
|
|
|
|
return star_token;
|
|
|
|
|
if (cv_qualifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = cv_qualifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-09-17 12:26:49 +02:00
|
|
|
if (ref_qualifier_token)
|
|
|
|
|
return ref_qualifier_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PointerToMemberAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-09-17 12:26:49 +02:00
|
|
|
if (ref_qualifier_token)
|
|
|
|
|
return ref_qualifier_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (cv_qualifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = cv_qualifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (star_token)
|
|
|
|
|
return star_token + 1;
|
|
|
|
|
if (nested_name_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = nested_name_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (global_scope_token)
|
|
|
|
|
return global_scope_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PostIncrDecrAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (incr_decr_token)
|
|
|
|
|
return incr_decr_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PostIncrDecrAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (incr_decr_token)
|
|
|
|
|
return incr_decr_token + 1;
|
|
|
|
|
if (base_expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = base_expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtEnumDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (enum_specifier_token)
|
|
|
|
|
return enum_specifier_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (enumerator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = enumerator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtEnumDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (enumerator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = enumerator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (enum_specifier_token)
|
|
|
|
|
return enum_specifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtFlagsDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (flags_specifier_token)
|
|
|
|
|
return flags_specifier_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (flag_enums_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = flag_enums_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtFlagsDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (flag_enums_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = flag_enums_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (flags_specifier_token)
|
|
|
|
|
return flags_specifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtInterfaceNameAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (interface_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = interface_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (constraint_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = constraint_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtInterfaceNameAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (constraint_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = constraint_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (interface_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = interface_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtInterfacesDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (interfaces_token)
|
|
|
|
|
return interfaces_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (interface_name_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = interface_name_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtInterfacesDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (interface_name_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = interface_name_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (interfaces_token)
|
|
|
|
|
return interfaces_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtMemberDeclarationAST::firstToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (q_token)
|
|
|
|
|
return q_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtMemberDeclarationAST::lastToken() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
2009-01-06 12:10:39 +01:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-01-06 12:10:39 +01:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (q_token)
|
|
|
|
|
return q_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtMethodAST::firstToken() const
|
2009-01-08 12:02:07 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (method_token)
|
|
|
|
|
return method_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2009-01-08 12:02:07 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtMethodAST::lastToken() const
|
2009-01-08 12:02:07 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (method_token)
|
|
|
|
|
return method_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2009-01-08 12:02:07 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtObjectTagAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (q_object_token)
|
|
|
|
|
return q_object_token;
|
|
|
|
|
return 0;
|
2009-01-08 12:02:07 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtObjectTagAST::lastToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (q_object_token)
|
|
|
|
|
return q_object_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtPrivateSlotAST::firstToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (q_private_slot_token)
|
|
|
|
|
return q_private_slot_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (dptr_token)
|
|
|
|
|
return dptr_token;
|
|
|
|
|
if (dptr_lparen_token)
|
|
|
|
|
return dptr_lparen_token;
|
|
|
|
|
if (dptr_rparen_token)
|
|
|
|
|
return dptr_rparen_token;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
2009-01-08 12:02:07 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtPrivateSlotAST::lastToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token + 1;
|
|
|
|
|
if (dptr_rparen_token)
|
|
|
|
|
return dptr_rparen_token + 1;
|
|
|
|
|
if (dptr_lparen_token)
|
|
|
|
|
return dptr_lparen_token + 1;
|
|
|
|
|
if (dptr_token)
|
|
|
|
|
return dptr_token + 1;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (q_private_slot_token)
|
|
|
|
|
return q_private_slot_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtPropertyDeclarationAST::firstToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (property_specifier_token)
|
|
|
|
|
return property_specifier_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
2010-12-08 15:08:03 +01:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-12-08 15:08:03 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (property_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (property_declaration_item_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_declaration_item_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2010-06-03 16:38:25 +02:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtPropertyDeclarationAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
2009-08-05 17:14:08 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (property_declaration_item_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_declaration_item_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (property_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = property_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-12-08 15:08:03 +01:00
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-12-08 15:08:03 +01:00
|
|
|
return candidate;
|
2009-08-05 17:14:08 +02:00
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (property_specifier_token)
|
|
|
|
|
return property_specifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtPropertyDeclarationItemAST::firstToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (item_name_token)
|
|
|
|
|
return item_name_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QtPropertyDeclarationItemAST::lastToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (item_name_token)
|
|
|
|
|
return item_name_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QualifiedNameAST::firstToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (global_scope_token)
|
|
|
|
|
return global_scope_token;
|
|
|
|
|
if (nested_name_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = nested_name_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (unqualified_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = unqualified_name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int QualifiedNameAST::lastToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (unqualified_name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = unqualified_name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (nested_name_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = nested_name_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (global_scope_token)
|
|
|
|
|
return global_scope_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ReferenceAST::firstToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (reference_token)
|
|
|
|
|
return reference_token;
|
|
|
|
|
return 0;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ReferenceAST::lastToken() const
|
2009-07-13 09:45:28 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (reference_token)
|
|
|
|
|
return reference_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-13 09:45:28 +02:00
|
|
|
}
|
2009-01-08 12:02:07 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ReturnStatementAST::firstToken() const
|
2009-07-15 12:11:07 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (return_token)
|
|
|
|
|
return return_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
2009-12-18 16:56:31 +01:00
|
|
|
return 0;
|
2009-07-15 12:11:07 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ReturnStatementAST::lastToken() const
|
2009-07-15 12:11:07 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (return_token)
|
|
|
|
|
return return_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
}
|
2009-07-15 12:11:07 +02:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SimpleDeclarationAST::firstToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (qt_invokable_token)
|
|
|
|
|
return qt_invokable_token;
|
|
|
|
|
if (decl_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = decl_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
2009-07-31 16:03:48 +02:00
|
|
|
return 0;
|
2009-07-15 12:11:07 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SimpleDeclarationAST::lastToken() const
|
2009-07-16 12:18:05 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (declarator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (decl_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = decl_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (qt_invokable_token)
|
|
|
|
|
return qt_invokable_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 12:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SimpleNameAST::firstToken() const
|
2009-07-16 12:18:05 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2009-07-16 12:18:05 +02:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SimpleNameAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
2009-07-16 12:18:05 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 12:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SimpleSpecifierAST::firstToken() const
|
2009-07-16 12:44:47 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (specifier_token)
|
|
|
|
|
return specifier_token;
|
|
|
|
|
return 0;
|
2009-07-16 12:44:47 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SimpleSpecifierAST::lastToken() const
|
2009-07-16 12:44:47 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (specifier_token)
|
|
|
|
|
return specifier_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 12:44:47 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SizeofExpressionAST::firstToken() const
|
2009-07-16 12:44:47 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (sizeof_token)
|
|
|
|
|
return sizeof_token;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2009-07-16 12:44:47 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SizeofExpressionAST::lastToken() const
|
2009-07-16 12:44:47 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
|
|
|
|
if (sizeof_token)
|
|
|
|
|
return sizeof_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 12:44:47 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int StringLiteralAST::firstToken() const
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token;
|
|
|
|
|
if (next)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = next->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-28 16:34:15 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int StringLiteralAST::lastToken() const
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (next)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = next->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-28 16:34:15 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SwitchStatementAST::firstToken() const
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (switch_token)
|
|
|
|
|
return switch_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-28 16:34:15 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int SwitchStatementAST::lastToken() const
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-07-28 16:34:15 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2009-07-28 16:34:15 +02:00
|
|
|
if (lparen_token)
|
2010-06-23 16:50:11 +02:00
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (switch_token)
|
|
|
|
|
return switch_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 14:31:13 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TemplateDeclarationAST::firstToken() const
|
2009-07-16 14:31:13 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (export_token)
|
|
|
|
|
return export_token;
|
|
|
|
|
if (template_token)
|
|
|
|
|
return template_token;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token;
|
|
|
|
|
if (template_parameter_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = template_parameter_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token;
|
|
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-16 14:31:13 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TemplateDeclarationAST::lastToken() const
|
2009-07-16 14:31:13 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token + 1;
|
|
|
|
|
if (template_parameter_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = template_parameter_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token + 1;
|
|
|
|
|
if (template_token)
|
|
|
|
|
return template_token + 1;
|
|
|
|
|
if (export_token)
|
|
|
|
|
return export_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 14:31:13 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TemplateIdAST::firstToken() const
|
2009-07-16 14:31:13 +02:00
|
|
|
{
|
2010-08-12 12:18:49 +02:00
|
|
|
if (template_token)
|
|
|
|
|
return template_token;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token;
|
|
|
|
|
if (template_argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = template_argument_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token;
|
|
|
|
|
return 0;
|
2009-07-16 14:31:13 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TemplateIdAST::lastToken() const
|
2009-07-16 15:50:42 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token + 1;
|
|
|
|
|
if (template_argument_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = template_argument_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token + 1;
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token + 1;
|
2010-08-12 12:18:49 +02:00
|
|
|
if (template_token)
|
|
|
|
|
return template_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 15:50:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TemplateTypeParameterAST::firstToken() const
|
2009-07-16 15:50:42 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (template_token)
|
|
|
|
|
return template_token;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token;
|
|
|
|
|
if (template_parameter_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = template_parameter_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token;
|
|
|
|
|
if (class_token)
|
|
|
|
|
return class_token;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-16 15:50:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TemplateTypeParameterAST::lastToken() const
|
2009-07-16 15:50:42 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token + 1;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
|
|
|
|
if (class_token)
|
|
|
|
|
return class_token + 1;
|
|
|
|
|
if (greater_token)
|
|
|
|
|
return greater_token + 1;
|
|
|
|
|
if (template_parameter_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = template_parameter_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (less_token)
|
|
|
|
|
return less_token + 1;
|
|
|
|
|
if (template_token)
|
|
|
|
|
return template_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 15:50:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ThisExpressionAST::firstToken() const
|
2009-07-16 15:50:42 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (this_token)
|
|
|
|
|
return this_token;
|
|
|
|
|
return 0;
|
2009-07-16 15:50:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ThisExpressionAST::lastToken() const
|
2009-07-16 17:38:24 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (this_token)
|
|
|
|
|
return this_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 17:38:24 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ThrowExpressionAST::firstToken() const
|
2009-07-16 17:38:24 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (throw_token)
|
|
|
|
|
return throw_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2009-07-28 16:34:15 +02:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int ThrowExpressionAST::lastToken() const
|
2010-06-23 16:50:11 +02:00
|
|
|
{
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (throw_token)
|
|
|
|
|
return throw_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 17:38:24 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TrailingReturnTypeAST::firstToken() const
|
2009-07-16 17:38:24 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (arrow_token)
|
|
|
|
|
return arrow_token;
|
|
|
|
|
if (attributes)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attributes->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-16 17:38:24 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TrailingReturnTypeAST::lastToken() const
|
2009-07-16 17:38:24 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-08-26 15:55:31 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (attributes)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attributes->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (arrow_token)
|
|
|
|
|
return arrow_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-16 17:38:24 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TranslationUnitAST::firstToken() const
|
2009-07-20 11:46:59 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-20 11:46:59 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TranslationUnitAST::lastToken() const
|
2009-07-20 11:46:59 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declaration_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declaration_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-20 11:46:59 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TryBlockStatementAST::firstToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (try_token)
|
|
|
|
|
return try_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (catch_clause_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = catch_clause_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TryBlockStatementAST::lastToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (catch_clause_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = catch_clause_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (try_token)
|
|
|
|
|
return try_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeConstructorCallAST::firstToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-09-19 10:26:07 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeConstructorCallAST::lastToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2012-09-19 10:26:07 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeIdAST::firstToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeIdAST::lastToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeidExpressionAST::firstToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (typeid_token)
|
|
|
|
|
return typeid_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeidExpressionAST::lastToken() const
|
2009-07-20 10:04:44 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
2009-07-20 10:04:44 +02:00
|
|
|
return rparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
2009-07-20 10:04:44 +02:00
|
|
|
return lparen_token + 1;
|
2010-06-23 16:50:11 +02:00
|
|
|
if (typeid_token)
|
|
|
|
|
return typeid_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-20 10:04:44 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypenameCallExpressionAST::firstToken() const
|
2009-07-31 16:53:05 +02:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (typename_token)
|
|
|
|
|
return typename_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2012-09-19 10:26:07 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2009-07-31 16:53:05 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypenameCallExpressionAST::lastToken() const
|
2009-07-31 16:53:05 +02:00
|
|
|
{
|
2012-09-19 10:26:07 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (typename_token)
|
|
|
|
|
return typename_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2009-07-31 16:53:05 +02:00
|
|
|
}
|
2010-03-24 12:54:25 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypenameTypeParameterAST::firstToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (classkey_token)
|
|
|
|
|
return classkey_token;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-03-24 12:54:25 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypenameTypeParameterAST::lastToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (type_id)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_id->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token + 1;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (dot_dot_dot_token)
|
|
|
|
|
return dot_dot_dot_token + 1;
|
|
|
|
|
if (classkey_token)
|
|
|
|
|
return classkey_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeofSpecifierAST::firstToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (typeof_token)
|
|
|
|
|
return typeof_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int TypeofSpecifierAST::lastToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (typeof_token)
|
|
|
|
|
return typeof_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int UnaryExpressionAST::firstToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (unary_op_token)
|
|
|
|
|
return unary_op_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
2010-03-24 12:54:25 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int UnaryExpressionAST::lastToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (unary_op_token)
|
|
|
|
|
return unary_op_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int UsingAST::firstToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (using_token)
|
|
|
|
|
return using_token;
|
|
|
|
|
if (typename_token)
|
|
|
|
|
return typename_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
2010-03-24 12:54:25 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int UsingAST::lastToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (typename_token)
|
|
|
|
|
return typename_token + 1;
|
|
|
|
|
if (using_token)
|
|
|
|
|
return using_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int UsingDirectiveAST::firstToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (using_token)
|
|
|
|
|
return using_token;
|
|
|
|
|
if (namespace_token)
|
|
|
|
|
return namespace_token;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int UsingDirectiveAST::lastToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (namespace_token)
|
|
|
|
|
return namespace_token + 1;
|
|
|
|
|
if (using_token)
|
|
|
|
|
return using_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int WhileStatementAST::firstToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (while_token)
|
|
|
|
|
return while_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int WhileStatementAST::lastToken() const
|
2010-03-24 12:54:25 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (condition)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = condition->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (while_token)
|
|
|
|
|
return while_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-03-24 12:54:25 +01:00
|
|
|
}
|
2010-03-25 12:15:38 +01:00
|
|
|
|
2010-06-23 16:50:11 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int GnuAttributeSpecifierAST::lastToken() const
|
2010-03-25 12:15:38 +01:00
|
|
|
{
|
2010-06-23 16:50:11 +02:00
|
|
|
if (second_rparen_token)
|
|
|
|
|
return second_rparen_token + 1;
|
|
|
|
|
if (first_rparen_token)
|
|
|
|
|
return first_rparen_token + 1;
|
|
|
|
|
if (attribute_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = attribute_list->lastToken())
|
2010-06-23 16:50:11 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (second_lparen_token)
|
|
|
|
|
return second_lparen_token + 1;
|
|
|
|
|
if (first_lparen_token)
|
|
|
|
|
return first_lparen_token + 1;
|
|
|
|
|
if (attribute_token)
|
|
|
|
|
return attribute_token + 1;
|
2010-09-09 15:18:17 +02:00
|
|
|
return 1;
|
2010-08-02 12:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
2020-05-14 23:07:05 +03:00
|
|
|
int MsvcDeclspecSpecifierAST::lastToken() const
|
|
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (attribute_list)
|
|
|
|
|
if (int candidate = attribute_list->lastToken())
|
|
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (attribute_token)
|
|
|
|
|
return attribute_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StdAttributeSpecifierAST::lastToken() const
|
|
|
|
|
{
|
|
|
|
|
if (second_rbracket_token)
|
|
|
|
|
return second_rbracket_token + 1;
|
|
|
|
|
if (first_rbracket_token)
|
|
|
|
|
return first_rbracket_token + 1;
|
|
|
|
|
if (attribute_list)
|
|
|
|
|
if (int candidate = attribute_list->lastToken())
|
|
|
|
|
return candidate;
|
|
|
|
|
if (second_lbracket_token)
|
|
|
|
|
return second_lbracket_token + 1;
|
|
|
|
|
if (first_lbracket_token)
|
|
|
|
|
return first_lbracket_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-18 13:33:26 +01:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PointerLiteralAST::firstToken() const
|
2011-11-18 13:33:26 +01:00
|
|
|
{
|
|
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int PointerLiteralAST::lastToken() const
|
2011-11-18 13:33:26 +01:00
|
|
|
{
|
|
|
|
|
if (literal_token)
|
|
|
|
|
return literal_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-02 11:40:01 +01:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NoExceptSpecificationAST::firstToken() const
|
2012-02-02 11:40:01 +01:00
|
|
|
{
|
|
|
|
|
if (noexcept_token)
|
|
|
|
|
return noexcept_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2012-02-02 11:40:01 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NoExceptSpecificationAST::lastToken() const
|
2012-02-02 11:40:01 +01:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2012-02-02 11:40:01 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (noexcept_token)
|
|
|
|
|
return noexcept_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-02 13:39:24 +01:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int StaticAssertDeclarationAST::firstToken() const
|
2012-02-02 13:39:24 +01:00
|
|
|
{
|
|
|
|
|
if (static_assert_token)
|
|
|
|
|
return static_assert_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2012-02-02 13:39:24 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token;
|
|
|
|
|
if (string_literal)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = string_literal->firstToken())
|
2012-02-02 13:39:24 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int StaticAssertDeclarationAST::lastToken() const
|
2012-02-02 13:39:24 +01:00
|
|
|
{
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (string_literal)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = string_literal->lastToken())
|
2012-02-02 13:39:24 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (comma_token)
|
|
|
|
|
return comma_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2012-02-02 13:39:24 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (static_assert_token)
|
|
|
|
|
return static_assert_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-10 14:41:58 +01:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DecltypeSpecifierAST::firstToken() const
|
2012-02-10 14:41:58 +01:00
|
|
|
{
|
|
|
|
|
if (decltype_token)
|
|
|
|
|
return decltype_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2012-02-10 14:41:58 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DecltypeSpecifierAST::lastToken() const
|
2012-02-10 14:41:58 +01:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2012-02-10 14:41:58 +01:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (decltype_token)
|
|
|
|
|
return decltype_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-19 16:33:25 +04:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int RangeBasedForStatementAST::firstToken() const
|
2012-02-19 16:33:25 +04:00
|
|
|
{
|
|
|
|
|
if (for_token)
|
|
|
|
|
return for_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->firstToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->firstToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->firstToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int RangeBasedForStatementAST::lastToken() const
|
2012-02-19 16:33:25 +04:00
|
|
|
{
|
|
|
|
|
if (statement)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = statement->lastToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (colon_token)
|
|
|
|
|
return colon_token + 1;
|
|
|
|
|
if (declarator)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = declarator->lastToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (type_specifier_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = type_specifier_list->lastToken())
|
2012-02-19 16:33:25 +04:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (for_token)
|
|
|
|
|
return for_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-17 13:47:18 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AlignofExpressionAST::firstToken() const
|
2012-09-17 13:47:18 +02:00
|
|
|
{
|
|
|
|
|
if (alignof_token)
|
|
|
|
|
return alignof_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (typeId)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = typeId->firstToken())
|
2012-09-17 13:47:18 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AlignofExpressionAST::lastToken() const
|
2012-09-17 13:47:18 +02:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (typeId)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = typeId->lastToken())
|
2012-09-17 13:47:18 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (alignof_token)
|
|
|
|
|
return alignof_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-18 10:45:10 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AliasDeclarationAST::firstToken() const
|
2012-09-18 10:45:10 +02:00
|
|
|
{
|
|
|
|
|
if (using_token)
|
|
|
|
|
return using_token;
|
2013-05-30 12:40:08 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->firstToken())
|
2013-05-30 12:40:08 +02:00
|
|
|
return candidate;
|
2012-09-18 10:45:10 +02:00
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (typeId)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = typeId->firstToken())
|
2012-09-18 10:45:10 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AliasDeclarationAST::lastToken() const
|
2012-09-18 10:45:10 +02:00
|
|
|
{
|
|
|
|
|
if (semicolon_token)
|
|
|
|
|
return semicolon_token + 1;
|
|
|
|
|
if (typeId)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = typeId->lastToken())
|
2012-09-18 10:45:10 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token + 1;
|
2013-05-30 12:40:08 +02:00
|
|
|
if (name)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = name->lastToken())
|
2013-05-30 12:40:08 +02:00
|
|
|
return candidate;
|
2012-09-18 10:45:10 +02:00
|
|
|
if (using_token)
|
|
|
|
|
return using_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-05 22:56:15 +08:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DesignatedInitializerAST::firstToken() const
|
2014-05-05 22:56:15 +08:00
|
|
|
{
|
|
|
|
|
if (designator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = designator_list->firstToken())
|
2014-05-05 22:56:15 +08:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token;
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->firstToken())
|
2014-05-05 22:56:15 +08:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DesignatedInitializerAST::lastToken() const
|
2014-05-05 22:56:15 +08:00
|
|
|
{
|
|
|
|
|
if (initializer)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = initializer->lastToken())
|
2014-05-05 22:56:15 +08:00
|
|
|
return candidate;
|
|
|
|
|
if (equal_token)
|
|
|
|
|
return equal_token + 1;
|
|
|
|
|
if (designator_list)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = designator_list->lastToken())
|
2014-05-05 22:56:15 +08:00
|
|
|
return candidate;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-20 09:57:46 +03:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BracketDesignatorAST::firstToken() const
|
2014-06-20 09:57:46 +03:00
|
|
|
{
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2014-06-20 09:57:46 +03:00
|
|
|
return candidate;
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int BracketDesignatorAST::lastToken() const
|
2014-06-20 09:57:46 +03:00
|
|
|
{
|
|
|
|
|
if (rbracket_token)
|
|
|
|
|
return rbracket_token + 1;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2014-06-20 09:57:46 +03:00
|
|
|
return candidate;
|
|
|
|
|
if (lbracket_token)
|
|
|
|
|
return lbracket_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DotDesignatorAST::firstToken() const
|
2014-06-20 09:57:46 +03:00
|
|
|
{
|
|
|
|
|
if (dot_token)
|
|
|
|
|
return dot_token;
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int DotDesignatorAST::lastToken() const
|
2014-06-20 09:57:46 +03:00
|
|
|
{
|
|
|
|
|
if (identifier_token)
|
|
|
|
|
return identifier_token + 1;
|
|
|
|
|
if (dot_token)
|
|
|
|
|
return dot_token + 1;
|
2014-05-05 22:56:15 +08:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-15 12:37:19 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AlignmentSpecifierAST::firstToken() const
|
2014-07-15 12:37:19 +02:00
|
|
|
{
|
|
|
|
|
if (align_token)
|
|
|
|
|
return align_token;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token;
|
|
|
|
|
if (typeIdExprOrAlignmentExpr)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = typeIdExprOrAlignmentExpr->firstToken())
|
2014-07-15 12:37:19 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (ellipses_token)
|
|
|
|
|
return ellipses_token;
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int AlignmentSpecifierAST::lastToken() const
|
2014-07-15 12:37:19 +02:00
|
|
|
{
|
|
|
|
|
if (rparen_token)
|
|
|
|
|
return rparen_token + 1;
|
|
|
|
|
if (ellipses_token)
|
|
|
|
|
return ellipses_token + 1;
|
|
|
|
|
if (typeIdExprOrAlignmentExpr)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = typeIdExprOrAlignmentExpr->lastToken())
|
2014-07-15 12:37:19 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (lparen_token)
|
|
|
|
|
return lparen_token + 1;
|
|
|
|
|
if (align_token)
|
|
|
|
|
return align_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-22 11:08:01 +02:00
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NoExceptOperatorExpressionAST::firstToken() const
|
2015-07-22 11:08:01 +02:00
|
|
|
{
|
|
|
|
|
if (noexcept_token)
|
|
|
|
|
return noexcept_token;
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->firstToken())
|
2015-07-22 11:08:01 +02:00
|
|
|
return candidate;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \generated */
|
2019-07-24 18:40:10 +02:00
|
|
|
int NoExceptOperatorExpressionAST::lastToken() const
|
2015-07-22 11:08:01 +02:00
|
|
|
{
|
|
|
|
|
if (expression)
|
2019-07-24 18:40:10 +02:00
|
|
|
if (int candidate = expression->lastToken())
|
2015-07-22 11:08:01 +02:00
|
|
|
return candidate;
|
|
|
|
|
if (noexcept_token)
|
|
|
|
|
return noexcept_token + 1;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2023-02-09 15:11:14 +01:00
|
|
|
|
|
|
|
|
int TypeConstraintAST::firstToken() const
|
|
|
|
|
{
|
|
|
|
|
if (nestedName)
|
|
|
|
|
return nestedName->firstToken();
|
|
|
|
|
return conceptName->firstToken();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int TypeConstraintAST::lastToken() const
|
|
|
|
|
{
|
|
|
|
|
if (greaterToken)
|
|
|
|
|
return greaterToken + 1;
|
|
|
|
|
return conceptName->lastToken();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int PlaceholderTypeSpecifierAST::firstToken() const
|
|
|
|
|
{
|
|
|
|
|
if (typeConstraint)
|
|
|
|
|
return typeConstraint->firstToken();
|
|
|
|
|
if (declTypetoken)
|
|
|
|
|
return declTypetoken;
|
|
|
|
|
return autoToken;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int PlaceholderTypeSpecifierAST::lastToken() const
|
|
|
|
|
{
|
|
|
|
|
if (rparenToken)
|
|
|
|
|
return rparenToken + 1;
|
|
|
|
|
return autoToken + 1;
|
|
|
|
|
}
|