mmsp_yacc.y revision cee0fb94c0d4227de0a00efc162fb2739844b641
%{
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* A parser for MMS protocols
* This parser is called by "mms_parse()".
*
*
* NAME
*
* Parser for MMP.
*
* SYNOPSIS
*
* libpar.a - library of parser functions.
*
* #include <mms_list.h>
* #include <mms_parser.h>
*
* int mms_mmp_parse(mms_par_node_t **cmd_node,
* void (*input_func)(char *buf, int *result, int max,
* void *callback_parm),
* mms_list_t *err_list,
* void *callback_parm);
*
* void mms_pn_destroy(mms_par_node_t *cmd_node);
*
* void mms_pe_destroy(mms_list_t *err_list);
*
*
* DESCRIPTION
*
* mms_mmp_parse parses an MMP command in XML form and constructs a parse tree.
*
*
* mms_par_node_t **cmd_node
* cmd_node specify the mms_address of a pointer to the root of the
* parse tree. mms_mmp_parse will put the mms_address of the root node
* in pointer.
*
* After processing the parse tree, mms_pn_destroy() must be called
* to delete resources allocated where the command was parsed.
*
* void (*input_func)(char *buf, int *result, int max, void *callback_parm)
* specifies a function that the parser will call when it needs more
* input. input_func() should put additional data into buf. The number
* of bytes should not be more than the value in max. The number of
* bytes is returned in *result. callback_parm is the callback_parm passed
* to mms_mmp_parse.
* If there is no more data, *result should be set to 0.
*
* mms_list_t *err_list
* specifies the mms_address of a mms_list_t
* which holds a list of mms_par_err_t.
* The parser will add mms_par_err_t to the list when it discovers errors.
* The definition of mms_par_err_t is:
*
* typedef struct mms_par_err {
* mms_list_node_t pe_next;
* int pe_code;
* int pe_line;
* int pe_col;
* char *pe_token;
* char *pe_msg;
* } mms_par_err_t;
*
* pe_code has the following values:
*
* MMS_PE_NOMEM 1 - no memory
* MMS_PE_SYNTAX 2 - Syntax error
* MMS_PE_MAX_LEVEL 3 - max level reached
* MMS_PE_INVAL_CALLBACK 4 - bad return value
* MMS_PE_USERABORT 5 - User abort
*
*
* pe_line, pe_col and pe_token indicate the location
* and the token near where the error occured.
*
* mms_pe_msg is the error message. If the error was MMS_PE_NOMEM,
* mms_pe_msg may be NULL because the parser was unable to obtain
* memory to store the message.
*
* It is up to the caller to print and examine the mms_par_err_t.
*
* After the parse tree is processed, mms_pe_destroy() must be
* called to remove the resource allocated for errors.
*
* void *callback_parm
* specifies the arguement that should be passed to the callback function.
* If no callback arguement is needed or if no callback processing
* is required, specify NULL.
*
* Return value
* mms_mmp_parse returns 0 is ther is no error, returns 1 if the parser
* entered an error, the error code is in mms_par_err_t and returns -1
* if mms_mmp_parse was unable to allocate memory for a work area.
*
* Parse Tree
* The parser discards the prolog of the XML file. The root of the
* parse tree is the root element of the XML file. Arguements to a
* command, clause and operations are stored in the arglist of the node.
*
*/
#include <thread.h>
#include <synch.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <strings.h>
#include <sys/int_types.h>
#include <mms_sym.h>
#include "mms_list.h"
#include "mms_parser.h"
#include "mms_par_impl.h"
#define YYPARSE_PARAM wka
#define YYLEX_PARAM wka
#define YYERROR_VERBOSE 1
#define YYSTYPE mms_stype_t
#define mms_mmsp_error(msg) { \
YYABORT; \
} \
}
/*
* The symbol table will be sorted in ascending order when the parser
* is initialized. There is no need to add new symbols in any particular order.
*/
mms_sym_t mms_sym_tab[] = {
"setpassword", SETPASSWORD,
"oldpassword", OLDPASSWORD,
"name", NAME,
"identity", IDENTITY,
"online", ONLINE,
"offline", OFFLINE,
"event", EVENT,
"newdrive", NEWDRIVE,
"newcartridge", NEWCARTRIDGE,
"request", REQUEST,
"cartridge", CARTRIDGE,
"volume", VOLUME,
"application", APPLICATION,
"global", GLOBAL,
"user", USER,
"direct", DIRECT,
"data", DATA,
"volumeid", VOLUMEID,
"filename", FILENAME,
"blocksize", BLOCKSIZE,
"retention", RETENTION,
"msgfile", MSGFILE,
"filesequence", FILESEQUENCE,
"bay", BAY,
"where", WHERE,
"CLEAN", CLEAN,
"signature", SIGNATURE,
"physicalunmount", PHYSICALUNMOUNT,
"unmount", UNMOUNT,
"from", FROM,
"to", TO,
"priority", PRIORITY,
"disconnected", DISCONNECTED,
"present", PRESENT,
"broken", BROKEN,
"response", RESPONSE,
"hello", HELLO,
"tag", TAG,
"alert", ALERT,
"warning", WARNING,
"who", WHO,
"operator", OPERATOR,
"notice", NOTICE,
"severity", SEVERITY,
"debug", DEBUG,
"log", LOG,
"emergency", EMERGENCY,
"critical", CRITICAL,
"information", INFORMATION,
"developer", DEVELOPER,
"get", GET,
"none", NONE,
"ansilabel", ANSILABEL,
"stale", STALE,
"drivehandle", DRIVEHANDLE,
"drive", DRIVE_CL,
"whichtask", WHICHTASK,
"partition", PARTITION,
"modename", MODENAME,
"caplist", CAPLIST,
"scope", SCOPE,
"bitformat", BITFORMAT,
"group", GROUP,
"cap", CAP,
"mountpoint", MOUNTPOINT,
"shapepriority", SHAPEPRIORITY,
"densitypriority", DENSITYPRIORITY,
"enable", ENABLE,
"disable", DISABLE,
"reserve", RESERVE,
"release", RELEASE,
"force", FORCE,
"restart", RESTART,
"nonewapps", NONEWAPPS,
"nonewmounts", NONEWMOUNTS,
"abortqueue", ABORTQUEUE,
"level", LEVEL,
"standard", STANDARD,
"administrator", ADMINISTRATOR,
"system", SYSTEM_PRIV,
"sort", SORT,
"slotgroup", SLOTGROUP,
"slot", SLOT,
"abort", ABORT,
"cartid", CARTID,
"cart", CART,
"all", ALL,
"fromslot", FROMSLOT,
"toslot", TOSLOT,
"partial", PARTIAL,
"full", FULL,
"AI", AI,
"APPLICATION", APPLICATION,
"BAY", BAY,
"CARTRIDGE", CARTRIDGE,
"CARTRIDGEGROUP", CARTRIDGEGROUP,
"CARTRIDGEGROUPAPPLICATION", CARTRIDGEGROUPAPPLICATION,
"CARTRIDGETYPE", CARTRIDGETYPE,
"CONNECTION", CONNECTION,
"DM", DM,
"DMBITFORMAT", DMBITFORMAT,
"DMBITFORMATTOKEN", DMBITFORMATTOKEN,
"DMCAPABILITY", DMCAPABILITY,
"DMCAPABILITYDEFAULTTOKEN", DMCAPABILITYDEFAULTTOKEN,
"DMCAPABILITYGROUP", DMCAPABILITYGROUP,
"DMCAPABILITYGROUPTOKEN", DMCAPABILITYGROUPTOKEN,
"DMCAPABILITYTOKEN", DMCAPABILITYTOKEN,
"DMP", DMP,
"DRIVE", DRIVE,
"DRIVECARTRIDGEACCESS", DRIVECARTRIDGEACCESS,
"DRIVECARTRIDGEERROR", DRIVECARTRIDGEERROR,
"DRIVEGROUP", DRIVEGROUP,
"DRIVEGROUPAPPLICATION", DRIVEGROUPAPPLICATION,
"FIRST", FIRST,
"LAST", LAST,
"LIBRARY", LIBRARY,
"LM", LM,
"LMP", LMP,
"MESSAGE", MESSAGE,
"MMP", MMP,
"MOUNTLOGICAL", MOUNTLOGICAL,
"MOUNTPHYSICAL", MOUNTPHYSICAL,
"NOTIFY", NOTIFY,
"PARTITION", PARTITION,
"REQUEST", REQUEST,
"SESSION", SESSION,
"SIDE", SIDE,
"SLOT", SLOT_OBJ,
"SLOTCONFIG", SLOTCONFIG,
"SLOTGROUP", SLOTGROUP,
"SLOTTYPE", SLOTTYPE,
"STALEHANDLE", STALEHANDLE,
"SYSTEM", SYSTEM,
"TASK", TASK,
"TASKCARTRIDGE", TASKCARTRIDGE,
"TASKDRIVE", TASKDRIVE,
"TASKLIBRARY", TASKLIBRARY,
"VOLUME", VOLUME,
"message", MESSAGE,
"accessmode", ACCESSMODE,
"and", AND,
"arg", ARG,
"attr", ATTR,
"bigendian", BIGENDIAN,
"block", BLOCK,
"blocking", BLOCKING,
"certificate", CERTIFICATE,
"client", CLIENT,
"false", FALSE,
"firstmount", FIRSTMOUNT,
"immediate", IMMEDIATE,
"instance", INSTANCE,
"isattr", ISATTR,
"isset", ISSET,
"notset", NOTSET,
"language", LANGUAGE,
"littleendian", LITTLEENDIAN,
"match", MATCH,
"name", NAME,
"namevalue", NAMEVALUE,
"newvolname", NEWVOLNAME,
"noattr", NOATTR,
"not", NOT,
"hosteq", HOSTEQ,
"hostne", HOSTNE,
"timeeq", TIMEEQ,
"timene", TIMENE,
"timelt", TIMELT,
"timele", TIMELE,
"timegt", TIMEGT,
"timege", TIMEGE,
"number", NUMBER,
"numeq", NUMEQ,
"numge", NUMGE,
"numgt", NUMGT,
"numhilo", NUMHILO,
"numle", NUMLE,
"numlohi", NUMLOHI,
"numlt", NUMLT,
"numne", NUMNE,
"object", OBJECT,
"action", ACTION,
"or", OR,
"order", ORDER,
"password", PASSWORD,
"range", RANGE,
"regex", REGEX,
"report", REPORT,
"reportmode", REPORTMODE,
"set", SET,
"streq", STREQ,
"strge", STRGE,
"strgt", STRGT,
"strhilo", STRHILO,
"strle", STRLE,
"strlohi", STRLOHI,
"strlt", STRLT,
"strne", STRNE,
"task", TASK,
"true", TRUE,
"type", TYPE,
"unique", UNIQUE,
"unset", UNSET,
"value", VALUE,
"version", VERSION,
"volname", VOLNAME,
"when", WHEN,
"servername", SERVERNAME,
"id", ID,
"cancelled", CANCELLED,
"canceled", CANCELED,
"success", SUCCESS,
"intermediate", INTERMEDIATE,
"loctext", LOCTEXT,
"text", TEXT,
"unacceptable", UNACCEPTABLE,
"arguments", ARGUMENTS,
"error", MMS_ERROR,
"accepted", ACCEPTED,
"attrlist", ATTRLIST,
"reqid", REQID,
"cpset", CPSET,
"cpunset", CPUNSET,
"cpreport", CPREPORT,
"cpreportmode", CPREPORTMODE,
"cptype", CPTYPE,
"receive", RECEIVE,
"volumeadd", VOLUMEADD,
"volumedelete", VOLUMEDELETE,
"dmup", DMUP,
"dmdown", DMDOWN,
"driveonline", DRIVEONLINE,
"driveoffline", DRIVEOFFLINE,
"lmup", LMUP,
"lmdown", LMDOWN,
"volumeinject", VOLUMEINJECT,
"volumeeject", VOLUMEEJECT,
"status", STATUS,
"librarycreate", LIBRARYCREATE,
"librarydelete", LIBRARYDELETE,
"drivedelete", DRIVEDELETE,
"LIBRARYLIST", LIBRARYLIST,
"DRIVELIST", DRIVELIST,
"CARTRIDGELIST", CARTRIDGELIST,
#if 0
/*
* These are Error codes
*/
"DM_E_ENABLED", ERROR_CODE,
"DM_E_COMMAND", ERROR_CODE,
"EOUTOFMEMORY", ERROR_CODE,
"DM_E_VIDMISMATCH", ERROR_CODE,
"DM_E_AGAIN", ERROR_CODE,
"DM_E_BADHANDLE", ERROR_CODE,
"DM_E_BADVAL", ERROR_CODE,
"DM_E_CMDARGS", ERROR_CODE,
"DM_E_DEVADMINCLT", ERROR_CODE,
"DM_E_DEVCMD", ERROR_CODE,
"DM_E_DEVCMDABORT", ERROR_CODE,
"DM_E_DEVCMDILLEGAL", ERROR_CODE,
"DM_E_DEVCMDTEMEOUT", ERROR_CODE,
"DM_E_DEVCOMMERR", ERROR_CODE,
"DM_E_DEVDET", ERROR_CODE,
"DM_E_DEVEMPTY", ERROR_CODE,
"DM_E_DEVFULL", ERROR_CODE,
"DM_E_DEVNORESPONSE", ERROR_CODE,
"DM_E_DEVOPERATOR", ERROR_CODE,
"DM_E_DEVOVERFLOW", ERROR_CODE,
"DM_E_DEVPERM", ERROR_CODE,
"DM_E_DEVPREV", ERROR_CODE,
"DM_E_DEVRESET", ERROR_CODE,
"DM_E_DEVSYNCHERR", ERROR_CODE,
"DM_E_DRIVE", ERROR_CODE,
"DM_E_HANDLEBUSY", ERROR_CODE,
"DM_E_HANDLEINUSE", ERROR_CODE,
"DM_E_INTERNAL", ERROR_CODE,
"DM_E_LIBRARY", ERROR_CODE,
"DM_E_MODE", ERROR_CODE,
"DM_E_NOCANC", ERROR_CODE,
"DM_E_NOCART", ERROR_CODE,
"DM_E_NOELT", ERROR_CODE,
"DM_E_NOEXISTHANDLE", ERROR_CODE,
"DM_E_NOID", ERROR_CODE,
"DM_E_NOTASK", ERROR_CODE,
"DM_E_READY", ERROR_CODE,
"DM_E_UNKNOWN", ERROR_CODE,
"EACCHANDLESTILLINUSE", ERROR_CODE,
"EAPPACCESSTOCART", ERROR_CODE,
"EAPPCARTNOACC", ERROR_CODE,
"EAPPDMDIFFHOSTS", ERROR_CODE,
"EAPPDRVNOACC", ERROR_CODE,
"EAPPHASNOVOLS", ERROR_CODE,
"EAPPLIBNOACCESS", ERROR_CODE,
"EAPPMOUNTNOTIUSSUED", ERROR_CODE,
"EAPPSESS", ERROR_CODE,
"EAPPTASKNOTISSUED", ERROR_CODE,
"EAUTOCREATEFAILED", ERROR_CODE,
"ECANCELLED", ERROR_CODE,
"ECANCELNUMRANGEDISALLOWED", ERROR_CODE,
"ECANTCANCEL", ERROR_CODE,
"ECARTDRVNOTCOMPATIBLE", ERROR_CODE,
"ECARTDRVSLOTMISMATCH", ERROR_CODE,
"ECARTINSLOT", ERROR_CODE,
"ECARTINUSE", ERROR_CODE,
"ECARTMOUNTNOTINVOLVED", ERROR_CODE,
"ECARTNOACC", ERROR_CODE,
"ECARTNOCGA", ERROR_CODE,
"ECARTNOFREEPARTS", ERROR_CODE,
"ECARTNOTINSLOT", ERROR_CODE,
"ECARTNOTLOCATED", ERROR_CODE,
"ECARTNOTOWNEDBYAP", ERROR_CODE,
"ECARTNOTOWNEDBYAPP", ERROR_CODE,
"ECLAUSEMISSING", ERROR_CODE,
"ECLAUSEMUTEX", ERROR_CODE,
"ECLAUSENEEDSARG", ERROR_CODE,
"ECLAUSENOPRIVILEGE", ERROR_CODE,
"ECOMMANDBEINGSUBMITTED", ERROR_CODE,
"ECOMMANDFAILED", ERROR_CODE,
"ECOMMANDNOPRIVILEGE", ERROR_CODE,
"ECONNDELETE", ERROR_CODE,
"EDMCONFIG", ERROR_CODE,
"EDMNOTCONNECTED", ERROR_CODE,
"EDMNOTREADY", ERROR_CODE,
"EDMPATTACH", ERROR_CODE,
"EDMPDETACH", ERROR_CODE,
"EDMPLOAD", ERROR_CODE,
"EDMPUNLOAD", ERROR_CODE,
"EDMRECOVERING", ERROR_CODE,
"EDMSTATE", ERROR_CODE,
"EDMSTILLBOOTING", ERROR_CODE,
"EDRIVEEMPTY", ERROR_CODE,
"EDRIVESET", ERROR_CODE,
"EDRVBROKEN", ERROR_CODE,
"EDRVCARTNOTREADABLE", ERROR_CODE,
"EDRVDISABLEDPERM", ERROR_CODE,
"EDRVDISABLEDTEMP", ERROR_CODE,
"EDRVEJECTING", ERROR_CODE,
"EDRVINUSE", ERROR_CODE,
"EDRVLOADED", ERROR_CODE,
"EDRVMOUNTNOTINVOLVED", ERROR_CODE,
"EDRVNODMCONFIGURED", ERROR_CODE,
"EDRVNOTINBAY", ERROR_CODE,
"EDRVNOTLOADED", ERROR_CODE,
"EDRVSESSNOUSE", ERROR_CODE,
"EDRVTASKNOTREQUIRED", ERROR_CODE,
"EDRVUNKNOWN", ERROR_CODE,
"EHANDLEINUSE", ERROR_CODE,
"EHANDLENOTDESTROY", ERROR_CODE,
"EINVALCLAUSEARG", ERROR_CODE,
"ELANGNOTSUPPORTED", ERROR_CODE,
"ELIBBROKEN", ERROR_CODE,
"ELIBCARTNOCONTAINMENT", ERROR_CODE,
"ELIBDISABLEDPERM", ERROR_CODE,
"ELIBDISABLEDTEMP", ERROR_CODE,
"ELIBDRVNOCONTAINMENT", ERROR_CODE,
"ELIBINUSE", ERROR_CODE,
"ELIBNOLMCONFIGURED", ERROR_CODE,
"ELMADD", ERROR_CODE,
"ELMCARTBAYNOTACCESS", ERROR_CODE,
"ELMCONFIG", ERROR_CODE,
"ELMDMCOMMUNICATION", ERROR_CODE,
"ELMDRVBAYNOTACCESS", ERROR_CODE,
"ELMDRVNOTACCESS", ERROR_CODE,
"ELMNOTCONNECTED", ERROR_CODE,
"ELMNOTREADY", ERROR_CODE,
"ELMPMOUNT", ERROR_CODE,
"ELMPORTNOTREADY", ERROR_CODE,
"ELMPUNMOUNT", ERROR_CODE,
"ELMSLOTNOTACCESS", ERROR_CODE,
"ELMSTATE", ERROR_CODE,
"ELMSTILLBOOTING", ERROR_CODE,
"EMLOGCREATE", ERROR_CODE,
"EMLOGDELETE", ERROR_CODE,
"EMNTCARTPRES", ERROR_CODE,
"EMOUNTLIBNOTINVOLVED", ERROR_CODE,
"EMPCREATE", ERROR_CODE,
"EMPHYSDEL", ERROR_CODE,
"ENEWVOLEXISTS", ERROR_CODE,
"ENEWVOLNAMECOUNT", ERROR_CODE,
"ENOALLOCATABLEPARTS", ERROR_CODE,
"ENOCANCELLABLETASKS", ERROR_CODE,
"ENOCARTRIDGE", ERROR_CODE,
"ENOINSTANCE", ERROR_CODE,
"ENOMATCH", ERROR_CODE,
"ENOMEMORY", ERROR_CODE,
"ENOPRIVCHANGE", ERROR_CODE,
"ENOSESSION", ERROR_CODE,
"ENOSLOT", ERROR_CODE,
"ENOSOLUTIONS", ERROR_CODE,
"ENOSUCHCART", ERROR_CODE,
"ENOSUCHLANG", ERROR_CODE,
"ENOSUCHPRIV", ERROR_CODE,
"ENOSUCHREQ", ERROR_CODE,
"ENOSUCHSIDE", ERROR_CODE,
"ENOSUCHSORT", ERROR_CODE,
"ENOSUCHVOLUME", ERROR_CODE,
"EOBJATTRMODDISALLOWED", ERROR_CODE,
"EOBJATTRTOOMANY", ERROR_CODE,
"EOBJATTRVALNOTENUM", ERROR_CODE,
"EOBJATTRVALNOTNUM", ERROR_CODE,
"EOBJATTRVALNULLSTRING", ERROR_CODE,
"EOBJCREATEDISALLOWED", ERROR_CODE,
"EOBJCREATEINVALREPORT", ERROR_CODE,
"EOBJCREATESYSATTRREQUIRED", ERROR_CODE,
"EOBJDELDISALLOWED", ERROR_CODE,
"EOBJDELNUMRANGEDISALLOWED", ERROR_CODE,
"EOBJDEPENDNOEXIST", ERROR_CODE,
"EOBJKEYCHANGE", ERROR_CODE,
"EOBJKEYNOTUNIQUE", ERROR_CODE,
"EOBJNOTVISIBLE", ERROR_CODE,
"EOBJREFERENCES", ERROR_CODE,
"EOBJSYSATTRCREATEDISALLOWED", ERROR_CODE,
"EOBJSYSATTRMODDISALLOWED", ERROR_CODE,
"EOBJSYSATTRMODNOPRIV", ERROR_CODE,
"EOBJUSRATTRCREATEDISALLOWED", ERROR_CODE,
"EOBJUSRATTRCREATENOPRIV", ERROR_CODE,
"EPARTNOTALLOCABLE", ERROR_CODE,
"EPRIVCHANGEDISALLOWED", ERROR_CODE,
"ERENAMEDVOLEXISTS", ERROR_CODE,
"EREPLACEFAILED", ERROR_CODE,
"EREQACCEPTEDBYDIFFSESS", ERROR_CODE,
"EREQSTATECHANGEFAILED", ERROR_CODE,
"EREQUESTALREADYACCEPTED", ERROR_CODE,
"EREQUESTALREADYSATISFIED", ERROR_CODE,
"EREQUESTNOTACCEPTED", ERROR_CODE,
"ESESSCARTNOTUSED", ERROR_CODE,
"ESESSLIBNOTUSED", ERROR_CODE,
"ESESSMNTNOTISSUED", ERROR_CODE,
"ESESSTASKNOISSUED", ERROR_CODE,
"ESHUTDOWNFAILED", ERROR_CODE,
"ESLOTNOTOCCUPIED", ERROR_CODE,
"ESLOTOCCUPIED", ERROR_CODE,
"ESORTNOTSUPPORTED", ERROR_CODE,
"ESYSATTRUNSETDISALLOWED", ERROR_CODE,
"ESYSTEM", ERROR_CODE,
"ETABLELIMIT", ERROR_CODE,
"ETASKCARTNOUSE", ERROR_CODE,
"ETASKLIBNOUSE", ERROR_CODE,
"ETASKMNTNOUSE", ERROR_CODE,
"ETMPUNAVAIL", ERROR_CODE,
"ETMPINUSE", ERROR_CODE,
"ETOOMANY", ERROR_CODE,
"ETOOMANYCLAUSES", ERROR_CODE,
"ETRANSACTIONFAILED", ERROR_CODE,
"EUNKNOWNERROR", ERROR_CODE,
"EVOLEXISTS", ERROR_CODE,
"EVOLINUSE", ERROR_CODE,
"EVOLNAMEREWRITE", ERROR_CODE,
"EVOLNOTOWNEDBYAPP", ERROR_CODE,
"EWOULDDEADLOCK", ERROR_CODE,
"LM_E_ACCESS", ERROR_CODE,
"LM_E_AGAIN", ERROR_CODE,
"LM_E_BADVAL", ERROR_CODE,
"LM_E_CMDARGS", ERROR_CODE,
"LM_E_DESTFULL", ERROR_CODE,
"LM_E_DEVADMINCLT", ERROR_CODE,
"LM_E_DEVCMD", ERROR_CODE,
"LM_E_DEVCMDABORT", ERROR_CODE,
"LM_E_DEVCMDILLEGAL", ERROR_CODE,
"LM_E_DEVCMDTEMEOUT", ERROR_CODE,
"LM_E_DEVCOMMERR", ERROR_CODE,
"LM_E_DEVEJ", ERROR_CODE,
"LM_E_DEVINJ", ERROR_CODE,
"LM_E_DEVNORESPONSE", ERROR_CODE,
"LM_E_DEVOPERATOR", ERROR_CODE,
"LM_E_DEVOVERFLOW", ERROR_CODE,
"LM_E_DEVPREM", ERROR_CODE,
"LM_E_DEVPREV", ERROR_CODE,
"LM_E_DEVRESET", ERROR_CODE,
"LM_E_DEVSYNCHERR", ERROR_CODE,
"LM_E_DIRECTION", ERROR_CODE,
"LM_E_INTERNAL", ERROR_CODE,
"LM_E_LIBRARY", ERROR_CODE,
"LM_E_MOVE", ERROR_CODE,
"LM_E_NOCANC", ERROR_CODE,
"LM_E_NODRIVE", ERROR_CODE,
"LM_E_NOELT", ERROR_CODE,
"LM_E_NOPCL", ERROR_CODE,
"LM_E_NOSLOT", ERROR_CODE,
"LM_E_NOTASK", ERROR_CODE,
"LM_E_PCL", ERROR_CODE,
"LM_E_PORT", ERROR_CODE,
"LM_E_PORTDIR", ERROR_CODE,
"LM_E_READY", ERROR_CODE,
"LM_E_SCREMPTY", ERROR_CODE,
"LM_E_SHAPE", ERROR_CODE,
"LM_E_SLOTGROUP", ERROR_CODE,
"LM_E_UNKNOWN", ERROR_CODE,
"LM_E_SUBCMDFAILED", ERROR_CODE,
"LM_E_CONFIG", ERROR_CODE,
"MM_E_AGAIN", ERROR_CODE,
"MM_E_BADVAL", ERROR_CODE,
"MM_E_CMDARGS", ERROR_CODE,
"MM_E_DEVCMD", ERROR_CODE,
"MM_E_DEVCMDABORT", ERROR_CODE,
"MM_E_DEVCMDILLEGAL", ERROR_CODE,
"MM_E_DEVCMDTEMEOUT", ERROR_CODE,
"MM_E_DEVOVERFLOW", ERROR_CODE,
"MM_E_DEVPREM", ERROR_CODE,
"MM_E_DEVPREV", ERROR_CODE,
"MM_E_INTERNAL", ERROR_CODE,
"MM_E_NOELT", ERROR_CODE,
/*
* Sun MM System vendor-defined error codes.
*/
"EDATABASE", ERROR_CODE,
"ENOTFOUND", ERROR_CODE,
"ESYNTAX", ERROR_CODE,
"EPRIVNOTMMSADMIN", ERROR_CODE,
"MM_E_NOTASK", ERROR_CODE,
"MM_E_TOOMANYTASKS", ERROR_CODE,
"ENOSUCHPCL", ERROR_CODE,
"ENOTENOUGHPARTITIONS", ERROR_CODE,
"EPARTITIONSTATECHANGE", ERROR_CODE,
"ECARTRIDGESTATECHANGE", ERROR_CODE,
"ESYSTEMCONFIGCHANGE", ERROR_CODE,
"ENOTCONNECTED", ERROR_CODE,
"ECOMMUNICATION", ERROR_CODE,
"ELIBRARYNOEXIST", ERROR_CODE,
"ELMNOEXIST", ERROR_CODE,
"ELIBALREADYONLINE", ERROR_CODE,
"ELIBALREADYOFFLINE", ERROR_CODE,
"EDRIVENOEXIST", ERROR_CODE,
"EDRIVEALREADYONLINE", ERROR_CODE,
"EDRIVEALREADYOFFLINE", ERROR_CODE,
"EDRIVEONLINE", ERROR_CODE,
"EDRIVEOFFLINE", ERROR_CODE,
"ELIBRARYONLINE", ERROR_CODE,
"ELIBRARYOFFLINE", ERROR_CODE,
#endif
/*
* These are error classes
*/
"compat", COMPAT,
"config", CONFIG,
"exist", EXIST,
"explicit", EXPLICIT,
"internal", INTERNAL,
"invalid", INVALID,
"permpriv", PERMPRIV,
"retry", RETRY,
"subop", SUBOP,
"state", STATE,
"LM_C_INVALID", LM_C_INVALID,
"LM_C_COMMAND", LM_C_COMMAND,
"DM_C_INVALID", DM_C_INVALID,
"DM_C_COMMAND", DM_C_COMMAND,
"MM_C_INVALID", MM_C_INVALID,
"MM_C_MANAGEMENT", MM_C_MANAGEMENT,
};
/*
* The following is the symbols for all the MMP commands.
*/
mms_sym_t mms_mmp_sym_tab[] = {
"request", MMP_REQUEST,
"message", MMP_MESSAGE,
"library", LIBRARY,
"drive", DRIVE,
"notify", NOTIFY_CMD,
"respond", RESPOND,
"accept", ACCEPT,
"allocate", ALLOCATE,
"attribute", ATTRIBUTE,
"show", SHOW,
"begin", BEGIN_CMD,
"cancel", CANCEL,
"add", ADD,
"change", CHANGE,
"cpattribute", CPATTRIBUTE,
"cpreset", CPRESET,
"cpstart", CPSTART,
"cpexit", CPEXIT,
"cpscan", CPSCAN,
"cpshow", CPSHOW,
"create", CREATE,
"deallocate", DEALLOCATE,
"delete", DELETE,
"eject", EJECT,
"end", END,
"goodbye", GOODBYE,
"inject", INJECT,
"locale", LOCALE,
"mount", MMP_MOUNT,
"move", MOVE,
"privilege", PRIVILEGE,
"release", RELEASE,
"rename", RENAME,
"shutdown", SHUTDOWN,
"unwelcome", MMS_UNWELCOME,
"welcome", MMS_WELCOME,
};
/*
* These are the DMPM commands
*/
static mms_sym_t mms_dmpm_sym_tab[] = {
"unload", UNLOAD,
"reset", XMPM_RESET,
"private", XMPM_PRIVATE,
"load", LOAD,
"exit", EXIT,
"identify", IDENTIFY,
"detach", DETACH,
"cancel", XMPX_CANCEL,
"activate", ACTIVATE,
"attach", ATTACH,
"event", EVENT,
};
/*
* These are the DMPD commands
*/
mms_sym_t mms_dmpd_sym_tab[] = {
"notify", NOTIFY_CMD,
"config", DMPD_CONFIG,
"message", XMPD_MESSAGE,
"private", DMPD_PRIVATE,
"ready", XMPD_READY,
"request", DMPD_REQUEST,
"cancel", XMPX_CANCEL,
"shutdown", SHUTDOWN,
"attribute", ATTRIBUTE,
"create", CREATE,
"show", SHOW,
};
/*
* These are the LMPM commands
*/
mms_sym_t mms_lmpm_sym_tab[] = {
"activate", LMPM_ACTIVATE,
"barrier", BARRIER,
"eject", LMPM_EJECT,
"exit", LMPM_EXIT,
"inject", LMPM_INJECT,
"mount", LMPM_MOUNT,
"move", LMPM_MOVE,
"private", XMPM_PRIVATE,
"reset", XMPM_RESET,
"scan", LMPM_SCAN,
"unmount", LMPM_UNMOUNT,
"cancel", XMPX_CANCEL,
"event", EVENT,
};
/*
* These are the LMPD commands
*/
mms_sym_t mms_lmpl_sym_tab[] = {
"notify", NOTIFY_CMD,
"cancel", XMPX_CANCEL,
"config", LMPD_CONFIG,
"freeslots", FREESLOTS,
"delslots", DELSLOTS,
"in", IN,
"out", OUT,
"both", BOTH,
"perf", PERF,
"message", XMPD_MESSAGE,
"private", LMPD_PRIVATE,
"ready", XMPD_READY,
"request", LMPD_REQUEST,
"shutdown", SHUTDOWN,
"attribute", ATTRIBUTE,
"show", SHOW,
};
%}
%%
command : {
}
{
}
}
| error
;
cmd /* MMP commands */
| end_cmd
| move_cmd
| show_cmd
/*
* XMP/M commands
* Commands common to both DMP/M and LMP/M
*/
/*
* XMP/D commands
* Commands common to both DMP/D and LMP/D
*/
/*
* XMP/X commands
* Commands common to dmpm, dmpd, lmpm and lmpd
*/
/*
* DMP/M commands
*/
/*
* DMP/D commands
*/
/*
* LMP/M commands
*/
/*
* LMP/D commands
*/
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(PASSWORD) == 0) {
yyerror("a password clause is required");
}
if (MMS_PAR_CHK_FLAG(OLDPASSWORD) &&
MMS_PAR_CHK_FLAG(NAME)) {
yyerror("oldpassword and name clauses are "
"incompatible");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$4.nodep);
}
;
: PASSWORD
{
}
{
$4.nodep);
}
;
: NAME
{
}
{
$4.nodep);
}
;
: IDENTITY
{
}
task_clause ';'
{
$3.nodep);
}
;
: DIRECT
{
}
direct_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TO) == 0) {
yyerror("a to clause is required");
}
if (MMS_PAR_CHK_FLAG(DATA) == 0) {
yyerror("a data clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TO
{
}
{
$4.nodep);
}
;
: DATA
{
}
{
$4.listp);
}
;
: DRIVE
{
}
drive_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ONLINE) +
MMS_PAR_CHK_FLAG(OFFLINE) == 0) {
yyerror("One of online or offline clauses "
"is required");
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: ONLINE
{
if (MMS_PAR_CHK_FLAG(OFFLINE)) {
yyerror("online and offline clauses are "
"imcompatible");
}
}
{
$4.nodep);
}
;
: OFFLINE
{
if (MMS_PAR_CHK_FLAG(ONLINE)) {
yyerror("online and offline clauses are "
"imcompatible");
}
}
{
$4.nodep);
}
;
: LIBRARY
{
}
library_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ONLINE) +
MMS_PAR_CHK_FLAG(OFFLINE) == 0) {
yyerror("one of online or offline clauses "
"is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: ONLINE
{
if (MMS_PAR_CHK_FLAG(OFFLINE)) {
yyerror("online and offline clauses are "
"imcompatible");
}
}
{
$4.nodep);
$5.nodep);
}
;
: OFFLINE
{
if (MMS_PAR_CHK_FLAG(ONLINE)) {
yyerror("online and offline clauses are "
"imcompatible");
}
}
{
$4.nodep);
}
;
{
}
notify_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(HAVE_STR_ARG) &&
yyerror("cannot have old style and new style "
"receive or cancel clauses");
}
if (MMS_PAR_CHK_FLAG(RECEIVE) == 0 &&
MMS_PAR_CHK_FLAG(CANCEL) == 0) {
yyerror("a receive or a cancel clause "
"is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: SCOPE
{
}
{
$4.nodep);
}
;
{
}
;
: GLOBAL
{
}
{
}
| STRING
{
} else {
yyerror("unexpected STRING, expecting "
"global or application");
}
}
;
: RECEIVE
{
}
{
char *msg;
if (MMS_PAR_CHK_FLAG(HAVE_SUB_CLAUSE) != 0) {
if (MMS_PAR_CHK_FLAG(OBJECT) == 0) {
yyerror("an object clause is required "
"in a receive clause");
}
if (MMS_PAR_CHK_FLAG(ADD) != 0 ||
MMS_PAR_CHK_FLAG(DELETE) != 0) {
/* "add" or "delete" action */
if (MMS_PAR_CHK_FLAG(TO) != 0) {
yyerror("to clause not "
"allowed with action 'add' "
"or 'delete'");
}
}
/*
* If 'change' verify that only one object
* is referenced in the match clause and it
* matches the object specified in the
* onject clause.
*/
}
}
}
;
{
}
{
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
;
: TO
{
}
{
$4.nodep);
}
;
: OBJECT
{
}
{
$4.nodep);
$5.listp);
}
}
;
;
: TAG
{
}
{
$4.nodep);
}
;
: ACTION
{
}
{
}
}
;
| DELETE
| CHANGE
| STRING
{
yyerror("unexpected STRING, "
"expecting add, delete, chage or all");
}
}
;
{
}
;
{
}
{
MMS_PAR_ALLOC_LIST($$.listp);
}
;
;
;
: EVENT
{
}
event_arg_list ';'
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
;
;
: OBJECT
{
}
{
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
$6.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
: DIRECT
{
}
{
$4.listp);
}
;
{
}
{
int count;
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
if (MMS_PAR_CHK_FLAG(PRIORITY) == 0) {
yyerror("a priority clause is required");
}
if (MMS_PAR_CHK_FLAG(MESSAGE) == 0) {
yyerror("a message clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TYPE
{
}
{
yyerror("unexpected objectname. "
"AI required");
}
$4.nodep);
}
;
: PRIORITY
{
}
{
$4.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(WHO) == 0) {
yyerror("a who clause is required");
}
if (MMS_PAR_CHK_FLAG(SEVERITY) == 0) {
yyerror("a severity clause is required");
}
if (MMS_PAR_CHK_FLAG(MESSAGE) == 0) {
yyerror("a message clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
int count;
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
if (MMS_PAR_CHK_FLAG(PRIORITY) == 0) {
yyerror("a priority clause is required");
}
if (MMS_PAR_CHK_FLAG(MESSAGE) == 0) {
yyerror("a message clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TYPE
{
}
{
node);
}
;
| STRING
{
yyerror("unexpected type. LM expected");
}
}
;
: PRIORITY
{
}
{
$4.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
MMS_PAR_CHK_FLAG(GET) == 0) {
yyerror("a set, unset or get clause is "
"required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
char msg[100];
"Unexpected object \"%s\", only "
"\"LM\" or \"LIBRARY\" object is "
}
}
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
$6.nodep);
}
;
{
}
;
| STRING
{
yyerror("unexpected STRING, "
"expecting in, out, both or none");
}
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
$6.nodep);
$7.nodep);
$8.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
$6.nodep);
$7.nodep);
$8.nodep);
$9.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ALL) == 0 &&
MMS_PAR_CHK_FLAG(FROMSLOT) == 0) {
yyerror("either all or fromslot clause is "
"required");
}
if (MMS_PAR_CHK_FLAG(ALL) &&
yyerror("all and fromslot clauses are "
"incompatible");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: FROMSLOT
{
}
{
$4.nodep);
$5.nodep);
$6.nodep);
}
;
: TOSLOT
{
}
{
$4.nodep);
$5.nodep);
$6.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ALL)) {
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
MMS_PAR_CHK_FLAG(SLOT) ||
yyerror("all is incompatible with "
"fromslot, toslot, "
"drive and slot");
}
}
if (MMS_PAR_CHK_FLAG(SLOT)) {
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
MMS_PAR_CHK_FLAG(ALL) ||
yyerror("slot is incompatible with "
"fromslot, toslot, "
"drive and all");
}
}
if (MMS_PAR_CHK_FLAG(DRIVE)) {
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
MMS_PAR_CHK_FLAG(ALL) ||
MMS_PAR_CHK_FLAG(SLOT)) {
("drive is incompatible with "
"fromslot, toslot, "
"all and slot");
}
}
if (MMS_PAR_CHK_FLAG(FROMSLOT)) {
if (MMS_PAR_CHK_FLAG(DRIVE) ||
MMS_PAR_CHK_FLAG(ALL) ||
MMS_PAR_CHK_FLAG(SLOT)) {
("fromslot is incompatible with "
"all, drive and slot");
}
}
if (MMS_PAR_CHK_FLAG(TOSLOT)) {
if (MMS_PAR_CHK_FLAG(DRIVE) ||
MMS_PAR_CHK_FLAG(ALL) ||
MMS_PAR_CHK_FLAG(SLOT)) {
("toslot is incompatible with "
"all, drive and slot");
}
}
if (MMS_PAR_CHK_FLAG(FROMSLOT) +
1) {
yyerror("fromslot and toslot must be "
"specified together");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
| all_spec
| to_spec
;
{
$3.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(FROM) == 0) {
yyerror("a from clause is required");
}
if (MMS_PAR_CHK_FLAG(TO) == 0) {
yyerror("a to clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: FROM
{
}
{
$4.nodep);
$5.nodep);
$6.nodep);
}
;
: TO
{
}
{
$4.nodep);
$5.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(DRIVE) == 0) {
yyerror("a drive clause is required");
}
if (MMS_PAR_CHK_FLAG(SLOT) == 0) {
yyerror("a slot clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
}
;
{
$3.nodep);
$4.nodep);
$5.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(SLOTGROUP) == 0) {
yyerror("a slotgroup clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
task_clause ';'
{
$3.nodep);
}
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(SLOTGROUP) == 0) {
yyerror("a slotgroup clause is required");
}
if (MMS_PAR_CHK_FLAG(SLOT) == 0) {
yyerror("a slot clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
$4.nodep);
}
;
: BARRIER
{
}
task_clause ';'
{
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
$3.nodep);
}
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ENABLE) == 0 &&
== 0) {
yyerror("one of enable and disable is "
"required");
}
== 1) {
("enable and disable are incompatible");
}
}
}
;
{
}
{
int count;
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
if (MMS_PAR_CHK_FLAG(PRIORITY) == 0) {
yyerror("a priority clause is required");
}
if (MMS_PAR_CHK_FLAG(MESSAGE) == 0) {
yyerror("a message clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TYPE
{
}
{
node);
}
;
| STRING
{
yyerror("unexpected type. DM expected");
}
}
;
: PRIORITY
{
}
{
$4.nodep);
}
;
{
}
{
int count;
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
;
: NOT
{
}
| BROKEN
{
}
{
}
| PRESENT
{
}
| STRING
{
yyerror("unexpected STRING, "
"expecting not, present, broken or "
"disconnected");
}
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
MMS_PAR_CHK_FLAG(GET) == 0) {
yyerror("a set, unset or get clause is "
"required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
char msg[100];
"Unexpected object \"%s\", only "
"\"DM\" or \"DRIVE\" object is "
}
}
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(WHO) == 0) {
yyerror("a who clause is required");
}
if (MMS_PAR_CHK_FLAG(SEVERITY) == 0) {
yyerror("a severity clause is required");
}
if (MMS_PAR_CHK_FLAG(MESSAGE) == 0) {
yyerror("a message clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: WHO
{
}
{
node);
}
;
| STRING
{
yyerror("unexpected STRING, expecting "
"operator, administrator or log");
}
}
;
: SEVERITY
{
}
{
node);
}
;
| STRING
{
yyerror("unexpected STRING, expecting "
"emergency, alert, critical, "
"error, warning, notice, "
"information, debug or developer");
}
}
;
: UNLOAD
{
}
task_clause ';'
{
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
$3.nodep);
}
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(FULL) == 0 &&
MMS_PAR_CHK_FLAG(PARTIAL) == 0) {
yyerror("full or partial is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
MMS_PAR_CHK_FLAG(GET) == 0) {
yyerror("a set, unset or get clause is "
"required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
$3.listp);
}
;
: str_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
$3.listp);
}
;
: str_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
: LOAD
{
}
task_clause ';'
{
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
$3.nodep);
}
}
;
: IDENTIFY
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TYPE
{
}
{
$4.nodep);
}
;
{
}
;
: NONE
| STRING
{
yyerror("unexpected STRING, expecting "
"none or ansilabel");
}
}
;
: EXIT
{
}
task_clause ';'
{
$3.nodep);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
}
}
;
: DETACH
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(STALE) == 0) {
yyerror("a stale clause is required");
}
if (MMS_PAR_CHK_FLAG(DRIVEHANDLE) == 0) {
yyerror("a drivehandle clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$4.nodep);
}
;
: STALE
{
}
{
$4.nodep);
}
;
;
: INTERNAL
{
}
str_arg_list ';'
{
$3.listp);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(WHICHTASK) == 0) {
yyerror("a whichtask clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$4.nodep);
}
;
: ATTACH
{
}
attach_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(MODENAME) == 0) {
yyerror("a scope clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: MODENAME
{
}
{
$4.nodep);
}
;
{
}
{
$4.nodep);
}
;
{
}
config_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(SCOPE) == 0) {
yyerror("a scope clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
}
;
{
}
{
}
;
{
}
{
}
;
: SCOPE
{
}
{
$4.nodep);
}
;
{
}
;
: FULL
{
}
| PARTIAL
{
}
| STRING
{
} else {
yyerror("unexpected STRING, expecting "
"full or partial");
}
}
;
{
}
;
: str_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
$3.nodep);
$4.nodep);
$5.listp);
}
}
;
: CAP '['
{
}
{
$4.nodep);
$5.listp);
}
;
: cap_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
$4.nodep);
}
;
: CAPLIST
{
}
{
$4.listp);
}
;
;
: ACTIVATE
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ENABLE) == 0 &&
MMS_PAR_CHK_FLAG(DISABLE) == 0 &&
MMS_PAR_CHK_FLAG(RESERVE) == 0 &&
MMS_PAR_CHK_FLAG(RELEASE) == 0) {
yyerror("one of enable, disable, "
"reserve or release is " "required");
}
if (MMS_PAR_CHK_FLAG(ENABLE) +
1) {
yyerror("enable, disable, "
"reserve and release are incompatible");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
;
: ENABLE
{
}
| DISABLE
{
}
| RELEASE
{
}
| RESERVE
{
}
;
: SHUTDOWN
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TYPE '['
{
}
{
if (MMS_PAR_CHK_FLAG(NONEWAPPS) +
("nonewapps, nonewmounts, abortqueue "
"and force are imcompatible");
}
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
}
;
{
}
{
}
{
}
| FORCE
{
}
| RESTART
{
}
| STRING
{
} else {
yyerror("unexpected STRING, expecting "
"nonewapps, nonewmounts, abortqueue "
"force or restart");
}
}
;
: restart
{
}
;
{
}
| STRING
{
yyerror("unexpected STRING, expecting "
"restart");
}
}
;
: RELEASE
{
}
release_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(MATCH) &&
yyerror("match and reqid clauses are "
"incompatible");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(LEVEL) == 0) {
yyerror("a level clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: LEVEL
{
}
{
$4.nodep);
}
;
: level
{
}
;
| STRING
{
yyerror("unexpected STRING, expecting "
"standard or administrator or "
"system_priv");
}
}
;
: MOVE
{
}
move_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TOSLOT) == 0) {
yyerror("a toslot clause is required");
}
if (MMS_PAR_CHK_FLAG(CART) &&
yyerror("cart and cartid clauses are "
"incompatible");
}
if ((MMS_PAR_CHK_FLAG(CART) +
MMS_PAR_CHK_FLAG(CARTID)) &&
MMS_PAR_CHK_FLAG(NUMBER))) {
yyerror("cart and cartid clauses are "
"incompatible with match, order and "
"number clauses");
}
}
}
;
: move_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TOSLOT
{
}
{
$4.nodep);
}
;
;
: CARTID
{
}
{
$4.nodep);
$5.nodep);
}
;
: CART
{
}
{
$4.nodep);
$5.nodep);
$6.nodep);
}
;
: LOCALE
{
}
locale_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: LANGUAGE
{
}
{
$4.nodep);
$5.nodep);
}
;
: str_arg
;
| str_arg
;
: SORT
{
}
{
$4.nodep);
}
;
: INJECT
{
}
inject_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: GOODBYE
{
}
task_clause ';'
{
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
$3.nodep);
}
}
;
{
}
end_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
}
}
;
: end_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: abort
{
}
;
{
}
| STRING
{
yyerror("unexpected STRING, expecting "
"abort");
}
}
;
: EJECT
{
}
eject_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"REPORTMODE clause");
}
if (MMS_PAR_CHK_FLAG(MATCH) +
(MMS_PAR_CHK_FLAG(CARTID) ||
yyerror("match is incompatible with cartid "
"and cart");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
;
{
$3.listp);
}
;
;
{
$3.nodep);
$4.nodep);
}
;
{
}
{
$4.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: CPSHOW
{
}
cpshow_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(CPTYPE) == 0) {
yyerror("a cptype clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: CPSCAN
{
}
cpscan_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(ALL)) {
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
MMS_PAR_CHK_FLAG(SLOT) ||
yyerror("all is incompatible with "
"fromslot, toslot, "
"drive and slot");
}
}
if (MMS_PAR_CHK_FLAG(SLOT)) {
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
MMS_PAR_CHK_FLAG(ALL) ||
yyerror("slot is incompatible with "
"fromslot, toslot, "
"drive and all");
}
}
if (MMS_PAR_CHK_FLAG(DRIVE)) {
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
MMS_PAR_CHK_FLAG(ALL) ||
MMS_PAR_CHK_FLAG(SLOT)) {
("drive is incompatible with "
"fromslot, toslot, "
"all and slot");
}
}
if (MMS_PAR_CHK_FLAG(FROMSLOT)) {
if (MMS_PAR_CHK_FLAG(DRIVE) ||
MMS_PAR_CHK_FLAG(ALL) ||
MMS_PAR_CHK_FLAG(SLOT)) {
("fromslot is incompatible with "
"all, drive and slot");
}
}
if (MMS_PAR_CHK_FLAG(TOSLOT)) {
if (MMS_PAR_CHK_FLAG(DRIVE) ||
MMS_PAR_CHK_FLAG(ALL) ||
MMS_PAR_CHK_FLAG(SLOT)) {
("toslot is incompatible with "
"all, drive and slot");
}
}
if (MMS_PAR_CHK_FLAG(FROMSLOT) +
1) {
yyerror("fromslot and toslot must be "
"specified together");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
| all_spec
| to_spec
;
: all
{
}
;
{
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
yyerror("all is incompatible with "
"fromslot and toslot");
}
}
| STRING
{
if (MMS_PAR_CHK_FLAG(FROMSLOT) ||
yyerror("all is incompatible with "
"fromslot and toslot");
}
} else {
yyerror("unexpected STRING, expecting "
"full or partial");
}
}
;
: FROMSLOT
{
if (MMS_PAR_CHK_FLAG(ALL)) {
yyerror("all is incompatible with "
"fromslot and toslot");
}
}
{
$4.nodep);
}
;
{
if (MMS_PAR_CHK_FLAG(ALL)) {
yyerror("all is incompatible with "
"fromslot and toslot");
}
}
{
$4.nodep);
}
;
: CPRESET
{
}
cpreset_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(CPTYPE) == 0) {
yyerror("a cptype clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: CPSTART
{
}
cpstart_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(CPTYPE) == 0) {
yyerror("a cptype clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: CPEXIT
{
}
cpexit_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(CPTYPE) == 0) {
yyerror("a cptype clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(CPTYPE) == 0) {
yyerror("a cptype clause is required");
}
if (MMS_PAR_CHK_FLAG(CPSET) == 0 &&
== 0) {
yyerror("a cpset or cpunset clause is "
"required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
if (MMS_PAR_CHK_FLAG(CPREPORTMODE) &&
MMS_PAR_CHK_FLAG(CPREPORT) == 0) {
("a cpreport clause is required with a "
"cpreportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: CPTYPE
{
}
{
$4.nodep);
}
;
: cptype
{
}
;
| DM
| STRING
{
yyerror("unexpected STRING, expecting "
"LM or DM");
}
}
;
{
$3.nodep);
$4.nodep);
}
;
{
$3.nodep);
}
;
;
: CPREPORT
{
}
{
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
}
{
if ((MMS_PAR_CHK_FLAG(NAME) +
yyerror("only two of name, "
"namevalue and unique are allowed");
}
$4.listp);
}
;
: str_arg
;
: str_arg
;
: CANCEL
{
}
cancel_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: ACCEPT
{
}
accept_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(MATCH) &&
yyerror("match and reqid are incompatible");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: REQID
{
}
{
$4.listp);
}
;
;
: RESPOND
{
}
respond_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REQID) == 0) {
yyerror("a reqid clause is required");
}
if (MMS_PAR_CHK_FLAG(MESSAGE) == 0) {
yyerror("a message clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: REQID
{
}
{
$4.nodep);
}
;
: RESPONSE
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) == 0 &&
MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE)) {
if (MMS_PAR_CHK_FLAG(TEXT)) {
("unacceptable is incompatible "
"with text and task");
}
} else if (MMS_PAR_CHK_FLAG(ACCEPTED)) {
if (MMS_PAR_CHK_FLAG(MESSAGE) ||
MMS_PAR_CHK_FLAG(TEXT)) {
yyerror("accepted is incompatible "
"with message and task");
}
} else if (MMS_PAR_CHK_FLAG(SUCCESS)) {
;
} else if (MMS_PAR_CHK_FLAG(INTERMEDIATE)) {
;
} else if (MMS_PAR_CHK_FLAG(CANCELLED)) {
if (MMS_PAR_CHK_FLAG(TEXT)) {
yyerror("cancelled is incompatible "
"with text");
}
} else if (MMS_PAR_CHK_FLAG(MMS_ERROR)) {
if (MMS_PAR_CHK_FLAG(TEXT)) {
yyerror("error is incompatible "
"with text");
}
} else {
yyerror("one of unacceptable, accepted, "
"success, intermediate, "
"cancelled or error is " "required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
if (MMS_PAR_CHK_FLAG(ACCEPTED) ||
yyerror("unacceptable is incompatible with "
"accepted, intermediate,"
"success, cancelled and error");
}
}
| ACCEPTED
{
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
yyerror("accepted is incompatible with "
"unacceptable, intermediate,"
"success, cancelled and error");
}
}
| SUCCESS
{
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
yyerror("success is incompatible with "
"unacceptable, intermediate,"
"accepted, cancelled and error");
}
}
{
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
yyerror("intermediate is incompatible with "
"unacceptable, success, "
"accepted, cancelled and error");
}
}
{
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
yyerror("cancelled is incompatible with "
"unacceptable, intermediate,"
"accepted, cancelled and error");
}
}
| STRING
{
if (MMS_PAR_CHK_FLAG(ACCEPTED) ||
("unacceptable is incompatible "
"with "
"accepted, intermediate,"
"success, cancelled and error");
}
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
("accepted is incompatible with "
"unacceptable, intermediate,"
"success, cancelled and error");
}
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
("success is incompatible with "
"unacceptable, intermediate,"
"accepted, cancelled and "
"error");
}
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
("intermediate is incompatible "
"with unacceptable, success,"
"accepted, cancelled and "
"error");
}
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
yyerror("cancelled is incompatible "
"with "
"unacceptable, intermediate,"
"accepted, cancelled and "
"error");
}
} else {
yyerror("unexpected STRING, expecting "
"unacceptable, accepted, success, "
"intermediate, "
"cancelled, error, text, task or "
"message");
}
}
{
/* Looking for an error code */
}
err_code_spec ']'
{
if (MMS_PAR_CHK_FLAG(UNACCEPTABLE) ||
yyerror("error is incompatible with "
"unacceptable, intermediate, "
"accepted, success and cancelled");
}
$3.nodep);
$5.nodep);
}
{
$3.listp);
}
| error
{
}
;
| CANCELED
{
$$.str = "cancelled";
}
;
: text_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
$3.listp);
}
;
{
}
;
| STRING
{
yyerror("unexpected STRING, expecting "
"compat, config, exist, explicit, "
"internal, invalid, permpriv, "
"retry, subop, language, state, "
"MM_C_MANAGEMENT, MM_C_INVALID, "
"DM_C_INVALID, "
"DM_C_COMMAND, LM_C_INVALID, "
"or LM_C_COMMAND");
}
}
;
: err_code
{
}
;
| STRING
;
: MESSAGE
{
}
{
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: ID
{
}
{
$4.nodep);
$5.nodep);
$6.nodep);
}
;
: str_arg
;
;
: str_arg
;
{
}
{
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
: LOCTEXT
{
}
{
$4.nodep);
$5.nodep);
}
;
: str_arg
;
;
: UNMOUNT
{
}
unmount_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
if (MMS_PAR_CHK_FLAG(MATCH) == 0 &&
MMS_PAR_CHK_FLAG(VOLNAME) == 0) {
yyerror("a match or volname clause "
"is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
MMS_PAR_ALLOC_LIST($$.listp);
}
;
: clean
{
}
;
{
}
| STRING
{
yyerror("unexpected STRING, expecting "
"clean");
}
}
;
{
}
;
{
}
| STRING
{
yyerror("unexpected STRING, expecting "
"physicalunmount");
}
;
{
}
{
$3.listp);
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
: str_arg
{
char *err_list[] = {
"SSAI_E_PROTOCOL_ERROR",
"SSAI_E_ACCESS_DENIED",
"SSAI_E_DUPLICATE_SESSION",
"SSAI_E_UNKNOWN_LANGUAGE",
"SSAI_E_UNSUPPORTED_LANGUAGE",
"SSAI_E_SSL"
};
int i;
for (i = 0; i < num_errs; i++) {
err_list[i]) == 0) {
break;
}
}
if (i == num_errs) {
/* Invalid error */
char msg[200];
mms_pn_token($$.nodep));
}
}
;
{
}
welcome_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(VERSION) == 0) {
yyerror("a version clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$4.nodep);
}
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
: VOLUMEID
{
}
{
$4.nodep);
("Volume ID greater than 6 characters");
}
}
;
: FILENAME
{
}
{
$4.nodep);
("Filename greater than 17 characters");
}
}
;
{
}
{
$4.nodep);
}
;
{
}
{
int fseq;
$4.nodep);
fseq = 0;
char msg[100];
sprintf("Unsupported filesequence: %s",
}
}
;
: WHERE
{
}
{
$4.nodep);
}
;
: TYPE
{
}
{
$4.nodep);
}
;
{
}
;
| STRING
{
yyerror("unexpected STRING, expecting "
"side, partition or volume");
}
}
;
{
$3.listp);
}
;
{
$3.listp);
}
;
;
: RENAME
{
}
rename_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(NEWVOLNAME) == 0) {
yyerror("a newvolname clause is required");
}
if (MMS_PAR_CHK_FLAG(MATCH) &&
yyerror("match and volname clauses are "
"incompatible");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
== 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if ((MMS_PAR_CHK_FLAG(SET) +
MMS_PAR_CHK_FLAG(UNSET)) == 0) {
yyerror("one of set and unset clauses is "
"required");
}
if (MMS_PAR_CHK_FLAG(MATCH) &&
yyerror("only one of match and volname is "
"allowed");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
== 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
}
;
;
: ALLOCATE
{
}
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(NEWVOLNAME) == 0) {
yyerror("a newvolname clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: WHO
{
}
{
$4.nodep);
$5.nodep);
}
;
{
}
{
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
: str_arg
;
: DELETE
{
}
delete_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: CREATE
{
}
create_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(TYPE) == 0) {
yyerror("a type clause is required");
}
if (MMS_PAR_CHK_FLAG(SET) == 0) {
yyerror("a set clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TYPE
{
}
{
$4.nodep);
}
;
{
$3.nodep);
$4.nodep);
}
;
;
{
}
show_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
if (MMS_PAR_CHK_FLAG(REPORTMODE) &&
MMS_PAR_CHK_FLAG(REPORT) == 0) {
("a report clause is required with a "
"reportmode clause");
}
}
}
;
: show_arg
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: MATCH
{
yyerror("a volname clause is incompatible "
"with the match clause");
}
}
{
$4.nodep);
}
;
: VOLNAME
{
yyerror("a volname clause is incompatible "
"with the match clause");
}
}
{
$4.listp);
}
;
: ORDER
{
}
{
$4.nodep);
}
;
: NUMBER
{
}
{
$4.nodep);
}
;
{
/* Not a range spec */
} else {
mms_list_insert_head(&$$.nodep->
}
}
;
: /* nothing */
{
}
| RANGE
{
if (MMS_PAR_CHK_FLAG(LAST)) {
/* Last canot be start of range */
("range cannot be started with LAST");
}
}
{
yyerror("range cannot be terminated "
"with FIRST");
}
$3.nodep);
}
;
: NUMERIC
{
}
{
}
| FIRST
{
}
| LAST
{
}
| STRING
{
} else {
yyerror("unexpected STRING, expecting "
"first, last or NUMBER");
}
}
;
;
: REPORT
{
}
{
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
}
{
if ((MMS_PAR_CHK_FLAG(NAME) +
yyerror("only two of name, "
"namevalue and unique are allowed");
}
$4.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
{
}
;
: NAME
{
}
{
}
| UNIQUE
{
}
| VALUE
{
}
| NUMBER
{
}
| STRING
{
yyerror("unexpected STRING, expecting "
"name, namevalue, unique or value");
}
}
;
{
$3.nodep);
}
{
$3.nodep);
}
{
$3.nodep);
}
{
$3.nodep);
}
;
{
$3.nodep);
}
;
: str_arg
;
{
}
;
| topmatch
;
{
$3.nodep);
}
{
$3.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
}
{
$3.nodep);
}
;
| multiop
;
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
{
$3.nodep);
$4.nodep);
}
;
{
$3.listp);
}
{
$3.listp);
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: topmatch
| str_arg
;
;
{
}
begin_arg_list ';'
{
$3.listp);
if (MMS_PAR_CHK_FLAG(TASK) == 0) {
yyerror("a task clause is required");
}
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
: TASK
{
}
{
$4.nodep);
}
;
: WHEN
{
}
{
$4.nodep);
}
;
: when_arg
{
}
;
{
yyerror("blocking and immediate are "
"incompatible");
}
}
| BLOCKING
{
yyerror("blocking and immediate are "
"incompatible");
}
}
| STRING
{
("blocking and immediate are "
"incompatible");
}
("blocking and immediate are "
"incompatible");
}
} else {
yyerror("unexpected STRING, expecting "
"immediate or blocking");
}
}
;
: HELLO
{
}
hello_arg_list ';'
{
$3.listp);
}
}
;
{
MMS_PAR_ALLOC_LIST($$.listp);
}
{
}
;
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
{
$3.nodep);
}
;
: lang_arg
{
}
;
| DMP
| LMP
| STRING
{
yyerror("unexpected STRING, expecting "
"MMP, DMP or LMP");
}
}
;
: VERSION
{
}
{
$4.listp);
}
;
;
;
: TAG
{
}
{
$4.listp);
}
;
;
: PASSWORD
{
if (MMS_PAR_CHK_FLAG(CERTIFICATE)) {
yyerror("certificate and password "
"clauses are incompatible");
}
}
{
$4.nodep);
}
;
{
if (MMS_PAR_CHK_FLAG(PASSWORD)) {
yyerror("certificate and password "
"clauses are incompatible");
}
}
{
$4.nodep);
$5.nodep);
}
;
;
;
{
}
;
{
}
;
{
}
;
;
| str_arg
;
;
{
}
;
| STRING
{
yyerror("unexpected STRING, expecting "
"true or false");
}
}
;
%%
/*
* If 'change' verify that only one object is referenced in the match
* clause and it matches the object specified in the object clause.
*/
char *
{
char *cur_obj;
return ("no object clause");
}
return (NULL);
}
return ("object in to clause does not "
"match object in object clause");
}
}
}
return (NULL);
}