RecordGram.h

Classes

Global Functions -- Global functions for flex/bison scanner/parser for RecordGram (full description)
RecordGramVal -- Helper class for values in 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

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

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 RecordGramVal

Interface

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

A record selection command is lexically analyzed via flex. An object of this class is used to hold a value (like a name or a literal) for later use in the parser code.

Member Description


class RecordGram

Interface

Public Members
static TableExprNode parse (const RecordInterface& record, const String& expression)
static TableExprNode parse (const Table& table, const String& expression)
static TableExprNode handleLiteral (RecordGramVal*)
static TableExprNode handleField (const String& name)
static TableExprNode handleFunc (const String& name, const TableExprNodeSet& arguments)
static void setNodePtr (TableExprNode* nodePtr)
Private Members
static TableExprNode doParse (const String& expression)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

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 expression will operate on a series of Record objects. The given record is needed to know the type of the fields used in the expression.

static TableExprNode parse (const Table& table, const String& expression)

Convert an expression string to an expression tree. The expression will operate on the given table.

static TableExprNode handleLiteral (RecordGramVal*)

Create a TableExprNode from a literal.

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.

static TableExprNode doParse (const String& expression)

Do the conversion of an expression string to an expression tree.