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)  

restructs.cpp
Go to the documentation of this file.
1 /* For copyright information please refer to files in the COPYRIGHT directory
2  */
3 #include "utils.hpp"
4 #include "restructs.hpp"
5 #include "parser.hpp"
6 
10 Node *newNode( NodeType type, const char* text, Label * eloc, Region *r ) {
11  Node *node = ( Node * )region_alloc( r, sizeof( Node ) );
12  if ( node == NULL ) {
13  return NULL;
14  }
15  memset( node, 0, sizeof( Node ) );
16  setNodeType( node, type );
17  if ( text != NULL ) {
18  node->text = ( char * )region_alloc( r, ( strlen( text ) + 1 ) * sizeof( char ) );
19  strcpy( node->text, text );
20  }
21  else {
22  node->text = NULL;
23  }
24  NODE_EXPR_POS( node ) = eloc == NULL ? 0 : eloc->exprloc;
26  if ( eloc != NULL ) {
27  setBase( node, eloc->base, r );
28  }
29  else {
30  setBase( node, "", r );
31  }
32  return node;
33 }
34 Node **allocSubtrees( Region *r, int size ) {
35  return ( Node** )region_alloc( r, sizeof( Node* ) * size );
36 }
37 
38 
39 Node *newExprType( NodeType type, int degree, Node **subtrees, Region *r ) {
40  ExprType *t = ( ExprType * )region_alloc( r, sizeof( ExprType ) );
41  memset( t, 0, sizeof( ExprType ) );
42  t->subtrees = subtrees;
43  t->degree = degree;
44  setNodeType( t, type );
45  t->option |= OPTION_TYPED;
47  return t;
48 
49 }
50 
51 ExprType *newTVar2( int numDisjuncts, Node **disjuncts, Region *r ) {
52  ExprType *t = newExprType( T_VAR, 0, NULL, r );
53  T_VAR_ID( t ) = newTVarId();
54  T_VAR_NUM_DISJUNCTS( t ) = numDisjuncts;
55  T_VAR_DISJUNCTS( t ) = numDisjuncts == 0 ? NULL : ( Node ** )region_alloc( r, sizeof( Node * ) * numDisjuncts );
56  if ( numDisjuncts != 0 ) {
57  memcpy( T_VAR_DISJUNCTS( t ), disjuncts, numDisjuncts * sizeof( Node * ) );
58  }
59  return t;
60 }
61 
63  ExprType *t = newExprType( T_VAR, 0, NULL, r );
64  T_VAR_ID( t ) = newTVarId();
65  T_VAR_NUM_DISJUNCTS( t ) = 0;
66  T_VAR_DISJUNCTS( t ) = NULL;
67  return t;
68 }
69 
71  return newExprType( type, 0, NULL, r );
72 }
73 ExprType *newErrorType( int errcode, Region *r ) {
74  Res *res = newExprType( T_ERROR, 0, NULL, r );
75  RES_ERR_CODE( res ) = errcode;
76  return res;
77 
78 }
79 ExprType *newFuncType( ExprType *paramType, ExprType* retType, Region *r ) {
80  ExprType **typeArgs = ( ExprType ** )region_alloc( r, sizeof( ExprType * ) * 2 );
81  typeArgs[0] = paramType;
82  typeArgs[1] = retType;
83  return newConsType( 2, cpStringExt( FUNC, r ), typeArgs, r );
84 }
85 ExprType *newFuncTypeVarArg( int arity, int vararg, ExprType **paramTypes, ExprType* retType, Region *r ) {
86  return newFuncType( newTupleTypeVarArg( arity, vararg, paramTypes, r ), retType, r );
87 }
88 ExprType *newConsType( int arity, char *cons, ExprType **paramTypes, Region *r ) {
89  ExprType *t = newExprType( T_CONS, arity, paramTypes, r );
90  T_CONS_TYPE_NAME( t ) = cpString( cons, r );
91  return t;
92 }
93 ExprType *newTupleTypeVarArg( int arity, int vararg, ExprType **paramTypes, Region *r ) {
94  ExprType *t = newExprType( T_TUPLE, arity, paramTypes, r );
95  setVararg( t, vararg );
96  return t;
97 }
98 
99 ExprType *newIRODSType( const char *name, Region *r ) {
100  ExprType *t = newExprType( T_IRODS, 0, NULL, r );
101  if ( name ) {
102  t->text = ( char * )region_alloc( r, ( strlen( name ) + 1 ) * sizeof( char ) );
103  strcpy( t->text, name );
104  }
105  else {
106  t->text = NULL;
107  }
108  return t;
109 }
110 ExprType *newCollType( ExprType *elemType, Region *r ) {
111  ExprType **typeArgs = ( ExprType** ) region_alloc( r, sizeof( ExprType* ) );
112  typeArgs[0] = elemType;
113  return newConsType( 1, cpStringExt( LIST, r ), typeArgs, r );
114 }
115 
116 ExprType *newTupleType( int arity, ExprType **typeArgs, Region *r ) {
117  return newExprType( T_TUPLE, arity, typeArgs, r );
118 }
119 ExprType *newUnaryType( NodeType nodeType, ExprType *typeArg, Region *r ) {
120  ExprType **typeArgs = ( ExprType** ) region_alloc( r, sizeof( ExprType* ) );
121  typeArgs[0] = typeArg;
122  return newExprType( nodeType, 1, typeArgs, r );
123 }
124 /* ExprType *newFlexKind(int arity, ExprType **typeArgs, Region *r) {
125  return newExprType(K_FLEX, arity, typeArgs, r);
126 } */
127 
128 FunctionDesc *newFuncSymLink( char *fn , int nArgs, Region *r ) {
129  Res *desc = newRes( r );
130  setNodeType( desc, N_SYM_LINK );
131  desc->text = cpStringExt( fn , r );
132  RES_FUNC_N_ARGS( desc ) = nArgs;
133  desc->exprType = newSimpType( T_DYNAMIC, r );
134  return desc;
135 }
136 
137 Node *newPartialApplication( Node *func, Node *arg, int nArgsLeft, Region *r ) {
138  Res *res1 = newRes( r );
140  RES_FUNC_N_ARGS( res1 ) = nArgsLeft;
141  res1->degree = 2;
142  res1->subtrees = ( Res ** )region_alloc( r, sizeof( Res * ) * 2 );
143  res1->subtrees[0] = func;
144  res1->subtrees[1] = arg;
145  return res1;
146 }
147 
148 Node *newTupleRes( int arity, Res **comps, Region *r ) {
149  Res *res1 = newRes( r );
150  setNodeType( res1, N_TUPLE );
151  res1->subtrees = comps;
152  res1->degree = arity;
153  ExprType **compTypes = ( ExprType ** )region_alloc( r, sizeof( ExprType * ) * arity );
154  int i;
155  for ( i = 0; i < arity; i++ ) {
156  compTypes[i] = comps[i]->exprType;
157  }
158  res1->exprType = newTupleType( arity, compTypes, r );
159  return res1;
160 }
161 Res* newCollRes( int size, ExprType *elemType, Region *r ) {
162  Res *res1 = newRes( r );
163  res1->exprType = newCollType( elemType, r );
164  res1->degree = size;
165  res1->subtrees = ( Res ** )region_alloc( r, sizeof( Res * ) * size );
166  return res1;
167 }
168 /* used in cpRes only */
169 Res* newCollRes2( int size, Region *r ) {
170  Res *res1 = newRes( r );
171  res1->exprType = NULL;
172  res1->degree = size;
173  res1->subtrees = ( Res ** )region_alloc( r, sizeof( Res * ) * size );
174  return res1;
175 }
176 Res* newRes( Region *r ) {
177  Res *res1 = ( Res * ) region_alloc( r, sizeof( Res ) );
178  memset( res1, 0, sizeof( Res ) );
179  setNodeType( res1, N_VAL );
180  setIOType( res1, IO_TYPE_INPUT );
181  return res1;
182 }
183 Res* newUninterpretedRes( Region *r, const char *typeName, void *ioStruct, bytesBuf_t *ioBuf ) {
184  Res *res1 = newRes( r );
185  res1->exprType = newIRODSType( typeName, r );
186  res1->param = newMsParam( typeName, ioStruct, ioBuf, r );
187  return res1;
188 }
189 msParam_t *newMsParam( const char *typeName, void *ioStruct, bytesBuf_t *ioBuf, Region *r ) {
190  msParam_t *param = ( msParam_t * ) region_alloc( r, sizeof( msParam_t ) );
191  memset( param, 0, sizeof( msParam_t ) );
192  if ( typeName ) {
193  param->type = ( char* ) region_alloc( r, sizeof( char ) * strlen( typeName ) );
194  strcpy( param->type, typeName );
195  }
196  else {
197  param->type = NULL;
198  }
199  param->inOutStruct = ioStruct;
200  param->inpOutBuf = ioBuf;
201  return param;
202 
203 }
204 Res* newIntRes( Region *r, int n ) {
205  Res *res1 = newRes( r );
206  res1->exprType = newSimpType( T_INT, r );
207  RES_INT_VAL_LVAL( res1 ) = n;
208  return res1;
209 }
210 Res* newDoubleRes( Region *r, double a ) {
211  Res *res1 = newRes( r );
212  res1->exprType = newSimpType( T_DOUBLE, r );
213  RES_DOUBLE_VAL_LVAL( res1 ) = a;
214  return res1;
215 }
216 Res* newBoolRes( Region *r, int n ) {
217  Res *res1 = newRes( r );
218  res1->exprType = newSimpType( T_BOOL, r );
219  RES_BOOL_VAL_LVAL( res1 ) = n;
220  return res1;
221 }
222 Res* newStringBasedRes( Region *r, const char *s ) {
223  Res *res1 = newRes( r );
224  if ( s ) {
225  RES_STRING_STR_LEN( res1 ) = strlen( s );
226  int size = ( RES_STRING_STR_LEN( res1 ) + 1 ) * sizeof( char );
227  res1->text = ( char * )region_alloc( r, size );
228  memcpy( res1->text, s, size );
229  }
230  else {
231  res1->text = NULL;
232  }
233  return res1;
234 }
235 Res *newStringRes( Region *r, const char *s ) {
236  Res *res = newStringBasedRes( r, s );
237  res->exprType = newSimpType( T_STRING, r );
238  return res;
239 
240 }
241 Res *newPathRes( Region *r, const char *s ) {
242  Res *res = newStringBasedRes( r, s );
243  res->exprType = newSimpType( T_PATH, r );
244  return res;
245 
246 }
248  Res *res1 = newRes( r );
249  res1->exprType = newSimpType( T_UNSPECED, r );
250  res1->text = cpStringExt( "", r );
251  return res1;
252 }
253 Res* newDatetimeRes( Region *r, long dt ) {
254  Res *res1 = newRes( r );
255  res1->exprType = newSimpType( T_DATETIME, r );
256  RES_TIME_VAL( res1 ) = dt;
257  return res1;
258 }
259 Res* newErrorRes( Region *r, int errcode ) {
260  Res *res1 = newRes( r );
261  setNodeType( res1, N_ERROR );
262  RES_ERR_CODE( res1 ) = errcode;
263  return res1;
264 }
265 
267  msParamArray_t *mpa = ( msParamArray_t * )malloc( sizeof( msParamArray_t ) );
268  mpa->len = 0;
269  mpa->msParam = NULL;
270  mpa->oprType = 0;
271  return mpa;
272 }
273 
274 void deleteMsParamArray( msParamArray_t *msParamArray ) {
275  clearMsParamArray( msParamArray, 0 ); /* do not delete inOutStruct because global varaibles of iRODS type may share it */
276  /* to do write a function that delete inOutStruct of msParamArray if it is not shared */
277  free( msParamArray );
278 
279 }
280 
281 Env *newEnv( Hashtable *current, Env *previous, Env *callerEnv, Region *r ) {
282  Env *env = ( Env * )region_alloc( r, sizeof( Env ) );
283  env->current = current;
284  env->previous = previous;
285  env->lower = callerEnv;
286  return env;
287 }
288 
289 /*void deleteEnv(Env *env, int deleteCurrent) {
290  if(deleteCurrent>=1) {
291  deleteHashTable(env->current, nop);
292  }
293  if(deleteCurrent==2) {
294  if(env->previous!=NULL && env->previous->previous!=NULL) {
295  deleteEnv(env->previous, deleteCurrent);
296  }
297  }
298  if(deleteCurrent>=3) {
299  if(env->previous!=NULL) {
300  deleteEnv(env->previous, deleteCurrent);
301 
302  }
303  }
304  free(env);
305 }*/
306 
309  memset( tc, 0, sizeof( TypingConstraint ) );
310  tc->subtrees = ( Node ** )region_alloc( r, sizeof( Node * ) * 4 );
311  TC_A( tc ) = a;
312  TC_B( tc ) = b;
313  setNodeType( tc, type );
314  TC_NODE( tc ) = node;
315  TC_NEXT( tc ) = NULL;
316  tc->degree = 4;
317  return tc;
318 }
319 
320 
321 
322 
324  FunctionDesc *desc = ( FunctionDesc * ) region_alloc( r, sizeof( FunctionDesc ) );
325  memset( desc, 0, sizeof( FunctionDesc ) );
326  FD_SMSI_FUNC_PTR_LVAL( desc ) = func;
327  desc->exprType = type == NULL ? NULL : parseFuncTypeFromString( type, r );
328  setNodeType( desc, N_FD_FUNCTION );
329  return desc;
330 }
333 }
334 
336  FunctionDesc *desc = ( FunctionDesc * ) region_alloc( r, sizeof( FunctionDesc ) );
337  memset( desc, 0, sizeof( FunctionDesc ) );
338  desc->exprType = type;
339  setNodeType( desc, N_FD_CONSTRUCTOR );
340  return desc;
341 }
343  FunctionDesc *desc = ( FunctionDesc * ) region_alloc( r, sizeof( FunctionDesc ) );
344  memset( desc, 0, sizeof( FunctionDesc ) );
345  desc->exprType = type;
346  setNodeType( desc, N_FD_EXTERNAL );
347  return desc;
348 }
349 FunctionDesc *newDeconstructorFD( char *type, int proj, Region *r ) {
350  FunctionDesc *desc = ( FunctionDesc * ) region_alloc( r, sizeof( FunctionDesc ) );
351  memset( desc, 0, sizeof( FunctionDesc ) );
352  desc->exprType = type == NULL ? NULL : parseFuncTypeFromString( type, r );
354  FD_PROJ( desc ) = proj;
355  return desc;
356 }
358  FunctionDesc *desc = ( FunctionDesc * ) region_alloc( r, sizeof( FunctionDesc ) );
359  memset( desc, 0, sizeof( FunctionDesc ) );
361  desc->exprType = type;
363  return desc;
364 }
365 
366 RuleDesc *newRuleDesc( RuleType rk, Node *n, int dynamictyping, Region *r ) {
367  RuleDesc *rd = ( RuleDesc * ) region_alloc( r, sizeof( RuleDesc ) );
368  memset( rd, 0, sizeof( RuleDesc ) );
369  rd->id = -1;
370  rd->node = n;
371  rd->type = NULL;
372  rd->ruleType = rk;
373  rd->dynamictyping = dynamictyping;
374  return rd;
375 }
376 
378  RuleSet *rs = ( RuleSet * ) region_alloc( r, sizeof( RuleSet ) );
379  memset( rs, 0, sizeof( RuleSet ) );
380  rs->len = 0;
381  return rs;
382 }
383 
384 void setBase( Node *node, char *base, Region *r ) {
385  node->base = ( char * )region_alloc( r, sizeof( char ) * ( strlen( base ) + 1 ) );
386  strcpy( node->base, base );
387 
388 }
392 Node **setDegree( Node *node, int d, Region *r ) {
393  node->degree = d;
394  node->subtrees = ( Node ** )region_alloc( r, d * sizeof( Node * ) );
395  if ( node->subtrees == NULL ) {
396  return NULL;
397  }
398  return node->subtrees;
399 }
400 /*
401 Node *dupNode(Node *node, Region* r) {
402  Node *dup = newNode(node->type, node->text, node->expr, r);
403  Node **subdup = setDegree(dup, node->degree, r);
404  int i;
405  for(i = 0;i<node->degree;i++) {
406  subdup[i] = dupNode(node->subtrees[i],r);
407  }
408  return dup;
409 }*/
410 Node *createUnaryFunctionNode( char *fn, Node *a, Label * expr, Region *r ) {
411  Node *node = newNode( N_APPLICATION, fn, expr, r );
412  if ( node == NULL ) {
413  return NULL;
414  }
415  setDegree( node, 1, r );
416  node->subtrees[0] = a;
417  return node;
418 }
419 Node *createBinaryFunctionNode( char *fn, Node *a, Node *b, Label * expr, Region *r ) {
420  Node *node = newNode( N_APPLICATION, fn, expr, r );
421  if ( node == NULL ) {
422  return NULL;
423  }
424  setDegree( node, 2, r );
425  node->subtrees[0] = a;
426  node->subtrees[1] = b;
427  return node;
428 }
429 Node *createFunctionNode( const char *fn, Node **params, int paramsLen, Label * exprloc, Region *r ) {
430  Node *node = newNode( N_APPLICATION, fn, exprloc, r );
431  if ( node == NULL ) {
432  return NULL;
433  }
434  Node *func = newNode( TK_TEXT, fn, exprloc, r );
435  Node *param = newNode( N_TUPLE, APPLICATION, exprloc, r );
436  setDegree( param, paramsLen, r );
437  memcpy( param->subtrees, params, paramsLen * sizeof( Node * ) );
438  setDegree( node, 2, r );
439  node->subtrees[0] = func;
440  node->subtrees[1] = param;
441  return node;
442 }
443 Node *createActionsNode( Node **params, int paramsLen, Label * exprloc, Region *r ) {
444  Node *node = newNode( N_ACTIONS, "ACTIONS", exprloc, r );
445  if ( node == NULL ) {
446  return NULL;
447  }
448  setDegree( node, paramsLen, r );
449  memcpy( node->subtrees, params, paramsLen * sizeof( Node * ) );
450  return node;
451 }
452 Node *createTextNode( char *t, Label * exprloc, Region *r ) {
453  Node *node = newNode( TK_TEXT, t, exprloc, r );
454  if ( node == NULL ) {
455  return NULL;
456  }
457  return node;
458 }
459 Node *createIntNode( char *t, Label * exprloc, Region *r ) {
460  Node *node = newNode( TK_INT, t, exprloc, r );
461  if ( node == NULL ) {
462  return NULL;
463  }
464  return node;
465 }
466 Node *createDoubleNode( char *t, Label * exprloc, Region *r ) {
467  Node *node = newNode( TK_DOUBLE, t, exprloc, r );
468  if ( node == NULL ) {
469  return NULL;
470  }
471  return node;
472 }
473 Node *createStringNode( char *t, Label * exprloc, Region *r ) {
474  Node *node = newNode( TK_STRING, t, exprloc, r );
475  if ( node == NULL ) {
476  return NULL;
477  }
478  return node;
479 }
480 Node *createErrorNode( char *error, Label * exprloc, Region *r ) {
481  Node *node = newNode( N_ERROR, error, exprloc, r );
482  if ( node == NULL ) {
483  return NULL;
484  }
485  return node;
486 }
487 
NULL
#define NULL
Definition: rodsDef.h:70
createErrorNode
Node * createErrorNode(char *error, Label *exprloc, Region *r)
Definition: restructs.cpp:480
parser.hpp
createIntNode
Node * createIntNode(char *t, Label *exprloc, Region *r)
Definition: restructs.cpp:459
newNode
Node * newNode(NodeType type, const char *text, Label *eloc, Region *r)
Definition: restructs.cpp:10
N_FD_DECONSTRUCTOR
@ N_FD_DECONSTRUCTOR
Definition: restructs.hpp:145
newRuleSet
RuleSet * newRuleSet(Region *r)
Definition: restructs.cpp:377
FUNC
#define FUNC
Definition: reconstants.hpp:20
newMsParamArray
msParamArray_t * newMsParamArray()
Definition: restructs.cpp:266
newRes
Res * newRes(Region *r)
Definition: restructs.cpp:176
utils.hpp
newTypingConstraint
TypingConstraint * newTypingConstraint(ExprType *a, ExprType *b, NodeType type, Node *node, Region *r)
Definition: restructs.cpp:307
newDatetimeRes
Res * newDatetimeRes(Region *r, long dt)
Definition: restructs.cpp:253
region_alloc
void * region_alloc(Region *r, size_t s)
Definition: region.cpp:138
env::previous
Env * previous
Definition: restructs.hpp:228
T_UNSPECED
@ T_UNSPECED
Definition: restructs.hpp:156
node::param
msParam_t * param
Definition: restructs.hpp:260
TC_NODE
#define TC_NODE(tc)
Definition: restructs.hpp:40
N_PARTIAL_APPLICATION
@ N_PARTIAL_APPLICATION
Definition: restructs.hpp:129
RES_TIME_VAL
#define RES_TIME_VAL(x)
Definition: restructs.hpp:60
env
Definition: restructs.hpp:226
newFuncSymLink
FunctionDesc * newFuncSymLink(char *fn, int nArgs, Region *r)
Definition: restructs.cpp:128
restructs.hpp
T_VAR_DISJUNCTS
#define T_VAR_DISJUNCTS(x)
Definition: restructs.hpp:36
RuleDesc::ruleType
RuleType ruleType
Definition: restructs.hpp:276
newRuleDesc
RuleDesc * newRuleDesc(RuleType rk, Node *n, int dynamictyping, Region *r)
Definition: restructs.cpp:366
ruleSet::len
int len
Definition: restructs.hpp:283
T_DOUBLE
@ T_DOUBLE
Definition: restructs.hpp:159
T_PATH
@ T_PATH
Definition: restructs.hpp:168
newTVar2
ExprType * newTVar2(int numDisjuncts, Node **disjuncts, Region *r)
Definition: restructs.cpp:51
N_APPLICATION
@ N_APPLICATION
Definition: restructs.hpp:128
setNodeType
#define setNodeType(x, t)
Definition: restructs.hpp:70
node
Definition: restructs.hpp:244
newIRODSType
ExprType * newIRODSType(const char *name, Region *r)
Definition: restructs.cpp:99
createTextNode
Node * createTextNode(char *t, Label *exprloc, Region *r)
Definition: restructs.cpp:452
newFunctionFD
FunctionDesc * newFunctionFD(char *type, SmsiFuncTypePtr func, Region *r)
Definition: restructs.cpp:323
newTVarId
int newTVarId()
Definition: utils.cpp:312
N_FD_RULE_INDEX_LIST
@ N_FD_RULE_INDEX_LIST
Definition: restructs.hpp:147
generate_iadmin_commands_for_41_to_42_upgrade.name
name
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:23
newCollRes
Res * newCollRes(int size, ExprType *elemType, Region *r)
Definition: restructs.cpp:161
label::exprloc
long exprloc
Definition: restructs.hpp:289
FD_SMSI_FUNC_PTR_LVAL
#define FD_SMSI_FUNC_PTR_LVAL(x)
Definition: restructs.hpp:64
newUnaryType
ExprType * newUnaryType(NodeType nodeType, ExprType *typeArg, Region *r)
Definition: restructs.cpp:119
N_SYM_LINK
@ N_SYM_LINK
Definition: restructs.hpp:148
cpString
char * cpString(char *res, Region *r)
Definition: utils.cpp:350
TK_INT
@ TK_INT
Definition: restructs.hpp:112
MsParam::type
char * type
Definition: msParam.h:78
T_CONS
@ T_CONS
Definition: restructs.hpp:167
APPLICATION
#define APPLICATION
Definition: reconstants.hpp:16
TC_B
#define TC_B(tc)
Definition: restructs.hpp:39
env::lower
Env * lower
Definition: restructs.hpp:229
newUnspecifiedRes
Res * newUnspecifiedRes(Region *r)
Definition: restructs.cpp:247
node::text
char * text
Definition: restructs.hpp:252
newRuleIndexListFD
FunctionDesc * newRuleIndexListFD(RuleIndexList *ruleIndexList, ExprType *type, Region *r)
Definition: restructs.cpp:357
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
IO_TYPE_INPUT
#define IO_TYPE_INPUT
Definition: restructs.hpp:81
T_IRODS
@ T_IRODS
Definition: restructs.hpp:172
FD_RULE_INDEX_LIST_LVAL
#define FD_RULE_INDEX_LIST_LVAL(x)
Definition: restructs.hpp:62
N_ACTIONS
@ N_ACTIONS
Definition: restructs.hpp:134
TK_TEXT
@ TK_TEXT
Definition: restructs.hpp:114
node::subtrees
struct node ** subtrees
Definition: restructs.hpp:254
N_FD_EXTERNAL
@ N_FD_EXTERNAL
Definition: restructs.hpp:146
setDegree
Node ** setDegree(Node *node, int d, Region *r)
Definition: restructs.cpp:392
MsParamArray::msParam
msParam_t ** msParam
Definition: msParam.h:87
createUnaryFunctionNode
Node * createUnaryFunctionNode(char *fn, Node *a, Label *expr, Region *r)
Definition: restructs.cpp:410
setBase
void setBase(Node *node, char *base, Region *r)
Definition: restructs.cpp:384
ruleIndexList
Definition: restructs.hpp:220
T_DATETIME
@ T_DATETIME
Definition: restructs.hpp:162
node::degree
int degree
Definition: restructs.hpp:246
newDeconstructorFD
FunctionDesc * newDeconstructorFD(char *type, int proj, Region *r)
Definition: restructs.cpp:349
RES_STRING_STR_LEN
#define RES_STRING_STR_LEN(x)
Definition: restructs.hpp:53
TC_A
#define TC_A(tc)
Definition: restructs.hpp:38
newPartialApplication
Node * newPartialApplication(Node *func, Node *arg, int nArgsLeft, Region *r)
Definition: restructs.cpp:137
createBinaryFunctionNode
Node * createBinaryFunctionNode(char *fn, Node *a, Node *b, Label *expr, Region *r)
Definition: restructs.cpp:419
T_STRING
@ T_STRING
Definition: restructs.hpp:161
NODE_EXPR_POS
#define NODE_EXPR_POS(x)
Definition: restructs.hpp:68
newExternalFD
FunctionDesc * newExternalFD(Node *type, Region *r)
Definition: restructs.cpp:342
newTupleTypeVarArg
ExprType * newTupleTypeVarArg(int arity, int vararg, ExprType **paramTypes, Region *r)
Definition: restructs.cpp:93
newTupleRes
Node * newTupleRes(int arity, Res **comps, Region *r)
Definition: restructs.cpp:148
label::base
char * base
Definition: restructs.hpp:290
newPathRes
Res * newPathRes(Region *r, const char *s)
Definition: restructs.cpp:241
N_FD_CONSTRUCTOR
@ N_FD_CONSTRUCTOR
Definition: restructs.hpp:144
RES_FUNC_N_ARGS
#define RES_FUNC_N_ARGS(x)
Definition: restructs.hpp:51
TK_DOUBLE
@ TK_DOUBLE
Definition: restructs.hpp:113
MsParam
Definition: msParam.h:76
N_FD_FUNCTION
@ N_FD_FUNCTION
Definition: restructs.hpp:143
newErrorRes
Res * newErrorRes(Region *r, int errcode)
Definition: restructs.cpp:259
RuleDesc::type
Node * type
Definition: restructs.hpp:274
newSimpType
ExprType * newSimpType(NodeType type, Region *r)
Definition: restructs.cpp:70
node::base
char * base
Definition: restructs.hpp:255
createFunctionNode
Node * createFunctionNode(const char *fn, Node **params, int paramsLen, Label *exprloc, Region *r)
Definition: restructs.cpp:429
RuleDesc::id
int id
Definition: restructs.hpp:273
createActionsNode
Node * createActionsNode(Node **params, int paramsLen, Label *exprloc, Region *r)
Definition: restructs.cpp:443
BytesBuf
Definition: rodsDef.h:197
region
Definition: region.h:45
T_BOOL
@ T_BOOL
Definition: restructs.hpp:163
MsParam::inpOutBuf
bytesBuf_t * inpOutBuf
Definition: msParam.h:81
newStringBasedRes
Res * newStringBasedRes(Region *r, const char *s)
Definition: restructs.cpp:222
MsParamArray::len
int len
Definition: msParam.h:85
newConstructorFD2
FunctionDesc * newConstructorFD2(Node *type, Region *r)
Definition: restructs.cpp:335
createStringNode
Node * createStringNode(char *t, Label *exprloc, Region *r)
Definition: restructs.cpp:473
FD_PROJ
#define FD_PROJ(x)
Definition: restructs.hpp:48
RuleDesc
Definition: restructs.hpp:272
N_VAL
@ N_VAL
Definition: restructs.hpp:126
node::exprType
ExprType * exprType
Definition: restructs.hpp:250
N_TUPLE
@ N_TUPLE
Definition: restructs.hpp:127
NodeType
enum node_type NodeType
newTVar
ExprType * newTVar(Region *r)
Definition: restructs.cpp:62
RES_DOUBLE_VAL_LVAL
#define RES_DOUBLE_VAL_LVAL(x)
Definition: restructs.hpp:54
newStringRes
Res * newStringRes(Region *r, const char *s)
Definition: restructs.cpp:235
newBoolRes
Res * newBoolRes(Region *r, int n)
Definition: restructs.cpp:216
irods.six.b
def b(s)
Definition: six.py:606
T_VAR
@ T_VAR
Definition: restructs.hpp:171
error
int error
Definition: filesystem.cpp:101
RuleDesc::node
Node * node
Definition: restructs.hpp:275
T_VAR_NUM_DISJUNCTS
#define T_VAR_NUM_DISJUNCTS(x)
Definition: restructs.hpp:37
T_INT
@ T_INT
Definition: restructs.hpp:160
N_ERROR
@ N_ERROR
Definition: restructs.hpp:111
RuleDesc::dynamictyping
int dynamictyping
Definition: restructs.hpp:277
T_TUPLE
@ T_TUPLE
Definition: restructs.hpp:166
env::current
Hashtable * current
Definition: restructs.hpp:227
TK_STRING
@ TK_STRING
Definition: restructs.hpp:115
TC_NEXT
#define TC_NEXT(tc)
Definition: restructs.hpp:41
node::option
int option
Definition: restructs.hpp:247
T_DYNAMIC
@ T_DYNAMIC
Definition: restructs.hpp:158
newFuncTypeVarArg
ExprType * newFuncTypeVarArg(int arity, int vararg, ExprType **paramTypes, ExprType *retType, Region *r)
Definition: restructs.cpp:85
newTupleType
ExprType * newTupleType(int arity, ExprType **typeArgs, Region *r)
Definition: restructs.cpp:116
createDoubleNode
Node * createDoubleNode(char *t, Label *exprloc, Region *r)
Definition: restructs.cpp:466
newMsParam
msParam_t * newMsParam(const char *typeName, void *ioStruct, bytesBuf_t *ioBuf, Region *r)
Definition: restructs.cpp:189
hashtable
Definition: irods_hashtable.h:16
SmsiFuncTypePtr
SmsiFuncType * SmsiFuncTypePtr
Definition: restructs.hpp:233
newIntRes
Res * newIntRes(Region *r, int n)
Definition: restructs.cpp:204
RES_ERR_CODE
#define RES_ERR_CODE(x)
Definition: restructs.hpp:50
size
long long size
Definition: filesystem.cpp:102
label
Definition: restructs.hpp:288
newEnv
Env * newEnv(Hashtable *current, Env *previous, Env *callerEnv, Region *r)
Definition: restructs.cpp:281
newExprType
Node * newExprType(NodeType type, int degree, Node **subtrees, Region *r)
Definition: restructs.cpp:39
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
MsParamArray
Definition: msParam.h:84
newUninterpretedRes
Res * newUninterpretedRes(Region *r, const char *typeName, void *ioStruct, bytesBuf_t *ioBuf)
Definition: restructs.cpp:183
parseFuncTypeFromString
ExprType * parseFuncTypeFromString(char *string, Region *r)
Definition: parser.cpp:3351
RES_INT_VAL_LVAL
#define RES_INT_VAL_LVAL(x)
Definition: restructs.hpp:55
newConstructorFD
FunctionDesc * newConstructorFD(char *type, Region *r)
Definition: restructs.cpp:331
newErrorType
ExprType * newErrorType(int errcode, Region *r)
Definition: restructs.cpp:73
setVararg
#define setVararg(n, v)
Definition: restructs.hpp:88
T_ERROR
@ T_ERROR
Definition: restructs.hpp:157
setIOType
#define setIOType(n, v)
Definition: restructs.hpp:90
allocSubtrees
Node ** allocSubtrees(Region *r, int size)
Definition: restructs.cpp:34
type
int type
Definition: filesystem.cpp:103
T_VAR_ID
#define T_VAR_ID(x)
Definition: restructs.hpp:34
newCollRes2
Res * newCollRes2(int size, Region *r)
Definition: restructs.cpp:169
RuleType
enum ruleType RuleType
newFuncType
ExprType * newFuncType(ExprType *paramType, ExprType *retType, Region *r)
Definition: restructs.cpp:79
newCollType
ExprType * newCollType(ExprType *elemType, Region *r)
Definition: restructs.cpp:110
OPTION_TYPED
#define OPTION_TYPED
Definition: restructs.hpp:78
cpStringExt
char * cpStringExt(const char *str, Region *r)
Definition: utils.cpp:358
deleteMsParamArray
void deleteMsParamArray(msParamArray_t *msParamArray)
Definition: restructs.cpp:274
MsParamArray::oprType
int oprType
Definition: msParam.h:86
T_CONS_TYPE_NAME
#define T_CONS_TYPE_NAME(x)
Definition: restructs.hpp:27
newConsType
ExprType * newConsType(int arity, char *cons, ExprType **paramTypes, Region *r)
Definition: restructs.cpp:88
LIST
#define LIST
Definition: reconstants.hpp:14
newDoubleRes
Res * newDoubleRes(Region *r, double a)
Definition: restructs.cpp:210
RES_BOOL_VAL_LVAL
#define RES_BOOL_VAL_LVAL(x)
Definition: restructs.hpp:56
ruleSet
Definition: restructs.hpp:282