IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2013, 12:18:50 PM (13 years ago)
Author:
eugene
Message:

change stack.type to an enum with sensible names; add support for binary functions of the form a(x,y); add support for the trinary operator a ? b : c (does not yet support sufficiently flexible cases for the types of a, b, c)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/Ohana/src/opihi/lib.shell/check_stack.c

    r34260 r36151  
    1212
    1313  for (i = 0; i < Nstack; i++) {
    14     if (stack[i].type == 'X') {
     14    if (stack[i].type == ST_VALUE) {
    1515
    1616      /** if this is a number, put it on the list of scalars and move on.  assume value is
     
    2727      stack[i].IntValue = strtol (stack[i].name, &c2, 0);
    2828      if ((fabs(stack[i].FltValue) > MAX_INT) && (c1 == stack[i].name + strlen (stack[i].name))) {
    29         stack[i].type  = 'S'; // 'S' == (float)
     29        stack[i].type  = ST_SCALAR_FLT; // (float)
    3030        continue;
    3131      }
    3232      if (c2 == stack[i].name + strlen (stack[i].name)) {
    33         stack[i].type  = 's'; // 's' == (int)
     33        stack[i].type  = ST_SCALAR_INT; // (int)
    3434        continue;
    3535      }
    3636      if (c1 == stack[i].name + strlen (stack[i].name)) {
    37         stack[i].type  = 'S'; // 'S' == (float)
     37        stack[i].type  = ST_SCALAR_FLT; // (float)
    3838        continue;
    3939      }
     
    4242      if (IsBuffer (stack[i].name)) {
    4343        stack[i].buffer = SelectBuffer (stack[i].name, OLDBUFFER, TRUE);
    44         stack[i].type   = 'M';
     44        stack[i].type   = ST_MATRIX;
    4545        if (Nx == -1) {
    4646          Nx = stack[i].buffer[0].matrix.Naxis[0];
     
    6363      if (IsVector (stack[i].name)) {
    6464        stack[i].vector = SelectVector (stack[i].name, OLDVECTOR, FALSE);
    65         stack[i].type   = 'V';
     65        stack[i].type   = ST_VECTOR;
    6666
    6767        if (Nv == -1) Nv = stack[i].vector[0].Nelements;
     
    8080
    8181      /* this is not a scalar, vector, or matrix.  must be string */
    82       stack[i].type  = 'W';
     82      stack[i].type  = ST_STRING;
    8383    }
    8484  }
Note: See TracChangeset for help on using the changeset viewer.