casacore
Loading...
Searching...
No Matches
TaQL.h
Go to the documentation of this file.
1// # TaQL.h: The TaQL module - Casacore data querying
2// # Copyright (C) 1994-2010
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 TABLES_TAQL_H
27#define TABLES_TAQL_H
28
29// # Includes
30// # table expressions (for selection of rows)
31#include <casacore/casa/aips.h>
32#include <casacore/tables/TaQL/ExprNode.h>
33#include <casacore/tables/TaQL/ExprNodeSet.h>
34#include <casacore/tables/TaQL/TableParse.h>
35
36namespace casacore { // # NAMESPACE CASACORE - BEGIN
37
38// <module>
39
40// <summary>
41// TaQL is the query language for Casacore tables
42// </summary>
43
44// <use visibility=export>
45
46// <reviewed reviewer="jhorstko" date="1994/08/30" tests="" demos="">
47// </reviewed>
48
49// <prerequisite>
50// <li> <linkto module="Tables:description">Tables</linkto> module
51// </prerequisite>
52
53// <etymology>
54// "TaQL" is the Table Query Language. Its pronounciation rhymes with bagel.
55// </etymology>
56
57// <synopsis>
58// TaQL is an SQL-like language to query a Casacore table.
59// Amongst its options are row select, sort, update, and delete.
60// <br>Some more information is given in the description of the
61// <linkto module="Tables:select and sort">Tables module</linkto>.
62// A detailed description is given in <A HREF="../notes/199.html">note 199</A>.
63//
64// The high-level interface is using a TaQL command as described in
65// <A HREF="../notes/199.html">note 199</A>. Such a command can be given
66// in C++ (using TableParse.h), Python or the shell program 'taql'.
67// The code for parsing and executing TaQL commands is quite complex.
68// Processing a command consists of two steps.
69// <ol>
70// <li>
71// First a command is parsed using 'flex' and 'bison'. The file TableGram.ll
72// is used by 'flex' to recognize the tokens in the command. The file
73// TableGram.yy defines the grammar which is used by bison to invoke
74// actions on the recognized parts of the command. These actions
75// consist of building a parse tree by means of class TaQLNode and
76// associated classes. In this way the command is syntactically checked.
77// <li>
78// If the parsing is done successfully, the command is executed
79// by walking through the parse tree using class TaQLNodeHandler.
80// In its turn that class invokes functions in class TableParseQuery
81// to check (semantically) and execute commands such as SELECT, UPDATE, etc..
82// Note that subqueries are executed before the entire parse tree has
83// been walked through, thus before possible later semantic errors are
84// detected.
85// <br>Expressions in the parse tree are converted to expression trees
86// using the various TableExprNode classes. Expression trees are evaluated
87// for each row in a table. Note that expressions can be used in many
88// parts of a TaQL command.
89// Functions in a command are handled by TableParseFunc.
90// </ol>
91//
92// Expression trees can also be generated directly in C++ using class
93// TableExprNode which is overloaded for many operators and functions
94// (such as sin, max, etc.). In fact, TaQLNodeHandler uses this code.
95// For example:
96// <example>
97// <srcblock>
98// Table tab("my.ms");
99// Table selection (tab(tab.col("ANTENNA1") == tab.col("ANTENNA2") &&
100// tab.col("SPECTRAL_WINDOW_ID") == 0));
101// </srcblock>
102// creates a (reference) table containing the autocorrelations of the
103// first spectral window in "my.ms".
104// </example>
105// </synopsis>
106// </module>
107
108} // namespace casacore
109
110#endif
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28