LTP GCOV extension - code coverage report
Current view: directory - src/libexpr - nixexpr-ast.hh
Test: app.info
Date: 2008-11-20 Instrumented lines: 317
Code covered: 95.6 % Executed lines: 303

       1                 : #include <aterm2.h>
       2                 : #ifdef __cplusplus
       3                 : namespace nix {
       4                 : #endif
       5                 : 
       6                 : 
       7                 : extern AFun symPos;
       8                 : 
       9                 : static inline Pos makePos(ATerm e1, int e2, int e3) __attribute__ ((pure, nothrow));
      10            2488 : static inline Pos makePos(ATerm e1, int e2, int e3) {
      11            2488 :     return (ATerm) ATmakeAppl3(symPos, e1, (ATerm) ATmakeInt(e2), (ATerm) ATmakeInt(e3));
      12                 : }
      13                 : 
      14                 : #ifdef __cplusplus
      15            2257 : static inline bool matchPos(ATerm e, ATerm & e1, int & e2, int & e3) {
      16            2257 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPos) return false;
      17              55 :     e1 = ATgetArgument(e, 0);
      18              55 :     if (ATgetType(e1) != AT_APPL) return false;
      19              55 :     e2 = ATgetInt((ATermInt) ATgetArgument(e, 1));
      20              55 :     e3 = ATgetInt((ATermInt) ATgetArgument(e, 2));
      21              55 :     return true;
      22                 : }
      23                 : #endif
      24                 : 
      25                 : 
      26                 : extern AFun symNoPos;
      27                 : 
      28                 : extern ATerm constNoPos;
      29                 : 
      30                 : static inline Pos makeNoPos() __attribute__ ((pure, nothrow));
      31            3432 : static inline Pos makeNoPos() {
      32            3432 :     return constNoPos;
      33                 : }
      34                 : 
      35                 : #ifdef __cplusplus
      36              20 : static inline bool matchNoPos(ATerm e) {
      37              20 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symNoPos) return false;
      38               2 :     return true;
      39                 : }
      40                 : #endif
      41                 : 
      42                 : 
      43                 : extern AFun symFunction;
      44                 : 
      45                 : static inline Expr makeFunction(Pattern e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
      46            2079 : static inline Expr makeFunction(Pattern e1, Expr e2, Pos e3) {
      47            2079 :     return (ATerm) ATmakeAppl3(symFunction, e1, e2, e3);
      48                 : }
      49                 : 
      50                 : #ifdef __cplusplus
      51          178919 : static inline bool matchFunction(ATerm e, Pattern & e1, Expr & e2, Pos & e3) {
      52          178919 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFunction) return false;
      53            4728 :     e1 = ATgetArgument(e, 0);
      54            4728 :     e2 = ATgetArgument(e, 1);
      55            4728 :     e3 = ATgetArgument(e, 2);
      56            4728 :     return true;
      57                 : }
      58                 : #endif
      59                 : 
      60                 : 
      61                 : extern AFun symAssert;
      62                 : 
      63                 : static inline Expr makeAssert(Expr e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
      64              40 : static inline Expr makeAssert(Expr e1, Expr e2, Pos e3) {
      65              40 :     return (ATerm) ATmakeAppl3(symAssert, e1, e2, e3);
      66                 : }
      67                 : 
      68                 : #ifdef __cplusplus
      69            1702 : static inline bool matchAssert(ATerm e, Expr & e1, Expr & e2, Pos & e3) {
      70            1702 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAssert) return false;
      71              33 :     e1 = ATgetArgument(e, 0);
      72              33 :     e2 = ATgetArgument(e, 1);
      73              33 :     e3 = ATgetArgument(e, 2);
      74              33 :     return true;
      75                 : }
      76                 : #endif
      77                 : 
      78                 : 
      79                 : extern AFun symWith;
      80                 : 
      81                 : static inline Expr makeWith(Expr e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
      82              16 : static inline Expr makeWith(Expr e1, Expr e2, Pos e3) {
      83              16 :     return (ATerm) ATmakeAppl3(symWith, e1, e2, e3);
      84                 : }
      85                 : 
      86                 : #ifdef __cplusplus
      87           20473 : static inline bool matchWith(ATerm e, Expr & e1, Expr & e2, Pos & e3) {
      88           20473 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symWith) return false;
      89              32 :     e1 = ATgetArgument(e, 0);
      90              32 :     e2 = ATgetArgument(e, 1);
      91              32 :     e3 = ATgetArgument(e, 2);
      92              32 :     return true;
      93                 : }
      94                 : #endif
      95                 : 
      96                 : 
      97                 : extern AFun symIf;
      98                 : 
      99                 : static inline Expr makeIf(Expr e1, Expr e2, Expr e3) __attribute__ ((pure, nothrow));
     100             190 : static inline Expr makeIf(Expr e1, Expr e2, Expr e3) {
     101             190 :     return (ATerm) ATmakeAppl3(symIf, e1, e2, e3);
     102                 : }
     103                 : 
     104                 : #ifdef __cplusplus
     105            2872 : static inline bool matchIf(ATerm e, Expr & e1, Expr & e2, Expr & e3) {
     106            2872 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symIf) return false;
     107            1170 :     e1 = ATgetArgument(e, 0);
     108            1170 :     e2 = ATgetArgument(e, 1);
     109            1170 :     e3 = ATgetArgument(e, 2);
     110            1170 :     return true;
     111                 : }
     112                 : #endif
     113                 : 
     114                 : 
     115                 : extern AFun symOpNot;
     116                 : 
     117                 : static inline Expr makeOpNot(Expr e1) __attribute__ ((pure, nothrow));
     118              14 : static inline Expr makeOpNot(Expr e1) {
     119              14 :     return (ATerm) ATmakeAppl1(symOpNot, e1);
     120                 : }
     121                 : 
     122                 : #ifdef __cplusplus
     123             948 : static inline bool matchOpNot(ATerm e, Expr & e1) {
     124             948 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpNot) return false;
     125              18 :     e1 = ATgetArgument(e, 0);
     126              18 :     return true;
     127                 : }
     128                 : #endif
     129                 : 
     130                 : 
     131                 : extern AFun symOpEq;
     132                 : 
     133                 : static inline Expr makeOpEq(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     134              96 : static inline Expr makeOpEq(Expr e1, Expr e2) {
     135              96 :     return (ATerm) ATmakeAppl2(symOpEq, e1, e2);
     136                 : }
     137                 : 
     138                 : #ifdef __cplusplus
     139            1653 : static inline bool matchOpEq(ATerm e, Expr & e1, Expr & e2) {
     140            1653 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpEq) return false;
     141             693 :     e1 = ATgetArgument(e, 0);
     142             693 :     e2 = ATgetArgument(e, 1);
     143             693 :     return true;
     144                 : }
     145                 : #endif
     146                 : 
     147                 : 
     148                 : extern AFun symOpNEq;
     149                 : 
     150                 : static inline Expr makeOpNEq(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     151              10 : static inline Expr makeOpNEq(Expr e1, Expr e2) {
     152              10 :     return (ATerm) ATmakeAppl2(symOpNEq, e1, e2);
     153                 : }
     154                 : 
     155                 : #ifdef __cplusplus
     156             960 : static inline bool matchOpNEq(ATerm e, Expr & e1, Expr & e2) {
     157             960 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpNEq) return false;
     158              12 :     e1 = ATgetArgument(e, 0);
     159              12 :     e2 = ATgetArgument(e, 1);
     160              12 :     return true;
     161                 : }
     162                 : #endif
     163                 : 
     164                 : 
     165                 : extern AFun symOpAnd;
     166                 : 
     167                 : static inline Expr makeOpAnd(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     168             122 : static inline Expr makeOpAnd(Expr e1, Expr e2) {
     169             122 :     return (ATerm) ATmakeAppl2(symOpAnd, e1, e2);
     170                 : }
     171                 : 
     172                 : #ifdef __cplusplus
     173             929 : static inline bool matchOpAnd(ATerm e, Expr & e1, Expr & e2) {
     174             929 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpAnd) return false;
     175             146 :     e1 = ATgetArgument(e, 0);
     176             146 :     e2 = ATgetArgument(e, 1);
     177             146 :     return true;
     178                 : }
     179                 : #endif
     180                 : 
     181                 : 
     182                 : extern AFun symOpOr;
     183                 : 
     184                 : static inline Expr makeOpOr(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     185               2 : static inline Expr makeOpOr(Expr e1, Expr e2) {
     186               2 :     return (ATerm) ATmakeAppl2(symOpOr, e1, e2);
     187                 : }
     188                 : 
     189                 : #ifdef __cplusplus
     190             783 : static inline bool matchOpOr(ATerm e, Expr & e1, Expr & e2) {
     191             783 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpOr) return false;
     192               1 :     e1 = ATgetArgument(e, 0);
     193               1 :     e2 = ATgetArgument(e, 1);
     194               1 :     return true;
     195                 : }
     196                 : #endif
     197                 : 
     198                 : 
     199                 : extern AFun symOpImpl;
     200                 : 
     201                 : static inline Expr makeOpImpl(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     202               8 : static inline Expr makeOpImpl(Expr e1, Expr e2) {
     203               8 :     return (ATerm) ATmakeAppl2(symOpImpl, e1, e2);
     204                 : }
     205                 : 
     206                 : #ifdef __cplusplus
     207             930 : static inline bool matchOpImpl(ATerm e, Expr & e1, Expr & e2) {
     208             930 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpImpl) return false;
     209               1 :     e1 = ATgetArgument(e, 0);
     210               1 :     e2 = ATgetArgument(e, 1);
     211               1 :     return true;
     212                 : }
     213                 : #endif
     214                 : 
     215                 : 
     216                 : extern AFun symOpUpdate;
     217                 : 
     218                 : static inline Expr makeOpUpdate(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     219              41 : static inline Expr makeOpUpdate(Expr e1, Expr e2) {
     220              41 :     return (ATerm) ATmakeAppl2(symOpUpdate, e1, e2);
     221                 : }
     222                 : 
     223                 : #ifdef __cplusplus
     224             782 : static inline bool matchOpUpdate(ATerm e, Expr & e1, Expr & e2) {
     225             782 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpUpdate) return false;
     226             149 :     e1 = ATgetArgument(e, 0);
     227             149 :     e2 = ATgetArgument(e, 1);
     228             149 :     return true;
     229                 : }
     230                 : #endif
     231                 : 
     232                 : 
     233                 : extern AFun symSubPath;
     234                 : 
     235                 : static inline Expr makeSubPath(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     236              17 : static inline Expr makeSubPath(Expr e1, Expr e2) {
     237              17 :     return (ATerm) ATmakeAppl2(symSubPath, e1, e2);
     238                 : }
     239                 : 
     240                 : #ifdef __cplusplus
     241             341 : static inline bool matchSubPath(ATerm e, Expr & e1, Expr & e2) {
     242             341 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symSubPath) return false;
     243              17 :     e1 = ATgetArgument(e, 0);
     244              17 :     e2 = ATgetArgument(e, 1);
     245              17 :     return true;
     246                 : }
     247                 : #endif
     248                 : 
     249                 : 
     250                 : extern AFun symOpHasAttr;
     251                 : 
     252                 : static inline Expr makeOpHasAttr(Expr e1, ATerm e2) __attribute__ ((pure, nothrow));
     253             192 : static inline Expr makeOpHasAttr(Expr e1, ATerm e2) {
     254             192 :     return (ATerm) ATmakeAppl2(symOpHasAttr, e1, e2);
     255                 : }
     256                 : 
     257                 : #ifdef __cplusplus
     258             633 : static inline bool matchOpHasAttr(ATerm e, Expr & e1, ATerm & e2) {
     259             633 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpHasAttr) return false;
     260             134 :     e1 = ATgetArgument(e, 0);
     261             134 :     e2 = ATgetArgument(e, 1);
     262             134 :     if (ATgetType(e2) != AT_APPL) return false;
     263             134 :     return true;
     264                 : }
     265                 : #endif
     266                 : 
     267                 : 
     268                 : extern AFun symOpPlus;
     269                 : 
     270                 : static inline Expr makeOpPlus(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     271             123 : static inline Expr makeOpPlus(Expr e1, Expr e2) {
     272             123 :     return (ATerm) ATmakeAppl2(symOpPlus, e1, e2);
     273                 : }
     274                 : 
     275                 : #ifdef __cplusplus
     276             158 : static inline bool matchOpPlus(ATerm e, Expr & e1, Expr & e2) {
     277             158 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpPlus) return false;
     278             138 :     e1 = ATgetArgument(e, 0);
     279             138 :     e2 = ATgetArgument(e, 1);
     280             138 :     return true;
     281                 : }
     282                 : #endif
     283                 : 
     284                 : 
     285                 : extern AFun symOpConcat;
     286                 : 
     287                 : static inline Expr makeOpConcat(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     288              39 : static inline Expr makeOpConcat(Expr e1, Expr e2) {
     289              39 :     return (ATerm) ATmakeAppl2(symOpConcat, e1, e2);
     290                 : }
     291                 : 
     292                 : #ifdef __cplusplus
     293             324 : static inline bool matchOpConcat(ATerm e, Expr & e1, Expr & e2) {
     294             324 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpConcat) return false;
     295             324 :     e1 = ATgetArgument(e, 0);
     296             324 :     e2 = ATgetArgument(e, 1);
     297             324 :     return true;
     298                 : }
     299                 : #endif
     300                 : 
     301                 : 
     302                 : extern AFun symConcatStrings;
     303                 : 
     304                 : static inline Expr makeConcatStrings(ATermList e1) __attribute__ ((pure, nothrow));
     305              38 : static inline Expr makeConcatStrings(ATermList e1) {
     306              38 :     return (ATerm) ATmakeAppl1(symConcatStrings, (ATerm) e1);
     307                 : }
     308                 : 
     309                 : #ifdef __cplusplus
     310              20 : static inline bool matchConcatStrings(ATerm e, ATermList & e1) {
     311              20 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symConcatStrings) return false;
     312              20 :     e1 = (ATermList) ATgetArgument(e, 0);
     313              20 :     return true;
     314                 : }
     315                 : #endif
     316                 : 
     317                 : 
     318                 : extern AFun symCall;
     319                 : 
     320                 : static inline Expr makeCall(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
     321            2549 : static inline Expr makeCall(Expr e1, Expr e2) {
     322            2549 :     return (ATerm) ATmakeAppl2(symCall, e1, e2);
     323                 : }
     324                 : 
     325                 : #ifdef __cplusplus
     326            9841 : static inline bool matchCall(ATerm e, Expr & e1, Expr & e2) {
     327            9841 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symCall) return false;
     328            4957 :     e1 = ATgetArgument(e, 0);
     329            4957 :     e2 = ATgetArgument(e, 1);
     330            4957 :     return true;
     331                 : }
     332                 : #endif
     333                 : 
     334                 : 
     335                 : extern AFun symSelect;
     336                 : 
     337                 : static inline Expr makeSelect(Expr e1, ATerm e2) __attribute__ ((pure, nothrow));
     338            2267 : static inline Expr makeSelect(Expr e1, ATerm e2) {
     339            2267 :     return (ATerm) ATmakeAppl2(symSelect, e1, e2);
     340                 : }
     341                 : 
     342                 : #ifdef __cplusplus
     343            4884 : static inline bool matchSelect(ATerm e, Expr & e1, ATerm & e2) {
     344            4884 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symSelect) return false;
     345            1688 :     e1 = ATgetArgument(e, 0);
     346            1688 :     e2 = ATgetArgument(e, 1);
     347            1688 :     if (ATgetType(e2) != AT_APPL) return false;
     348            1688 :     return true;
     349                 : }
     350                 : #endif
     351                 : 
     352                 : 
     353                 : extern AFun symVar;
     354                 : 
     355                 : static inline Expr makeVar(ATerm e1) __attribute__ ((pure, nothrow));
     356            4442 : static inline Expr makeVar(ATerm e1) {
     357            4442 :     return (ATerm) ATmakeAppl1(symVar, e1);
     358                 : }
     359                 : 
     360                 : #ifdef __cplusplus
     361          167025 : static inline bool matchVar(ATerm e, ATerm & e1) {
     362          167025 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symVar) return false;
     363           15936 :     e1 = ATgetArgument(e, 0);
     364           15936 :     if (ATgetType(e1) != AT_APPL) return false;
     365           15936 :     return true;
     366                 : }
     367                 : #endif
     368                 : 
     369                 : 
     370                 : extern AFun symInt;
     371                 : 
     372                 : static inline Expr makeInt(int e1) __attribute__ ((pure, nothrow));
     373             672 : static inline Expr makeInt(int e1) {
     374             672 :     return (ATerm) ATmakeAppl1(symInt, (ATerm) ATmakeInt(e1));
     375                 : }
     376                 : 
     377                 : #ifdef __cplusplus
     378            1717 : static inline bool matchInt(ATerm e, int & e1) {
     379            1717 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symInt) return false;
     380            1463 :     e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
     381            1463 :     return true;
     382                 : }
     383                 : #endif
     384                 : 
     385                 : 
     386                 : extern AFun symStr;
     387                 : 
     388                 : static inline Expr makeStr(ATerm e1, ATermList e2) __attribute__ ((pure, nothrow));
     389            3246 : static inline Expr makeStr(ATerm e1, ATermList e2) {
     390            3246 :     return (ATerm) ATmakeAppl2(symStr, e1, (ATerm) e2);
     391                 : }
     392                 : 
     393                 : #ifdef __cplusplus
     394            3941 : static inline bool matchStr(ATerm e, ATerm & e1, ATermList & e2) {
     395            3941 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symStr) return false;
     396            3282 :     e1 = ATgetArgument(e, 0);
     397            3282 :     if (ATgetType(e1) != AT_APPL) return false;
     398            3282 :     e2 = (ATermList) ATgetArgument(e, 1);
     399            3282 :     return true;
     400                 : }
     401                 : #endif
     402                 : 
     403                 : 
     404                 : extern AFun symObsoleteStr;
     405                 : 
     406                 : static inline Expr makeObsoleteStr(ATerm e1) __attribute__ ((pure, nothrow));
     407                 : static inline Expr makeObsoleteStr(ATerm e1) {
     408                 :     return (ATerm) ATmakeAppl1(symObsoleteStr, e1);
     409                 : }
     410                 : 
     411                 : #ifdef __cplusplus
     412            4161 : static inline bool matchObsoleteStr(ATerm e, ATerm & e1) {
     413            4161 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symObsoleteStr) return false;
     414               0 :     e1 = ATgetArgument(e, 0);
     415               0 :     if (ATgetType(e1) != AT_APPL) return false;
     416               0 :     return true;
     417                 : }
     418                 : #endif
     419                 : 
     420                 : 
     421                 : extern AFun symIndStr;
     422                 : 
     423                 : static inline Expr makeIndStr(ATerm e1) __attribute__ ((pure, nothrow));
     424              36 : static inline Expr makeIndStr(ATerm e1) {
     425              36 :     return (ATerm) ATmakeAppl1(symIndStr, e1);
     426                 : }
     427                 : 
     428                 : #ifdef __cplusplus
     429             106 : static inline bool matchIndStr(ATerm e, ATerm & e1) {
     430             106 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symIndStr) return false;
     431              72 :     e1 = ATgetArgument(e, 0);
     432              72 :     if (ATgetType(e1) != AT_APPL) return false;
     433              72 :     return true;
     434                 : }
     435                 : #endif
     436                 : 
     437                 : 
     438                 : extern AFun symPath;
     439                 : 
     440                 : static inline Expr makePath(ATerm e1) __attribute__ ((pure, nothrow));
     441             285 : static inline Expr makePath(ATerm e1) {
     442             285 :     return (ATerm) ATmakeAppl1(symPath, e1);
     443                 : }
     444                 : 
     445                 : #ifdef __cplusplus
     446             997 : static inline bool matchPath(ATerm e, ATerm & e1) {
     447             997 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPath) return false;
     448             281 :     e1 = ATgetArgument(e, 0);
     449             281 :     if (ATgetType(e1) != AT_APPL) return false;
     450             281 :     return true;
     451                 : }
     452                 : #endif
     453                 : 
     454                 : 
     455                 : extern AFun symList;
     456                 : 
     457                 : static inline Expr makeList(ATermList e1) __attribute__ ((pure, nothrow));
     458            1302 : static inline Expr makeList(ATermList e1) {
     459            1302 :     return (ATerm) ATmakeAppl1(symList, (ATerm) e1);
     460                 : }
     461                 : 
     462                 : #ifdef __cplusplus
     463            2602 : static inline bool matchList(ATerm e, ATermList & e1) {
     464            2602 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symList) return false;
     465            2261 :     e1 = (ATermList) ATgetArgument(e, 0);
     466            2261 :     return true;
     467                 : }
     468                 : #endif
     469                 : 
     470                 : 
     471                 : extern AFun symBlackHole;
     472                 : 
     473                 : extern ATerm constBlackHole;
     474                 : 
     475                 : static inline Expr makeBlackHole() __attribute__ ((pure, nothrow));
     476           27740 : static inline Expr makeBlackHole() {
     477           27740 :     return constBlackHole;
     478                 : }
     479                 : 
     480                 : #ifdef __cplusplus
     481                 : static inline bool matchBlackHole(ATerm e) {
     482                 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBlackHole) return false;
     483                 :     return true;
     484                 : }
     485                 : #endif
     486                 : 
     487                 : 
     488                 : extern AFun symUndefined;
     489                 : 
     490                 : extern ATerm constUndefined;
     491                 : 
     492                 : static inline Expr makeUndefined() __attribute__ ((pure, nothrow));
     493                 : static inline Expr makeUndefined() {
     494                 :     return constUndefined;
     495                 : }
     496                 : 
     497                 : #ifdef __cplusplus
     498                 : static inline bool matchUndefined(ATerm e) {
     499                 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symUndefined) return false;
     500                 :     return true;
     501                 : }
     502                 : #endif
     503                 : 
     504                 : 
     505                 : extern AFun symRemoved;
     506                 : 
     507                 : extern ATerm constRemoved;
     508                 : 
     509                 : static inline Expr makeRemoved() __attribute__ ((pure, nothrow));
     510           18075 : static inline Expr makeRemoved() {
     511           18075 :     return constRemoved;
     512                 : }
     513                 : 
     514                 : #ifdef __cplusplus
     515                 : static inline bool matchRemoved(ATerm e) {
     516                 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symRemoved) return false;
     517                 :     return true;
     518                 : }
     519                 : #endif
     520                 : 
     521                 : 
     522                 : extern AFun symPrimOp;
     523                 : 
     524                 : static inline Expr makePrimOp(int e1, ATermBlob e2, ATermList e3) __attribute__ ((pure, nothrow));
     525             888 : static inline Expr makePrimOp(int e1, ATermBlob e2, ATermList e3) {
     526             888 :     return (ATerm) ATmakeAppl3(symPrimOp, (ATerm) ATmakeInt(e1), (ATerm) e2, (ATerm) e3);
     527                 : }
     528                 : 
     529                 : #ifdef __cplusplus
     530            4957 : static inline bool matchPrimOp(ATerm e, int & e1, ATermBlob & e2, ATermList & e3) {
     531            4957 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPrimOp) return false;
     532            2844 :     e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
     533            2844 :     e2 = (ATermBlob) ATgetArgument(e, 1);
     534            2844 :     e3 = (ATermList) ATgetArgument(e, 2);
     535            2844 :     return true;
     536                 : }
     537                 : #endif
     538                 : 
     539                 : 
     540                 : extern AFun symAttrs;
     541                 : 
     542                 : static inline Expr makeAttrs(ATermList e1) __attribute__ ((pure, nothrow));
     543            1710 : static inline Expr makeAttrs(ATermList e1) {
     544            1710 :     return (ATerm) ATmakeAppl1(symAttrs, (ATerm) e1);
     545                 : }
     546                 : 
     547                 : #ifdef __cplusplus
     548           42504 : static inline bool matchAttrs(ATerm e, ATermList & e1) {
     549           42504 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAttrs) return false;
     550            4637 :     e1 = (ATermList) ATgetArgument(e, 0);
     551            4637 :     return true;
     552                 : }
     553                 : #endif
     554                 : 
     555                 : 
     556                 : extern AFun symClosed;
     557                 : 
     558                 : static inline Expr makeClosed(Expr e1) __attribute__ ((pure, nothrow));
     559            5516 : static inline Expr makeClosed(Expr e1) {
     560            5516 :     return (ATerm) ATmakeAppl1(symClosed, e1);
     561                 : }
     562                 : 
     563                 : #ifdef __cplusplus
     564          188352 : static inline bool matchClosed(ATerm e, Expr & e1) {
     565          188352 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symClosed) return false;
     566           15811 :     e1 = ATgetArgument(e, 0);
     567           15811 :     return true;
     568                 : }
     569                 : #endif
     570                 : 
     571                 : 
     572                 : extern AFun symRec;
     573                 : 
     574                 : static inline Expr makeRec(ATermList e1, ATermList e2) __attribute__ ((pure, nothrow));
     575             752 : static inline Expr makeRec(ATermList e1, ATermList e2) {
     576             752 :     return (ATerm) ATmakeAppl2(symRec, (ATerm) e1, (ATerm) e2);
     577                 : }
     578                 : 
     579                 : #ifdef __cplusplus
     580          177723 : static inline bool matchRec(ATerm e, ATermList & e1, ATermList & e2) {
     581          177723 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symRec) return false;
     582            1171 :     e1 = (ATermList) ATgetArgument(e, 0);
     583            1171 :     e2 = (ATermList) ATgetArgument(e, 1);
     584            1171 :     return true;
     585                 : }
     586                 : #endif
     587                 : 
     588                 : 
     589                 : extern AFun symBool;
     590                 : 
     591                 : static inline Expr makeBool(ATermBool e1) __attribute__ ((pure, nothrow));
     592             472 : static inline Expr makeBool(ATermBool e1) {
     593             472 :     return (ATerm) ATmakeAppl1(symBool, e1);
     594                 : }
     595                 : 
     596                 : #ifdef __cplusplus
     597               0 : static inline bool matchBool(ATerm e, ATermBool & e1) {
     598               0 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBool) return false;
     599               0 :     e1 = ATgetArgument(e, 0);
     600               0 :     return true;
     601                 : }
     602                 : #endif
     603                 : 
     604                 : 
     605                 : extern AFun symNull;
     606                 : 
     607                 : extern ATerm constNull;
     608                 : 
     609                 : static inline Expr makeNull() __attribute__ ((pure, nothrow));
     610               0 : static inline Expr makeNull() {
     611               0 :     return constNull;
     612                 : }
     613                 : 
     614                 : #ifdef __cplusplus
     615             302 : static inline bool matchNull(ATerm e) {
     616             302 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symNull) return false;
     617               0 :     return true;
     618                 : }
     619                 : #endif
     620                 : 
     621                 : 
     622                 : extern AFun symBind;
     623                 : 
     624                 : static inline ATerm makeBind(ATerm e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
     625           10104 : static inline ATerm makeBind(ATerm e1, Expr e2, Pos e3) {
     626           10104 :     return (ATerm) ATmakeAppl3(symBind, e1, e2, e3);
     627                 : }
     628                 : 
     629                 : #ifdef __cplusplus
     630           20364 : static inline bool matchBind(ATerm e, ATerm & e1, Expr & e2, Pos & e3) {
     631           20364 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBind) return false;
     632           20364 :     e1 = ATgetArgument(e, 0);
     633           20364 :     if (ATgetType(e1) != AT_APPL) return false;
     634           20364 :     e2 = ATgetArgument(e, 1);
     635           20364 :     e3 = ATgetArgument(e, 2);
     636           20364 :     return true;
     637                 : }
     638                 : #endif
     639                 : 
     640                 : 
     641                 : extern AFun symObsoleteBind;
     642                 : 
     643                 : static inline ATerm makeObsoleteBind(ATerm e1, Expr e2) __attribute__ ((pure, nothrow));
     644                 : static inline ATerm makeObsoleteBind(ATerm e1, Expr e2) {
     645                 :     return (ATerm) ATmakeAppl2(symObsoleteBind, e1, e2);
     646                 : }
     647                 : 
     648                 : #ifdef __cplusplus
     649            4161 : static inline bool matchObsoleteBind(ATerm e, ATerm & e1, Expr & e2) {
     650            4161 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symObsoleteBind) return false;
     651               0 :     e1 = ATgetArgument(e, 0);
     652               0 :     if (ATgetType(e1) != AT_APPL) return false;
     653               0 :     e2 = ATgetArgument(e, 1);
     654               0 :     return true;
     655                 : }
     656                 : #endif
     657                 : 
     658                 : 
     659                 : extern AFun symInherit;
     660                 : 
     661                 : static inline ATerm makeInherit(Expr e1, ATermList e2, Pos e3) __attribute__ ((pure, nothrow));
     662             135 : static inline ATerm makeInherit(Expr e1, ATermList e2, Pos e3) {
     663             135 :     return (ATerm) ATmakeAppl3(symInherit, e1, (ATerm) e2, e3);
     664                 : }
     665                 : 
     666                 : #ifdef __cplusplus
     667            1926 : static inline bool matchInherit(ATerm e, Expr & e1, ATermList & e2, Pos & e3) {
     668            1926 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symInherit) return false;
     669             135 :     e1 = ATgetArgument(e, 0);
     670             135 :     e2 = (ATermList) ATgetArgument(e, 1);
     671             135 :     e3 = ATgetArgument(e, 2);
     672             135 :     return true;
     673                 : }
     674                 : #endif
     675                 : 
     676                 : 
     677                 : extern AFun symScope;
     678                 : 
     679                 : extern ATerm constScope;
     680                 : 
     681                 : static inline Expr makeScope() __attribute__ ((pure, nothrow));
     682             132 : static inline Expr makeScope() {
     683             132 :     return constScope;
     684                 : }
     685                 : 
     686                 : #ifdef __cplusplus
     687             135 : static inline bool matchScope(ATerm e) {
     688             135 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symScope) return false;
     689             132 :     return true;
     690                 : }
     691                 : #endif
     692                 : 
     693                 : 
     694                 : extern AFun symVarPat;
     695                 : 
     696                 : static inline Pattern makeVarPat(ATerm e1) __attribute__ ((pure, nothrow));
     697             413 : static inline Pattern makeVarPat(ATerm e1) {
     698             413 :     return (ATerm) ATmakeAppl1(symVarPat, e1);
     699                 : }
     700                 : 
     701                 : #ifdef __cplusplus
     702            4748 : static inline bool matchVarPat(ATerm e, ATerm & e1) {
     703            4748 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symVarPat) return false;
     704            4361 :     e1 = ATgetArgument(e, 0);
     705            4361 :     if (ATgetType(e1) != AT_APPL) return false;
     706            4361 :     return true;
     707                 : }
     708                 : #endif
     709                 : 
     710                 : 
     711                 : extern AFun symAttrsPat;
     712                 : 
     713                 : static inline Pattern makeAttrsPat(ATermList e1, ATermBool e2) __attribute__ ((pure, nothrow));
     714              99 : static inline Pattern makeAttrsPat(ATermList e1, ATermBool e2) {
     715              99 :     return (ATerm) ATmakeAppl2(symAttrsPat, (ATerm) e1, e2);
     716                 : }
     717                 : 
     718                 : #ifdef __cplusplus
     719             415 : static inline bool matchAttrsPat(ATerm e, ATermList & e1, ATermBool & e2) {
     720             415 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAttrsPat) return false;
     721             391 :     e1 = (ATermList) ATgetArgument(e, 0);
     722             391 :     e2 = ATgetArgument(e, 1);
     723             391 :     return true;
     724                 : }
     725                 : #endif
     726                 : 
     727                 : 
     728                 : extern AFun symAtPat;
     729                 : 
     730                 : static inline Pattern makeAtPat(Pattern e1, Pattern e2) __attribute__ ((pure, nothrow));
     731               6 : static inline Pattern makeAtPat(Pattern e1, Pattern e2) {
     732               6 :     return (ATerm) ATmakeAppl2(symAtPat, e1, e2);
     733                 : }
     734                 : 
     735                 : #ifdef __cplusplus
     736              24 : static inline bool matchAtPat(ATerm e, Pattern & e1, Pattern & e2) {
     737              24 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAtPat) return false;
     738              24 :     e1 = ATgetArgument(e, 0);
     739              24 :     e2 = ATgetArgument(e, 1);
     740              24 :     return true;
     741                 : }
     742                 : #endif
     743                 : 
     744                 : 
     745                 : extern AFun symFormal;
     746                 : 
     747                 : static inline ATerm makeFormal(ATerm e1, DefaultValue e2) __attribute__ ((pure, nothrow));
     748             267 : static inline ATerm makeFormal(ATerm e1, DefaultValue e2) {
     749             267 :     return (ATerm) ATmakeAppl2(symFormal, e1, e2);
     750                 : }
     751                 : 
     752                 : #ifdef __cplusplus
     753             983 : static inline bool matchFormal(ATerm e, ATerm & e1, DefaultValue & e2) {
     754             983 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFormal) return false;
     755             983 :     e1 = ATgetArgument(e, 0);
     756             983 :     if (ATgetType(e1) != AT_APPL) return false;
     757             983 :     e2 = ATgetArgument(e, 1);
     758             983 :     return true;
     759                 : }
     760                 : #endif
     761                 : 
     762                 : 
     763                 : extern AFun symDefaultValue;
     764                 : 
     765                 : static inline DefaultValue makeDefaultValue(Expr e1) __attribute__ ((pure, nothrow));
     766              78 : static inline DefaultValue makeDefaultValue(Expr e1) {
     767              78 :     return (ATerm) ATmakeAppl1(symDefaultValue, e1);
     768                 : }
     769                 : 
     770                 : #ifdef __cplusplus
     771             131 : static inline bool matchDefaultValue(ATerm e, Expr & e1) {
     772             131 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symDefaultValue) return false;
     773             130 :     e1 = ATgetArgument(e, 0);
     774             130 :     return true;
     775                 : }
     776                 : #endif
     777                 : 
     778                 : 
     779                 : extern AFun symNoDefaultValue;
     780                 : 
     781                 : extern ATerm constNoDefaultValue;
     782                 : 
     783                 : static inline DefaultValue makeNoDefaultValue() __attribute__ ((pure, nothrow));
     784             189 : static inline DefaultValue makeNoDefaultValue() {
     785             189 :     return constNoDefaultValue;
     786                 : }
     787                 : 
     788                 : #ifdef __cplusplus
     789                 : static inline bool matchNoDefaultValue(ATerm e) {
     790                 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symNoDefaultValue) return false;
     791                 :     return true;
     792                 : }
     793                 : #endif
     794                 : 
     795                 : 
     796                 : extern AFun symTrue;
     797                 : 
     798                 : extern ATerm constTrue;
     799                 : 
     800                 : static inline ATermBool makeTrue() __attribute__ ((pure, nothrow));
     801             236 : static inline ATermBool makeTrue() {
     802             236 :     return constTrue;
     803                 : }
     804                 : 
     805                 : #ifdef __cplusplus
     806                 : static inline bool matchTrue(ATerm e) {
     807                 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symTrue) return false;
     808                 :     return true;
     809                 : }
     810                 : #endif
     811                 : 
     812                 : 
     813                 : extern AFun symFalse;
     814                 : 
     815                 : extern ATerm constFalse;
     816                 : 
     817                 : static inline ATermBool makeFalse() __attribute__ ((pure, nothrow));
     818             236 : static inline ATermBool makeFalse() {
     819             236 :     return constFalse;
     820                 : }
     821                 : 
     822                 : #ifdef __cplusplus
     823                 : static inline bool matchFalse(ATerm e) {
     824                 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFalse) return false;
     825                 :     return true;
     826                 : }
     827                 : #endif
     828                 : 
     829                 : 
     830                 : extern AFun symPrimOpDef;
     831                 : 
     832                 : static inline ATerm makePrimOpDef(int e1, ATermBlob e2) __attribute__ ((pure, nothrow));
     833           11564 : static inline ATerm makePrimOpDef(int e1, ATermBlob e2) {
     834           11564 :     return (ATerm) ATmakeAppl2(symPrimOpDef, (ATerm) ATmakeInt(e1), (ATerm) e2);
     835                 : }
     836                 : 
     837                 : #ifdef __cplusplus
     838             348 : static inline bool matchPrimOpDef(ATerm e, int & e1, ATermBlob & e2) {
     839             348 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPrimOpDef) return false;
     840             348 :     e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
     841             348 :     e2 = (ATermBlob) ATgetArgument(e, 1);
     842             348 :     return true;
     843                 : }
     844                 : #endif
     845                 : 
     846                 : 
     847                 : extern AFun symAttrRHS;
     848                 : 
     849                 : static inline ATerm makeAttrRHS(Expr e1, Pos e2) __attribute__ ((pure, nothrow));
     850            8363 : static inline ATerm makeAttrRHS(Expr e1, Pos e2) {
     851            8363 :     return (ATerm) ATmakeAppl2(symAttrRHS, e1, e2);
     852                 : }
     853                 : 
     854                 : #ifdef __cplusplus
     855            8539 : static inline bool matchAttrRHS(ATerm e, Expr & e1, Pos & e2) {
     856            8539 :     if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAttrRHS) return false;
     857            8539 :     e1 = ATgetArgument(e, 0);
     858            8539 :     e2 = ATgetArgument(e, 1);
     859            8539 :     return true;
     860                 : }
     861                 : #endif
     862                 : 
     863                 : 
     864                 : extern ATerm eTrue;
     865                 : extern ATerm eFalse;
     866                 : extern ATerm sOverrides;
     867                 : void initNixExprHelpers();
     868                 : 
     869           13525 : static inline const char * aterm2String(ATerm t) {
     870           13525 :     return (const char *) ATgetName(ATgetAFun(t));
     871                 : }
     872                 : 
     873                 : #ifdef __cplusplus
     874                 : }
     875                 : #endif
     876                 : 
     877                 : 

Generated by: LTP GCOV extension version 1.6