casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSObservationGram.h
Go to the documentation of this file.
00001 //# MSObservationGram.h: Grammar for ms scan sub-expressions
00002 //# Copyright (C) 1998
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: MSObservationGram.h 20652 2009-07-06 05:04:32Z Malte.Marquarding $
00027 
00028 #ifndef MS_MSOBSERVATIONGRAM_H
00029 #define MS_MSOBSERVATIONGRAM_H
00030 
00031 
00032 //# Includes
00033 #include <ms/MeasurementSets/MSObservationParse.h> 
00034 #include <casa/BasicSL/String.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 //# Forward Declarations
00039 class MeasurementSet;
00040 class TableExprNode;
00041 
00042 // <summary>
00043 // Global functions for flex/bison scanner/parser for MSObservationGram
00044 // </summary>
00045 
00046 // <use visibility=local>
00047 
00048 // <reviewed reviewer="" date="" tests="">
00049 // </reviewed>
00050 
00051 // <prerequisite>
00052 //# Classes you should understand before using this one.
00053 //  <li> MSObservationGram.l and .y  (flex and bison grammar)
00054 // </prerequisite>
00055 
00056 // <synopsis> 
00057 // Global functions are needed to define the input of the flex scanner
00058 // and to start the bison parser.
00059 // The input is taken from a string.
00060 // </synopsis> 
00061 
00062 // <motivation>
00063 // It is necessary to be able to give an image expression in ASCII.
00064 // This can be used in glish.
00065 // </motivation>
00066 // <todo asof="$DATE:$">
00067 //# A List of bugs, limitations, extensions or planned refinements.
00068 // </todo>
00069   
00070   
00071 // <group name=MSObservationGramFunctions>
00072   
00073 // Declare the bison parser (is implemented by bison command).
00074   TableExprNode msObservationGramParseCommand (const MeasurementSet *ms, 
00075                                                const MSObservation& obsSubTable,
00076                                                const TableExprNode& colAsTEN,
00077                                                const String& command, 
00078                                                Vector<Int>& idList);
00079   
00080   TableExprNode baseMSObservationGramParseCommand (MSObservationParse* parser, 
00081                                                    const TableExprNode& colAsTEN,
00082                                                    const String& command, 
00083                                                    Vector<Int>& selectedIDs);
00084   // The yyerror function for the parser.
00085   // It throws an exception with the current token.
00086   void MSObservationGramerror (const char*);
00087   
00088   // Give the table expression node.
00089   //const TableExprNode *msObservationGramParseNode();
00090   void msObservationGramParseDeleteNode();
00091   
00092   // Give the current position in the string.
00093   // This can be used when parse errors occur.
00094   Int& msObservationGramPosition();
00095   
00096   // Declare the input routine for flex/bison.
00097   int msObservationGramInput (char* buf, int max_size);
00098   
00099   // A function to remove escaped characters.
00100   //String msObservationGramRemoveEscapes (const String& in);
00101   
00102   // A function to remove quotes from a quoted string.
00103   //String msObservationGramRemoveQuotes (const String& in);
00104   
00105   // </group>
00106   
00107 } //# NAMESPACE CASA - END
00108 
00109 #endif