MSTimeParse.h

Classes

MSTimeParse -- Class to hold values from time grammar parser (full description)

class MSTimeParse : public MSParse

Interface

Public Members
MSTimeParse ()
MSTimeParse (const MeasurementSet* ms)
const TableExprNode *selectTime(const MEpoch& time, bool daytime = false)
const TableExprNode *selectTimeGT(const MEpoch& lowboundTime, bool daytime = false)
const TableExprNode *selectTimeLT(const MEpoch& upboundTime, bool daytime = false)
const TableExprNode *selectTimeRange(const MEpoch& lowboundTime, const MEpoch& upboundTime, bool daytime = false)
const TableExprNode *addCondition(TableExprNode& condition)
static void setDefaults(TimeFields& tf, Bool dataOrigin=True)
static void copyDefaults(TimeFields& target, TimeFields& source)
static const MEpoch *yearTimeConvert(Int year=-1, Int month=-1, Int day=-1, Int hour = -1, Int minute = -1, Int second = -1, Int millisec = -1)
static const MEpoch *yearTimeConvert(const TimeFields& tf)
static const TableExprNode* node()
const Int year0()
const Int month0()
const Int day0()
const Int hour0()
const Int minute0()
const Int second0()
const Int fractionalsec0()
const Double defaultInteg()
static const void validate(const TimeFields& tf)
static const Double toTAIInSec(const MEpoch& time)

Description

Prerequisite

Etymology

MSTimeParse is the class used to parse a time command.

Synopsis

MSTimeParse is used by the parser of time sub-expression statements. The parser is written in Bison and Flex in files MSTimeGram.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 list. The variable names can be qualified by the table name and will be looked up in the appropriate table.

The class MSTimeParse only contains information about a table used in the table command. Global variables (like a list and a vector) are used in MSTimeParse.cc to hold further information.

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

Motivation

It is necessary to be able to give a ms 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.

Member Description

MSTimeParse ()

Default constructor

MSTimeParse (const MeasurementSet* ms)

Associate the ms and the shorthand.

const TableExprNode *selectTime(const MEpoch& time, bool daytime = false)

const TableExprNode *selectTimeGT(const MEpoch& lowboundTime, bool daytime = false)

const TableExprNode *selectTimeLT(const MEpoch& upboundTime, bool daytime = false)

const TableExprNode *selectTimeRange(const MEpoch& lowboundTime, const MEpoch& upboundTime, bool daytime = false)

const TableExprNode *addCondition(TableExprNode& condition)

static void setDefaults(TimeFields& tf, Bool dataOrigin=True)

static void copyDefaults(TimeFields& target, TimeFields& source)

static const MEpoch *yearTimeConvert(Int year=-1, Int month=-1, Int day=-1, Int hour = -1, Int minute = -1, Int second = -1, Int millisec = -1)

static const MEpoch *yearTimeConvert(const TimeFields& tf)

static const TableExprNode* node()

Get table expression node object.

const Int year0()

const Int month0()

const Int day0()

const Int hour0()

const Int minute0()

const Int second0()

const Int fractionalsec0()

const Double defaultInteg()

static const void validate(const TimeFields& tf)

static const Double toTAIInSec(const MEpoch& time)

private: