casacore
Public Member Functions | Private Attributes | List of all members

More...

#include <TableParse.h>

Public Member Functions

 TableParse ()
 Default constructor for container class. More...
 
 TableParse (const Table &table, Int tabnr, const String &name, const String &shorthand)
 Associate the table and the shorthand. More...
 
Bool test (const String &shortHand) const
 Test if shorthand matches. More...
 
Int tabnr () const
 Get the given table number (of $i tables in TempTables) More...
 
const Stringname () const
 Get the given table name. More...
 
const Stringshorthand () const
 Get the shorthand. More...
 
const Tabletable () const
 Get table object. More...
 
Tabletable ()
 
void replaceTable (const Table &)
 Replace the Table object. More...
 

Private Attributes

Int tabnr_p
 
String name_p
 
String shorthand_p
 
Table table_p
 

Detailed Description

Class to hold values from table grammar parser

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tTableGram

Etymology

TableParse is the class used to parse a table command.

Synopsis

TableParse is used by the parser of table select statements. The parser is written in Bison and Flex in files TableGram.y and.l. The statements in there use the routines in this file to act upon a reduced rule. Since multiple tables can be given (with a shorthand), the table names are stored in a container. The variable names can be qualified by the table name and will be looked up in the appropriate table.

A select command is similar to SQL and can look like: SELECT columns FROM tab1 sh1, tab2 sh2, tab3 WHERE sh1.field == 3*sh1.field2... ORDERBY columns GIVING table This is described in more detail in TableGram.l.

The class TableParse only contains information about a table used in the table command.

Global functions are used to operate on the information. The main function is the global function tableCommand. It executes the given TaQL command and returns the resulting table. This is, in fact, the only function to be used by a user.

Motivation

It is necessary to be able to give a table select command in ASCII. This can be used in a CLI or in the table browser to get a subset of a table or to sort a table.

Definition at line 109 of file TableParse.h.

Constructor & Destructor Documentation

◆ TableParse() [1/2]

casacore::TableParse::TableParse ( )

Default constructor for container class.

◆ TableParse() [2/2]

casacore::TableParse::TableParse ( const Table table,
Int  tabnr,
const String name,
const String shorthand 
)

Associate the table and the shorthand.

Member Function Documentation

◆ name()

const String & casacore::TableParse::name ( ) const
inline

Get the given table name.

Definition at line 1000 of file TableParse.h.

References name_p.

◆ replaceTable()

void casacore::TableParse::replaceTable ( const Table table)
inline

Replace the Table object.

Definition at line 1012 of file TableParse.h.

References table(), and table_p.

◆ shorthand()

const String & casacore::TableParse::shorthand ( ) const
inline

Get the shorthand.

Definition at line 1003 of file TableParse.h.

References shorthand_p.

◆ table() [1/2]

Table & casacore::TableParse::table ( )
inline

Definition at line 1009 of file TableParse.h.

References table_p.

◆ table() [2/2]

const Table & casacore::TableParse::table ( ) const
inline

Get table object.

Definition at line 1006 of file TableParse.h.

References table_p.

Referenced by replaceTable().

◆ tabnr()

Int casacore::TableParse::tabnr ( ) const
inline

Get the given table number (of $i tables in TempTables)

Definition at line 997 of file TableParse.h.

References tabnr_p.

◆ test()

Bool casacore::TableParse::test ( const String shortHand) const
inline

Test if shorthand matches.

If also matches if the given shorthand is empty.

Definition at line 994 of file TableParse.h.

References casacore::String::empty(), and shorthand_p.

Member Data Documentation

◆ name_p

String casacore::TableParse::name_p
private

Definition at line 141 of file TableParse.h.

Referenced by name().

◆ shorthand_p

String casacore::TableParse::shorthand_p
private

Definition at line 142 of file TableParse.h.

Referenced by shorthand(), and test().

◆ table_p

Table casacore::TableParse::table_p
private

Definition at line 143 of file TableParse.h.

Referenced by replaceTable(), and table().

◆ tabnr_p

Int casacore::TableParse::tabnr_p
private

Definition at line 140 of file TableParse.h.

Referenced by tabnr().


The documentation for this class was generated from the following file: