aboutsummaryrefslogtreecommitdiff
path: root/src/gram.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/gram.y')
-rw-r--r--src/gram.y29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/gram.y b/src/gram.y
index 810eba3..af0093e 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -27,10 +27,11 @@ struct dsegm *dsdef[DS_MAX];
%locations
%token <type> T_TYPE
-%token T_OFF T_PAD T_DEF T_SET
+%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
-%type <string> string verb
+%type <string> string
%type <arg> arg
%type <arglist> arglist arg1list
%type <dsegm> def
@@ -51,6 +52,7 @@ struct dsegm *dsdef[DS_MAX];
struct datadef *type;
struct dsegm *dsegm;
struct { struct dsegm *head, *tail; } dsegmlist;
+ struct command *cmd;
}
%%
@@ -64,7 +66,7 @@ stmtlist : stmt
;
stmt : /* empty */ '\n'
- | verb arglist '\n'
+ | T_CMD arglist '\n'
{
if (run_command ($1, &$2) && !interactive)
exit (EXIT_USAGE);
@@ -72,6 +74,16 @@ stmt : /* empty */ '\n'
}
| set '\n'
| defn '\n'
+ | T_BOGUS '\n'
+ {
+ if (interactive)
+ {
+ yyclearin;
+ yyerrok;
+ }
+ else
+ YYERROR;
+ }
| error { end_def(); } '\n'
{
if (interactive)
@@ -84,9 +96,6 @@ stmt : /* empty */ '\n'
}
;
-verb : T_IDENT
- ;
-
arglist : /* empty */
{
gdbmarglist_init (&$$, NULL);
@@ -166,14 +175,6 @@ slist : string
string : T_IDENT
| T_WORD
- | T_DEF
- {
- $$ = estrdup ("def");
- }
- | T_SET
- {
- $$ = estrdup ("set");
- }
;
defn : T_DEF defid { begin_def (); } '{' deflist optcomma '}'

Return to:

Send suggestions and report system problems to the System administrator.