00001 //# MSFeedGram.h: Grammar for ms feed sub-expressions 00002 //# Copyright (C) 2015 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 MS_MSFEEDGRAM_H 00029 #define MS_MSFEEDGRAM_H 00030 00031 00032 //# Includes 00033 #include <casacore/casa/aips.h> 00034 #include <casacore/casa/BasicSL/String.h> 00035 #include <casacore/casa/Arrays/Matrix.h> 00036 #include <casacore/ms/MSSel/MSFeedParse.h> // routines used by bison actions 00037 00038 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00039 00040 //# Forward Declarations 00041 class MeasurementSet; 00042 class TableExprNode; 00043 00044 // <summary> 00045 // Global functions for flex/bison scanner/parser for MSFeedGram 00046 // </summary> 00047 00048 // <use visibility=local> 00049 00050 // <reviewed reviewer="" date="" tests=""> 00051 // </reviewed> 00052 00053 // <prerequisite> 00054 //# Classes you should understand before using this one. 00055 // <li> MSFeedGram.l and .y (flex and bison grammar) 00056 // </prerequisite> 00057 00058 // <synopsis> 00059 // Global functions are needed to define the input of the flex scanner 00060 // and to start the bison parser. 00061 // The input is taken from a string. 00062 // </synopsis> 00063 00064 // <motivation> 00065 // It is necessary to be able to give an image expression in ASCII. 00066 // This can be used in glish. 00067 // </motivation> 00068 // <todo asof="$DATE:$"> 00069 //# A List of bugs, limitations, extensions or planned refinements. 00070 // </todo> 00071 00072 00073 // <group name=MSFeedGramFunctions> 00074 00075 // Declare the bison parser (is implemented by bison command). 00076 // It returns a TaQL expression tree. 00077 TableExprNode msFeedGramParseCommand (MSFeedParse* thisParser, 00078 const TableExprNode& col1TEN, 00079 const TableExprNode& col2TEN, 00080 const String& command, 00081 Vector<Int>& selectedFeeds1, 00082 Vector<Int>& selectedFeeds2, 00083 Matrix<Int>& selectedFeedPairs) ; 00084 TableExprNode msFeedGramParseCommand (Table& subTable, 00085 TableExprNode& col1TEN, 00086 TableExprNode& col2TEN, 00087 const String& command, 00088 Vector<Int>& selectedFeeds1, 00089 Vector<Int>& selectedFeeds2, 00090 Matrix<Int>& selectedFeedPairs) ; 00091 TableExprNode msFeedGramParseCommand (const MeasurementSet *ms, 00092 const String& command, 00093 Vector<Int>& selectedFeeds1, 00094 Vector<Int>& selectedFeeds2, 00095 Matrix<Int>& selectedFeedPairs); 00096 00097 TableExprNode baseMSFeedGramParseCommand(MSFeedParse* parser, const String& command, 00098 Vector<Int>& selectedFeeds1, 00099 Vector<Int>& selectedFeeds2, 00100 Matrix<Int>& selectedFeedPairs); 00101 // The yyerror function for the parser. 00102 // It throws an exception with the current token. 00103 void MSFeedGramerror (const char*); 00104 00105 // Give the current position in the string. 00106 // This can be used when parse errors occur. 00107 Int& msFeedGramPosition(); 00108 00109 // Declare the input routine for flex/bison. 00110 int msFeedGramInput (char* buf, int max_size); 00111 00112 // A function to remove escaped characters. 00113 //String msFeedGramRemoveEscapes (const String& in); 00114 00115 // A function to remove quotes from a quoted string. 00116 //String msFeedGramRemoveQuotes (const String& in); 00117 00118 // </group> 00119 00120 } //# NAMESPACE CASACORE - END 00121 00122 #endif