casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TableGram.h
Go to the documentation of this file.
00001 //# TableGram.h: Grammar for table command lines
00002 //# Copyright (C) 1993,1994,1995,1997,1999
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: TableGram.h 20652 2009-07-06 05:04:32Z Malte.Marquarding $
00027 
00028 #ifndef TABLES_TABLEGRAM_H
00029 #define TABLES_TABLEGRAM_H
00030 
00031 //# Includes
00032 #include <casa/BasicSL/String.h>
00033 #include <casa/Quanta/MVTime.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 //# Forward Declarations
00038 
00039 
00040 // <summary>
00041 // Global functions for flex/bison scanner/parser for TableGram
00042 // </summary>
00043 
00044 // <use visibility=local>
00045 
00046 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tTableGram">
00047 // </reviewed>
00048 
00049 // <prerequisite>
00050 //# Classes you should understand before using this one.
00051 //  <li> TableGram.l and .y  (flex and bison grammar)
00052 // </prerequisite>
00053 
00054 // <synopsis> 
00055 // Global functions are needed to define the input of the flex scanner
00056 // and to start the bison parser.
00057 // The input is taken from a string.
00058 // </synopsis> 
00059 
00060 // <motivation>
00061 // It is necessary to be able to give a table select command in ASCII.
00062 // This can be used in a CLI or in the table browser to get a subset
00063 // of a table or to sort a table.
00064 // </motivation>
00065 
00066 // <todo asof="$DATE:$">
00067 //# A List of bugs, limitations, extensions or planned refinements.
00068 // </todo>
00069 
00070 // <group name=TableGramFunctions>
00071 
00072 // Declare the bison parser (is implemented by bison command).
00073 int tableGramParseCommand (const String& command);
00074 
00075 // The yyerror function for the parser.
00076 // It throws an exception with the current token.
00077 void TableGramerror (const char*);
00078 
00079 // Give the current position in the string.
00080 // This can be used when parse errors occur.
00081 Int& tableGramPosition();
00082 
00083 // Declare the input routine for flex/bison.
00084 int tableGramInput (char* buf, int max_size);
00085 
00086 // A function to remove escaped characters.
00087 String tableGramRemoveEscapes (const String& in);
00088 
00089 // A function to remove quotes from a quoted string.
00090 String tableGramRemoveQuotes (const String& in);
00091 
00092 // A function to parse a date/time string.
00093 MVTime tableGramParseDateTime (const String& in);
00094 
00095 // A function to parse a time/position string.
00096 // The value is returned in radians.
00097 Double tableGramParseTime (const String& in);
00098 
00099 // </group>
00100 
00101 
00102 
00103 } //# NAMESPACE CASA - END
00104 
00105 #endif