File indexing completed on 2024-04-28 03:40:38
0001 /************************************************************************************* 0002 * Copyright (C) 2008 by Aleix Pol <aleixpol@kde.org> * 0003 * Copyright (C) 2014 by Percy Camilo T. Aucahuasi <percy.camilo.ta@gmail.com> * 0004 * * 0005 * This program is free software; you can redistribute it and/or * 0006 * modify it under the terms of the GNU General Public License * 0007 * as published by the Free Software Foundation; either version 2 * 0008 * of the License, or (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the Free Software * 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 0018 *************************************************************************************/ 0019 0020 #ifndef ABSTRACTEXPRESSIONVISITOR_H 0021 #define ABSTRACTEXPRESSIONVISITOR_H 0022 0023 #include "analitzaexport.h" 0024 0025 #include <QVariant> 0026 0027 namespace Analitza 0028 { 0029 class Object; 0030 class None; 0031 class Apply; 0032 class Ci; 0033 class Cn; 0034 class CustomObject; 0035 class Container; 0036 class Operator; 0037 class Vector; 0038 class List; 0039 class Matrix; 0040 class MatrixRow; 0041 0042 /** 0043 * \class AbstractExpressionWriter 0044 * 0045 * \ingroup AnalitzaModule 0046 * 0047 * \brief This interface defines the generic expression writer contract. 0048 */ 0049 0050 class ANALITZA_EXPORT AbstractExpressionVisitor 0051 { 0052 public: 0053 virtual ~AbstractExpressionVisitor(); 0054 0055 virtual QVariant visit(const None* var) = 0; 0056 virtual QVariant visit(const Operator* var) = 0; 0057 virtual QVariant visit(const Ci* var) = 0; 0058 virtual QVariant visit(const Cn* var) = 0; 0059 virtual QVariant visit(const Container* var) = 0; 0060 virtual QVariant visit(const Vector* var) = 0; 0061 virtual QVariant visit(const List* l) = 0; 0062 virtual QVariant visit(const Apply* a) = 0; 0063 virtual QVariant visit(const CustomObject* c) = 0; 0064 virtual QVariant visit(const Matrix* c) = 0; 0065 virtual QVariant visit(const MatrixRow* c) = 0; 0066 0067 virtual QVariant result() const = 0; 0068 }; 0069 0070 } 0071 0072 #endif