2013-09-21 14:42:35 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2013-02-02 22:59:17 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* Based on LLVM/Clang.
|
|
|
|
*
|
|
|
|
* This file is distributed under the University of Illinois Open Source
|
|
|
|
* License. See LICENSE.TXT for details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TUTORIAL1_H
|
|
|
|
#define TUTORIAL1_H
|
|
|
|
|
|
|
|
#include "plugin.hxx"
|
|
|
|
|
|
|
|
namespace loplugin
|
|
|
|
{
|
|
|
|
|
|
|
|
// The class implementing the plugin action.
|
|
|
|
class Tutorial1
|
|
|
|
// Inherits from the Clang class that will allow examing the Clang AST tree (i.e. syntax tree).
|
|
|
|
: public RecursiveASTVisitor< Tutorial1 >
|
|
|
|
// And the base class for LO Clang plugins.
|
|
|
|
, public Plugin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Ctor, nothing special.
|
2014-07-23 00:02:35 -03:00
|
|
|
Tutorial1( const InstantiationData& data );
|
2013-02-02 22:59:17 +01:00
|
|
|
// The function that will be called to perform the actual action.
|
2013-05-31 18:34:11 +02:00
|
|
|
virtual void run() override;
|
2013-02-02 22:59:17 +01:00
|
|
|
// Function from Clang, it will be called for every return statement in the source.
|
2013-05-02 18:17:32 +02:00
|
|
|
bool VisitReturnStmt( const ReturnStmt* returnstmt );
|
2013-02-02 22:59:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif // POSTFIXINCREMENTFIX_H
|
|
|
|
|
2013-09-21 14:42:35 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|