28 #ifndef TABLES_RECORDGRAM_H
29 #define TABLES_RECORDGRAM_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicSL/String.h>
34 #include <casacore/tables/TaQL/TableGram.h>
35 #include <casacore/tables/TaQL/TaQLStyle.h>
36 #include <casacore/tables/Tables/Table.h>
37 #include <casacore/casa/Containers/Record.h>
38 #include <casacore/casa/Arrays/Array.h>
45 class TableExprNodeSet;
46 class TableExprNodeSetElem;
97 {
return tableGramRemoveEscapes (in); }
101 {
return tableGramRemoveQuotes (in); }
188 const String& expression);
195 const String& expression);
Helper class for values in RecordGram.
Select-class for flex/bison scanner/parser for RecordGram.
static String expr2String(const String &expr, const Record &vars=Record())
static TableExprNode doParse(const String &expression)
Do the conversion of an expression string to an expression tree.
static void deleteToken(TableExprNodeSet *ptr)
static TableExprNode parse(const Table &table, const String &expression)
Convert an expression string to an expression tree.
static double expr2Double(const String &expr, const Record &vars=Record(), const String &unit=String())
static Array< Bool > expr2ArrayBool(const String &expr, const Record &vars=Record())
static TableExprNode handleRegex(const TableExprNode &left, const String ®ex)
Handle a regex.
static std::mutex theirMutex
static void deleteToken(TableExprNode *ptr)
Delete a token and remove from the list.
static TableExprNode handleLiteral(RecordGramVal *)
Create a TableExprNode from a literal.
static void deleteToken(TableExprNodeSetElem *ptr)
static Array< DComplex > expr2ArrayComplex(const String &expr, const Record &vars=Record())
static Bool expr2Bool(const String &expr, const Record &vars=Record())
Evaluate an expression to the given type.
static void deleteTokenStorage()
Delete all tokens not deleted yet.
static TableExprNode handleFunc(const String &name, const TableExprNodeSet &arguments)
Handle a function.
static DComplex expr2Complex(const String &expr, const Record &vars=Record())
static void deleteToken(RecordGramVal *ptr)
static void addToken(TableExprNodeSet *ptr)
static const Table * theirTabPtr
static Array< MVTime > expr2ArrayDate(const String &expr, const Record &vars=Record())
static TableExprNode parse(const RecordInterface &record, const String &expression)
Convert an expression string to an expression tree.
static TableExprNode * theirNodePtr
static Int64 expr2Int(const String &expr, const Record &vars=Record())
static Array< Int64 > expr2ArrayInt(const String &expr, const Record &vars=Record())
static MVTime expr2Date(const String &expr, const Record &vars=Record())
static TaQLStyle theirTaQLStyle
Define the global TaQLStyle to use.
static void addToken(void *ptr, Token type)
Add a token to the list of tokens to be deleted.
static void setNodePtr(TableExprNode *nodePtr)
Set the final node pointer.
static void addToken(TableExprNode *ptr)
Add a token to the list of tokens to be deleted for the possible tokens in the RecordGram....
static TableExprNode handleField(const String &name)
Find the field name and create a TableExprNode from it.
static Array< String > expr2ArrayString(const String &expr, const Record &vars=Record())
static Array< double > expr2ArrayDouble(const String &expr, const Record &vars=Record(), const String &unit=String())
Token
Define the types of tokens in the grammar.
static std::map< void *, Token > theirTokens
static void addToken(RecordGramVal *ptr)
static void removeToken(void *ptr)
Remove a token from the list of tokens to be deleted.
static const RecordInterface * theirRecPtr
static void addToken(TableExprNodeSetElem *ptr)
String: the storage and methods of handling collections of characters.
Class to hold multiple table expression nodes.
std::complex< Double > DComplex
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
bool Bool
Define the standard types used by Casacore.
int recordGramParseCommand(const String &command)
Declare the bison parser (is implemented by bison command).
int recordGramInput(char *buf, int max_size)
Declare the input routine for flex/bison.
String recordGramRemoveEscapes(const String &in)
A function to remove escaped characters.
void RecordGramerror(const char *)
The yyerror function for the parser.
Int & recordGramPosition()
Give the current position in the string.
String recordGramRemoveQuotes(const String &in)
A function to remove quotes from a quoted string.