]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/CCode/Source/Pccts/antlr/lex.c
2 * lex.c -- Generate all of the lexical type files: parser.dlg tokens.h
6 * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
7 * Set (PCCTS) -- PCCTS is in the public domain. An individual or
8 * company may do whatever they wish with source code distributed with
9 * PCCTS or the code generated by PCCTS, including the incorporation of
10 * PCCTS, or its output, into commerical software.
12 * We encourage users to develop software with PCCTS. However, we do ask
13 * that credit is given to us for developing PCCTS. By "credit",
14 * we mean that if you incorporate our source code into one of your
15 * programs (commercial product, research project, or otherwise) that you
16 * acknowledge this fact somewhere in the documentation, research report,
17 * etc... If you like PCCTS and have developed a nice tool with the
18 * output, please mention that you developed it using PCCTS. In
19 * addition, we ask that this header remain intact in our source code.
20 * As long as these guidelines are kept, we expect to continue enhancing
21 * this system and expect to make other tools available as they are
26 * Parr Research Corporation
27 * with Purdue University and AHPCRC, University of Minnesota
34 /* MR1 10-Apr-97 MR1 Replace use of __STDC__ with __USE_PROTOS */
42 #define DLGErrorString "invalid token"
44 /* Generate a complete lexical description of the lexemes found in the grammar */
53 FILE *dlgFile
= fopen(OutMetaName(DlgFileName
), "w");
54 require(dlgFile
!=NULL
, eMsg1("genLexFile: cannot open %s", OutMetaName(DlgFileName
)) );
56 special_fopen_actions(OutMetaName(DlgFileName
)); /* MR1 */
58 fprintf(dlgFile
, "<<\n");
59 fprintf(dlgFile
, "/* %s -- DLG Description of scanner\n", DlgFileName
);
60 fprintf(dlgFile
, " *\n");
61 fprintf(dlgFile
, " * Generated from:");
62 {int i
; for (i
=0; i
<NumFiles
; i
++) fprintf(dlgFile
, " %s", FileStr
[i
]);}
63 fprintf(dlgFile
, "\n");
64 fprintf(dlgFile
, " *\n");
65 fprintf(dlgFile
, " * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
66 fprintf(dlgFile
, " * Purdue University Electrical Engineering\n");
67 fprintf(dlgFile
, " * With AHPCRC, University of Minnesota\n");
68 fprintf(dlgFile
, " * ANTLR Version %s\n", Version
);
69 fprintf(dlgFile
, " */\n\n");
70 if (FirstAction
!= NULL
) dumpAction( FirstAction
, dlgFile
, 0, -1, 0, 1 ); /* MR11 MR15b */
71 fprintf(dlgFile
, "#define ANTLR_VERSION %s\n", VersionDef
);
74 if ( !UserDefdTokens
) fprintf(dlgFile
, "#include \"%s\"\n", DefFileName
);
75 else fprintf(dlgFile
, "#include %s\n", UserTokenDefsFile
);
76 fprintf(dlgFile
, "#include \"%s\"\n", ATOKEN_H
);
77 if ( GenAST
) fprintf(dlgFile
, "#include \"%s\"\n", ASTBASE_H
);
78 if ( HdrAction
!= NULL
) dumpAction( HdrAction
, dlgFile
, 0, -1, 0, 1 );
82 fprintf(dlgFile
, "#include \"pcctscfg.h\"\n");
83 fprintf(dlgFile
, "#include \"pccts_stdio.h\"\n");
84 if ( strcmp(ParserName
, DefaultParserName
)!=0 )
85 fprintf(dlgFile
, "#define %s %s\n", DefaultParserName
, ParserName
);
86 if ( strcmp(ParserName
, DefaultParserName
)!=0 )
87 fprintf(dlgFile
, "#include \"%s\"\n", RemapFileName
);
88 if ( HdrAction
!= NULL
) dumpAction( HdrAction
, dlgFile
, 0, -1, 0, 1 );
91 fprintf(dlgFile
, "#define ZZCAN_GUESS\n");
92 fprintf(dlgFile
, "#include \"pccts_setjmp.h\"\n");
94 if ( OutputLL_k
> 1 ) fprintf(dlgFile
, "#define LL_K %d\n", OutputLL_k
);
95 if ( DemandLookahead
) fprintf(dlgFile
, "#define DEMAND_LOOK\n");
97 fprintf(dlgFile
,"#ifndef zzTRACE_RULES\n"); /* MR20 */
98 fprintf(dlgFile
,"#define zzTRACE_RULES\n"); /* MR20 */
99 fprintf(dlgFile
,"#endif\n"); /* MR22 */
101 fprintf(dlgFile
, "#include \"antlr.h\"\n");
103 fprintf(dlgFile
, "#include \"ast.h\"\n");
105 if ( UserDefdTokens
)
106 fprintf(dlgFile
, "#include %s\n", UserTokenDefsFile
);
107 /* still need this one as it has the func prototypes */
108 fprintf(dlgFile
, "#include \"%s\"\n", DefFileName
);
109 fprintf(dlgFile
, "#include \"dlgdef.h\"\n");
110 fprintf(dlgFile
, "LOOKAHEAD\n");
111 fprintf(dlgFile
, "\n");
112 fprintf(dlgFile
, "void\n");
113 fprintf(dlgFile
, "#ifdef __USE_PROTOS\n");
114 fprintf(dlgFile
, "zzerraction(void)\n");
115 fprintf(dlgFile
, "#else\n");
116 fprintf(dlgFile
, "zzerraction()\n");
117 fprintf(dlgFile
, "#endif\n");
118 fprintf(dlgFile
, "{\n");
119 fprintf(dlgFile
, "\t(*zzerr)(\"%s\");\n", DLGErrorString
);
120 fprintf(dlgFile
, "\tzzadvance();\n");
121 fprintf(dlgFile
, "\tzzskip();\n");
122 fprintf(dlgFile
, "}\n");
124 fprintf(dlgFile
, ">>\n\n");
126 /* dump all actions */
129 /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
130 /* MR1 via <<%%lexmember ....>> & <<%%lexprefix ...>> */
132 if (LexActions
!= NULL
) {
133 for (p
= LexActions
->next
; p
!=NULL
; p
=p
->next
)
135 /* MR1 */ fprintf(dlgFile
, "<<%%%%lexaction\n");
136 dumpAction( (char *)p
->elem
, dlgFile
, 0, -1, 0, 1 );
137 fprintf(dlgFile
, ">>\n\n");
141 /* MR1 */ if (GenCC
) {
142 /* MR1 */ fprintf(dlgFile
,"<<%%%%parserclass %s>>\n\n",CurrentClassName
);
145 /* MR1 */ if (LexPrefixActions
!= NULL
) {
146 /* MR1 */ for (p
= LexPrefixActions
->next
; p
!=NULL
; p
=p
->next
)
148 /* MR1 */ fprintf(dlgFile
, "<<%%%%lexprefix\n");
149 /* MR1 */ dumpAction( (char *)p
->elem
, dlgFile
, 0, -1, 0, 1 );
150 /* MR1 */ fprintf(dlgFile
, ">>\n\n");
154 /* MR1 */ if (LexMemberActions
!= NULL
) {
155 /* MR1 */ for (p
= LexMemberActions
->next
; p
!=NULL
; p
=p
->next
)
157 /* MR1 */ fprintf(dlgFile
, "<<%%%%lexmember\n");
158 /* MR1 */ dumpAction( (char *)p
->elem
, dlgFile
, 0, -1, 0, 1 );
159 /* MR1 */ fprintf(dlgFile
, ">>\n\n");
163 /* dump all regular expression rules/actions (skip sentinel node) */
164 if ( ExprOrder
== NULL
) {
165 warnNoFL("no regular expressions found in grammar");
167 else dumpLexClasses(dlgFile
);
168 fprintf(dlgFile
, "%%%%\n");
172 /* For each lexical class, scan ExprOrder looking for expressions
173 * in that lexical class. Print out only those that match.
174 * Each element of the ExprOrder list has both an expr and an lclass
179 dumpLexClasses( FILE *dlgFile
)
181 dumpLexClasses( dlgFile
)
190 for (i
=0; i
<NumLexClasses
; i
++)
192 fprintf(dlgFile
, "\n%%%%%s\n\n", lclass
[i
].classnum
);
193 for (p
=ExprOrder
->next
; p
!=NULL
; p
=p
->next
)
195 q
= (Expr
*) p
->elem
;
196 if ( q
->lclass
!= i
) continue;
198 t
= (TermEntry
*) hash_get(Texpr
, q
->expr
);
199 require(t
!=NULL
, eMsg1("genLexDescr: rexpr %s not in hash table",q
->expr
) );
200 if ( t
->token
== EpToken
) continue;
201 fprintf(dlgFile
, "%s\n\t<<\n", StripQuotes(q
->expr
));
202 /* replace " killed by StripQuotes() */
203 q
->expr
[ strlen(q
->expr
) ] = '"';
205 if ( TokenString(t
->token
) != NULL
)
206 fprintf(dlgFile
, "\t\tNLA = %s;\n", TokenString(t
->token
));
208 fprintf(dlgFile
, "\t\tNLA = %d;\n", t
->token
);
210 if ( t
->action
!= NULL
) dumpAction( t
->action
, dlgFile
, 2,-1,0,1 );
212 if ( TokenString(t
->token
) != NULL
)
213 fprintf(dlgFile
, "\t\treturn %s;\n", TokenString(t
->token
));
215 fprintf(dlgFile
, "\t\treturn (ANTLRTokenType)%d;\n", t
->token
);
217 fprintf(dlgFile
, "\t>>\n\n");
222 /* Strip the leading path (if any) from a filename */
225 StripPath( char *fileName
)
227 StripPath( fileName
)
232 static char dirSym
[2] = DirectorySymbol
;
234 if(NULL
!= (p
= strrchr(fileName
, dirSym
[0])))
242 /* Generate a list of #defines && list of struct definitions for
243 * aggregate retv's */
253 /* If C++ mode and #tokdef used, then don't need anything in here since
254 * C++ puts all definitions in the class file name.
256 if ( GenCC
&& UserTokenDefsFile
) return;
257 if ( MR_Inhibit_Tokens_h_Gen
) return;
259 DefFile
= fopen(OutMetaName(DefFileName
), "w");
260 require(DefFile
!=NULL
, eMsg1("genDefFile: cannot open %s", OutMetaName(DefFileName
)) );
262 special_fopen_actions(OutMetaName(DefFileName
)); /* MR1 */
264 fprintf(DefFile
, "#ifndef %s\n", StripPath(gate_symbol(DefFileName
)));
265 fprintf(DefFile
, "#define %s\n", StripPath(gate_symbol(DefFileName
)));
267 fprintf(DefFile
, "/* %s -- List of labelled tokens and stuff\n", DefFileName
);
268 fprintf(DefFile
, " *\n");
269 fprintf(DefFile
, " * Generated from:");
270 for (i
=0; i
<NumFiles
; i
++) fprintf(DefFile
, " %s", FileStr
[i
]);
271 fprintf(DefFile
, "\n");
272 fprintf(DefFile
, " *\n");
273 fprintf(DefFile
, " * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
274 fprintf(DefFile
, " * Purdue University Electrical Engineering\n");
275 fprintf(DefFile
, " * ANTLR Version %s\n", Version
);
276 fprintf(DefFile
, " */\n");
278 if ( !GenCC
&& LexGen
) {
279 fprintf(DefFile
,"#define zzEOF_TOKEN %d\n",
280 TokenInd
!=NULL
?TokenInd
[EofToken
]:EofToken
);
283 if ( !UserDefdTokens
)
287 if ( GenCC
) fprintf(DefFile
, "enum ANTLRTokenType {\n");
288 for (i
=1; i
<TokenNum
; i
++)
290 /* Don't do EpToken or expr w/o labels */
291 if ( TokenString(i
)!=NULL
&& i
!= EpToken
)
295 if ( WarningLevel
>1 )
298 /* look in all lexclasses for the reg expr */
300 /* MR10 Derek Pappas */
301 /* MR10 A #tokclass doesn't have associated regular expressiones */
302 /* MR10 so don't warn user about it's omission */
304 p
= (TermEntry
*) hash_get(Tname
, TokenString(i
));
306 if (p
!= NULL
&& ! p
->classname
) {
307 for (j
=0; j
<NumLexClasses
; j
++)
310 if ( ExprString(i
)!=NULL
) break;
312 if ( j
>=NumLexClasses
)
314 warnNoFL(eMsg1("token label has no associated rexpr: %s",TokenString(i
)));
318 require((p
=(TermEntry
*)hash_get(Tname
, TokenString(i
))) != NULL
,
319 "token not in sym tab when it should be");
323 if ( !first
) fprintf(DefFile
, ",\n");
325 fprintf(DefFile
, "\t%s=%d", TokenString(i
), i
);
328 fprintf(DefFile
, "#define %s %d\n", TokenString(i
), i
);
333 /* MR1 10-Apr-97 133MR1 Prevent use of varying sizes of integer */
334 /* MR1 for the enum ANTLRTokenType */
336 if ( GenCC
) { /* MR1 */
337 if ( !first
) fprintf(DefFile
, ",\n"); /* MR14 */
338 fprintf(DefFile
, "\tDLGminToken=0"); /* MR1 */
339 fprintf(DefFile
, ",\n\tDLGmaxToken=9999};\n"); /* MR1 */
343 if ( !GenCC
) GenRulePrototypes(DefFile
, SynDiag
);
345 fprintf(DefFile
, "\n#endif\n");
355 if ( strcmp(ParserName
, DefaultParserName
)!=0 )
360 f
= fopen(OutMetaName(RemapFileName
), "w");
361 require(f
!=NULL
, eMsg1("GenRemapFile: cannot open %s", OutMetaName(RemapFileName
)) );
363 special_fopen_actions(OutMetaName(RemapFileName
)); /* MR1 */
365 fprintf(f
, "/* %s -- List of symbols to remap\n", RemapFileName
);
367 fprintf(f
, " * Generated from:");
368 for (i
=0; i
<NumFiles
; i
++) fprintf(f
, " %s", FileStr
[i
]);
371 fprintf(f
, " * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
372 fprintf(f
, " * Purdue University Electrical Engineering\n");
373 fprintf(f
, " * ANTLR Version %s\n", Version
);
376 GenRuleFuncRedefs(f
, SynDiag
);
377 GenPredefinedSymbolRedefs(f
);
378 if ( GenAST
) GenASTSymbolRedefs(f
);
385 /* Generate a bunch of #defines that rename all functions to be "ParserName_func" */
388 GenRuleFuncRedefs( FILE *f
, Junction
*p
)
390 GenRuleFuncRedefs( f
, p
)
395 fprintf(f
, "\n/* rename rule functions to be 'ParserName_func' */\n");
398 fprintf(f
, "#define %s %s_%s\n", p
->rname
, ParserName
, p
->rname
);
399 p
= (Junction
*)p
->p2
;
403 /* Generate a bunch of #defines that rename all standard symbols to be
404 * "ParserName_symbol". The list of standard symbols to change is in
409 GenPredefinedSymbolRedefs( FILE *f
)
411 GenPredefinedSymbolRedefs( f
)
417 fprintf(f
, "\n/* rename PCCTS-supplied symbols to be 'ParserName_symbol' */\n");
418 for (p
= &StandardSymbols
[0]; *p
!=NULL
; p
++)
420 fprintf(f
, "#define %s %s_%s\n", *p
, ParserName
, *p
);
424 /* Generate a bunch of #defines that rename all AST symbols to be
425 * "ParserName_symbol". The list of AST symbols to change is in
430 GenASTSymbolRedefs( FILE *f
)
432 GenASTSymbolRedefs( f
)
438 fprintf(f
, "\n/* rename PCCTS-supplied AST symbols to be 'ParserName_symbol' */\n");
439 for (p
= &ASTSymbols
[0]; *p
!=NULL
; p
++)
441 fprintf(f
, "#define %s %s_%s\n", *p
, ParserName
, *p
);
445 /* redefine all sets generated by ANTLR; WARNING: 'zzerr', 'setwd' must match
446 * use in bits.c (DumpSetWd() etc...)
450 GenSetRedefs( FILE *f
)
458 for (i
=1; i
<=wordnum
; i
++)
460 fprintf(f
, "#define setwd%d %s_setwd%d\n", i
, ParserName
, i
);
462 for (i
=1; i
<=esetnum
; i
++)
464 fprintf(f
, "#define zzerr%d %s_err%d\n", i
, ParserName
, i
);
468 /* Find all return types/parameters that require structs and def
469 * all rules with ret types.
471 * This is for the declaration, not the definition.
475 GenRulePrototypes( FILE *f
, Junction
*p
)
477 GenRulePrototypes( f
, p
)
487 if ( p
->ret
!= NULL
)
489 /* MR23 */ if ( hasMultipleOperands(p
->ret
) )
491 DumpRetValStruct(f
, p
->ret
, i
);
493 fprintf(f
, "\n#ifdef __USE_PROTOS\n");
494 /* MR23 */ if ( hasMultipleOperands(p
->ret
) )
496 fprintf(f
, "extern struct _rv%d", i
);
500 fprintf(f
, "extern ");
503 fprintf(f
, " %s%s(", RulePrefix
, p
->rname
);
504 DumpANSIFunctionArgDef(f
,p
,1 /* emit initializers ? */);
506 fprintf(f
, "#else\n");
507 /* MR23 */ if ( hasMultipleOperands(p
->ret
) )
509 fprintf(f
, "extern struct _rv%d", i
);
513 fprintf(f
, "extern ");
516 fprintf(f
, " %s%s();\n", RulePrefix
, p
->rname
);
517 fprintf(f
, "#endif\n");
521 fprintf(f
, "\n#ifdef __USE_PROTOS\n");
522 fprintf(f
, "void %s%s(", RulePrefix
, p
->rname
);
523 DumpANSIFunctionArgDef(f
,p
, 1 /* emit initializers ? */ );
526 if ( p
->pdecl
!= NULL
|| GenAST
)
529 fprintf(f
, "AST **%s",(p
->pdecl
!=NULL
)?",":"");
531 if ( p
->pdecl
!=NULL
) fprintf(f
, "%s", p
->pdecl
);
533 else fprintf(f
, "void");
536 fprintf(f
, "#else\n");
537 fprintf(f
, "extern void %s%s();\n", RulePrefix
, p
->rname
);
538 fprintf(f
, "#endif\n");
541 p
= (Junction
*)p
->p2
;
545 /* Define all rules in the class.h file; generate any required
546 * struct definitions first, however.
550 GenRuleMemberDeclarationsForCC( FILE *f
, Junction
*q
)
552 GenRuleMemberDeclarationsForCC( f
, q
)
560 fprintf(f
, "private:\n");
562 /* Dump dflt handler declaration */
563 fprintf(f
, "\tvoid zzdflthandlers( int _signal, int *_retsignal );\n\n");
565 fprintf(f
, "public:\n");
567 /* Dump return value structs */
571 if ( p
->ret
!= NULL
)
573 /* MR23 */ if ( hasMultipleOperands(p
->ret
) )
575 DumpRetValStruct(f
, p
->ret
, i
);
579 p
= (Junction
*)p
->p2
;
582 /* Dump member func defs && CONSTRUCTOR */
583 fprintf(f
, "\t%s(ANTLRTokenBuffer *input);\n", CurrentClassName
);
585 fprintf(f, "\t%s(ANTLRTokenBuffer *input, ANTLRTokenType eof);\n",
593 if ( p
->ret
!= NULL
)
595 /* MR23 */ if ( hasMultipleOperands(p
->ret
) )
597 fprintf(f
, "\tstruct _rv%d", i
);
604 fprintf(f
, " %s%s(",RulePrefix
,p
->rname
);
605 DumpANSIFunctionArgDef(f
,p
, 1 /* emit initializers ? */ );
608 if ( p
->pdecl
!= NULL
|| GenAST
)
610 if ( GenAST
) fprintf(f
, "ASTBase **%s",(p
->pdecl
!=NULL
)?",":"");
611 if ( p
->pdecl
!=NULL
) fprintf(f
, "%s", p
->pdecl
);
618 fprintf(f
, "\tvoid %s%s(",RulePrefix
,p
->rname
);
619 DumpANSIFunctionArgDef(f
,p
, 1 /* emit initializers ? */);
622 if ( p
->pdecl
!= NULL
|| GenAST
)
624 if ( GenAST
) fprintf(f
, "ASTBase **%s",(p
->pdecl
!=NULL
)?",":"");
625 if ( p
->pdecl
!=NULL
) fprintf(f
, "%s", p
->pdecl
);
631 p
= (Junction
*)p
->p2
;
635 /* Given a list of ANSI-style parameter declarations, print out a
636 * comma-separated list of the symbols (w/o types).
637 * Basically, we look for a comma, then work backwards until start of
638 * the symbol name. Then print it out until 1st non-alnum char. Now,
639 * move on to next parameter.
643 /* MR5 Jan Mikkelsen 26-May-97 - added initalComma parameter */
647 DumpListOfParmNames(char *pdecl
, FILE *output
, int initialComma
) /* MR5 */
649 DumpListOfParmNames(pdecl
, output
, initialComma
) /* MR5 */
650 char *pdecl
; /* MR5 */
651 FILE *output
; /* MR5 */
652 int initialComma
; /* MR5 */
655 int firstTime
= 1, done
= 0;
656 require(output
!=NULL
, "DumpListOfParmNames: NULL parm");
658 if ( pdecl
== NULL
) return;
661 if ( !firstTime
|| initialComma
) putc(',', output
); /* MR5 */
662 done
= DumpNextNameInDef(&pdecl
, output
);
667 /* given a list of parameters or return values, dump the next
668 * name to output. Return 1 if last one just printed, 0 if more to go.
671 /* MR23 Total rewrite */
675 DumpNextNameInDef( char **q
, FILE *output
)
677 DumpNextNameInDef( q
, output
)
699 /* MR26 Handle rule arguments such as: IIR_Bool (IIR_Decl::*contstraint)()
700 For this we need to strip off anything which follows the symbol.
703 /* MR26 */ t
= pSymbol
;
704 /* MR26 */ if (t
!= NULL
) {
705 /* MR26 */ for (t
= pSymbol
; *t
!= 0; t
++) {
706 /* MR26 */ if (! (isalpha(*t
) || isdigit(*t
) || *t
== '_' || *t
== '$')) break;
709 /* MR26 */ fprintf(output
,strBetween(pSymbol
, t
, pSeparator
));
712 return (*pSeparator
== 0);
715 /* Given a list of ANSI-style parameter declarations, dump K&R-style
716 * declarations, one per line for each parameter. Basically, convert
717 * comma to semi-colon, newline.
721 DumpOldStyleParms( char *pdecl
, FILE *output
)
723 DumpOldStyleParms( pdecl
, output
)
728 require(output
!=NULL
, "DumpOldStyleParms: NULL parm");
730 if ( pdecl
== NULL
) return;
731 while ( *pdecl
!= '\0' )
736 putc(';', output
); putc('\n', output
);
737 while ( *pdecl
==' ' || *pdecl
=='\t' || *pdecl
=='\n' ) pdecl
++;
739 else {putc(*pdecl
, output
); pdecl
++;}
745 /* Take in a type definition (type + symbol) and print out type only */
746 /* MR23 Total rewrite */
750 DumpType( char *s
, FILE *f
)
765 require(s
!=NULL
, "DumpType: invalid type string");
774 fprintf(f
,strBetween(pDataType
, pSymbol
, pSeparator
));
777 /* check to see if string e is a word in string s */
780 strmember( char *s
, char *e
)
788 require(s
!=NULL
&&e
!=NULL
, "strmember: NULL string");
790 if ( *e
=='\0' ) return 1; /* empty string is always member */
792 while ( *s
!='\0' && !isalnum(*s
) && *s
!='_' )
795 while ( *p
!='\0' && *p
==*s
) {p
++; s
++;}
797 if ( *s
=='\0' ) return 1;
798 if ( !isalnum (*s
) && *s
!= '_' ) return 1;
800 while ( isalnum(*s
) || *s
== '_' )
802 } while ( *s
!='\0' );
808 /* MR23 Replaced by hasMultipleOperands() */
819 if ( *s
++ == ',' ) return 1;
825 /* MR23 Total rewrite */
829 DumpRetValStruct( FILE *f
, char *ret
, int i
)
831 DumpRetValStruct( f
, ret
, i
)
845 fprintf(f
, "\nstruct _rv%d {\n", i
);
846 while (*p
!= 0 && nest
== 0) {
855 fprintf(f
,strBetween(pDataType
, pSymbol
, pSeparator
));
857 fprintf(f
,strBetween(pSymbol
, pEqualSign
, pSeparator
));
863 /* given "s" yield s -- DESTRUCTIVE (we modify s if starts with " else return s) */
866 StripQuotes( char *s
)
874 s
[ strlen(s
)-1 ] = '\0'; /* remove last quote */
875 return( s
+1 ); /* return address past initial quote */