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)
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)
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
Prerequisite
- RecordGram.l and .y (flex and bison grammar)
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
Declare the bison parser (is implemented by bison command).
The yyerror function for the parser.
It throws an exception with the current token.
Give the current position in the string.
This can be used when parse errors occur.
Declare the input routine for flex/bison.
A function to remove escaped characters.
A function to remove quotes from a quoted string.
Interface
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
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)
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
Prerequisite
- RecordGram.l and .y (flex and bison grammar)
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.
Convert an expression string to an expression tree.
The expression will operate on the given table.
Create a TableExprNode from a literal.
Find the field name and create a TableExprNode from it.
Handle a function.
Set the final node pointer.
Do the conversion of an expression string to an expression tree.