• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-2000
27  */
28 
29 #include "pcctscfg.h"
30 
31 #ifdef __STDC__
32 #include "pccts_stdlib.h"
33 #else
34 #include <malloc.h>
35 #endif
36 #include "pccts_string.h"
37 
38 /* 133MR1 include stdio.h for fprintf in charptr.c */
39 
40 #include "pccts_stdio.h"
41 
42 /* 133MR1 include charptr.h for Attrib in charptr.c */
43 
44 #include "charptr.h"
45 
46 #ifdef __USE_PROTOS
zzcr_attr(Attrib * a,int token,char * text)47 zzcr_attr(Attrib *a,int token,char *text)
48 #else
49 zzcr_attr(a,token,text)
50 Attrib *a;
51 int token;
52 char *text;
53 #endif
54 {
55 	*a = (char *) malloc(strlen(text)+1);			/* MR6 */
56 	if ( *a == NULL ) {fprintf(stderr, "zzcr_attr: out of memory!\n"); exit(-1);}
57 	strcpy(*a, text);
58 }
59