home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnusmalltalk / mstid.c < prev    next >
C/C++ Source or Header  |  1992-02-15  |  2KB  |  96 lines

  1. /***********************************************************************
  2.  *
  3.  * Identifier related functions
  4.  *
  5.  ***********************************************************************/
  6.  
  7. /***********************************************************************
  8.  *
  9.  * Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
  10.  * Written by Steve Byrne.
  11.  *
  12.  * This file is part of GNU Smalltalk.
  13.  *
  14.  * GNU Smalltalk is free software; you can redistribute it and/or modify it
  15.  * under the terms of the GNU General Public License as published by the Free
  16.  * Software Foundation; either version 1, or (at your option) any later 
  17.  * version.
  18.  * 
  19.  * GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  20.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  21.  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  22.  * more details.
  23.  * 
  24.  * You should have received a copy of the GNU General Public License along with
  25.  * GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  26.  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  27.  *
  28.  ***********************************************************************/
  29.  
  30. /*
  31.  *    Change Log
  32.  * ============================================================================
  33.  * Author      Date       Change 
  34.  * sbyrne    27 Dec 88    Created.
  35.  */
  36.  
  37. #include "mststr.h"
  38. #include "mstid.h"
  39.  
  40. /*
  41.  *    void initIdent(c)
  42.  *
  43.  * Description
  44.  *
  45.  *    Prepares for scanning of an identifier
  46.  *
  47.  * Inputs
  48.  *
  49.  *    c     : Initial character of identifier
  50.  *
  51.  */
  52. void initIdent(c)
  53. char    c;
  54. {
  55.   initStrBuf();
  56.   addStrBufChar(c);
  57. }
  58.  
  59. /*
  60.  *    void addIdentChar(c)
  61.  *
  62.  * Description
  63.  *
  64.  *    adds a character "c" to the identifier being accumulated.
  65.  *
  66.  * Inputs
  67.  *
  68.  *    c     : character to add.
  69.  *
  70.  */
  71. void addIdentChar(c)
  72. char    c;
  73. {
  74.   addStrBufChar(c);
  75. }
  76.  
  77. /*
  78.  *    char *doneIdent()
  79.  *
  80.  * Description
  81.  *
  82.  *    Called when the indentifier is complete, this function returns a C
  83.  *    string (NUL terminated) that is the identifier.  Note that the returned
  84.  *    value comes from a constant string, and should be copied by the caller
  85.  *    as soon as possible.
  86.  *
  87.  * Outputs
  88.  *
  89.  *    Pointer to NUL terminated C string that is the identifier that has been
  90.  *    accumulated.
  91.  */
  92. char *doneIdent()
  93. {
  94.   return (curStrBuf());
  95. }
  96.