casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSTimeGram.h
Go to the documentation of this file.
1 //# MSTimeGram.h: Grammar for ms time sub-expressions
2 //# Copyright (C) 1998
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_MSTIMEGRAM_H
29 #define MS_MSTIMEGRAM_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 #include <casacore/ms/MSSel/MSTimeParse.h> // routines used by bison actions
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 MSTimeGram
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> MSTimeGram.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  // <group name=MSTimeGramFunctions>
73 
74  // Declare the bison parser (is implemented by bison command).
75  int msTimeGramParseCommand (const MeasurementSet *ms, const String& command, const TableExprNode& otherTens);
76  int msTimeGramParseCommand (const MeasurementSet *ms, const String& command, const TableExprNode& otherTens,
77  Matrix<Double>& timeList);
78  int msTimeGramParseCommand (const MeasurementSet *ms, const String& command, const TableExprNode& colAsTEN,
79  MSSelectableMainColumn& msMainColInterface, const TableExprNode& otherTens, Matrix<Double>& timeList);
80  int baseMSTimeGramParseCommand (MSTimeParse* parser, const String& command,
81  Matrix<Double>& selectedTimeList);
82 
83  // The yyerror function for the parser.
84  // It throws an exception with the current token.
85  void MSTimeGramerror (const char*);
86 
87  // Give the table expression node.
88  const TableExprNode *msTimeGramParseNode();
89  void msTimeGramParseDeleteNode();
90 
91  // Give the current position in the string.
92  // This can be used when parse errors occur.
93  Int& msTimeGramPosition();
94 
95  // Declare the input routine for flex/bison.
96  int msTimeGramInput (char* buf, int max_size);
97 
98  // A function to remove escaped characters.
99  String msTimeGramRemoveEscapes (const String& in);
100 
101  // A function to remove quotes from a quoted string.
102  //String msTimeGramRemoveQuotes (const String& in);
103 
104  // A function to set the fields of the TimeFields structure
105  void msTimeGramSetTimeFields (struct TimeFields& tf,
106  Int year, Int month, Int day,
107  Int hour, Int minute, Int sec, Int fsec);
108  // </group>
109 
110 } //# NAMESPACE CASACORE - END
111 
112 #endif
int Int
Definition: aipstype.h:50
const Double hour
hour
Handle class for a table column expression tree.
Definition: ExprNode.h:156
Class to hold values from time grammar parser.
Definition: MSTimeParse.h:90
const Double minute
minute
TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1515
TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1519
A Table intended to hold astronomical data (a set of Measurements).
TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1523
String: the storage and methods of handling collections of characters.
Definition: String.h:225