LTP GCOV extension - code coverage report
Current view: directory - src/libexpr - nixexpr-ast.hh
Test: app.info
Date: 2004-12-21 Instrumented lines: 264
Code covered: 77.3 % Executed lines: 204

       1                 : extern AFun symPos;
       2                 : 
       3             141 : static inline Pos makePos(ATerm e1, int e2, int e3) {
       4             141 :     return (ATerm) ATmakeAppl3(symPos, e1, (ATerm) ATmakeInt(e2), (ATerm) ATmakeInt(e3));
       5                 : }
       6                 : 
       7                 : #ifdef __cplusplus
       8               3 : static inline bool matchPos(ATerm e, ATerm & e1, int & e2, int & e3) {
       9               3 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symPos) return false;
      10               3 :     e1 = ATgetArgument(e, 0);
      11               3 :     e2 = ATgetInt((ATermInt) ATgetArgument(e, 1));
      12               3 :     e3 = ATgetInt((ATermInt) ATgetArgument(e, 2));
      13               3 :     return true;
      14                 : }
      15                 : #endif
      16                 : 
      17                 : 
      18                 : extern AFun symNoPos;
      19                 : 
      20              92 : static inline Pos makeNoPos() {
      21              92 :     return (ATerm) ATmakeAppl0(symNoPos);
      22                 : }
      23                 : 
      24                 : #ifdef __cplusplus
      25               3 : static inline bool matchNoPos(ATerm e) {
      26               3 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symNoPos) return false;
      27               0 :     return true;
      28                 : }
      29                 : #endif
      30                 : 
      31                 : 
      32                 : extern AFun symFunction;
      33                 : 
      34               9 : static inline Expr makeFunction(ATermList e1, Expr e2, Pos e3) {
      35               9 :     return (ATerm) ATmakeAppl3(symFunction, (ATerm) e1, e2, e3);
      36                 : }
      37                 : 
      38                 : #ifdef __cplusplus
      39            3101 : static inline bool matchFunction(ATerm e, ATermList & e1, Expr & e2, Pos & e3) {
      40            3101 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symFunction) return false;
      41              12 :     e1 = (ATermList) ATgetArgument(e, 0);
      42              12 :     e2 = ATgetArgument(e, 1);
      43              12 :     e3 = ATgetArgument(e, 2);
      44              12 :     return true;
      45                 : }
      46                 : #endif
      47                 : 
      48                 : 
      49                 : extern AFun symFunction1;
      50                 : 
      51              26 : static inline Expr makeFunction1(ATerm e1, Expr e2, Pos e3) {
      52              26 :     return (ATerm) ATmakeAppl3(symFunction1, e1, e2, e3);
      53                 : }
      54                 : 
      55                 : #ifdef __cplusplus
      56            3089 : static inline bool matchFunction1(ATerm e, ATerm & e1, Expr & e2, Pos & e3) {
      57            3089 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symFunction1) return false;
      58              50 :     e1 = ATgetArgument(e, 0);
      59              50 :     e2 = ATgetArgument(e, 1);
      60              50 :     e3 = ATgetArgument(e, 2);
      61              50 :     return true;
      62                 : }
      63                 : #endif
      64                 : 
      65                 : 
      66                 : extern AFun symAssert;
      67                 : 
      68               7 : static inline Expr makeAssert(Expr e1, Expr e2, Pos e3) {
      69               7 :     return (ATerm) ATmakeAppl3(symAssert, e1, e2, e3);
      70                 : }
      71                 : 
      72                 : #ifdef __cplusplus
      73               4 : static inline bool matchAssert(ATerm e, Expr & e1, Expr & e2, Pos & e3) {
      74               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symAssert) return false;
      75               0 :     e1 = ATgetArgument(e, 0);
      76               0 :     e2 = ATgetArgument(e, 1);
      77               0 :     e3 = ATgetArgument(e, 2);
      78               0 :     return true;
      79                 : }
      80                 : #endif
      81                 : 
      82                 : 
      83                 : extern AFun symWith;
      84                 : 
      85               0 : static inline Expr makeWith(Expr e1, Expr e2, Pos e3) {
      86               0 :     return (ATerm) ATmakeAppl3(symWith, e1, e2, e3);
      87                 : }
      88                 : 
      89                 : #ifdef __cplusplus
      90            1318 : static inline bool matchWith(ATerm e, Expr & e1, Expr & e2, Pos & e3) {
      91            1318 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symWith) return false;
      92               0 :     e1 = ATgetArgument(e, 0);
      93               0 :     e2 = ATgetArgument(e, 1);
      94               0 :     e3 = ATgetArgument(e, 2);
      95               0 :     return true;
      96                 : }
      97                 : #endif
      98                 : 
      99                 : 
     100                 : extern AFun symIf;
     101                 : 
     102               8 : static inline Expr makeIf(Expr e1, Expr e2, Expr e3) {
     103               8 :     return (ATerm) ATmakeAppl3(symIf, e1, e2, e3);
     104                 : }
     105                 : 
     106                 : #ifdef __cplusplus
     107               4 : static inline bool matchIf(ATerm e, Expr & e1, Expr & e2, Expr & e3) {
     108               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symIf) return false;
     109               0 :     e1 = ATgetArgument(e, 0);
     110               0 :     e2 = ATgetArgument(e, 1);
     111               0 :     e3 = ATgetArgument(e, 2);
     112               0 :     return true;
     113                 : }
     114                 : #endif
     115                 : 
     116                 : 
     117                 : extern AFun symOpNot;
     118                 : 
     119               0 : static inline Expr makeOpNot(Expr e1) {
     120               0 :     return (ATerm) ATmakeAppl1(symOpNot, e1);
     121                 : }
     122                 : 
     123                 : #ifdef __cplusplus
     124               4 : static inline bool matchOpNot(ATerm e, Expr & e1) {
     125               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpNot) return false;
     126               0 :     e1 = ATgetArgument(e, 0);
     127               0 :     return true;
     128                 : }
     129                 : #endif
     130                 : 
     131                 : 
     132                 : extern AFun symOpEq;
     133                 : 
     134               2 : static inline Expr makeOpEq(Expr e1, Expr e2) {
     135               2 :     return (ATerm) ATmakeAppl2(symOpEq, e1, e2);
     136                 : }
     137                 : 
     138                 : #ifdef __cplusplus
     139               4 : static inline bool matchOpEq(ATerm e, Expr & e1, Expr & e2) {
     140               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpEq) return false;
     141               0 :     e1 = ATgetArgument(e, 0);
     142               0 :     e2 = ATgetArgument(e, 1);
     143               0 :     return true;
     144                 : }
     145                 : #endif
     146                 : 
     147                 : 
     148                 : extern AFun symOpNEq;
     149                 : 
     150               7 : static inline Expr makeOpNEq(Expr e1, Expr e2) {
     151               7 :     return (ATerm) ATmakeAppl2(symOpNEq, e1, e2);
     152                 : }
     153                 : 
     154                 : #ifdef __cplusplus
     155               4 : static inline bool matchOpNEq(ATerm e, Expr & e1, Expr & e2) {
     156               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpNEq) return false;
     157               0 :     e1 = ATgetArgument(e, 0);
     158               0 :     e2 = ATgetArgument(e, 1);
     159               0 :     return true;
     160                 : }
     161                 : #endif
     162                 : 
     163                 : 
     164                 : extern AFun symOpAnd;
     165                 : 
     166               4 : static inline Expr makeOpAnd(Expr e1, Expr e2) {
     167               4 :     return (ATerm) ATmakeAppl2(symOpAnd, e1, e2);
     168                 : }
     169                 : 
     170                 : #ifdef __cplusplus
     171               4 : static inline bool matchOpAnd(ATerm e, Expr & e1, Expr & e2) {
     172               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpAnd) return false;
     173               0 :     e1 = ATgetArgument(e, 0);
     174               0 :     e2 = ATgetArgument(e, 1);
     175               0 :     return true;
     176                 : }
     177                 : #endif
     178                 : 
     179                 : 
     180                 : extern AFun symOpOr;
     181                 : 
     182               1 : static inline Expr makeOpOr(Expr e1, Expr e2) {
     183               1 :     return (ATerm) ATmakeAppl2(symOpOr, e1, e2);
     184                 : }
     185                 : 
     186                 : #ifdef __cplusplus
     187               4 : static inline bool matchOpOr(ATerm e, Expr & e1, Expr & e2) {
     188               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpOr) return false;
     189               0 :     e1 = ATgetArgument(e, 0);
     190               0 :     e2 = ATgetArgument(e, 1);
     191               0 :     return true;
     192                 : }
     193                 : #endif
     194                 : 
     195                 : 
     196                 : extern AFun symOpImpl;
     197                 : 
     198               7 : static inline Expr makeOpImpl(Expr e1, Expr e2) {
     199               7 :     return (ATerm) ATmakeAppl2(symOpImpl, e1, e2);
     200                 : }
     201                 : 
     202                 : #ifdef __cplusplus
     203               4 : static inline bool matchOpImpl(ATerm e, Expr & e1, Expr & e2) {
     204               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpImpl) return false;
     205               0 :     e1 = ATgetArgument(e, 0);
     206               0 :     e2 = ATgetArgument(e, 1);
     207               0 :     return true;
     208                 : }
     209                 : #endif
     210                 : 
     211                 : 
     212                 : extern AFun symOpUpdate;
     213                 : 
     214               0 : static inline Expr makeOpUpdate(Expr e1, Expr e2) {
     215               0 :     return (ATerm) ATmakeAppl2(symOpUpdate, e1, e2);
     216                 : }
     217                 : 
     218                 : #ifdef __cplusplus
     219               4 : static inline bool matchOpUpdate(ATerm e, Expr & e1, Expr & e2) {
     220               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpUpdate) return false;
     221               0 :     e1 = ATgetArgument(e, 0);
     222               0 :     e2 = ATgetArgument(e, 1);
     223               0 :     return true;
     224                 : }
     225                 : #endif
     226                 : 
     227                 : 
     228                 : extern AFun symSubPath;
     229                 : 
     230               0 : static inline Expr makeSubPath(Expr e1, Expr e2) {
     231               0 :     return (ATerm) ATmakeAppl2(symSubPath, e1, e2);
     232                 : }
     233                 : 
     234                 : #ifdef __cplusplus
     235               0 : static inline bool matchSubPath(ATerm e, Expr & e1, Expr & e2) {
     236               0 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symSubPath) return false;
     237               0 :     e1 = ATgetArgument(e, 0);
     238               0 :     e2 = ATgetArgument(e, 1);
     239               0 :     return true;
     240                 : }
     241                 : #endif
     242                 : 
     243                 : 
     244                 : extern AFun symOpHasAttr;
     245                 : 
     246               0 : static inline Expr makeOpHasAttr(Expr e1, ATerm e2) {
     247               0 :     return (ATerm) ATmakeAppl2(symOpHasAttr, e1, e2);
     248                 : }
     249                 : 
     250                 : #ifdef __cplusplus
     251               4 : static inline bool matchOpHasAttr(ATerm e, Expr & e1, ATerm & e2) {
     252               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpHasAttr) return false;
     253               0 :     e1 = ATgetArgument(e, 0);
     254               0 :     e2 = ATgetArgument(e, 1);
     255               0 :     return true;
     256                 : }
     257                 : #endif
     258                 : 
     259                 : 
     260                 : extern AFun symOpPlus;
     261                 : 
     262               7 : static inline Expr makeOpPlus(Expr e1, Expr e2) {
     263               7 :     return (ATerm) ATmakeAppl2(symOpPlus, e1, e2);
     264                 : }
     265                 : 
     266                 : #ifdef __cplusplus
     267               4 : static inline bool matchOpPlus(ATerm e, Expr & e1, Expr & e2) {
     268               4 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symOpPlus) return false;
     269               4 :     e1 = ATgetArgument(e, 0);
     270               4 :     e2 = ATgetArgument(e, 1);
     271               4 :     return true;
     272                 : }
     273                 : #endif
     274                 : 
     275                 : 
     276                 : extern AFun symCall;
     277                 : 
     278              52 : static inline Expr makeCall(Expr e1, Expr e2) {
     279              52 :     return (ATerm) ATmakeAppl2(symCall, e1, e2);
     280                 : }
     281                 : 
     282                 : #ifdef __cplusplus
     283              96 : static inline bool matchCall(ATerm e, Expr & e1, Expr & e2) {
     284              96 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symCall) return false;
     285              53 :     e1 = ATgetArgument(e, 0);
     286              53 :     e2 = ATgetArgument(e, 1);
     287              53 :     return true;
     288                 : }
     289                 : #endif
     290                 : 
     291                 : 
     292                 : extern AFun symSelect;
     293                 : 
     294              47 : static inline Expr makeSelect(Expr e1, ATerm e2) {
     295              47 :     return (ATerm) ATmakeAppl2(symSelect, e1, e2);
     296                 : }
     297                 : 
     298                 : #ifdef __cplusplus
     299              43 : static inline bool matchSelect(ATerm e, Expr & e1, ATerm & e2) {
     300              43 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symSelect) return false;
     301              31 :     e1 = ATgetArgument(e, 0);
     302              31 :     e2 = ATgetArgument(e, 1);
     303              31 :     return true;
     304                 : }
     305                 : #endif
     306                 : 
     307                 : 
     308                 : extern AFun symVar;
     309                 : 
     310             134 : static inline Expr makeVar(ATerm e1) {
     311             134 :     return (ATerm) ATmakeAppl1(symVar, e1);
     312                 : }
     313                 : 
     314                 : #ifdef __cplusplus
     315            3423 : static inline bool matchVar(ATerm e, ATerm & e1) {
     316            3423 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symVar) return false;
     317             253 :     e1 = ATgetArgument(e, 0);
     318             253 :     return true;
     319                 : }
     320                 : #endif
     321                 : 
     322                 : 
     323                 : extern AFun symInt;
     324                 : 
     325               9 : static inline Expr makeInt(int e1) {
     326               9 :     return (ATerm) ATmakeAppl1(symInt, (ATerm) ATmakeInt(e1));
     327                 : }
     328                 : 
     329                 : #ifdef __cplusplus
     330              72 : static inline bool matchInt(ATerm e, int & e1) {
     331              72 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symInt) return false;
     332               0 :     e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
     333               0 :     return true;
     334                 : }
     335                 : #endif
     336                 : 
     337                 : 
     338                 : extern AFun symStr;
     339                 : 
     340             148 : static inline Expr makeStr(ATerm e1) {
     341             148 :     return (ATerm) ATmakeAppl1(symStr, e1);
     342                 : }
     343                 : 
     344                 : #ifdef __cplusplus
     345             253 : static inline bool matchStr(ATerm e, ATerm & e1) {
     346             253 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symStr) return false;
     347             179 :     e1 = ATgetArgument(e, 0);
     348             179 :     return true;
     349                 : }
     350                 : #endif
     351                 : 
     352                 : 
     353                 : extern AFun symPath;
     354                 : 
     355              66 : static inline Expr makePath(ATerm e1) {
     356              66 :     return (ATerm) ATmakeAppl1(symPath, e1);
     357                 : }
     358                 : 
     359                 : #ifdef __cplusplus
     360             102 : static inline bool matchPath(ATerm e, ATerm & e1) {
     361             102 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symPath) return false;
     362              69 :     e1 = ATgetArgument(e, 0);
     363              69 :     return true;
     364                 : }
     365                 : #endif
     366                 : 
     367                 : 
     368                 : extern AFun symUri;
     369                 : 
     370               8 : static inline Expr makeUri(ATerm e1) {
     371               8 :     return (ATerm) ATmakeAppl1(symUri, e1);
     372                 : }
     373                 : 
     374                 : #ifdef __cplusplus
     375              72 : static inline bool matchUri(ATerm e, ATerm & e1) {
     376              72 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symUri) return false;
     377               0 :     e1 = ATgetArgument(e, 0);
     378               0 :     return true;
     379                 : }
     380                 : #endif
     381                 : 
     382                 : 
     383                 : extern AFun symList;
     384                 : 
     385              30 : static inline Expr makeList(ATermList e1) {
     386              30 :     return (ATerm) ATmakeAppl1(symList, (ATerm) e1);
     387                 : }
     388                 : 
     389                 : #ifdef __cplusplus
     390              34 : static inline bool matchList(ATerm e, ATermList & e1) {
     391              34 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symList) return false;
     392              34 :     e1 = (ATermList) ATgetArgument(e, 0);
     393              34 :     return true;
     394                 : }
     395                 : #endif
     396                 : 
     397                 : 
     398                 : extern AFun symBlackHole;
     399                 : 
     400              23 : static inline Expr makeBlackHole() {
     401              23 :     return (ATerm) ATmakeAppl0(symBlackHole);
     402                 : }
     403                 : 
     404                 : #ifdef __cplusplus
     405                 : static inline bool matchBlackHole(ATerm e) {
     406                 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symBlackHole) return false;
     407                 :     return true;
     408                 : }
     409                 : #endif
     410                 : 
     411                 : 
     412                 : extern AFun symUndefined;
     413                 : 
     414               3 : static inline Expr makeUndefined() {
     415               3 :     return (ATerm) ATmakeAppl0(symUndefined);
     416                 : }
     417                 : 
     418                 : #ifdef __cplusplus
     419                 : static inline bool matchUndefined(ATerm e) {
     420                 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symUndefined) return false;
     421                 :     return true;
     422                 : }
     423                 : #endif
     424                 : 
     425                 : 
     426                 : extern AFun symPrimOp;
     427                 : 
     428              14 : static inline Expr makePrimOp(int e1, ATermBlob e2, ATermList e3) {
     429              14 :     return (ATerm) ATmakeAppl3(symPrimOp, (ATerm) ATmakeInt(e1), (ATerm) e2, (ATerm) e3);
     430                 : }
     431                 : 
     432                 : #ifdef __cplusplus
     433              53 : static inline bool matchPrimOp(ATerm e, int & e1, ATermBlob & e2, ATermList & e3) {
     434              53 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symPrimOp) return false;
     435              26 :     e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
     436              26 :     e2 = (ATermBlob) ATgetArgument(e, 1);
     437              26 :     e3 = (ATermList) ATgetArgument(e, 2);
     438              26 :     return true;
     439                 : }
     440                 : #endif
     441                 : 
     442                 : 
     443                 : extern AFun symAttrs;
     444                 : 
     445              55 : static inline Expr makeAttrs(ATermList e1) {
     446              55 :     return (ATerm) ATmakeAppl1(symAttrs, (ATerm) e1);
     447                 : }
     448                 : 
     449                 : #ifdef __cplusplus
     450             226 : static inline bool matchAttrs(ATerm e, ATermList & e1) {
     451             226 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symAttrs) return false;
     452             170 :     e1 = (ATermList) ATgetArgument(e, 0);
     453             170 :     return true;
     454                 : }
     455                 : #endif
     456                 : 
     457                 : 
     458                 : extern AFun symClosed;
     459                 : 
     460              57 : static inline Expr makeClosed(Expr e1) {
     461              57 :     return (ATerm) ATmakeAppl1(symClosed, e1);
     462                 : }
     463                 : 
     464                 : #ifdef __cplusplus
     465            2003 : static inline bool matchClosed(ATerm e, Expr & e1) {
     466            2003 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symClosed) return false;
     467              52 :     e1 = ATgetArgument(e, 0);
     468              52 :     return true;
     469                 : }
     470                 : #endif
     471                 : 
     472                 : 
     473                 : extern AFun symRec;
     474                 : 
     475              13 : static inline Expr makeRec(ATermList e1, ATermList e2) {
     476              13 :     return (ATerm) ATmakeAppl2(symRec, (ATerm) e1, (ATerm) e2);
     477                 : }
     478                 : 
     479                 : #ifdef __cplusplus
     480            3051 : static inline bool matchRec(ATerm e, ATermList & e1, ATermList & e2) {
     481            3051 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symRec) return false;
     482              21 :     e1 = (ATermList) ATgetArgument(e, 0);
     483              21 :     e2 = (ATermList) ATgetArgument(e, 1);
     484              21 :     return true;
     485                 : }
     486                 : #endif
     487                 : 
     488                 : 
     489                 : extern AFun symBool;
     490                 : 
     491              46 : static inline Expr makeBool(ATerm e1) {
     492              46 :     return (ATerm) ATmakeAppl1(symBool, e1);
     493                 : }
     494                 : 
     495                 : #ifdef __cplusplus
     496                 : static inline bool matchBool(ATerm e, ATerm & e1) {
     497                 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symBool) return false;
     498                 :     e1 = ATgetArgument(e, 0);
     499                 :     return true;
     500                 : }
     501                 : #endif
     502                 : 
     503                 : 
     504                 : extern AFun symNull;
     505                 : 
     506               0 : static inline Expr makeNull() {
     507               0 :     return (ATerm) ATmakeAppl0(symNull);
     508                 : }
     509                 : 
     510                 : #ifdef __cplusplus
     511               0 : static inline bool matchNull(ATerm e) {
     512               0 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symNull) return false;
     513               0 :     return true;
     514                 : }
     515                 : #endif
     516                 : 
     517                 : 
     518                 : extern AFun symBind;
     519                 : 
     520             371 : static inline ATerm makeBind(ATerm e1, Expr e2, Pos e3) {
     521             371 :     return (ATerm) ATmakeAppl3(symBind, e1, e2, e3);
     522                 : }
     523                 : 
     524                 : #ifdef __cplusplus
     525             516 : static inline bool matchBind(ATerm e, ATerm & e1, Expr & e2, Pos & e3) {
     526             516 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symBind) return false;
     527             516 :     e1 = ATgetArgument(e, 0);
     528             516 :     e2 = ATgetArgument(e, 1);
     529             516 :     e3 = ATgetArgument(e, 2);
     530             516 :     return true;
     531                 : }
     532                 : #endif
     533                 : 
     534                 : 
     535                 : extern AFun symBind2;
     536                 : 
     537                 : static inline ATerm makeBind2(ATerm e1, Expr e2) {
     538                 :     return (ATerm) ATmakeAppl2(symBind2, e1, e2);
     539                 : }
     540                 : 
     541                 : #ifdef __cplusplus
     542                 : static inline bool matchBind2(ATerm e, ATerm & e1, Expr & e2) {
     543                 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symBind2) return false;
     544                 :     e1 = ATgetArgument(e, 0);
     545                 :     e2 = ATgetArgument(e, 1);
     546                 :     return true;
     547                 : }
     548                 : #endif
     549                 : 
     550                 : 
     551                 : extern AFun symInherit;
     552                 : 
     553               6 : static inline ATerm makeInherit(Expr e1, ATermList e2, Pos e3) {
     554               6 :     return (ATerm) ATmakeAppl3(symInherit, e1, (ATerm) e2, e3);
     555                 : }
     556                 : 
     557                 : #ifdef __cplusplus
     558             118 : static inline bool matchInherit(ATerm e, Expr & e1, ATermList & e2, Pos & e3) {
     559             118 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symInherit) return false;
     560               6 :     e1 = ATgetArgument(e, 0);
     561               6 :     e2 = (ATermList) ATgetArgument(e, 1);
     562               6 :     e3 = ATgetArgument(e, 2);
     563               6 :     return true;
     564                 : }
     565                 : #endif
     566                 : 
     567                 : 
     568                 : extern AFun symScope;
     569                 : 
     570               5 : static inline Expr makeScope() {
     571               5 :     return (ATerm) ATmakeAppl0(symScope);
     572                 : }
     573                 : 
     574                 : #ifdef __cplusplus
     575               6 : static inline bool matchScope(ATerm e) {
     576               6 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symScope) return false;
     577               5 :     return true;
     578                 : }
     579                 : #endif
     580                 : 
     581                 : 
     582                 : extern AFun symNoDefFormal;
     583                 : 
     584              11 : static inline ATerm makeNoDefFormal(ATerm e1) {
     585              11 :     return (ATerm) ATmakeAppl1(symNoDefFormal, e1);
     586                 : }
     587                 : 
     588                 : #ifdef __cplusplus
     589              28 : static inline bool matchNoDefFormal(ATerm e, ATerm & e1) {
     590              28 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symNoDefFormal) return false;
     591              17 :     e1 = ATgetArgument(e, 0);
     592              17 :     return true;
     593                 : }
     594                 : #endif
     595                 : 
     596                 : 
     597                 : extern AFun symDefFormal;
     598                 : 
     599              11 : static inline ATerm makeDefFormal(ATerm e1, Expr e2) {
     600              11 :     return (ATerm) ATmakeAppl2(symDefFormal, e1, e2);
     601                 : }
     602                 : 
     603                 : #ifdef __cplusplus
     604              11 : static inline bool matchDefFormal(ATerm e, ATerm & e1, Expr & e2) {
     605              11 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symDefFormal) return false;
     606              11 :     e1 = ATgetArgument(e, 0);
     607              11 :     e2 = ATgetArgument(e, 1);
     608              11 :     return true;
     609                 : }
     610                 : #endif
     611                 : 
     612                 : 
     613                 : extern AFun symTrue;
     614                 : 
     615              23 : static inline ATerm makeTrue() {
     616              23 :     return (ATerm) ATmakeAppl0(symTrue);
     617                 : }
     618                 : 
     619                 : #ifdef __cplusplus
     620                 : static inline bool matchTrue(ATerm e) {
     621                 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symTrue) return false;
     622                 :     return true;
     623                 : }
     624                 : #endif
     625                 : 
     626                 : 
     627                 : extern AFun symFalse;
     628                 : 
     629              23 : static inline ATerm makeFalse() {
     630              23 :     return (ATerm) ATmakeAppl0(symFalse);
     631                 : }
     632                 : 
     633                 : #ifdef __cplusplus
     634                 : static inline bool matchFalse(ATerm e) {
     635                 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symFalse) return false;
     636                 :     return true;
     637                 : }
     638                 : #endif
     639                 : 
     640                 : 
     641                 : extern AFun symPrimOpDef;
     642                 : 
     643             207 : static inline ATerm makePrimOpDef(int e1, ATermBlob e2) {
     644             207 :     return (ATerm) ATmakeAppl2(symPrimOpDef, (ATerm) ATmakeInt(e1), (ATerm) e2);
     645                 : }
     646                 : 
     647                 : #ifdef __cplusplus
     648              13 : static inline bool matchPrimOpDef(ATerm e, int & e1, ATermBlob & e2) {
     649              13 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symPrimOpDef) return false;
     650              13 :     e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
     651              13 :     e2 = (ATermBlob) ATgetArgument(e, 1);
     652              13 :     return true;
     653                 : }
     654                 : #endif
     655                 : 
     656                 : 
     657                 : extern AFun symAttrRHS;
     658                 : 
     659             243 : static inline ATerm makeAttrRHS(Expr e1, Pos e2) {
     660             243 :     return (ATerm) ATmakeAppl2(symAttrRHS, e1, e2);
     661                 : }
     662                 : 
     663                 : #ifdef __cplusplus
     664             364 : static inline bool matchAttrRHS(ATerm e, Expr & e1, Pos & e2) {
     665             364 :     if (ATgetType(e) != AT_APPL || ATgetAFun(e) != symAttrRHS) return false;
     666             364 :     e1 = ATgetArgument(e, 0);
     667             364 :     e2 = ATgetArgument(e, 1);
     668             364 :     return true;
     669                 : }
     670                 : #endif
     671                 : 
     672                 : 
     673                 : extern ATerm eTrue;
     674                 : extern ATerm eFalse;
     675                 : void initNixExprHelpers();
     676                 : 
     677             714 : static inline const char * aterm2String(ATerm t) {
     678             714 :     return (const char *) ATgetName(ATgetAFun(t));
     679                 : }
     680                 : 

Generated by: LTP GCOV extension version 1.1