casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
casa::TableParse Class Reference

Class to hold values from table grammar parser. More...

#include <TableParse.h>

List of all members.

Public Member Functions

 TableParse ()
 Default constructor for container class.
 TableParse (const TableParse &)
 Copy constructor (copy semantics).
TableParseoperator= (const TableParse &)
 Assignment (copy semantics).
 TableParse (const Table &table, const String &shorthand)
 Associate the table and the shorthand.
Bool test (const String &shortHand) const
 Test if shorthand matches.
const Stringshorthand () const
 Get the shorthand.
const Tabletable () const
 Get table object.

Private Attributes

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 103 of file TableParse.h.


Constructor & Destructor Documentation

Default constructor for container class.

Copy constructor (copy semantics).

casa::TableParse::TableParse ( const Table table,
const String shorthand 
)

Associate the table and the shorthand.


Member Function Documentation

TableParse& casa::TableParse::operator= ( const TableParse )

Assignment (copy semantics).

const String & casa::TableParse::shorthand ( ) const [inline]

Get the shorthand.

Definition at line 656 of file TableParse.h.

References shorthand_p.

const Table & casa::TableParse::table ( ) const [inline]

Get table object.

Definition at line 659 of file TableParse.h.

References table_p.

Bool casa::TableParse::test ( const String shortHand) const [inline]

Test if shorthand matches.

Definition at line 653 of file TableParse.h.

References casa::False, shorthand_p, and casa::True.


Member Data Documentation

Definition at line 129 of file TableParse.h.

Referenced by shorthand(), and test().

Definition at line 130 of file TableParse.h.

Referenced by table().


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