964 |
} |
} |
965 |
|
|
966 |
|
|
967 |
|
|
968 |
|
/*---------------------------------. |
969 |
|
| Parse a double quoted parameter. | |
970 |
|
`---------------------------------*/ |
971 |
|
|
972 |
|
static const char * |
973 |
|
parse_dquoted_param (const char *from) |
974 |
|
{ |
975 |
|
struct obstack param_obstack; |
976 |
|
const char *param = NULL; |
977 |
|
int c; |
978 |
|
|
979 |
|
obstack_init (¶m_obstack); |
980 |
|
c = skip_white_space (); |
981 |
|
|
982 |
|
if (c != '"') |
983 |
|
{ |
984 |
|
complain (_("invalid %s declaration"), from); |
985 |
|
ungetc (c, finput); |
986 |
|
skip_to_char ('%'); |
987 |
|
return NULL; |
988 |
|
} |
989 |
|
|
990 |
|
for (;;) |
991 |
|
{ |
992 |
|
if (literalchar (NULL, &c, '\"')) |
993 |
|
obstack_1grow (¶m_obstack, c); |
994 |
|
else |
995 |
|
break; |
996 |
|
} |
997 |
|
|
998 |
|
obstack_1grow (¶m_obstack, '\0'); |
999 |
|
param = obstack_finish (¶m_obstack); |
1000 |
|
|
1001 |
|
if (c != '"' || strlen (param) == 0) |
1002 |
|
{ |
1003 |
|
complain (_("invalid %s declaration"), from); |
1004 |
|
if (c != '"') |
1005 |
|
ungetc (c, finput); |
1006 |
|
skip_to_char ('%'); |
1007 |
|
return NULL; |
1008 |
|
} |
1009 |
|
|
1010 |
|
return param; |
1011 |
|
} |
1012 |
|
|
1013 |
/*----------------------------------. |
/*----------------------------------. |
1014 |
| Parse what comes after %skeleton. | |
| Parse what comes after %skeleton. | |
1015 |
`----------------------------------*/ |
`----------------------------------*/ |
1017 |
void |
void |
1018 |
parse_skel_decl (void) |
parse_skel_decl (void) |
1019 |
{ |
{ |
1020 |
/* Complete with parse_dquoted_param () on the CVS branch 1.29. */ |
skeleton = parse_dquoted_param ("%skeleton"); |
1021 |
} |
} |
1022 |
|
|
1023 |
/*----------------------------------------------------------------. |
/*----------------------------------------------------------------. |