casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSCorrParse.h
Go to the documentation of this file.
00001 //# MSCorrParse.h: Classes to hold results from corr grammar parser
00002 //# Copyright (C) 1994,1995,1997,1998,1999,2000,2001,2003
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: MSCorrParse.h 20266 2008-02-26 00:43:05Z gervandiepen $
00027 
00028 #ifndef MS_MSUVDISTPARSE_H
00029 #define MS_MSUVDISTPARSE_H
00030 
00031 //# Includes
00032 #include <ms/MeasurementSets/MSParse.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 //# Forward Declarations
00037 
00038 // <summary>
00039 // Class to hold values from UV dist grammar parser
00040 // </summary>
00041 
00042 // <use visibility=local>
00043 
00044 // <reviewed reviewer="" date="" tests="">
00045 // </reviewed>
00046 
00047 // <prerequisite>
00048 //# Classes you should understand before using this one.
00049 // </prerequisite>
00050 
00051 // <etymology>
00052 // MSCorrParse is the class used to parse a corr command.
00053 // </etymology>
00054 
00055 // <synopsis>
00056 // MSCorrParse is used by the parser of UV dist sub-expression statements.
00057 // The parser is written in Bison and Flex in files MSCorrGram.y and .l.
00058 // The statements in there use the routines in this file to act
00059 // upon a reduced rule.
00060 // Since multiple tables can be given (with a shorthand), the table
00061 // names are stored in a list. The variable names can be qualified
00062 // by the table name and will be looked up in the appropriate table.
00063 //
00064 // The class MSCorrParse only contains information about a table
00065 // used in the table command. Global variables (like a list and a vector)
00066 // are used in MSCorrParse.cc to hold further information.
00067 //
00068 // Global functions are used to operate on the information.
00069 // The main function is the global function msCorrCommand.
00070 // It executes the given STaQL command and returns the resulting ms.
00071 // This is, in fact, the only function to be used by a user.
00072 // </synopsis>
00073 
00074 // <motivation>
00075 // It is necessary to be able to give a ms command in ASCII.
00076 // This can be used in a CLI or in the table browser to get a subset
00077 // of a table or to sort a table.
00078 // </motivation>
00079 
00080 //# <todo asof="$DATE:$">
00081 //# A List of bugs, limitations, extensions or planned refinements.
00082 //# </todo>
00083 
00084 
00085 class MSCorrParse : public MSParse
00086 {
00087 
00088 public:
00089   // Default constructor
00090   MSCorrParse ();
00091 
00092   // Associate the ms and the shorthand.
00093   MSCorrParse (const MeasurementSet* ms);
00094   
00095   //  ~MSCorrParse() {if (node_p) delete node_p;node_p=0x0;};
00096   // MS selection
00097   const TableExprNode * selectCorrType(const String& corrType);
00098   
00099   // Get table expression node object.
00100   static const TableExprNode* node();
00101   static void cleanup() {if (node_p) delete node_p;node_p=0x0;};
00102   
00103 private:
00104     static TableExprNode *node_p;
00105 };
00106 
00107 } //# NAMESPACE CASA - END
00108 
00109 #endif