/* Copyright (c) 1982 Regents of the University of California */
static char sccsid[] = "@(#)commands.y 1.11 (Berkeley) %G%";
* Yacc grammar for debugger commands.
private String curformat = "X";
ALIAS AND ASSIGN AT CALL CATCH CONT DEBUG DELETE DIV DOWN DUMP
EDIT FILE FUNC GRIPE HELP IF IGNORE IN LIST MOD NEXT NEXTI NIL NOT OR
PRINT PSYM QUIT RERUN RETURN RUN SH SKIP SOURCE STATUS STEP STEPI
STOP STOPI TRACE TRACEI UP
USE WHATIS WHEN WHERE WHEREIS WHICH
%term INT REAL NAME STRING
%term LFORMER RFORMER ABSTRACTION ARROW
%binary '<' '=' '>' '!' IN
%left '*' '/' DIV MOD AND
%left NOT '(' '[' '.' '^' ARROW
%type <y_string> STRING redirectout filename opt_filename mode
%type <y_name> ALIAS AND ASSIGN AT CALL CATCH CONT
%type <y_name> DEBUG DELETE DIV DOWN DUMP
%type <y_name> EDIT FILE FUNC GRIPE HELP IF IGNORE IN LIST MOD
%type <y_name> NEXT NEXTI NIL NOT OR
%type <y_name> PRINT PSYM QUIT RERUN RETURN RUN SH SKIP SOURCE STATUS
%type <y_name> STEP STEPI STOP STOPI TRACE TRACEI
%type <y_name> UP USE WHATIS WHEN WHERE WHEREIS WHICH
%type <y_name> name NAME keyword
%type <y_node> opt_qual_symbol symbol
%type <y_node> command rcommand cmd step what where examine
%type <y_node> event opt_exp_list opt_cond
%type <y_node> exp_list exp term boolean_exp constant address
%type <y_node> integer_list alias_command list_command line_number
%type <y_node> search_command pattern
%type <y_cmdlist> actions
%type <y_list> sourcepath
if(debug_flag[2]) {dumptree(stderr,$1); fflush (stderr);}
if(debug_flag[2]) {dumptree(stderr,$1); fflush (stderr);}
if(debug_flag[2]) {dumptree(stderr,$1); fflush (stderr);}
* Non-redirectable commands.
$$ = build(O_ASSIGN, $2, $4);
$$ = build(O_CONT, (long) DEFSIG);
$$ = build(O_DELETE, $2);
$$ = build(O_DOWN, build(O_LCON, (long) 1));
$$ = build(O_DOWN, build(O_LCON, (long) $2));
EDIT shellmode opt_filename
FILE shellmode opt_filename
$$ = build(O_CHFILE, $3);
$$ = build(O_IGNORE, $2);
$$ = build(O_RETURN, nil);
$$ = build(O_RETURN, $2);
SOURCE shellmode filename
$$ = build(O_SOURCE, $3);
$$ = build($1, nil, $2, $3);
$$ = build($1, $2, nil, $3);
$$ = build($1, nil, nil, $3);
trace what where opt_cond
$$ = build($1, $2, $3, $4);
$$ = build($1, nil, $2, $3);
$$ = build($1, $2, nil, $3);
$$ = build($1, nil, nil, $2);
$$ = build(O_UP, build(O_LCON, (long) 1));
$$ = build(O_UP, build(O_LCON, (long) $2));
if (list_size($3) == 0) {
foreach (String, dir, sourcepath)
foreach (String, dir, sourcepath)
list_delete(list_curitem(sourcepath), sourcepath);
$$ = build(O_WHATIS, $2);
WHEN event '{' actions '}'
$$ = build(O_ADDEVENT, $2, $4);
$$ = build(O_WHEREIS, $2);
$$ = build(O_SEARCH, build(O_LCON, 1), $2);
$$ = build(O_SEARCH, build(O_LCON, 0), $2);
$$ = build(O_STEP, true, false);
$$ = build(O_STEP, false, false);
$$ = build(O_STEP, true, true);
$$ = build(O_STEP, false, true);
list_append(list_item(ident($2)), nil, $$);
CALL term '(' opt_exp_list ')'
$$ = build(O_CALL, $2, $4);
$$ = build(O_ALIAS, build(O_NAME, $2), build(O_NAME, $3));
$$ = build(O_ALIAS, build(O_NAME, $2), nil);
$$ = build(O_ALIAS, nil, nil);
$$ = build(O_QLINE, build(O_SCON, $1), $3);
$$ = build(O_QLINE, build(O_SCON, cursource), $2);
AT STRING ':' line_number
$$ = build(O_QLINE, build(O_SCON, $2), $4);
build(O_LCON, (long) cursrcline),
build(O_LCON, (long) cursrcline + 9)
$$ = build(O_LIST, $2, $2);
LIST line_number ',' line_number
$$ = build(O_LIST, $2, $4);
$$ = build(O_COMMA, build(O_LCON, $1), $2);
$$ = build(O_LCON, (long) LASTLINE);
$$ = build(O_EXAMINE, $4, $1, nil, $3);
address ',' address '/' mode
$$ = build(O_EXAMINE, $5, $1, $3, 0);
$$ = build(O_EXAMINE, $3, build(O_LCON, (long) prtaddr), nil, $2);
$$ = build(O_EXAMINE, $3, $1, nil, 0);
$$ = build(O_ADD, $1, $3);
$$ = build(O_SUB, $1, $3);
$$ = build(O_MUL, $1, $3);
'*' address %prec UNARYSIGN
$$ = build(O_COMMA, $1, nil);
$$ = build(O_COMMA, $1, $3);
$$ = build(O_TYPERENAME, $1, $3);
$$ = build(O_ADD, $1, $3);
$$ = build(O_SUB, $1, $3);
$$ = build(O_MUL, $1, $3);
$$ = build(O_DIVF, $1, $3);
$$ = build(O_DIV, $1, $3);
$$ = build(O_MOD, $1, $3);
$$ = build(O_AND, $1, $3);
$$ = build(O_OR, $1, $3);
$$ = build(O_LT, $1, $3);
$$ = build(O_LE, $1, $4);
$$ = build(O_GT, $1, $3);
$$ = build(O_GE, $1, $4);
$$ = build(O_EQ, $1, $3);
$$ = build(O_EQ, $1, $4);
$$ = build(O_NE, $1, $4);
$$ = build(O_NE, $1, $4);
'*' '(' exp ')' %prec UNARYSIGN
'#' '(' exp ')' %prec UNARYSIGN
term '(' opt_exp_list ')'
$$ = build(O_CALL, $1, $3);
$$ = build(O_SYM, which($1));
$$ = dot(build(O_SYM, program), $2);
ALIAS | AND | ASSIGN | AT | CALL | CATCH | CONT | DEBUG | DELETE | DIV |
DOWN | DUMP | EDIT | FILE | FUNC | GRIPE | HELP | IGNORE | IN | LIST |
MOD | NEXT | NEXTI | NIL | NOT | OR | PRINT | PSYM | QUIT |
RERUN | RETURN | RUN | SH | SKIP | SOURCE | STATUS | STEP | STEPI |
STOP | STOPI | TRACE | TRACEI | UP |
USE | WHATIS | WHEN | WHERE | WHEREIS | WHICH