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
44// <summary>
45// Class to hold values from an ms grammar parser
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// </prerequisite>
56
57// <etymology>
58// MSParse is the class used to parse an ms command.
59// </etymology>
60
61// <synopsis>
62// MSParse is used by the parser of an ms sub-expression statements.
63// The parser is written in Bison and Flex in files MSXXXGram.y and .l.
64// The statements in there use the routines in this file to act
65// upon a reduced rule.
66// Since multiple tables can be given (with a shorthand), the table
67// names are stored in a list. The variable names can be qualified
68// by the table name and will be looked up in the appropriate table.
69//
70// The class MSParse only contains information about an ms
71// used in the ms command. Global variables (like a list and a vector)
72// are used in MSParse.cc to hold further information.
73//
74// Global functions are used to operate on the information.
75// The main function is the global function msXXXCommand.
76// It executes the given STaQL command and returns the resulting ms.
77// This is, in fact, the only function to be used by a user.
78// </synopsis>
79
80// <motivation>
81// It is necessary to be able to give a ms command in ASCII.
82// This can be used in a CLI or in the table browser to get a subset
83// of a table or to sort a table.
84// </motivation>
85
86//# <todo asof="$DATE:$">
87//# A List of bugs, limitations, extensions or planned refinements.
88//# </todo>
89
90
92{
93// Dummy AipsIO routines; they are needed for the List container.
94// <group>
95friend AipsIO& operator<< (AipsIO&, const MSParse&);
97// </group>
98
99public:
100 // Default constructor for List container class.
102
103 // Copy constructor (copy semantics).
104 MSParse (const MSParse&);
105
107
108 // Assignment (copy semantics).
110
111 // Associate the ms and the shorthand.
113 // Associate the ms and the shorthand.
115
116 // Test if shorthand matches.
117 Bool test (const String& shortHand) const;
118
119 // Get the shorthand.
121
122 // Get ms object.
124 // Get ms object.
126
132
133private:
135 // The following exists for the period we make the transition from
136 // using MS to using MSSelectableTable. Till then, both interfaces
137 // have to be supported.
139};
140
141} //# NAMESPACE CASACORE - END
142
143#endif
String shorthand_p
Definition MSParse.h:134
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:128
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:127
MSSelectableTable * tempMSInterface_p
The following exists for the period we make the transition from using MS to using MSSelectableTable.
Definition MSParse.h:138
Bool test(const String &shortHand) const
Test if shorthand matches.
static MSSelectableTable * msInterface_p
Definition MSParse.h:130
MSParse(const MSParse &)
Copy constructor (copy semantics).
static MeasurementSet * ms_p
Definition MSParse.h:129
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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40