extern void cmd_exit (struct vty *vty);
extern int cmd_list_cmds (struct vty *vty, int do_permute);
+ /* NOT safe for general use; call this only if DEV_BUILD! */
+ extern void grammar_sandbox_init (void);
+
/* memory management for cmd_token */
-struct cmd_token *
-new_cmd_token (enum cmd_token_type, u_char attr, char *, char *);
-void
-del_cmd_token (struct cmd_token *);
-struct cmd_token *
-copy_cmd_token (struct cmd_token *);
+extern struct cmd_token *new_cmd_token (enum cmd_token_type, u_char attr,
+ const char *text, const char *desc);
+extern void del_cmd_token (struct cmd_token *);
+extern struct cmd_token *copy_cmd_token (struct cmd_token *);
+ extern vector completions_to_vec (struct list *completions);
extern void command_parse_format (struct graph *graph, struct cmd_element *cmd);
/* Export typical functions. */
/* bison declarations */
void
- cmd_yyerror (struct parser_ctx *ctx, char const *msg);
-
- /* subgraph semantic value */
- struct subgraph {
- struct graph_node *start, *end;
- };
+ cmd_yyerror (CMD_YYLTYPE *locp, struct parser_ctx *ctx, char const *msg);
/* helper functions for parser */
- static char *
+ static const char *
doc_next (struct parser_ctx *ctx);
static struct graph_node *
static struct graph_node *
new_token_node (struct parser_ctx *,
enum cmd_token_type type,
- char *text,
- char *doc);
+ const char *text,
+ const char *doc);
static void
- terminate_graph (struct parser_ctx *ctx,
+ terminate_graph (CMD_YYLTYPE *locp, struct parser_ctx *ctx,
struct graph_node *);
static void
| placeholder_token
;
- compound_token:
- selector
- | option
- ;
-
literal_token: WORD
{
- $$ = new_token_node (ctx, WORD_TKN, strdup($1), doc_next(ctx));
+ $$ = new_token_node (ctx, WORD_TKN, $1, doc_next(ctx));
free ($1);
}
;