Back to index

tetex-bin  3.0
Defines | Functions | Variables
token.c File Reference
#include "types.h"
#include "t1stdio.h"
#include "util.h"
#include "digit.h"
#include "token.h"
#include "tokst.h"
#include "hdigit.h"

Go to the source code of this file.

Defines

#define Exp10(e)
#define next_ch()   (getc(inputFileP))
#define back_ch(ch)   (ungetc(ch, inputFileP))
#define back_ch_not_white(ch)
#define save_unsafe_ch(ch)   (*tokenCharP++ = ch)
#define save_ch(ch)
#define DONE   (256)

Functions

int T1Getc (F_FILE *)
int T1Ungetc (int, F_FILE *)
static DOUBLE P10 (LONG exponent)
static int next_char (int ch)
static int add_char (int ch)
static int skip_space (int ch)
static int skip_comment (int ch)
static int add_sign (int ch)
static int add_1st_digits (int ch)
static int add_digits (int ch)
static int add_1st_decpt (int ch)
static int add_decpt (int ch)
static int add_fraction (int ch)
static int add_e_sign (int ch)
static int add_exponent (int ch)
static int add_radix (int ch)
static int add_r_digits (int ch)
static int RADIX_NUMBER (int ch)
static int INTEGER (int ch)
static int REAL (int ch)
static int HEX_STRING (int ch)
static void save_digraph (int ch)
static int STRING (int ch)
static int AAH_NAME (int ch)
static int NAME (int ch)
static int LITERAL_NAME (int ch)
static int IMMED_NAME (int ch)
static int OOPS_NAME (int ch)
static int RIGHT_ANGLE (int ch)
static int RIGHT_PAREN (int ch)
static int LEFT_BRACE (int ch)
static int RIGHT_BRACE (int ch)
static int LEFT_BRACKET (int ch)
static int RIGHT_BRACKET (int ch)
static int BREAK_SIGNAL (int ch)
static int NO_TOKEN (int ch)
void scan_token (psobj *inputP)

Variables

char * tokenStartP
char * tokenMaxP
int tokenLength
boolean tokenTooLong
int tokenType
psvalue tokenValue
static FILEinputFileP
static char * tokenCharP
static DOUBLE Exp10T [128]
static int m_sign
static LONG m_value
static LONG m_scale
static int e_sign
static LONG e_value
static LONG e_scale
static LONG r_base
static LONG r_value
static LONG r_scale

Define Documentation

#define back_ch (   ch)    (ungetc(ch, inputFileP))

Definition at line 150 of file token.c.

#define back_ch_not_white (   ch)
Value:
(\
isWHITE_SPACE(ch)\
 ? ((ch == '\r')\
   ? (((ch = next_ch()) == '\n')\
     ? EOF\
     : back_ch(ch)\
     )\
   : EOF\
   )\
 : back_ch(ch)\
)

Definition at line 157 of file token.c.

#define DONE   (256)

Definition at line 200 of file token.c.

#define Exp10 (   e)
Value:
((e) == 0\
 ? (DOUBLE)(1.0)\
 : (-64 <= (e) && (e) <= 63\
    ? Exp10T[(e)+64]\
    : P10(e)\
   )\
)

Definition at line 75 of file token.c.

#define next_ch ( )    (getc(inputFileP))

Definition at line 138 of file token.c.

#define save_ch (   ch)
Value:

Definition at line 183 of file token.c.

#define save_unsafe_ch (   ch)    (*tokenCharP++ = ch)

Definition at line 180 of file token.c.


Function Documentation

static int AAH_NAME ( int  ch) [static]

Definition at line 923 of file token.c.

{
  do {
    save_ch(ch);
    ch = next_ch();
  } while(isNAME(ch));
 
  back_ch_not_white(ch);
  tokenType = TOKEN_NAME;
  return(DONE);
}

Here is the caller graph for this function:

static int add_1st_decpt ( int  ch) [static]

Definition at line 368 of file token.c.

{
  m_sign = '+';
  return(add_decpt(ch));
}

Here is the call graph for this function:

static int add_1st_digits ( int  ch) [static]

Definition at line 269 of file token.c.

{
  m_sign = '+';
  return(add_digits(ch));
}

Here is the call graph for this function:

static int add_char ( int  ch) [static]

Definition at line 210 of file token.c.

{
  save_ch(ch);
  return(next_ch());
}
static int add_decpt ( int  ch) [static]

Definition at line 375 of file token.c.

{
  /* On entry, expect m_sign to be set to '+' or '-' */
  m_value = 0;
  m_scale = 0;
  save_unsafe_ch(ch);
  return(next_ch());
}

Here is the caller graph for this function:

static int add_digits ( int  ch) [static]

Definition at line 276 of file token.c.

{
  LONG value, p_value, scale;
  int digit;
 
  /* On entry, expect m_sign to be set to '+' or '-';
   *  ch is a decimal digit.
   * Expect at most one character saved at this point,
   *  a sign.  This routine will save up to 10 more
   *  characters without checking the buffer boundary.
   */
 
  value = ch - '0';
  save_unsafe_ch(ch);
  ch = next_ch();
 
  while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) {
    value = (value << 3) + (value << 1) + (ch - '0');
    save_unsafe_ch(ch);
    ch = next_ch();
  }
 
  /* Quick exit for small integers --
   *    |x| <= 10*((MAX_INTEGER/10)-1)+9
   *    |x| <= 2,147,483,639 for 32 bit integers
   */
  if (isNUMBER_ENDER(ch)) {
    back_ch_not_white(ch);
    tokenValue.integer = (m_sign == '-' ? -value : value);
    tokenType = TOKEN_INTEGER;
    return(DONE);
  }
 
  /* Handle additional digits.  Beyond the boundary case,
   *   10*(MAX_INTEGER/10) <= |number| <= MAX_INTEGER
   * just count the digits: the number is too large to
   * represent as an integer and will be returned as a real.
   * The mantissa of a real holds fewer bits than an integer.
   */
  p_value = value;
  value = (m_sign == '-' ? -value : value);
  scale = 0;
 
  if (isDECIMAL_DIGIT(ch)) {
 
    /* Handle the boundary case */
    if (p_value == (MAX_INTEGER/10)) {
      digit = ch - '0';
 
      /* Must handle positive and negative values separately  */
      /* for 2's complement arithmetic */
      if (value > 0) {
        if (digit <= MAX_INTEGER%10)
          value = (value << 3) + (value << 1) + digit;
        else
          ++scale;  /* Too big, just count it */
      }
      else {
        /* Use positive % operands for portability */
        if (digit <= -(MIN_INTEGER+10)%10)
          value = (value << 3) + (value << 1) - digit;
        else
          ++scale;  /* Too big, just count it */
      }
    }
    else
      ++scale;  /* Not boundary case, just count digit */
 
    save_unsafe_ch(ch);
    ch = next_ch();
 
    /* Continue scanning digits, but can't store them */
    while(isDECIMAL_DIGIT(ch)) {
      ++scale;
      save_ch(ch);
      ch = next_ch();
    }
  }
 
  /* Continue from here scanning radix integer or real */
  m_value = value;
  m_scale = scale;
 
  /* Initialize for possible real */
  e_sign = '+';
  e_value = 0;
  e_scale = 0;
 
  return(ch);
}

Here is the caller graph for this function:

static int add_e_sign ( int  ch) [static]

Definition at line 482 of file token.c.

{
  e_sign = ch;
  save_ch(ch);
  return(next_ch());
}
static int add_exponent ( int  ch) [static]

Definition at line 490 of file token.c.

{
  LONG value, p_value;
  LONG scale = 0;
  int digit;
 
  /* On entry, expect e_sign to be set to '+' or '-' */
 
  value = ch - '0';
  save_ch(ch);
  ch = next_ch();
 
  while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) {
    value = (value << 3) + (value << 1) + (ch - '0');
    save_ch(ch);
    ch = next_ch();
  }
 
  p_value = value;
  value = (e_sign == '-' ? -value : value);
 
  /* Handle additional digits.  Beyond the boundary case,
   *   10*(MAX_INTEGER/10) <= |number| <= MAX_INTEGER
   * just count the digits: the number is too large to
   * represent as an integer.
   */
  if (isDECIMAL_DIGIT(ch)) {
 
    /* Examine boundary case */
    if (p_value == (MAX_INTEGER/10)) {
      digit = ch - '0';
 
      /* Must handle positive and negative values separately */
      /*  for 2's complement arithmetic */
      if (value > 0) {
        if (digit <= MAX_INTEGER%10)
          value = (value << 3) + (value << 1) + digit;
        else
          ++scale; /* Too big, just count it */
      }
      else {
        /* Use positive % operands for portability */
        if (digit <= -(MIN_INTEGER+10)%10)
          value = (value << 3) + (value << 1) - digit;
        else
          ++scale; /* Too big, just count it */
      }
    }
    else
      ++scale;  /* Not boundary case, just count digit */
 
    save_ch(ch);
    ch = next_ch();
 
    /* Continue scanning digits, but can't store any more */
    while(isDECIMAL_DIGIT(ch)) {
      ++scale;
      save_ch(ch);
      ch = next_ch();
    }
  }
 
  /* Store results */
  e_value = value;
  e_scale = scale;
 
  return(ch);
}
static int add_fraction ( int  ch) [static]

Definition at line 385 of file token.c.

{
  LONG value, scale;
  int digit;
 
  /* On entry, expect m_value and m_scale to be initialized,
   * and m_sign to be set to '+' or '-'.  Expect m_value and m_sign
   * to be consistent (this is not checked).
   */
  value = m_value;
  scale = m_scale;
 
  /* Scan leading zeroes */
  if (value == 0) {
    while(ch == '0') {
      --scale;
      save_ch(ch);
      ch = next_ch();
    }
 
    /* Scan first significant digit */
    if (isDECIMAL_DIGIT(ch)) {
      --scale;
      value = ch - '0';
      value = (m_sign == '-' ? -value : value);
      save_ch(ch);
      ch = next_ch();
    }
    else
      /* no significant digits -- number is zero */
      scale = 0;
  }
  /* value != 0 || value == 0 && !isDECIMAL_DIGIT(ch) */
 
  /* Scan additional significant digits */
  if (isDECIMAL_DIGIT(ch)) {
    if (value > 0) {
      while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) {
        --scale;
        value = (value << 3) + (value << 1) + (ch - '0');
        save_ch(ch);
        ch = next_ch();
      }
      /* Check boundary case */
      if (isDECIMAL_DIGIT(ch) && value == (MAX_INTEGER/10)) {
        digit = ch - '0';
        if (digit <= MAX_INTEGER%10) {
          --scale;
          value = (value << 3) + (value << 1) + digit;
          save_ch(ch);
          ch = next_ch();
        }
      }
    }
    else {
      /* value < 0 */
      while(isDECIMAL_DIGIT(ch) && value > -(-(MIN_INTEGER+10)/10+1)) {
        /* Use positive / operands for portability */
        --scale;
        value = (value << 3) + (value << 1) - (ch - '0');
        save_ch(ch);
        ch = next_ch();
      }
      /* Check boundary case */
      if (isDECIMAL_DIGIT(ch)
          && value == -(-(MIN_INTEGER+10)/10+1)) {
        digit = ch - '0';
        if (digit <= -(MIN_INTEGER+10)%10) {
        /* Use positive % operands for portability */
          --scale;
          value = (value << 3) + (value << 1) - digit;
          save_ch(ch);
          ch = next_ch();
        }
      }
    }
 
    /* Additional digits can be discarded */
    while(isDECIMAL_DIGIT(ch)) {
      save_ch(ch);
      ch = next_ch();
    }
  }
 
  /* Store results */
  m_value = value;
  m_scale = scale;
 
  /* Initialize for possible real */
  e_sign = '+';
  e_value = 0;
  e_scale = 0;
 
  return(ch);
}
static int add_r_digits ( int  ch) [static]

Definition at line 574 of file token.c.

{
  ULONG value;
  LONG radix, scale;
  int digit;
 
  /* NOTE:  The syntax of a radix number allows only for
   * values of zero or more.  The value will be stored as
   * a 32 bit integer, which PostScript then interprets
   * as signed.  This means, for example, that the numbers:
   *
   *     8#37777777777
   *    10#4294967295
   *    16#FFFFFFFF
   *    36#1Z141Z3
   *
   * are all interpreted as -1.  This routine implements this
   * idea explicitly:  it accumulates the number's value
   * as unsigned, then casts it to signed when done.
   */
 
  /* Expect r_base to be initialized */
  radix = r_base;
  value = 0;
  scale = 0;
 
  /* Scan leading zeroes */
  while(ch == '0') {
    save_ch(ch);
    ch = next_ch();
  }
 
  /* Handle first non-zero digit */
  if ((digit=digit_value[ch]) < radix) {
    value = digit;
    save_ch(ch);
    ch = next_ch();
 
    /* Add digits until boundary case reached */
    while((digit=digit_value[ch]) < radix
            && value < (MAX_ULONG / radix)) {
      value = value * radix + digit;
      save_ch(ch);
      ch = next_ch();
    };
 
    /* Scan remaining digits */
    if ((digit=digit_value[ch]) < radix) {
 
      /* Examine boundary case ---
       *   radix*(MAX_ULONG/radix) <= number <= MAX_ULONG
       */
      if (value == (MAX_ULONG/radix) && digit <= MAX_ULONG%radix)
        value = value * radix + digit;
      else
        ++scale;
 
      /* Continue scanning digits, but can't store them */
      save_ch(ch);
      ch = next_ch();
      while(digit_value[ch] < radix) {
        ++scale;
        save_ch(ch);
        ch = next_ch();
      }
    }
  }
 
  /* Store result */
  r_value = (LONG) value; /* result is signed */
  r_scale = scale;
 
  return(ch);
}
static int add_radix ( int  ch) [static]

Definition at line 560 of file token.c.

{
  if (2 <= m_value && m_value <= 36 && m_scale == 0) {
    r_base = m_value;
    save_ch(ch);
    return(next_ch());
  }
  else {
    /* Radix invalid, complete a name token */
    return(AAH_NAME(ch));
  }
}

Here is the call graph for this function:

static int add_sign ( int  ch) [static]

Definition at line 261 of file token.c.

{
  m_sign = ch;
  save_unsafe_ch(ch);
  return(next_ch());
}
static int BREAK_SIGNAL ( int  ch) [static]

Definition at line 1118 of file token.c.

{
  tokenType = TOKEN_BREAK;
  return(DONE);
}
static int HEX_STRING ( int  ch) [static]

Definition at line 724 of file token.c.

{
  int value;
 
  while(TRUE) {
 
    /* Process odd digit */
    ch = next_ch();
    if (!isHEX_DIGIT(ch)) {
 
      /* Skip white space */
      while(isWHITE_SPACE(ch))
        ch = next_ch();
 
      /* Check for terminator */
      if (!isHEX_DIGIT(ch)) {
        break;
      }
    }
    value = digit_value[ch] << 4;
 
    /* Process even digit */
    ch = next_ch();
    if (!isHEX_DIGIT(ch)) {
 
      /* Skip white space */
      while(isWHITE_SPACE(ch))
        ch = next_ch();
 
      /* Check for terminator */
      if (!isHEX_DIGIT(ch)) {
        save_ch(value);
        break;
      }
    }
    save_ch(value + digit_value[ch]);
  }
 
  /* Classify result, based on why loop ended */
  if (ch == '>')
    tokenType = TOKEN_HEX_STRING;
  else {
    /* save the invalid character for error reporting */
    save_ch(ch);
    tokenType = TOKEN_INVALID;
  }
 
  return(DONE);
}
static int IMMED_NAME ( int  ch) [static]

Definition at line 1015 of file token.c.

{
  ch = next_ch();
  if (isNAME(ch)) {
    save_unsafe_ch(ch);
    ch = next_ch();
    if (isNAME(ch)) {
      save_unsafe_ch(ch);
      ch = next_ch();
      if (isNAME(ch)) {
        save_unsafe_ch(ch);
        ch = next_ch();
        if (isNAME(ch)) {
          save_unsafe_ch(ch);
          ch = next_ch();
          if (isNAME(ch)) {
            save_unsafe_ch(ch);
            ch = next_ch();
            if (isNAME(ch)) {
              save_unsafe_ch(ch);
              ch = next_ch();
              while(isNAME(ch)) {
                save_ch(ch);
                ch = next_ch();
              }
            }
          }
        }
      }
    }
  }
 
  back_ch_not_white(ch);
  tokenType = TOKEN_IMMED_NAME;
  return(DONE);
}
static int INTEGER ( int  ch) [static]

Definition at line 671 of file token.c.

static int LEFT_BRACE ( int  ch) [static]

Definition at line 1084 of file token.c.

static int LEFT_BRACKET ( int  ch) [static]

Definition at line 1100 of file token.c.

static int LITERAL_NAME ( int  ch) [static]

Definition at line 977 of file token.c.

{
  if (isNAME(ch)) {
    save_unsafe_ch(ch);
    ch = next_ch();
    if (isNAME(ch)) {
      save_unsafe_ch(ch);
      ch = next_ch();
      if (isNAME(ch)) {
        save_unsafe_ch(ch);
        ch = next_ch();
        if (isNAME(ch)) {
          save_unsafe_ch(ch);
          ch = next_ch();
          if (isNAME(ch)) {
            save_unsafe_ch(ch);
            ch = next_ch();
            if (isNAME(ch)) {
              save_unsafe_ch(ch);
              ch = next_ch();
              while(isNAME(ch)) {
                save_ch(ch);
                ch = next_ch();
              }
            }
          }
        }
      }
    }
  }
 
  back_ch_not_white(ch);
  tokenType = TOKEN_LITERAL_NAME;
  return(DONE);
}
static int NAME ( int  ch) [static]

Definition at line 937 of file token.c.

{
  save_unsafe_ch(ch);
  ch = next_ch();
  if (isNAME(ch)) {
    save_unsafe_ch(ch);
    ch = next_ch();
    if (isNAME(ch)) {
      save_unsafe_ch(ch);
      ch = next_ch();
      if (isNAME(ch)) {
        save_unsafe_ch(ch);
        ch = next_ch();
        if (isNAME(ch)) {
          save_unsafe_ch(ch);
          ch = next_ch();
          if (isNAME(ch)) {
            save_unsafe_ch(ch);
            ch = next_ch();
            if (isNAME(ch)) {
              save_unsafe_ch(ch);
              ch = next_ch();
              while(isNAME(ch)) {
                save_ch(ch);
                ch = next_ch();
              }
            }
          }
        }
      }
    }
  }
 
  back_ch_not_white(ch);
  tokenType = TOKEN_NAME;
  return(DONE);
}
static int next_char ( int  ch) [static]

Definition at line 203 of file token.c.

{
  return(next_ch());
}
static int NO_TOKEN ( int  ch) [static]

Definition at line 1126 of file token.c.

{
  tokenType = TOKEN_EOF;
  return(DONE);
}
static int OOPS_NAME ( int  ch) [static]

Definition at line 1054 of file token.c.

static DOUBLE P10 ( LONG  exponent) [static]

Definition at line 103 of file token.c.

{
  DOUBLE value, power;
 
  if (exponent < 0) {
    power = 0.1;
    value = (exponent & 1 ? power : 1.0);
    exponent = -((exponent+1) >> 1); /* portable C for -(exponent/2) */
  }
  else {
    power = 10.0;
    value = (exponent & 1 ? power : 1.0);
    exponent = exponent >> 1;
  }
 
  while(exponent > 0) {
    power *= power;
    if (exponent & 1)
      value *= power;
    exponent >>= 1;
  }
 
  return(value);
}
static int RADIX_NUMBER ( int  ch) [static]

Definition at line 656 of file token.c.

static int REAL ( int  ch) [static]

Definition at line 687 of file token.c.

{
  DOUBLE temp;
 
  back_ch_not_white(ch);
 
  /* NOTE: ignore e_scale, since e_value alone will cause
   *   exponent overflow if e_scale > 0.
   */
 
  /* HAZARD: exponent overflow of intermediate result
   * (e.g., in 370 floating point); this should not be a problem
   * with IEEE floating point.  Reduce exponent overflow hazard by
   * combining m_scale and e_value first, if they have different signs,
   * or multiplying m_value and one of the other factors, if both
   * m_scale and e_value are negative.
   */
  if ((m_scale >= 0 && e_value <= 0)
      || (m_scale <= 0 && e_value >= 0)) {
    tokenValue.real = (DOUBLE)(m_value) * Exp10(m_scale + e_value);
  }
  else {
    temp = (DOUBLE)(m_value) * Exp10(m_scale);
    tokenValue.real = temp * Exp10(e_value);
  }
 
  tokenType = TOKEN_REAL;
  return(DONE);
}
static int RIGHT_ANGLE ( int  ch) [static]

Definition at line 1068 of file token.c.

static int RIGHT_BRACE ( int  ch) [static]

Definition at line 1092 of file token.c.

static int RIGHT_BRACKET ( int  ch) [static]

Definition at line 1109 of file token.c.

static int RIGHT_PAREN ( int  ch) [static]

Definition at line 1076 of file token.c.

static void save_digraph ( int  ch) [static]

Definition at line 797 of file token.c.

{
  int value;
 
  switch (ch) {
 
    case 'b':   /* backspace */
      ch = '\b';
      break;
 
    case 'f':   /* formfeed */
      ch = '\f';
      break;
 
    case 'n':   /* newline */
      ch = '\n';
      break;
 
    case 'r':   /* carriage return */
      ch = '\r';
      break;
 
    case 't':   /* horizontal tab */
      ch = '\t';
      break;
 
    case '\n':  /* line continuation -- consume it */
      return;
 
    case '\r':  /* carriage return   -- consume it */
      ch = next_ch();   /* look at next character, is it \n?  */
      if (ch == '\n')  return;
      back_ch(ch);      /* if not a line feed, then return it */
      return;
 
    case EOF:   /* end of file -- forget it */
      return;
 
  default:
    /* scan up to three octal digits to get value */
    if (isOCTAL_DIGIT(ch)) {
      value = digit_value[ch];
      ch = next_ch();
      if (isOCTAL_DIGIT(ch)) {
        value = (value << 3) + digit_value[ch];
        ch = next_ch();
        if (isOCTAL_DIGIT(ch))
          value = (value << 3) + digit_value[ch];
        else
          back_ch(ch);
      }
      else
        back_ch(ch);
      ch = value;
    }
  }
 
  /* Found a character to save */
  save_ch(ch);
}

Here is the caller graph for this function:

void scan_token ( psobj inputP)

Definition at line 1157 of file token.c.

{
  int ch;
  unsigned char *stateP = s0;
  unsigned char entry;
  int (*actionP)();
 
  /* Define input source */
  inputFileP = inputP->data.fileP;
  if (inputFileP == NULL)  {
    tokenType = TOKEN_EOF;
    return;
  }
 
  /* Ensure enough space for most cases
   * (so we don't have to keep checking)
   * The length needs to cover the maximum number
   * of save_unsafe_ch() calls that might be executed.
   * That number is 11 (a sign and 10 decimal digits, e.g.,
   * when scanning -2147483648), but use MAX_NAME_LEN
   * in case someone changes that without checking.
   */
  if (vm_free_bytes() < (MAX_NAME_LEN)) {
     if (!(vm_init())) {
        tokenLength = 0;
        tokenTooLong = TRUE;
        tokenType = TOKEN_NONE;
        tokenValue.integer = 0;
        return;
     }
  }
 
  tokenStartP = vm_next_byte();
 
  /* Reset token */
  tokenCharP = tokenStartP;
  tokenTooLong = FALSE;
 
  /* Scan one token */
  ch = next_ch();
  do {
    entry = stateP[ch];
    stateP = classActionTable[entry].nextStateP;
    actionP = classActionTable[entry].actionRoutineP;
    ch = (*actionP)(ch);
  } while(ch != DONE);
 
 
  /* Return results */
  tokenLength = tokenCharP - tokenStartP;
}

Here is the caller graph for this function:

static int skip_comment ( int  ch) [static]

Definition at line 233 of file token.c.

{
  do {
    ch = next_ch();
  } while(isCOMMENT(ch));
  return(ch);
}
static int skip_space ( int  ch) [static]

Definition at line 223 of file token.c.

{
  do {
    ch = next_ch();
  } while(isWHITE_SPACE(ch));
  return(ch);
}
static int STRING ( int  ch) [static]

Definition at line 860 of file token.c.

{
  int nest_level = 1;
 
  tokenType = TOKEN_STRING;
 
  do {
 
    ch = next_ch();
    while(!isSTRING_SPECIAL(ch)) {
      save_ch(ch);
      ch = next_ch();
    };
 
    switch (ch) {
 
     case '(':
       ++nest_level;
       save_ch(ch);
       break;
 
     case ')':
       if (--nest_level > 0)
         save_ch(ch);
       break;
 
     case '\\':
          save_digraph(next_ch());
        break;
 
     case '\r':
        /* All carriage returns (\r) are turned into linefeeds (\n)*/
          ch = next_ch();       /* get the next one, is it \n? */
          if (ch != '\n') {     /* if not, then put it back.   */
            back_ch(ch);
          }
          save_ch('\n');        /* in either case, save a linefeed */
        break;
 
 
     case EOF:
       tokenType = TOKEN_INVALID;  /* Unterminated string */
       nest_level = 0;
       break;
    }
 
  } while(nest_level > 0);
 
  return(DONE);
}

Here is the call graph for this function:

int T1Getc ( F_FILE )

Definition at line 134 of file t1io.c.

{
  if (f->b_base == NULL) return EOF;  /* already closed */
 
  if (f->flags & UNGOTTENC) { /* there is an ungotten c */
    f->flags &= ~UNGOTTENC;
    return (int) f->ungotc;
  }
 
  if (f->b_cnt == 0)  /* Buffer needs to be (re)filled */
    f->b_cnt = T1Fill(f);
  if (f->b_cnt > 0) return (f->b_cnt--, (int) *(f->b_ptr++));
  else {
    f->flags |= FIOEOF;
    return EOF;
  }
} /* end Getc */
int T1Ungetc ( int  ,
F_FILE  
)

Definition at line 337 of file t1io.c.

{
  if (c != EOF) {
    f->ungotc = c;
    f->flags |= UNGOTTENC;  /* set flag */
    f->flags &= ~FIOEOF;    /* reset EOF */
  }
  return c;
} /* end Ungetc */

Variable Documentation

LONG e_scale [static]

Definition at line 254 of file token.c.

int e_sign [static]

Definition at line 252 of file token.c.

LONG e_value [static]

Definition at line 253 of file token.c.

DOUBLE Exp10T[128] [static]
Initial value:
 {
  1e-64, 1e-63, 1e-62, 1e-61, 1e-60, 1e-59, 1e-58, 1e-57,
  1e-56, 1e-55, 1e-54, 1e-53, 1e-52, 1e-51, 1e-50, 1e-49,
  1e-48, 1e-47, 1e-46, 1e-45, 1e-44, 1e-43, 1e-42, 1e-41,
  1e-40, 1e-39, 1e-38, 1e-37, 1e-36, 1e-35, 1e-34, 1e-33,
  1e-32, 1e-31, 1e-30, 1e-29, 1e-28, 1e-27, 1e-26, 1e-25,
  1e-24, 1e-23, 1e-22, 1e-21, 1e-20, 1e-19, 1e-18, 1e-17,
  1e-16, 1e-15, 1e-14, 1e-13, 1e-12, 1e-11, 1e-10, 1e-9,
  1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1,
  1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7,
  1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
  1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22, 1e23,
  1e24, 1e25, 1e26, 1e27, 1e28, 1e29, 1e30, 1e31,
  1e32, 1e33, 1e34, 1e35, 1e36, 1e37, 1e38, 1e39,
  1e40, 1e41, 1e42, 1e43, 1e44, 1e45, 1e46, 1e47,
  1e48, 1e49, 1e50, 1e51, 1e52, 1e53, 1e54, 1e55,
  1e56, 1e57, 1e58, 1e59, 1e60, 1e61, 1e62, 1e63
}

Definition at line 84 of file token.c.

FILE* inputFileP [static]

Definition at line 63 of file token.c.

LONG m_scale [static]

Definition at line 249 of file token.c.

int m_sign [static]

Definition at line 247 of file token.c.

LONG m_value [static]

Definition at line 248 of file token.c.

LONG r_base [static]

Definition at line 257 of file token.c.

LONG r_scale [static]

Definition at line 259 of file token.c.

LONG r_value [static]

Definition at line 258 of file token.c.

char* tokenCharP [static]

Definition at line 67 of file token.c.

Definition at line 52 of file token.c.

char* tokenMaxP

Definition at line 49 of file token.c.

char* tokenStartP

Definition at line 48 of file token.c.

Definition at line 53 of file token.c.

Definition at line 54 of file token.c.

Definition at line 55 of file token.c.