Support %define "KEY" {VALUE}.

* src/scan-code.h, src/scan-code.l (translate_action)
(translate_rule_action, translate_symbol_action, translate_code):
Return char *, not const char *.
* src/parse-gram.y (declaration): Rename as...
(prologue_declaration): this.
(string_content): Remove this nonterminal, use STRING.
(braceless, content, content.opt): New nonterminal.
Use them.
(%define): Now accept content.opt, i.e., accept also BRACED_CODE
as value.
* src/scan-gram.l (getargs.h): Don't include it.
This commit is contained in:
Akim Demaille
2006-07-13 08:12:00 +00:00
parent db7e5eb5ef
commit 2ce4ed68c9
7 changed files with 488 additions and 461 deletions

View File

@@ -35,13 +35,13 @@ void code_scanner_free (void);
/* The action of the rule R contains $$, $1 etc. referring to the values
of the rule R. */
const char *translate_rule_action (symbol_list *r);
char *translate_rule_action (symbol_list *r);
/* The action A refers to $$ and @$ only, referring to a symbol. */
const char *translate_symbol_action (const char *a, location l);
char *translate_symbol_action (const char *a, location l);
/* The action contains no special escapes, just protect M4 special
symbols. */
const char *translate_code (const char *a, location l);
char *translate_code (const char *a, location l);
#endif /* !SCAN_CODE_H_ */