]> pd.if.org Git - pccts/blob - h/charptr.c
auto commit for import
[pccts] / h / charptr.c
1 /*
2  * SOFTWARE RIGHTS
3  *
4  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
5  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
6  * company may do whatever they wish with source code distributed with
7  * PCCTS or the code generated by PCCTS, including the incorporation of
8  * PCCTS, or its output, into commerical software.
9  * 
10  * We encourage users to develop software with PCCTS.  However, we do ask
11  * that credit is given to us for developing PCCTS.  By "credit",
12  * we mean that if you incorporate our source code into one of your
13  * programs (commercial product, research project, or otherwise) that you
14  * acknowledge this fact somewhere in the documentation, research report,
15  * etc...  If you like PCCTS and have developed a nice tool with the
16  * output, please mention that you developed it using PCCTS.  In
17  * addition, we ask that this header remain intact in our source code.
18  * As long as these guidelines are kept, we expect to continue enhancing
19  * this system and expect to make other tools available as they are
20  * completed.
21  *
22  * ANTLR 1.33
23  * Terence Parr
24  * Parr Research Corporation
25  * with Purdue University and AHPCRC, University of Minnesota
26  * 1989-1995
27  */
28 #ifdef __STDC__
29 #include <stdlib.h>
30 #else
31 #include <malloc.h>
32 #endif
33 #include <string.h>
34
35 #ifdef __STDC__
36 zzcr_attr(Attrib *a,int token,char *text)
37 #else
38 zzcr_attr(a,token,text)
39 Attrib *a;
40 int token;
41 char *text;
42 #endif
43 {
44         *a = malloc(strlen(text)+1);
45         if ( *a == NULL ) {fprintf(stderr, "zzcr_attr: out of memory!\n"); exit(-1);}
46         strcpy(*a, text);
47 }