casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSFeedGram.h
Go to the documentation of this file.
1 //# MSFeedGram.h: Grammar for ms feed sub-expressions
2 //# Copyright (C) 2015
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef MS_MSFEEDGRAM_H
29 #define MS_MSFEEDGRAM_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 #include <casacore/ms/MSSel/MSFeedParse.h> // routines used by bison actions
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 //# Forward Declarations
41 class MeasurementSet;
42 class TableExprNode;
43 
44 // <summary>
45 // Global functions for flex/bison scanner/parser for MSFeedGram
46 // </summary>
47 
48 // <use visibility=local>
49 
50 // <reviewed reviewer="" date="" tests="">
51 // </reviewed>
52 
53 // <prerequisite>
54 //# Classes you should understand before using this one.
55 // <li> MSFeedGram.l and .y (flex and bison grammar)
56 // </prerequisite>
57 
58 // <synopsis>
59 // Global functions are needed to define the input of the flex scanner
60 // and to start the bison parser.
61 // The input is taken from a string.
62 // </synopsis>
63 
64 // <motivation>
65 // It is necessary to be able to give an image expression in ASCII.
66 // This can be used in glish.
67 // </motivation>
68 // <todo asof="$DATE:$">
69 //# A List of bugs, limitations, extensions or planned refinements.
70 // </todo>
71 
72 
73 // <group name=MSFeedGramFunctions>
74 
75 // Declare the bison parser (is implemented by bison command).
76 // It returns a TaQL expression tree.
77  TableExprNode msFeedGramParseCommand (MSFeedParse* thisParser,
78  const TableExprNode& col1TEN,
79  const TableExprNode& col2TEN,
80  const String& command,
81  Vector<Int>& selectedFeeds1,
82  Vector<Int>& selectedFeeds2,
83  Matrix<Int>& selectedFeedPairs) ;
84  TableExprNode msFeedGramParseCommand (Table& subTable,
85  TableExprNode& col1TEN,
86  TableExprNode& col2TEN,
87  const String& command,
88  Vector<Int>& selectedFeeds1,
89  Vector<Int>& selectedFeeds2,
90  Matrix<Int>& selectedFeedPairs) ;
91  TableExprNode msFeedGramParseCommand (const MeasurementSet *ms,
92  const String& command,
93  Vector<Int>& selectedFeeds1,
94  Vector<Int>& selectedFeeds2,
95  Matrix<Int>& selectedFeedPairs);
96 
97  TableExprNode baseMSFeedGramParseCommand(MSFeedParse* parser, const String& command,
98  Vector<Int>& selectedFeeds1,
99  Vector<Int>& selectedFeeds2,
100  Matrix<Int>& selectedFeedPairs);
101  // The yyerror function for the parser.
102  // It throws an exception with the current token.
103  void MSFeedGramerror (const char*);
104 
105  // Give the current position in the string.
106  // This can be used when parse errors occur.
107  Int& msFeedGramPosition();
108 
109  // Declare the input routine for flex/bison.
110  int msFeedGramInput (char* buf, int max_size);
111 
112  // A function to remove escaped characters.
113  //String msFeedGramRemoveEscapes (const String& in);
114 
115  // A function to remove quotes from a quoted string.
116  //String msFeedGramRemoveQuotes (const String& in);
117 
118  // </group>
119 
120 } //# NAMESPACE CASACORE - END
121 
122 #endif
int Int
Definition: aipstype.h:50
Main interface class to a read/write table.
Definition: Table.h:157
Handle class for a table column expression tree.
Definition: ExprNode.h:156
A Table intended to hold astronomical data (a set of Measurements).
Class to hold values from feed grammar parser.
Definition: MSFeedParse.h:88
String: the storage and methods of handling collections of characters.
Definition: String.h:225