diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-05-14 13:16:37 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-05-14 13:16:37 +0000 |
commit | c3df0bf5f64241cb7ea00c1894da7f81e055a2aa (patch) | |
tree | 2a698dae997c076077b1ad7476d6576c0f89db12 /src/gram.y | |
parent | 60f99611aee975bcd0710c59e32e8c2a13154603 (diff) | |
download | gdbm-c3df0bf5f64241cb7ea00c1894da7f81e055a2aa.tar.gz gdbm-c3df0bf5f64241cb7ea00c1894da7f81e055a2aa.tar.bz2 |
Provide "open" and "close" commands; implement new variables.
* src/datconv.c (datum_format): Don't print field delimiter
after the last field.
(dsprint): Bugfix.
* src/gdbmload.c (gdbm_load_from_file): Return GDBM_NO_DBNAME
when loading from bdb dump and the database pointer is NULL.
* src/gdbmtool.c (opendb, checkdb): New auxiliary functions.
(begin handlers): call checkdb.
(import_handler): Special handling for GDBM_NO_DBNAME.
(status_handler): Print more info.
(command_tab): Call checkdb prior to handlers that expect an
open database.
New commands: open, close
(gdbmarg_string, gdbmarg_datum)
(gdbmarg_kvpair): Take pointer to locus as the 2nd argument.
All uses changed.
(coerce): Include locus info in the diagnostic message.
(main): Don't open database right away.
* src/gdbmtool.h (GDBMTOOL_DEFFILE): New define.
(gdbmarg) <loc>: New member.
(VART_INT): New variable typ.e
(VAR_ERR_FAILURE): New error code.
(variable_is_set, varible_mode_name): New protos.
* src/gram.y: Provide printable token names for error messages.
Pass locus to gdbmarg initialization functions.
* src/lex.l (vparse_error): Fix output.
* src/var.c (variable) <v.num, hook, hook_data>: New members.
(vartab): Define more variables.
(variable_set): Accept value of any valid datatype.
(variable_mode_name, variable_is_set): New functions.
Diffstat (limited to 'src/gram.y')
-rw-r--r-- | src/gram.y | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -27,10 +27,14 @@ struct dsegm *dsdef[DS_MAX]; %locations %token <type> T_TYPE -%token T_OFF T_PAD T_DEF T_SET T_BOGUS -%token <cmd> T_CMD -%token <num> T_NUM -%token <string> T_IDENT T_WORD +%token T_OFF "off" + T_PAD "pad" + T_DEF "define" + T_SET "set" + T_BOGUS +%token <cmd> T_CMD "command verb" +%token <num> T_NUM "number" +%token <string> T_IDENT "identifier" T_WORD "word" %type <string> string %type <arg> arg %type <arglist> arglist arg1list @@ -116,11 +120,11 @@ arg1list : arg arg : string { - $$ = gdbmarg_string ($1); + $$ = gdbmarg_string ($1, &@1); } | compound { - $$ = gdbmarg_kvpair ($1); + $$ = gdbmarg_kvpair ($1, &@1); } ; |