2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998, 2000 University of Maryland at College Park
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of U.M. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. U.M. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Authors: the Amanda Development Team. Its members are listed in a
24 * file named AUTHORS, in the root directory of this distribution.
27 * $Id: uparse.y,v 1.2 2006/05/25 01:47:13 johnfranks Exp $
29 * parser for amrecover interactive language
33 #include "amrecover.h"
35 void yyerror(char *s);
36 extern int yylex(void);
49 /* literal keyword tokens */
51 %token LISTHOST LISTDISK SETHOST SETDISK SETDATE SETTAPE SETMODE
52 %token CD CDX QUIT DHIST LS ADD ADDX EXTRACT
53 %token LIST DELETE DELETEX PWD CLEAR HELP LCD LPWD MODE SMB TAR
76 char * errstr = vstralloc("Invalid command: ", yytext, NULL);
80 } /* Quiets compiler warnings about unused label */
84 LISTHOST { list_host(); }
85 | LISTDISK PATH { list_disk($2); amfree($2); }
86 | LISTDISK { list_disk(NULL); }
87 | SETDATE DATE { set_date($2); amfree($2); }
88 | SETHOST PATH { set_host($2); amfree($2); }
89 | SETDISK PATH PATH { set_disk($2, $3); amfree($2); amfree($3); }
90 | SETDISK PATH { set_disk($2, NULL); amfree($2); }
91 | SETTAPE PATH { set_tape($2); amfree($2); }
92 | SETTAPE { set_tape(""); }
93 | CD PATH { cd_glob($2); amfree($2); }
94 | CDX PATH { cd_regex($2); amfree($2); }
97 set_mode(SAMBA_SMBCLIENT);
98 #endif /* SAMBA_CLIENT */
103 #endif /* SAMBA_CLIENT */
108 DHIST { list_disk_history(); }
109 | LS { list_directory(); }
110 | LIST PATH { display_extract_list($2); amfree($2); }
111 | LIST { display_extract_list(NULL); }
112 | PWD { show_directory(); }
113 | CLEAR { clear_extract_list(); }
114 | MODE { show_mode (); }
126 add_path PATH { add_glob($2); amfree($2); }
127 | PATH { add_glob($1); amfree($1); }
135 addx_path PATH { add_regex($2); amfree($2); }
136 | PATH { add_regex($1); amfree($1); }
144 delete_path PATH { delete_glob($2); amfree($2); }
145 | PATH { delete_glob($1); amfree($1); }
153 deletex_path PATH { delete_regex($2); amfree($2); }
154 | PATH { delete_regex($1); amfree($1); }
158 LPWD { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
166 HELP { help_list(); }
170 EXTRACT { extract_files(); }
173 /* ADDITIONAL C CODE */