@
@	Cego admin language definition
@	------------------------------
@	by Bjoern Lemke
@
@	(C)opyright 2006-2013 by Bjoern Lemke
@
@	This language defintion can be used with Dragon(c) 
@	for parser code generation

HEADER
IGNORE	STRINGVAL
SEPIGNORE '\t'
SEPIGNORE ' '
SEPSIGN '.'
SEPSIGN ';'
SEPSIGN ','
SEPSIGN '='
SEPSIGN '<'
SEPSIGN '>'
SEPSIGN ')'
SEPSIGN '('
SEPSIGN '['
SEPSIGN ']'
SEPSIGN '*'
SEPSIGN '/'
SEPSIGN '+'
SEPSIGN '-'
SEPSIGN '|'
END

TOKENSET
abort			:	ABORT
add			:	ADD
adm			:	ADM
appendmode		:	APPENDMODE
appsize			:	APPSIZE
archlog			:	ARCHLOG
assign			:	ASSIGN
autocorrect		:	AUTOCORRECT
backup			:	BACKUP
backupmng		:	BACKUPMNG
begin			:	BEGIN_TOKEN
binary			:	BINARY
branchid		:	BRANCHID
bufile			:	BUFILE
bustat			:	BUSTAT
tsticket		:	TSTICKET
by			:	BY
checkpoint		:	CHECKPOINT
clean			:	CLEAN
cleanup			:	CLEANUP
close			:	CLOSE
connect			:	CONNECT
correct			:	CORRECT
cost			:	COST
cpdump			:	CPDUMP
create			:	CREATE
datafile		:	DATAFILE
db			:	DB
define			:	DEFINE
direct			:	DIRECT
disable			:	DISABLE
drop			:	DROP
enable			:	ENABLE
end			:	END_TOKEN
maxentry		:	MAXENTRY
export			:	EXPORT
file			:	FILE
filter			:	FILTER
for			:	FOR
forceload		:	FORCELOAD
from			:	FROM
getdbspec		:	GETDBSPEC
gettslist		:	GETTSLIST
getnodelist		:	GETNODELIST
getdbinfo		:	GETDBINFO
hashrange		:	HASHRANGE
import			:	IMPORT
initfile		:	INITFILE
keep			:	KEEP
last			:	LAST
list			:	LIST
lsn			:	LSN
lock			:	LOCK
locks			:	LOCKS
lockstat		:	LOCKSTAT
log			:	LOG
logfile			:	LOGFILE
logmng			:	LOGMNG
lognum			:	LOGNUM
logsize			:	LOGSIZE
identified		:	IDENTIFIED
uindex			:	UINDEX
maxsize			:	MAXSIZE
mediator		:	MEDIATOR
message			:	MESSAGE
node			:	NODE
noinit			:	NOINIT
object			:	OBJECT
off			:	OFF
on			:	ON
parameter		:	PARAMETER
path			:	PATH
passwd			:	PASSWD
permission		:	PERMISSION
pit			:	PIT
plain			:	PLAIN
pool			:	POOL
post			:	POST
querycache		:	QUERYCACHE
queryhist		:	QUERYHIST
quit			:	QUIT
rawmode			:	RAWMODE
relocate		:	RELOCATE
remove			:	REMOVE
recover			:	RECOVER
recovery		:	RECOVERY
reset			:	RESET
restore			:	RESTORE
right			:	RIGHT
role			:	ROLE
session			:	SESSION
set			:	SET
size			:	SIZE
sortareasize		:	SORTAREASIZE
structure		:	STRUCTURE
show			:	SHOW
start			:	START_TOK
stop			:	STOP_TOK
switch			:	SWITCH
sync			:	SYNC
syssize			:	SYSSIZE
table			:	TABLE
tablecache		:	TABLECACHE
tableset		:	TABLESET
timeout			:	TIMEOUT
thread			:	THREAD
threadinfo		:	THREADINFO
threshold		:	THRESHOLD
tmpsize			:	TMPSIZE
to			:	TO
trace			:	TRACE
transaction		:	TRANSACTION
tsroot			:	TSROOT
user			:	USER
verify			:	VERIFY
with			:	WITH
xml			:	XML
','			:	KSEP
';'			: 	SEMICOLON
'='			:	EQU
(0|[1-9]*[0-9])		:	INTVAL
[a-zA-Z]*[a-zA-Z0-9_]	:	IDENTIFIER
END

PRODUCTIONSET
Start			:	Statement SEMICOLON ; statementAction
Statement		:	SHOW POOL ; poolInfoAction
Statement		:	SHOW PARAMETER ; parameterInfoAction
Statement		:	SHOW TABLESET IDENTIFIER ; tableSetInfoAction
Statement		:	LIST POOL ; poolEntryListAction
Statement		:	RAWMODE ON ; rawModeOn
Statement		:	RAWMODE OFF ; rawModeOff
Statement		:	LIST IDENTIFIER LOCK ; lockInfoAction
Statement		:	LIST TABLESET ; listTableSetAction
Statement		:	LIST DATAFILE FOR IDENTIFIER ; dataFileInfoAction
Statement		:	LIST ARCHLOG FOR IDENTIFIER ; archLogInfoAction
Statement		:	LIST LOGFILE FOR IDENTIFIER ; logInfoAction
Statement		:	LIST OBJECT FOR IDENTIFIER ; objInfoAction
Statement		:	LIST BUFILE FOR IDENTIFIER ; buFileInfoAction
Statement		:	LIST BUSTAT FOR IDENTIFIER ; buStatInfoAction
Statement		:	RESET BUSTAT FOR IDENTIFIER ; buStatResetAction
Statement		:	THREADINFO ; threadInfoAction
Statement		:	LOCKSTAT ; lockStatAction
Statement		:	VERIFY LOCKS ; verifyLocksAction	
Statement		:	THREADINFO DB ; dbThreadInfoAction
Statement		:	QUERYHIST THREAD INTVAL ; dbThreadQueryHistAction
Statement		:	QUERYHIST LAST INTVAL ; dbQueryHistLastAction
Statement		:	QUERYHIST COST INTVAL ; dbQueryHistCostAction
#
Statement		:	THREADINFO ADM ; admThreadInfoAction
Statement		:	LIST TRANSACTION FOR IDENTIFIER ; transactionInfoAction
#
Statement		:	ABORT DB THREAD INTVAL ; abortDbThreadAction
#
Statement		:	DEFINE TABLESET IDENTIFIER AttrList ; defineTableSetAction
Statement		:	CREATE TABLESET IDENTIFIER ; createTableSetAction
Statement		:	START_TOK TABLESET IDENTIFIER StartOptList ; startTableSetAction
Statement		:	STOP_TOK TABLESET IDENTIFIER ; stopTableSetAction
Statement		:	START_TOK RECOVERY IDENTIFIER ; startRecoveryAction
Statement		:	STOP_TOK RECOVERY IDENTIFIER ; stopRecoveryAction
# Statement		:	SWITCH TABLESET IDENTIFIER ; switchTableSetAction
# Statement		:	SWITCH SECONDARY FOR IDENTIFIER ; switchSecondaryAction
# Statement		:	SWITCH MEDIATOR FOR IDENTIFIER ; switchMediatorAction
# Statement		:	RELOCATE SECONDARY FOR IDENTIFIER TO STRINGVAL ; relocateSecondaryAction
# Statement		:	RELOCATE MEDIATOR FOR IDENTIFIER TO STRINGVAL ; relocateMediatorAction
Statement		:	DROP TABLESET IDENTIFIER ; dropTableSetAction
Statement		:	REMOVE TABLESET IDENTIFIER ; removeTableSetAction
Statement		:	ADD IDENTIFIER DATAFILE STRINGVAL SIZE INTVAL TO IDENTIFIER  ; addDataFileAction
Statement		:	VERIFY TABLESET IDENTIFIER ; verifyTableSetAction
Statement		:	CORRECT TABLESET IDENTIFIER ; correctTableSetAction
#
Statement		:	ADD USER IDENTIFIER IDENTIFIED BY STRINGVAL ; addUserAction
Statement		:	LIST USER ; listUserAction
Statement		:	DROP USER IDENTIFIER  ; removeUserAction
Statement		:	PASSWD USER IDENTIFIER IDENTIFIED BY STRINGVAL ; changePwdAction
Statement		:	ASSIGN ROLE IDENTIFIER TO IDENTIFIER ; assignRoleAction
Statement		:	REMOVE ROLE IDENTIFIER FROM IDENTIFIER ; removeRoleAction
Statement		:	LIST ROLE ; listRoleAction
Statement		:	SHOW ROLE IDENTIFIER ; showRoleAction
Statement		:	CREATE ROLE IDENTIFIER ; createRoleAction
Statement		:	DROP ROLE IDENTIFIER ; dropRoleAction
Statement		:	SET PERMISSION IDENTIFIER WITH PermList FOR IDENTIFIER ; setPermAction
PermList		:	PermList KSEP PermEntry
PermList		:	PermEntry 
PermEntry		:	TABLESET EQU IDENTIFIER ; setTableSetPerm
PermEntry		:	FILTER EQU STRINGVAL ; setFilterPerm
PermEntry		:	RIGHT EQU IDENTIFIER ; setRightPerm
Statement		:	REMOVE PERMISSION IDENTIFIER FROM IDENTIFIER ; removePermAction
#
Statement		:	TRACE ON USER IDENTIFIER  ; traceOnAction
Statement		:	TRACE OFF USER IDENTIFIER  ; traceOffAction
#
Statement		:	ENABLE ARCHLOG FOR IDENTIFIER ; enableArchLogAction
Statement		:	DISABLE ARCHLOG FOR IDENTIFIER ; disableArchLogAction
Statement		:	ADD ARCHLOG IDENTIFIER PATH STRINGVAL TO IDENTIFIER ; addArchLogAction
Statement		:	REMOVE ARCHLOG IDENTIFIER FROM IDENTIFIER ; removeArchLogAction
Statement		:	BEGIN_TOKEN BACKUP FOR IDENTIFIER MsgOption ; beginBackupAction
Statement		:	BACKUP TABLESET IDENTIFIER MsgOption ; executeBackupAction
Statement		:	END_TOKEN BACKUP FOR IDENTIFIER MsgOption KeepTicketOpt  ; endBackupAction
Statement		:	LIST BACKUP FOR IDENTIFIER ListBuOption ; listBackupAction
Statement		:	SYNC TABLESET IDENTIFIER SyncCmdOption MsgOption ; syncTableSetAction
Statement		:	RESTORE TABLESET IDENTIFIER FROM STRINGVAL ; restoreTableSetAction
Statement		:	RECOVER TABLESET IDENTIFIER RecoverPitOption ; recoverTableSetAction
Statement		:	SET LOGMNG STRINGVAL TimeoutOpt ; setLogMngAction
Statement		:	SET BACKUPMNG STRINGVAL ; setBackupMngAction
Statement		:	SHOW LOGMNG ; showLogMngAction
Statement		:	SHOW BACKUPMNG ; showBackupMngAction
#
Statement		:	SET INITFILE STRINGVAL FOR IDENTIFIER ; setTSInitFileAction
Statement		:	SET CHECKPOINT INTVAL FOR IDENTIFIER ; setCheckpointAction
Statement		:	SET SYSSIZE INTVAL FOR IDENTIFIER ; setTSSysSizeAction
Statement		:	SET TMPSIZE INTVAL FOR IDENTIFIER ; setTSTmpSizeAction
Statement		:	SET APPSIZE INTVAL FOR IDENTIFIER ; setTSAppSizeAction
Statement		:	SET TSROOT STRINGVAL FOR IDENTIFIER ; setTSRootPathAction
Statement		:	SET LOGNUM INTVAL FOR IDENTIFIER ; setTSLogNumAction
Statement		:	SET LOGSIZE INTVAL FOR IDENTIFIER ; setTSLogSizeAction
Statement		:	SET SORTAREASIZE INTVAL FOR IDENTIFIER ; setTSSortAreaSizeAction
Statement		:	SET QUERYHIST LAST INTVAL ; setNumQueryLastAction
Statement		:	SET QUERYHIST COST INTVAL ; setNumQueryCostAction	
#
#
Statement		:	ENABLE APPENDMODE FOR IDENTIFIER ; enableAppendModeAction
Statement		:	DISABLE APPENDMODE FOR IDENTIFIER ; disableAppendModeAction
#
Statement		:	SET AUTOCORRECT AutoCorrectMode FOR IDENTIFIER ; setAutoCorrectAction
AutoCorrectMode		:	DIRECT ; setAutoCorrectDirect
AutoCorrectMode		:	POST ; setAutoCorrectPost
AutoCorrectMode		:	OFF ; setAutoCorrectOff

# Table Cache Actions
Statement		:	ENABLE TABLECACHE FOR IDENTIFIER ; enableTableCacheAction
Statement		:	DISABLE TABLECACHE FOR IDENTIFIER ; disableTableCacheAction
Statement		:	LIST TABLECACHE FOR IDENTIFIER ; listTableCacheAction
Statement		:	SHOW TABLECACHE FOR IDENTIFIER ; showTableCacheAction
Statement		:	CLEAN TABLECACHE FOR IDENTIFIER ; cleanTableCacheAction
Statement		:	SET TABLECACHE TableCacheParamList FOR IDENTIFIER ; setTableCacheParamAction
TableCacheParamList	:	TableCacheParamList KSEP TableCacheParam
TableCacheParamList	:	TableCacheParam
TableCacheParam		:       FILTER EQU STRINGVAL ; setTableCacheFilter
TableCacheParam		:       MAXSIZE EQU INTVAL ; setTableCacheMaxSize
TableCacheParam		:       MAXENTRY EQU INTVAL ; setTableCacheMaxEntry
TableCacheParam		:       HASHRANGE EQU INTVAL ; setTableCacheHashRange
#
# Query Cache Actions
Statement		:	ENABLE QUERYCACHE FOR IDENTIFIER ; enableQueryCacheAction
Statement		:	DISABLE QUERYCACHE FOR IDENTIFIER ; disableQueryCacheAction
Statement		:	LIST QUERYCACHE FOR IDENTIFIER ; listQueryCacheAction
Statement		:	SHOW QUERYCACHE FOR IDENTIFIER ; showQueryCacheAction
Statement		:	CLEAN QUERYCACHE FOR IDENTIFIER ; cleanQueryCacheAction
Statement		:	SET QUERYCACHE QueryCacheParamList FOR IDENTIFIER ; setQueryCacheParamAction
QueryCacheParamList	:	QueryCacheParamList KSEP QueryCacheParam
QueryCacheParamList	:	QueryCacheParam
QueryCacheParam		:       MAXENTRY EQU INTVAL ; setQueryCacheMaxEntry
QueryCacheParam		:       MAXSIZE EQU INTVAL ; setQueryCacheMaxSize
QueryCacheParam		:       HASHRANGE EQU INTVAL ; setQueryCacheHashRange
QueryCacheParam		:       THRESHOLD EQU INTVAL ; setQueryCacheThreshold
#
#
Statement		:	EXPORT XPMode TABLE IDENTIFIER FROM IDENTIFIER TO STRINGVAL ; exportTableAction
Statement		:	EXPORT XPMode TABLESET IDENTIFIER TO STRINGVAL ; exportTableSetAction
Statement		:	EXPORT XPMode TABLESET STRUCTURE IDENTIFIER  TO STRINGVAL ; exportTableSetStructureAction
Statement		:	IMPORT XPMode TABLE IDENTIFIER TO IDENTIFIER FROM STRINGVAL ; importTableAction
Statement		:	IMPORT XPMode TABLESET IDENTIFIER FROM STRINGVAL ; importTableSetAction
Statement		:	IMPORT XPMode TABLESET STRUCTURE IDENTIFIER FROM STRINGVAL ; importTableSetStructureAction
#
KeepTicketOpt		:	KEEP TSTICKET ; keepTicketAction
KeepTicketOpt		:	
SyncCmdOption		:	WITH STRINGVAL TimeoutOpt ; syncCmdAction
SyncCmdOption		:
TimeoutOpt		:	TIMEOUT INTVAL ; timeoutAction
TimeoutOpt		:
MsgOption		:	MESSAGE STRINGVAL ; msgAction 
MsgOption		:
StartOptList		:	StartOptList StartOpt
StartOptList		:		
StartOpt		:	CLEANUP ; cleanupAction
StartOpt		:	FORCELOAD ; forceloadAction
StartOpt		:	CPDUMP ; cpDumpAction
StartOpt		:	NOINIT ; noInitAction	
#
XPMode			:	XML ; xmlModeAction
XPMode			:	BINARY ; binModeAction
XPMode			:	PLAIN ; plainModeAction
XPMode			:	
#
AttrList		:   	AttrList Attr 
AttrList   		: 
Attr			:   	SYSSIZE EQU INTVAL ; storeSysSizeAttr
Attr			:   	TMPSIZE EQU INTVAL ; storeTmpSizeAttr
Attr			:   	LOGSIZE EQU INTVAL ; storeLogSizeAttr
Attr			:   	LOGNUM EQU INTVAL ; storeLogNumAttr
Attr			:	APPSIZE EQU INTVAL ; storeAppSizeAttr
Attr			:   	SORTAREASIZE EQU INTVAL ; storeSortAreaAttr
Attr			:   	TSROOT EQU STRINGVAL ; storeTSRootAttr
Attr			:   	BRANCHID EQU INTVAL ; storeBranchAttr
ListBuOption		:	TO STRINGVAL ; storePit
ListBuOption		:
RecoverPitOption		:	TO PIT STRINGVAL ; storePit
RecoverPitOption		:   	TO LSN INTVAL ; storeLsn
RecoverPitOption		:
#
END






