irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

parser.hpp File Reference
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "objInfo.h"
#include "reHelpers1.hpp"
#include "reconstants.hpp"
#include "restructs.hpp"
#include "utils.hpp"
#include "region.h"
#include "irods_hashtable.h"
Include dependency graph for parser.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  op
 
struct  pointer
 
struct  ParserContext
 

Macros

#define num_ops   31
 
#define pushRule(rs, r)   ((rs)->rules[(rs)->len++] = (r))
 
#define PUSH(n)   (context->nodeStack[(context->nodeStackTop)++] = n)
 
#define POP   (context->nodeStack[--(context->nodeStackTop)])
 
#define NEXT_TOKEN_BASIC   NEXT_TOKEN(0)
 
#define NEXT_TOKEN_EXT   NEXT_TOKEN(1)
 
#define NEXT_TOKEN(ext)
 
#define TOKEN_TYPE(t)   (token->type == (t))
 
#define TOKEN_TEXT(str)   (strcmp(token->text, (str))==0)
 
#define PUSHBACK   pushback( token, context)
 
#define FPOS   (getFPos(&pos, e, context))
 
#define UPDATE_ERR_LOC   if(FPOS->exprloc > context->errloc.exprloc) {context->errloc = *FPOS;}
 
#define CASCADE(x)
 
#define BUILD_NODE(type, cons, loc, deg, consume)
 
#define BUILD_APP_NODE(cons, loc, deg)
 
#define PARSER_FUNC_PROTO(l)   void CONCAT(nextRuleGen, l)(Pointer* e, ParserContext *context)
 
#define PARSER_FUNC_PROTO1(l, p)   void CONCAT(nextRuleGen, l)(Pointer* e, ParserContext *context, p)
 
#define PARSER_FUNC_PROTO2(l, p, q)   void CONCAT(nextRuleGen, l)(Pointer* e, ParserContext *context, p, q)
 
#define PARSER_BEGIN(l)
 
#define PARSER_FUNC_BEGIN(l)
 
#define PARSER_FUNC_BEGIN1(l, p)
 
#define PARSER_FUNC_BEGIN2(l, p, q)
 
#define PARSER_FUNC_END(l)
 
#define PARSER_END(l)    } while(0);
 
#define SWAP
 
#define UNZIP(n)
 
#define TTEXT(x)
 
#define TTEXT2(x, y)
 
#define TTEXT3(x, y, z)
 
#define TTEXT_LOOKAHEAD(x)
 
#define TTYPE(x)
 
#define TTYPE_LOOKAHEAD(x)
 
#define NO_SYNTAX_ERROR   (context->error == 0)
 
#define CHECK_ERROR
 
#define NT(x)
 
#define NT1(x, p)
 
#define NT2(x, p, q)
 
#define CHOICE_BEGIN(l)
 
#define CHOICE_END(l)
 
#define BRANCH_BEGIN(l)
 
#define BRANCH_END(l)
 
#define TRY(l)
 
#define OR(l)
 
#define FINALLY(l)
 
#define END_TRY(l)
 
#define ABORT(x)
 
#define OPTIONAL_BEGIN(l)
 
#define OPTIONAL_END(l)
 
#define LOOP_BEGIN(l)
 
#define LOOP_END(l)
 
#define DONE(l)
 
#define COUNTER(l)    CONCAT(l, Counter)
 
#define REPEAT_BEGIN(l)
 
#define REPEAT_END(l)
 
#define LIST_BEGIN(l)
 
#define LIST_DELIM(l)
 
#define LIST_END(l)
 

Typedefs

typedef struct op Op
 
typedef struct pointer Pointer
 

Functions

ParserContextnewParserContext (rError_t *errmsg, Region *r)
 
void deleteParserContext (ParserContext *t)
 
TokennextTokenRuleGen (Pointer *expr, ParserContext *pc, int rulegen, int ext)
 
int nextString (Pointer *e, char *value, int vars[])
 
int nextString2 (Pointer *e, char *value, int vars[])
 
int eol (char ch)
 
int isOp (char *token)
 
int isUnaryOp (Token *token)
 
int getUnaryPrecedence (Token *token)
 
int isBinaryOp (Token *token)
 
int getBinaryPrecedence (Token *token)
 
void getCoor (Pointer *p, Label *errloc, int coor[2])
 
int getLineRange (Pointer *p, int line, rodsLong_t range[2])
 
int skip (Pointer *expr, char *text, Token **token, ParserContext *pc, int rulegen)
 
void skipWhitespace (Pointer *expr)
 
char * findLineCont (char *expr)
 
int parseRuleSet (Pointer *e, RuleSet *ruleSet, Env *funcDesc, int *errloc, rError_t *errmsg, Region *r)
 
NodeparseRuleRuleGen (Pointer *expr, int backwardCompatible, ParserContext *pc)
 
NodeparseTermRuleGen (Pointer *expr, int rulegn, ParserContext *pc)
 
NodeparseActionsRuleGen (Pointer *expr, int rulegn, int backwardCompatible, ParserContext *pc)
 
void pushback (Token *token, ParserContext *pc)
 
void initPointer (Pointer *p, FILE *fp, const char *ruleBaseName)
 
void initPointer2 (Pointer *p, char *buf)
 
PointernewPointer (FILE *buf, const char *ruleBaseName)
 
PointernewPointer2 (char *buf)
 
void deletePointer (Pointer *buf)
 
void skipComments (Pointer *e)
 
int nextChar (Pointer *p)
 
int lookAhead (Pointer *p, unsigned int n)
 
char * trim (char *str)
 
void trimquotes (char *string)
 
int isLocalVariableNode (Node *node)
 
int isSessionVariableNode (Node *node)
 
int isVariableNode (Node *node)
 
void ruleNameToString (char **p, int *s, int indent, Node *rn)
 
void ruleToString (char *buf, int size, RuleDesc *rd)
 
void actionsToString (char **p, int *s, int indent, Node *na, Node *nr)
 
void indentToString (char **p, int *s, int indent)
 
void termToString (char **p, int *s, int indent, int prec, Node *n, int quote)
 
void patternToString (char **p, int *s, int indent, int prec, Node *n)
 
void typeToStringParser (char **p, int *s, int indent, int lifted, Node *n)
 
void functionApplicationToString (char *buf, int size, char *fn, Node **args, int n)
 
char * nextRuleSection (char *expr, char *section)
 
char * parseFunctionParameters (char *e, char *args[], int *argc)
 
char * functionParameters (char *expr, char *param)
 
ExprTypeparseFuncTypeFromString (char *string, Region *r)
 
NodeparseTypingConstraintsFromString (char *string, Region *r)
 
ExprTypeparseType (Pointer *e, int prec, Env *vtable, int lifted, Region *r)
 
LabelgetFPos (Label *label, Pointer *p, ParserContext *context)
 
void clearBuffer (Pointer *p)
 
void seekInFile (Pointer *p, unsigned long x)
 
void nextChars (Pointer *p, int len)
 
void syncTokenQueue (Pointer *e, ParserContext *context)
 
int dupLine (Pointer *p, Label *start, int n, char *buf)
 
int dupString (Pointer *p, Label *start, int n, char *buf)
 
StringListgetVarNamesInExprNode (Node *expr, Region *r)
 
StringListgetVarNamesInExprNodeAux (Node *expr, StringList *varnames, Region *r)
 
int eqExprNodeSyntactic (Node *a, Node *b)
 
int eqExprNodeSyntacticVarMapping (Node *a, Node *b, Hashtable *varMapping)
 
int nextStringBase (Pointer *e, char *value, int max_len, char *delim, int consumeDelim, char escape, int cntOffset, int vars[])
 
int nextStringBase2 (Pointer *e, char *value, int max_len, char *delim)
 
NodeconvertStringToExpression (Token *token, char *base, Node **node, Region *r)
 
NodenextActionBackwardCompatible (Pointer *e, Node **node, rError_t *errmsg, Region *r)
 
NodeparseActionArgumentBackwardCompatible (Pointer *e, Node **node, rError_t *errmsg, Region *r)
 
void nextActionArgumentStringBackwardCompatible (Pointer *e, Token *token)
 
char * typeName_Res (Res *s)
 
char * typeName_ExprType (ExprType *s)
 
char * typeName_NodeType (NodeType s)
 
char * typeName_Parser (NodeType s)
 
void printTree (Node *n, int indent)
 
void printIndent (int indent)
 
void generateErrMsgFromFile (char *msg, long errloc, char *ruleBaseName, char *ruleBasePath, char errbuf[1024])
 
void generateErrMsgFromSource (char *msg, long errloc, char *src, char errbuf[1024])
 
void generateErrMsgFromPointer (char *msg, Label *l, Pointer *e, char errbuf[1024])
 
char * generateErrMsg (char *msg, long errloc, char *ruleBaseName, char errbuf[1024])
 
void generateAndAddErrMsg (char *msg, Node *node, int errcode, rError_t *errmsg)
 

Variables

Op new_ops []
 

Macro Definition Documentation

◆ ABORT

#define ABORT (   x)
Value:
if(x) { \
context->error = 1; \
break;\
}

Definition at line 269 of file parser.hpp.

◆ BRANCH_BEGIN

#define BRANCH_BEGIN (   l)
Value:
if(!CONCAT(l,Finish)) { \
do { \
context->tqp = CONCAT(l,TokenQueueP); \
context->nodeStackTop = context->stackTopStack[context->stackTopStackTop-1]; \
context->error = 0;

Definition at line 239 of file parser.hpp.

◆ BRANCH_END

#define BRANCH_END (   l)
Value:
if(context->error == 0) \
CONCAT(l,Finish) = 1; \
} while(0);\
}

Definition at line 246 of file parser.hpp.

◆ BUILD_APP_NODE

#define BUILD_APP_NODE (   cons,
  loc,
  deg 
)
Value:
BUILD_NODE(N_TUPLE, TUPLE, loc, deg, deg); \
BUILD_NODE(TK_TEXT, cons, loc, 0, 0); \
SWAP; \
BUILD_NODE(N_APPLICATION, APPLICATION, loc, 2, 2); \

Definition at line 113 of file parser.hpp.

◆ BUILD_NODE

#define BUILD_NODE (   type,
  cons,
  loc,
  deg,
  consume 
)
Value:
if(context->error==0){Node *var = newNode((type), (cons), (loc), context->region); \
if(deg!=0) { \
Node **subs = setDegree(var, (deg), context->region); \
int counter; \
for(counter = 1;counter <= (deg);counter ++) {\
subs[(deg)-counter] = context->nodeStack[context->nodeStackTop-counter];\
} \
} \
context->nodeStackTop -= (consume); \
CASCADE(var);}

Definition at line 101 of file parser.hpp.

◆ CASCADE

#define CASCADE (   x)
Value:
{\
Node *_ncascade = (x); \
if(_ncascade == NULL || _ncascade->nodeType == N_ERROR) { \
UPDATE_ERR_LOC; \
context->error = 1; \
break;\
} else { \
PUSH(_ncascade); \
} \
}

Definition at line 90 of file parser.hpp.

◆ CHECK_ERROR

#define CHECK_ERROR
Value:
if(context->error!=0) { \
break; \
}

Definition at line 205 of file parser.hpp.

◆ CHOICE_BEGIN

#define CHOICE_BEGIN (   l)
Value:
if(context->error==0) { \
Label CONCAT(l,Start); \
int CONCAT(l,Finish) = 0; \
int CONCAT(l,TokenQueueP) = context->tqp; \
getFPos(&CONCAT(l,Start), e, context); \
context->stackTopStack[context->stackTopStackTop++] = context->nodeStackTop;

Definition at line 222 of file parser.hpp.

◆ CHOICE_END

#define CHOICE_END (   l)
Value:
(context->stackTopStackTop)--; \
if(!CONCAT(l,Finish)) { \
UPDATE_ERR_LOC; \
context->error = 1; \
break;\
} \
}

Definition at line 230 of file parser.hpp.

◆ COUNTER

#define COUNTER (   l)     CONCAT(l, Counter)

Definition at line 312 of file parser.hpp.

◆ DONE

#define DONE (   l)
Value:
CONCAT(done, l) = 1; \
goto CONCAT(exit, l);

Definition at line 307 of file parser.hpp.

◆ END_TRY

#define END_TRY (   l)
Value:
CHOICE_END(l)

Definition at line 265 of file parser.hpp.

◆ FINALLY

#define FINALLY (   l)
Value:
{ \
do {

Definition at line 260 of file parser.hpp.

◆ FPOS

#define FPOS   (getFPos(&pos, e, context))

Definition at line 88 of file parser.hpp.

◆ LIST_BEGIN

#define LIST_BEGIN (   l)
Value:
int COUNTER(l) = 0; \
LOOP_BEGIN(l) \

Definition at line 327 of file parser.hpp.

◆ LIST_DELIM

#define LIST_DELIM (   l)
Value:
COUNTER(l)++; \
TRY(l) \

Definition at line 331 of file parser.hpp.

◆ LIST_END

#define LIST_END (   l)
Value:
OR(l) \
DONE(l); \
END_TRY(l) \
LOOP_END(l)

Definition at line 335 of file parser.hpp.

◆ LOOP_BEGIN

#define LOOP_BEGIN (   l)
Value:
int CONCAT(done, l) = 0; \
while(!CONCAT(done, l) && NO_SYNTAX_ERROR) {

Definition at line 285 of file parser.hpp.

◆ LOOP_END

#define LOOP_END (   l)
Value:
} \
CONCAT(exit, l): \
if(!CONCAT(done, l)) { \
break; \
}

Definition at line 300 of file parser.hpp.

◆ NEXT_TOKEN

#define NEXT_TOKEN (   ext)
Value:
{ \
FPOS; \
token = nextTokenRuleGen(e, context, rulegen, ext); \
if(token->type==N_ERROR) { \
context->error=1; \
if(pos.exprloc > context->errloc.exprloc) context->errloc = pos; \
break;\
} \
}

Definition at line 75 of file parser.hpp.

◆ NEXT_TOKEN_BASIC

#define NEXT_TOKEN_BASIC   NEXT_TOKEN(0)

Definition at line 73 of file parser.hpp.

◆ NEXT_TOKEN_EXT

#define NEXT_TOKEN_EXT   NEXT_TOKEN(1)

Definition at line 74 of file parser.hpp.

◆ NO_SYNTAX_ERROR

#define NO_SYNTAX_ERROR   (context->error == 0)

Definition at line 204 of file parser.hpp.

◆ NT

#define NT (   x)
Value:
CONCAT(nextRuleGen, x)(e, context); \
CHECK_ERROR;

Definition at line 210 of file parser.hpp.

◆ NT1

#define NT1 (   x,
 
)
Value:
CONCAT(nextRuleGen, x)(e, context, p); \
CHECK_ERROR;

Definition at line 214 of file parser.hpp.

◆ NT2

#define NT2 (   x,
  p,
 
)
Value:
CONCAT(nextRuleGen, x)(e, context, p, q); \
CHECK_ERROR;

Definition at line 218 of file parser.hpp.

◆ num_ops

#define num_ops   31

Definition at line 32 of file parser.hpp.

◆ OPTIONAL_BEGIN

#define OPTIONAL_BEGIN (   l)
Value:
BRANCH_BEGIN(l);

Definition at line 275 of file parser.hpp.

◆ OPTIONAL_END

#define OPTIONAL_END (   l)
Value:
BRANCH_BEGIN(l); \
BRANCH_END(l); \
CHOICE_END(l);

Definition at line 279 of file parser.hpp.

◆ OR

#define OR (   l)
Value:
BRANCH_BEGIN(l)

Definition at line 256 of file parser.hpp.

◆ PARSER_BEGIN

#define PARSER_BEGIN (   l)
Value:
Label pos; \
Token *token = NULL; (void)token; \
skipWhitespace(e); \
getFPos(&start, (e), context); \
do {

Definition at line 125 of file parser.hpp.

◆ PARSER_END

#define PARSER_END (   l)     } while(0);

Definition at line 146 of file parser.hpp.

◆ PARSER_FUNC_BEGIN

#define PARSER_FUNC_BEGIN (   l)
Value:
PARSER_BEGIN(l)

Definition at line 133 of file parser.hpp.

◆ PARSER_FUNC_BEGIN1

#define PARSER_FUNC_BEGIN1 (   l,
 
)
Value:
PARSER_BEGIN(l)

Definition at line 136 of file parser.hpp.

◆ PARSER_FUNC_BEGIN2

#define PARSER_FUNC_BEGIN2 (   l,
  p,
 
)
Value:
PARSER_BEGIN(l)

Definition at line 139 of file parser.hpp.

◆ PARSER_FUNC_END

#define PARSER_FUNC_END (   l)
Value:
}

Definition at line 143 of file parser.hpp.

◆ PARSER_FUNC_PROTO

#define PARSER_FUNC_PROTO (   l)    void CONCAT(nextRuleGen, l)(Pointer* e, ParserContext *context)

Definition at line 119 of file parser.hpp.

◆ PARSER_FUNC_PROTO1

#define PARSER_FUNC_PROTO1 (   l,
 
)    void CONCAT(nextRuleGen, l)(Pointer* e, ParserContext *context, p)

Definition at line 121 of file parser.hpp.

◆ PARSER_FUNC_PROTO2

#define PARSER_FUNC_PROTO2 (   l,
  p,
 
)    void CONCAT(nextRuleGen, l)(Pointer* e, ParserContext *context, p, q)

Definition at line 123 of file parser.hpp.

◆ POP

#define POP   (context->nodeStack[--(context->nodeStackTop)])

Definition at line 72 of file parser.hpp.

◆ PUSH

#define PUSH (   n)    (context->nodeStack[(context->nodeStackTop)++] = n)

Definition at line 71 of file parser.hpp.

◆ PUSHBACK

#define PUSHBACK   pushback( token, context)

Definition at line 87 of file parser.hpp.

◆ pushRule

#define pushRule (   rs,
 
)    ((rs)->rules[(rs)->len++] = (r))

Definition at line 48 of file parser.hpp.

◆ REPEAT_BEGIN

#define REPEAT_BEGIN (   l)
Value:
int COUNTER(l) = 0; \
LOOP_BEGIN(l) \
TRY(l) \

Definition at line 315 of file parser.hpp.

◆ REPEAT_END

#define REPEAT_END (   l)
Value:
COUNTER(l)++; \
OR(l) \
DONE(l); \
END_TRY(l) \
LOOP_END(l)

Definition at line 320 of file parser.hpp.

◆ SWAP

#define SWAP
Value:
{\
Node *node = POP;\
Node *node2 = POP;\
PUSH(node);\
PUSH(node2);\
}

Definition at line 149 of file parser.hpp.

◆ TOKEN_TEXT

#define TOKEN_TEXT (   str)    (strcmp(token->text, (str))==0)

Definition at line 86 of file parser.hpp.

◆ TOKEN_TYPE

#define TOKEN_TYPE (   t)    (token->type == (t))

Definition at line 85 of file parser.hpp.

◆ TRY

#define TRY (   l)
Value:
BRANCH_BEGIN(l)

Definition at line 252 of file parser.hpp.

◆ TTEXT

#define TTEXT (   x)
Value:
NEXT_TOKEN(0); \
context->error = 1; \
if(pos.exprloc > context->errloc.exprloc) context->errloc = pos; \
break; \
}

Definition at line 169 of file parser.hpp.

◆ TTEXT2

#define TTEXT2 (   x,
 
)
Value:
NEXT_TOKEN(0); \
context->error = 1; \
if(pos.exprloc > context->errloc.exprloc) context->errloc = pos; \
break; \
}

Definition at line 176 of file parser.hpp.

◆ TTEXT3

#define TTEXT3 (   x,
  y,
 
)
Value:
NEXT_TOKEN(0); \
context->error = 1; \
if(pos.exprloc > context->errloc.exprloc) context->errloc = pos; \
break; \
}

Definition at line 183 of file parser.hpp.

◆ TTEXT_LOOKAHEAD

#define TTEXT_LOOKAHEAD (   x)
Value:
TTEXT(x); \
PUSHBACK;

Definition at line 190 of file parser.hpp.

◆ TTYPE

#define TTYPE (   x)
Value:
if(!TOKEN_TYPE(x)) { \
context->error = 1; \
if(pos.exprloc > context->errloc.exprloc) context->errloc = pos; \
break; \
}

Definition at line 193 of file parser.hpp.

◆ TTYPE_LOOKAHEAD

#define TTYPE_LOOKAHEAD (   x)
Value:
TTYPE(x); \
PUSHBACK;

Definition at line 200 of file parser.hpp.

◆ UNZIP

#define UNZIP (   n)
Value:
{ \
int i; \
Node *node[1024]; \
for(i=0;i<n;i++) { \
node[i] = context->nodeStack[context->nodeStackTop - 2*(n-i) + 1]; \
context->nodeStack[context->nodeStackTop-2*n+i] = context->nodeStack[context->nodeStackTop-2*n+2*i]; \
} \
for(i=0;i<n;i++) { \
context->nodeStack[context->nodeStackTop-n+i] = node[i]; \
} \
}

Definition at line 156 of file parser.hpp.

◆ UPDATE_ERR_LOC

#define UPDATE_ERR_LOC   if(FPOS->exprloc > context->errloc.exprloc) {context->errloc = *FPOS;}

Definition at line 89 of file parser.hpp.

Typedef Documentation

◆ Op

typedef struct op Op

◆ Pointer

typedef struct pointer Pointer

Function Documentation

◆ actionsToString()

void actionsToString ( char **  p,
int s,
int  indent,
Node na,
Node nr 
)

Definition at line 2095 of file parser.cpp.

References node::degree, getNodeType, irods.lib::indent(), indentToString(), MIN_PREC, N_APPLICATION, NULL, pid_age::p, PRINT, node::subtrees, termToString(), and node::text.

Referenced by functionApplicationToString(), insertRulesIntoDBNew(), ruleToString(), and termToString().

Here is the call graph for this function:

◆ clearBuffer()

void clearBuffer ( Pointer p)

Definition at line 2512 of file parser.cpp.

References pid_age::p.

Referenced by seekInFile().

◆ convertStringToExpression()

Node* convertStringToExpression ( Token token,
char *  base,
Node **  node,
Region r 
)

◆ deleteParserContext()

void deleteParserContext ( ParserContext t)

Definition at line 85 of file parser.cpp.

Referenced by parseAndComputeExpression().

◆ deletePointer()

void deletePointer ( Pointer buf)

◆ dupLine()

int dupLine ( Pointer p,
Label start,
int  n,
char *  buf 
)

Definition at line 2546 of file parser.cpp.

References buf, label::exprloc, getFPos(), lookAhead(), nextChar(), NULL, pid_age::p, and seekInFile().

Here is the call graph for this function:

◆ dupString()

int dupString ( Pointer p,
Label start,
int  n,
char *  buf 
)

Definition at line 2522 of file parser.cpp.

References buf, label::exprloc, getFPos(), lookAhead(), nextChar(), NULL, pid_age::p, seekInFile(), and start().

Referenced by nextTokenRuleGen().

Here is the call graph for this function:

◆ eol()

int eol ( char  ch)

Definition at line 364 of file parser.cpp.

◆ eqExprNodeSyntactic()

int eqExprNodeSyntactic ( Node a,
Node b 
)

Definition at line 2342 of file parser.cpp.

References irods.six::b(), node::degree, getNodeType, node::subtrees, and node::text.

Referenced by eqExprNodeSyntacticVarMapping().

Here is the call graph for this function:

◆ eqExprNodeSyntacticVarMapping()

int eqExprNodeSyntacticVarMapping ( Node a,
Node b,
Hashtable varMapping 
)

Definition at line 2355 of file parser.cpp.

References irods.six::b(), node::degree, eqExprNodeSyntactic(), getNodeType, lookupFromHashTable(), NULL, node::subtrees, node::text, and TK_VAR.

Referenced by createCondIndex().

Here is the call graph for this function:

◆ findLineCont()

char* findLineCont ( char *  expr)

Definition at line 128 of file parser.cpp.

References terminate_irods_processes::e, and NULL.

◆ functionApplicationToString()

void functionApplicationToString ( char *  buf,
int  size,
char *  fn,
Node **  args,
int  n 
)

Definition at line 2314 of file parser.cpp.

References actionsToString(), buf, convertResToString(), getNodeType, MIN_PREC, N_ACTIONS, N_VAL, NULL, pid_age::p, PRINT, size, and termToString().

Here is the call graph for this function:

◆ functionParameters()

char* functionParameters ( char *  expr,
char *  param 
)

Definition at line 2671 of file parser.cpp.

References terminate_irods_processes::e, mode, and get_irods_version::value.

◆ generateAndAddErrMsg()

◆ generateErrMsg()

◆ generateErrMsgFromFile()

void generateErrMsgFromFile ( char *  msg,
long  errloc,
char *  ruleBaseName,
char *  ruleBasePath,
char  errbuf[1024] 
)

Definition at line 3502 of file parser.cpp.

◆ generateErrMsgFromPointer()

void generateErrMsgFromPointer ( char *  msg,
Label l,
Pointer e,
char  errbuf[1024] 
)

Definition at line 3522 of file parser.cpp.

◆ generateErrMsgFromSource()

void generateErrMsgFromSource ( char *  msg,
long  errloc,
char *  src,
char  errbuf[1024] 
)

Definition at line 3514 of file parser.cpp.

◆ getBinaryPrecedence()

int getBinaryPrecedence ( Token token)

Definition at line 1691 of file parser.cpp.

References new_ops, num_ops, op::prec, and token::text.

Referenced by patternToString(), and termToString().

◆ getCoor()

void getCoor ( Pointer p,
Label errloc,
int  coor[2] 
)

Definition at line 2577 of file parser.cpp.

References label::exprloc, getFPos(), lookAhead(), nextChar(), NULL, pid_age::p, and seekInFile().

Here is the call graph for this function:

◆ getFPos()

◆ getLineRange()

int getLineRange ( Pointer p,
int  line,
rodsLong_t  range[2] 
)

Definition at line 2600 of file parser.cpp.

References label::exprloc, getFPos(), get_db_schema_version::l, irods.pyparsing::line(), lookAhead(), nextChar(), NULL, pid_age::p, irods.pyparsing::range, and seekInFile().

Referenced by processXMsg().

Here is the call graph for this function:

◆ getUnaryPrecedence()

int getUnaryPrecedence ( Token token)

Definition at line 1700 of file parser.cpp.

References new_ops, num_ops, op::prec, and token::text.

◆ getVarNamesInExprNode()

StringList* getVarNamesInExprNode ( Node expr,
Region r 
)

Definition at line 2375 of file parser.cpp.

References getVarNamesInExprNodeAux(), and NULL.

Here is the call graph for this function:

◆ getVarNamesInExprNodeAux()

StringList* getVarNamesInExprNodeAux ( Node expr,
StringList varnames,
Region r 
)

Definition at line 2379 of file parser.cpp.

References node::degree, getNodeType, str_list::next, region_alloc(), str_list::str, node::subtrees, node::text, and TK_VAR.

Referenced by getVarNamesInExprNode().

Here is the call graph for this function:

◆ indentToString()

void indentToString ( char **  p,
int s,
int  indent 
)

Definition at line 2088 of file parser.cpp.

References irods.lib::indent(), pid_age::p, and PRINT.

Referenced by actionsToString(), metadataToString(), ruleToString(), and termToString().

Here is the call graph for this function:

◆ initPointer()

void initPointer ( Pointer p,
FILE *  fp,
const char *  ruleBaseName 
)

Definition at line 2452 of file parser.cpp.

References pid_age::p.

Referenced by newPointer().

◆ initPointer2()

void initPointer2 ( Pointer p,
char *  buf 
)

Definition at line 2464 of file parser.cpp.

References buf, and pid_age::p.

Referenced by newPointer2().

◆ isBinaryOp()

int isBinaryOp ( Token token)

Definition at line 1720 of file parser.cpp.

References new_ops, num_ops, op::string, and token::text.

Referenced by patternToString(), and termToString().

◆ isLocalVariableNode()

int isLocalVariableNode ( Node node)

Definition at line 88 of file parser.cpp.

References getNodeType, node::text, and TK_VAR.

Referenced by isVariableNode().

◆ isOp()

int isOp ( char *  token)

Definition at line 1731 of file parser.cpp.

References new_ops, and num_ops.

◆ isSessionVariableNode()

int isSessionVariableNode ( Node node)

Definition at line 93 of file parser.cpp.

References getNodeType, node::text, and TK_VAR.

Referenced by isVariableNode().

◆ isUnaryOp()

int isUnaryOp ( Token token)

Definition at line 1709 of file parser.cpp.

References new_ops, num_ops, op::string, and token::text.

◆ isVariableNode()

int isVariableNode ( Node node)

Definition at line 98 of file parser.cpp.

References isLocalVariableNode(), and isSessionVariableNode().

Referenced by evaluateFunction3(), and execMicroService3().

Here is the call graph for this function:

◆ lookAhead()

int lookAhead ( Pointer p,
unsigned int  n 
)

Definition at line 2651 of file parser.cpp.

References pid_age::p, and readToBuffer().

Referenced by dupLine(), dupString(), getCoor(), getLineRange(), nextActionArgumentStringBackwardCompatible(), nextChar(), nextTokenRuleGen(), processXMsg(), skipComments(), and skipWhitespace().

Here is the call graph for this function:

◆ newParserContext()

ParserContext* newParserContext ( rError_t errmsg,
Region r 
)

utility functions

Definition at line 70 of file parser.cpp.

References ParserContext::errloc, ParserContext::errmsg, ParserContext::errmsgbuf, ParserContext::errnode, ParserContext::error, label::exprloc, newHashTable2(), ParserContext::nodeStackTop, NULL, ParserContext::region, ParserContext::stackTopStackTop, ParserContext::symtable, ParserContext::tqbot, ParserContext::tqp, and ParserContext::tqtop.

Referenced by parseAndComputeExpression(), and processXMsg().

Here is the call graph for this function:

◆ newPointer()

Pointer* newPointer ( FILE *  buf,
const char *  ruleBaseName 
)

Definition at line 2430 of file parser.cpp.

References terminate_irods_processes::e, and initPointer().

Referenced by processXMsg(), and readRuleSetFromLocalFile().

Here is the call graph for this function:

◆ newPointer2()

Pointer* newPointer2 ( char *  buf)

Definition at line 2435 of file parser.cpp.

References buf, terminate_irods_processes::e, and initPointer2().

Referenced by parseAndComputeExpression(), parseAndComputeRule(), processXMsg(), and readRuleSetFromDB().

Here is the call graph for this function:

◆ nextActionArgumentStringBackwardCompatible()

void nextActionArgumentStringBackwardCompatible ( Pointer e,
Token token 
)

Definition at line 2838 of file parser.cpp.

References terminate_irods_processes::e, label::exprloc, token::exprloc, getFPos(), lookAhead(), MAX_TOKEN_TEXT_LEN, nextStringBase(), nextStringParsed(), NULL, skipWhitespace(), start(), token::text, TK_EOS, TK_STRING, token::type, and token::vars.

Here is the call graph for this function:

◆ nextActionBackwardCompatible()

Node* nextActionBackwardCompatible ( Pointer e,
Node **  node,
rError_t errmsg,
Region r 
)

◆ nextChar()

int nextChar ( Pointer p)

returns -1 if reached eos

Definition at line 2410 of file parser.cpp.

References lookAhead(), and pid_age::p.

Referenced by dupLine(), dupString(), getCoor(), getLineRange(), nextChars(), nextTokenRuleGen(), skipComments(), and skipWhitespace().

Here is the call graph for this function:

◆ nextChars()

void nextChars ( Pointer p,
int  len 
)

Definition at line 2400 of file parser.cpp.

References nextChar(), and pid_age::p.

Referenced by nextTokenRuleGen().

Here is the call graph for this function:

◆ nextRuleSection()

char* nextRuleSection ( char *  expr,
char *  section 
)

Definition at line 2787 of file parser.cpp.

References buf, terminate_irods_processes::e, mode, and get_irods_version::value.

◆ nextString()

int nextString ( Pointer e,
char *  value,
int  vars[] 
)

Definition at line 1684 of file parser.cpp.

Referenced by nextTokenRuleGen().

◆ nextString2()

int nextString2 ( Pointer e,
char *  value,
int  vars[] 
)

Definition at line 1687 of file parser.cpp.

References terminate_irods_processes::e, MAX_TOKEN_TEXT_LEN, nextStringBase(), and get_irods_version::value.

Referenced by nextTokenRuleGen().

Here is the call graph for this function:

◆ nextStringBase()

int nextStringBase ( Pointer e,
char *  value,
int  max_len,
char *  delim,
int  consumeDelim,
char  escape,
int  cntOffset,
int  vars[] 
)

◆ nextStringBase2()

int nextStringBase2 ( Pointer e,
char *  value,
int  max_len,
char *  delim 
)

Definition at line 1557 of file parser.cpp.

Referenced by nextTokenRuleGen().

◆ nextTokenRuleGen()

◆ parseActionArgumentBackwardCompatible()

Node* parseActionArgumentBackwardCompatible ( Pointer e,
Node **  node,
rError_t errmsg,
Region r 
)

◆ parseActionsRuleGen()

Node* parseActionsRuleGen ( Pointer expr,
int  rulegn,
int  backwardCompatible,
ParserContext pc 
)

Definition at line 3400 of file parser.cpp.

Referenced by parseAndComputeExpression().

◆ parseFunctionParameters()

char* parseFunctionParameters ( char *  e,
char *  args[],
int argc 
)

◆ parseFuncTypeFromString()

ExprType* parseFuncTypeFromString ( char *  string,
Region r 
)

Definition at line 3351 of file parser.cpp.

Referenced by newConstructorFD(), newDeconstructorFD(), and newFunctionFD().

◆ parseRuleRuleGen()

Node* parseRuleRuleGen ( Pointer expr,
int  backwardCompatible,
ParserContext pc 
)

Parse a rule, create a rule pack. If error, either ret==NULL or ret->type=N_ERROR.

Definition at line 3372 of file parser.cpp.

◆ parseRuleSet()

int parseRuleSet ( Pointer e,
RuleSet ruleSet,
Env funcDesc,
int errloc,
rError_t errmsg,
Region r 
)

Definition at line 3179 of file parser.cpp.

Referenced by parseAndComputeRule(), readRuleSetFromDB(), and readRuleSetFromLocalFile().

◆ parseTermRuleGen()

Node* parseTermRuleGen ( Pointer expr,
int  rulegn,
ParserContext pc 
)

Definition at line 3385 of file parser.cpp.

Referenced by parseAndComputeExpression(), and processXMsg().

◆ parseType()

ExprType* parseType ( Pointer e,
int  prec,
Env vtable,
int  lifted,
Region r 
)

◆ parseTypingConstraintsFromString()

Node* parseTypingConstraintsFromString ( char *  string,
Region r 
)

Definition at line 3360 of file parser.cpp.

◆ patternToString()

void patternToString ( char **  p,
int s,
int  indent,
int  prec,
Node n 
)

Definition at line 1808 of file parser.cpp.

References node::degree, getBinaryPrecedence(), getNodeType, irods.lib::indent(), isBinaryOp(), MIN_PREC, N_APPLICATION, N_TUPLE, pid_age::p, PRINT, node::subtrees, node::text, token::text, TK_BOOL, TK_DOUBLE, TK_INT, TK_STRING, TK_TEXT, and TK_VAR.

Referenced by ruleNameToString(), and termToString().

Here is the call graph for this function:

◆ printIndent()

void printIndent ( int  indent)

Definition at line 487 of file utils.cpp.

Referenced by printEnvIndent(), printTree(), and printTreeDeref().

◆ printTree()

void printTree ( Node n,
int  indent 
)

Definition at line 1759 of file parser.cpp.

References buf, node::coercionType, node::degree, node::exprType, getIOType, getNodeType, irods.lib::indent(), IO_TYPE_ACTIONS, IO_TYPE_DYNAMIC, IO_TYPE_EXPRESSION, IO_TYPE_INPUT, IO_TYPE_OUTPUT, NULL, node::option, printIndent(), node::subtrees, T_TYPE, T_UNSPECED, TC_LT, TC_SET, node::text, and typeToString().

Here is the call graph for this function:

◆ pushback()

void pushback ( Token token,
ParserContext pc 
)

Definition at line 348 of file parser.cpp.

References DEC_MOD, TK_EOS, ParserContext::tqp, and token::type.

◆ ruleNameToString()

void ruleNameToString ( char **  p,
int s,
int  indent,
Node rn 
)

Definition at line 2131 of file parser.cpp.

References node::degree, irods.lib::indent(), MIN_PREC, pid_age::p, patternToString(), PRINT, node::subtrees, and node::text.

Referenced by insertRulesIntoDBNew(), and ruleToString().

Here is the call graph for this function:

◆ ruleToString()

void ruleToString ( char *  buf,
int  size,
RuleDesc rd 
)

Definition at line 2244 of file parser.cpp.

References actionsToString(), buf, node::degree, getNodeType, irods.lib::indent(), indentToString(), metadataToString(), MIN_PREC, N_TUPLE, RuleDesc::node, NULL, pid_age::p, PRINT, RK_CONSTRUCTOR, RK_DATA, RK_EXTERN, RK_FUNC, RK_REL, ruleNameToString(), RuleDesc::ruleType, size, node::subtrees, termToString(), node::text, TK_BOOL, and typeToStringParser().

Referenced by processXMsg().

Here is the call graph for this function:

◆ seekInFile()

void seekInFile ( Pointer p,
unsigned long  x 
)

Definition at line 2492 of file parser.cpp.

References clearBuffer(), LOG_ERROR, pid_age::p, readToBuffer(), and rodsLog().

Referenced by dupLine(), dupString(), getCoor(), getLineRange(), nextTokenRuleGen(), and syncTokenQueue().

Here is the call graph for this function:

◆ skip()

int skip ( Pointer e,
char *  text,
Token **  token,
ParserContext pc,
int  rulegen 
)

skip a token of type TK_TEXT, TK_OP, or TK_MISC_OP and text text, token will has type N_ERROR if the token does not match

skip a token of type TK_TEXT, TK_OP, or TK_MISC_OP and text text, token will have type N_ERROR if the token does not match return 0 failure non 0 success

Definition at line 147 of file parser.cpp.

References terminate_irods_processes::e, N_ERROR, nextTokenRuleGen(), TK_MISC_OP, TK_OP, and TK_TEXT.

Referenced by cllCheckPending().

Here is the call graph for this function:

◆ skipComments()

void skipComments ( Pointer e)

Definition at line 122 of file parser.cpp.

References terminate_irods_processes::e, lookAhead(), and nextChar().

Referenced by nextTokenRuleGen().

Here is the call graph for this function:

◆ skipWhitespace()

void skipWhitespace ( Pointer expr)

Definition at line 115 of file parser.cpp.

References lookAhead(), and nextChar().

Referenced by nextActionArgumentStringBackwardCompatible(), nextTokenRuleGen(), and processXMsg().

Here is the call graph for this function:

◆ syncTokenQueue()

void syncTokenQueue ( Pointer e,
ParserContext context 
)

Definition at line 355 of file parser.cpp.

References terminate_irods_processes::e, token::exprloc, seekInFile(), ParserContext::tokenQueue, ParserContext::tqp, and ParserContext::tqtop.

Referenced by processXMsg().

Here is the call graph for this function:

◆ termToString()

void termToString ( char **  p,
int s,
int  indent,
int  prec,
Node n,
int  quote 
)

◆ trim()

char* trim ( char *  str)

Definition at line 1740 of file parser.cpp.

References get_db_schema_version::l.

Referenced by irods::set_default_resource(), and smsi_split().

◆ trimquotes()

void trimquotes ( char *  string)

Definition at line 1753 of file parser.cpp.

Referenced by nextString2String(), and nextStringString().

◆ typeName_ExprType()

char* typeName_ExprType ( ExprType s)

Definition at line 3419 of file parser.cpp.

Referenced by getBaseTypeOrTVarId(), and typeToString().

◆ typeName_NodeType()

char* typeName_NodeType ( NodeType  s)

Definition at line 3465 of file parser.cpp.

◆ typeName_Parser()

char* typeName_Parser ( NodeType  s)

Definition at line 3428 of file parser.cpp.

Referenced by typeToStringParser().

◆ typeName_Res()

char* typeName_Res ( Res s)

◆ typeToStringParser()

void typeToStringParser ( char **  p,
int s,
int  indent,
int  lifted,
Node n 
)

Variable Documentation

◆ new_ops

Op new_ops[]
NULL
#define NULL
Definition: rodsDef.h:70
PARSER_END
#define PARSER_END(l)
Definition: parser.hpp:145
setDegree
Node ** setDegree(Node *node, int d, Region *r)
Definition: restructs.cpp:392
token::type
NodeType type
Definition: restructs.hpp:294
nextTokenRuleGen
Token * nextTokenRuleGen(Pointer *expr, ParserContext *pc, int rulegen, int ext)
Definition: parser.cpp:160
NO_SYNTAX_ERROR
#define NO_SYNTAX_ERROR
Definition: parser.hpp:203
PARSER_FUNC_PROTO1
#define PARSER_FUNC_PROTO1(l, p)
Definition: parser.hpp:120
NEXT_TOKEN
#define NEXT_TOKEN(ext)
Definition: parser.hpp:74
pid_age.p
p
Definition: pid_age.py:13
TUPLE
#define TUPLE
Definition: reconstants.hpp:15
N_APPLICATION
@ N_APPLICATION
Definition: restructs.hpp:128
node
Definition: restructs.hpp:244
token
Definition: restructs.hpp:293
TK_MISC_OP
@ TK_MISC_OP
Definition: restructs.hpp:123
CHOICE_BEGIN
#define CHOICE_BEGIN(l)
Definition: parser.hpp:221
APPLICATION
#define APPLICATION
Definition: reconstants.hpp:16
TTYPE
#define TTYPE(x)
Definition: parser.hpp:192
TTEXT
#define TTEXT(x)
Definition: parser.hpp:168
POP
#define POP
Definition: parser.hpp:71
OR
#define OR(l)
Definition: parser.hpp:255
COUNTER
#define COUNTER(l)
Definition: parser.hpp:311
start
irods::error start(irods::default_re_ctx &_u, const std::string &_instance_name)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:796
TK_TEXT
@ TK_TEXT
Definition: restructs.hpp:114
newNode
Node * newNode(NodeType type, const char *text, Label *exprloc, Region *r)
Definition: restructs.cpp:10
BUILD_NODE
#define BUILD_NODE(type, cons, loc, deg, consume)
Definition: parser.hpp:100
PARSER_FUNC_PROTO2
#define PARSER_FUNC_PROTO2(l, p, q)
Definition: parser.hpp:122
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
TOKEN_TYPE
#define TOKEN_TYPE(t)
Definition: parser.hpp:84
TK_PATH
@ TK_PATH
Definition: restructs.hpp:125
PARSER_FUNC_PROTO
#define PARSER_FUNC_PROTO(l)
Definition: parser.hpp:118
TOKEN_TEXT
#define TOKEN_TEXT(str)
Definition: parser.hpp:85
get_db_schema_version.l
l
Definition: get_db_schema_version.py:19
TK_OP
@ TK_OP
Definition: restructs.hpp:122
N_TUPLE
@ N_TUPLE
Definition: restructs.hpp:127
N_ERROR
@ N_ERROR
Definition: restructs.hpp:111
label
Definition: restructs.hpp:288
type
int type
Definition: filesystem.cpp:103
BRANCH_END
#define BRANCH_END(l)
Definition: parser.hpp:245
CONCAT
#define CONCAT(a, b)
Definition: utils.hpp:104