RecordGram.h

Classes

Global Functions -- Global functions for flex/bison scanner/parser for RecordGram (full description)
RecordGram -- Select-class for flex/bison scanner/parser for RecordGram (full description)

Global functions for flex/bison scanner/parser for RecordGram (source)

Interface

int recordGramParseCommand (const String& command)
void RecordGramerror (char*)
Int& recordGramPosition()
int recordGramInput (char* buf, int max_size)
inline String recordGramRemoveEscapes (const String& in)
inline String recordGramRemoveQuotes (const String& in)

Description

Prerequisite

Synopsis

Global functions are needed to define the input of the flex scanner and to start the bison parser. The input is taken from a string.

Motivation

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

To Do

Member Description

int recordGramParseCommand (const String& command)

Declare the bison parser (is implemented by bison command).

void RecordGramerror (char*)

The yyerror function for the parser. It throws an exception with the current token.

Int& recordGramPosition()

Give the current position in the string. This can be used when parse errors occur.

int recordGramInput (char* buf, int max_size)

Declare the input routine for flex/bison.

inline String recordGramRemoveEscapes (const String& in)

A function to remove escaped characters.

inline String recordGramRemoveQuotes (const String& in)

A function to remove quotes from a quoted string.


class RecordGram

Interface

Public Members
static TableExprNode parse (const RecordInterface& record, const String& expression)
static TableExprNode handleField (const String& name)
static TableExprNode handleFunc (const String& name, const TableExprNodeSet& arguments)
static void setNodePtr (TableExprNode* nodePtr)

Description

Prerequisite

Synopsis

This class is needed for the the actions in the flex scanner and bison parser. This stores the information by constructing RecordGram objects as needed and storing them in a List.

Motivation

It is necessary to be able to give a record select command in ASCII. It is used by the ACSIS people.

Member Description

static TableExprNode parse (const RecordInterface& record, const String& expression)

Convert an expression string to an expression tree. The record is needed to know the type of the fields used in the expression.

static TableExprNode handleField (const String& name)

Find the field name and create a TableExprNode from it.

static TableExprNode handleFunc (const String& name, const TableExprNodeSet& arguments)

Handle a function.

static void setNodePtr (TableExprNode* nodePtr)

Set the final node pointer.