casacore
Loading...
Searching...
No Matches
MSFieldParse.h
Go to the documentation of this file.
1//# MSFieldParse.h: Classes to hold results from field 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_MSFIELDPARSE_H
27#define MS_MSFIELDPARSE_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/ms/MeasurementSets/MSField.h>
32#include <casacore/ms/MeasurementSets/MSFieldColumns.h>
33#include <casacore/ms/MSSel/MSParse.h>
34#include <casacore/ms/MSSel/MSSelectionError.h>
35#include <casacore/ms/MSSel/MSSelectableTable.h>
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38//# Forward Declarations
39
40
41// <motivation>
42// It is necessary to be able to give a ms command in ASCII.
43// This can be used in a CLI or in the table browser to get a subset
44// of a table or to sort a table.
45// </motivation>
46
47// <summary>
48// Class to hold values from field grammar parser
49// </summary>
50
51// <use visibility=local>
52
53// <reviewed reviewer="" date="" tests="">
54// </reviewed>
55
56// <prerequisite>
57//# Classes you should understand before using this one.
58// </prerequisite>
59
60// <etymology>
61// MSFieldParse is the class used to parse a field command.
62// </etymology>
63
64// <synopsis>
65// MSFieldParse is used by the parser of field sub-expression statements.
66// The parser is written in Bison and Flex in files MSFieldGram.y and .l.
67// The statements in there use the routines in this file to act
68// upon a reduced rule.
69// Since multiple tables can be given (with a shorthand), the table
70// names are stored in a list. The variable names can be qualified
71// by the table name and will be looked up in the appropriate table.
72//
73// The class MSFieldParse only contains information about a table
74// used in the table command. Global variables (like a list and a vector)
75// are used in MSFieldParse.cc to hold further information.
76//
77// Global functions are used to operate on the information.
78// The main function is the global function msFieldCommand.
79// It executes the given STaQL command and returns the resulting ms.
80// This is, in fact, the only function to be used by a user.
81// </synopsis>
82
83 class MSFieldParse : public MSParse
84 {
85
86 public:
87 // Default constructor
90 MSFieldParse (const MSField& fieldSubTable, const TableExprNode& columnAsTEN);
92
93 const TableExprNode *selectFieldIds(const Vector<Int>& fieldIds);
94
95 // Get table expression node object.
96 static const TableExprNode* node();
98 static Vector<Int> selectedIDs() {return idList;}
99 static void reset();
100 static void cleanup()
101 {if (node_p) delete node_p;node_p=0x0;}
103 private:
109 };
110
111} //# NAMESPACE CASACORE - END
112
113#endif
114
115
116//---------------------OLD CODE START (Feb. 2012)-------------------
117// #ifndef MS_MSFIELDPARSE_H
118// #define MS_MSFIELDPARSE_H
119
120// //# Includes
121// #include <casacore/ms/MSSel/MSParse.h>
122// #include <casacore/ms/MSSel/MSSelectionError.h>
123// #include <casacore/ms/MSSel/MSSelectableTable.h>
124// namespace casacore { //# NAMESPACE CASACORE - BEGIN
125
126// //# Forward Declarations
127
128
129// // <summary>
130// // Class to hold values from field grammar parser
131// // </summary>
132
133// // <use visibility=local>
134
135// // <reviewed reviewer="" date="" tests="">
136// // </reviewed>
137
138// // <prerequisite>
139// //# Classes you should understand before using this one.
140// // </prerequisite>
141
142// // <etymology>
143// // MSFieldParse is the class used to parse a field command.
144// // </etymology>
145
146// // <synopsis>
147// // MSFieldParse is used by the parser of field sub-expression statements.
148// // The parser is written in Bison and Flex in files MSFieldGram.y and .l.
149// // The statements in there use the routines in this file to act
150// // upon a reduced rule.
151// // Since multiple tables can be given (with a shorthand), the table
152// // names are stored in a list. The variable names can be qualified
153// // by the table name and will be looked up in the appropriate table.
154// //
155// // The class MSFieldParse only contains information about a table
156// // used in the table command. Global variables (like a list and a vector)
157// // are used in MSFieldParse.cc to hold further information.
158// //
159// // Global functions are used to operate on the information.
160// // The main function is the global function msFieldCommand.
161// // It executes the given STaQL command and returns the resulting ms.
162// // This is, in fact, the only function to be used by a user.
163// // </synopsis>
164
165// // <motivation>
166// // It is necessary to be able to give a ms command in ASCII.
167// // This can be used in a CLI or in the table browser to get a subset
168// // of a table or to sort a table.
169// // </motivation>
170
171// //# <todo asof="$DATE:$">
172// //# A List of bugs, limitations, extensions or planned refinements.
173// //# </todo>
174
175
176// class MSFieldParse : public MSParse
177// {
178
179// public:
180// // Default constructor
181// MSFieldParse ();
182// // ~MSFieldParse() {idList.resize(0);}
183// // Associate the ms and the shorthand.
184// MSFieldParse (const MeasurementSet* ms);
185// MSFieldParse (MSSelectableTable* msLike);
186// //~MSFieldParse() {if (node_p) delete node_p;node_p=0x0;}
187
188// const TableExprNode *selectFieldIds(const Vector<Int>& fieldIds);
189// // const TableExprNode *selectFieldOrSource(const String& fieldName);
190
191// // Get table expression node object.
192// static const TableExprNode* node();
193// static MSFieldParse* thisMSFParser;
194// static Vector<Int> selectedIDs() {return idList;}
195// static void reset();//{idList.resize(0);}
196// static void cleanup() {if (node_p) delete node_p;node_p=0x0;}
197// private:
198// static TableExprNode* node_p;
199// const String colName;
200// static Vector<Int> idList;
201
202// };
203
204// } //# NAMESPACE CASACORE - END
205
206// #endif
207//---------------------OLD CODE END (Feb. 2012)-------------------
Class to hold values from field grammar parser.
static Vector< Int > idList
static Vector< Int > selectedIDs()
static const TableExprNode * node()
Get table expression node object.
static MSFieldParse * thisMSFParser
const TableExprNode * selectFieldIds(const Vector< Int > &fieldIds)
MSFieldParse()
Default constructor.
MSFieldParse(const MeasurementSet *ms)
static TableExprNode columnAsTEN_p
MSFieldParse(const MSField &fieldSubTable, const TableExprNode &columnAsTEN)
static TableExprNode * node_p
MeasurementSet * ms()
Get ms object.
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