00001 //# TaQLShow.h: Class to show various TaQL-related info 00002 //# Copyright (C) 2016 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef TABLES_TAQLSHOW_H 00029 #define TABLES_TAQLSHOW_H 00030 00031 //# Includes 00032 #include <casacore/casa/aips.h> 00033 #include <casacore/tables/TaQL/TaQLNodeRep.h> 00034 #include <casacore/casa/Quanta/UnitName.h> 00035 #include <casacore/casa/Arrays/Vector.h> 00036 #include <map> 00037 #include <ostream> 00038 00039 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00040 00041 // <summary> 00042 // Class to show various TaQL-related info 00043 // </summary> 00044 00045 // <use visibility=local> 00046 00047 // <reviewed reviewer="" date="" tests="tTaQLNode"> 00048 // </reviewed> 00049 00050 // <prerequisite> 00051 //# Classes you should understand before using this one. 00052 // <li> <linkto group=TableGram.h#TableGramFunctions>TableGram</linkto> 00053 // <li> Note 199 describing 00054 // <a href="../notes/199.html"> 00055 // TaQL</a> 00056 // </prerequisite> 00057 00058 // <synopsis> 00059 // The result of parsing a TaQL command is stored in TaQLNode objects. 00060 // Each part of the command can have its own specialized 00061 // <linkto class=TaQLNodeRep>TaQLNodeRep</linkto> object, which forms 00062 // the letter in the TaQLNode envelope. 00063 // <br>The actual scanning/parsing of the command is done using flex/bison 00064 // as defined in the TableGram files. 00065 // </synopsis> 00066 00067 // <motivation> 00068 // The letter-envelope idiom (counted pointer) makes if much easier 00069 // to keep track of memory, especially in the case of exceptions. 00070 // </motivation> 00071 00072 class TaQLShow 00073 { 00074 public: 00075 static String getInfo (const Vector<String>& parts, 00076 const TaQLStyle& style); 00077 static String showTable (const Vector<String>& parts, 00078 const TaQLStyle& style); 00079 static String showCommand (const String& cmd); 00080 static String showFuncs (const String& type, 00081 const Vector<String>& parts, 00082 const TaQLStyle& style); 00083 static void showUnitKind (std::ostream& os, const UnitVal& kind, 00084 const std::map<String, UnitName>& units); 00085 static String showUnits (const String& type); 00086 static String showMeasTypes (const String& type); 00087 }; 00088 00089 00090 } //# NAMESPACE CASACORE - END 00091 00092 #endif