casacore
Loading...
Searching...
No Matches
MSParse.h
Go to the documentation of this file.
1// # MSParse.h: Classes to hold results from an ms grammar parser
2// # Copyright (C) 1994,1995,1997,1998,1999,2000,2001,2003
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: casa-feedback@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#ifndef MS_MSPARSE_H
27#define MS_MSPARSE_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprNode.h>
32#include <casacore/tables/TaQL/ExprNodeSet.h>
33
34#include <casacore/ms/MeasurementSets/MeasurementSet.h>
35#include <casacore/ms/MSSel/MSSelectableTable.h>
36#include <casacore/casa/BasicSL/String.h>
37
38namespace casacore { // # NAMESPACE CASACORE - BEGIN
39
40// # Forward Declarations
41class AipsIO;
42
43// <summary>
44// Class to hold values from an ms grammar parser
45// </summary>
46
47// <use visibility=local>
48
49// <reviewed reviewer="" date="" tests="">
50// </reviewed>
51
52// <prerequisite>
53// # Classes you should understand before using this one.
54// </prerequisite>
55
56// <etymology>
57// MSParse is the class used to parse an ms command.
58// </etymology>
59
60// <synopsis>
61// MSParse is used by the parser of an ms sub-expression statements.
62// The parser is written in Bison and Flex in files MSXXXGram.y and .l.
63// The statements in there use the routines in this file to act
64// upon a reduced rule.
65// Since multiple tables can be given (with a shorthand), the table
66// names are stored in a list. The variable names can be qualified
67// by the table name and will be looked up in the appropriate table.
68//
69// The class MSParse only contains information about an ms
70// used in the ms command. Global variables (like a list and a vector)
71// are used in MSParse.cc to hold further information.
72//
73// Global functions are used to operate on the information.
74// The main function is the global function msXXXCommand.
75// It executes the given STaQL command and returns the resulting ms.
76// This is, in fact, the only function to be used by a user.
77// </synopsis>
78
79// <motivation>
80// It is necessary to be able to give a ms command in ASCII.
81// This can be used in a CLI or in the table browser to get a subset
82// of a table or to sort a table.
83// </motivation>
84
85// # <todo asof="$DATE:$">
86// # A List of bugs, limitations, extensions or planned refinements.
87// # </todo>
88
89class MSParse {
90 // Dummy AipsIO routines; they are needed for the List container.
91 // <group>
92 friend AipsIO& operator<<(AipsIO&, const MSParse&);
94 // </group>
95
96 public:
97 // Default constructor for List container class.
99
100 // Copy constructor (copy semantics).
102
104
105 // Assignment (copy semantics).
107
108 // Associate the ms and the shorthand.
110 // Associate the ms and the shorthand.
112
113 // Test if shorthand matches.
114 Bool test(const String& shortHand) const;
115
116 // Get the shorthand.
118
119 // Get ms object.
121 // Get ms object.
123
129
130 private:
132 // The following exists for the period we make the transition from
133 // using MS to using MSSelectableTable. Till then, both interfaces
134 // have to be supported.
136};
137
138} // namespace casacore
139
140#endif
String shorthand_p
Definition MSParse.h:131
MSParse & operator=(const MSParse &)
Assignment (copy semantics).
MSParse()
Default constructor for List container class.
String & shorthand()
Get the shorthand.
MSSelectableTable * msInterface()
Get ms object.
MeasurementSet * ms()
Get ms object.
void setMSInterface(MSSelectableTable *msI)
Definition MSParse.h:125
friend AipsIO & operator<<(AipsIO &, const MSParse &)
Dummy AipsIO routines; they are needed for the List container.
MSParse(const MeasurementSet *ms, const String &shorthand)
Associate the ms and the shorthand.
void setMS(MeasurementSet *ms)
Definition MSParse.h:124
MSSelectableTable * tempMSInterface_p
The following exists for the period we make the transition from using MS to using MSSelectableTable.
Definition MSParse.h:135
Bool test(const String &shortHand) const
Test if shorthand matches.
static MSSelectableTable * msInterface_p
Definition MSParse.h:127
MSParse(const MSParse &)
Copy constructor (copy semantics).
static MeasurementSet * ms_p
Definition MSParse.h:126
void addCondition(TableExprNode &target, TableExprNode &source)
MSParse(const MSSelectableTable *ms, const String &shorthand)
Associate the ms and the shorthand.
friend AipsIO & operator>>(AipsIO &, MSParse &)
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40