@
@	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
appsize			:	APPSIZE
archlog			:	ARCHLOG
assign			:	ASSIGN
autocorrect		:	AUTOCORRECT
backup			:	BACKUP
backupmng		:	BACKUPMNG
begin			:	BEGIN_TOKEN
binary			:	BINARY
bufile			:	BUFILE
bustat			:	BUSTAT
tsticket		:	TSTICKET
by			:	BY
check			:	CHECK
checkpoint		:	CHECKPOINT
clean			:	CLEAN
cleanup			:	CLEANUP
close			:	CLOSE
connect			:	CONNECT
copy			:	COPY
correct			:	CORRECT
cpdump			:	CPDUMP
create			:	CREATE
datafile		:	DATAFILE
db			:	DB
define			:	DEFINE
disable			:	DISABLE
drop			:	DROP
dump			:	DUMP
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
list			:	LIST
lock			:	LOCK
lockstat		:	LOCKSTAT
log			:	LOG
logfile			:	LOGFILE
logmng			:	LOGMNG
lognum			:	LOGNUM
logsize			:	LOGSIZE
loguser			:	LOGUSER
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
plain			:	PLAIN
pool			:	POOL
primary			:	PRIMARY
querycache		:	QUERYCACHE
quit			:	QUIT
rawmode			:	RAWMODE
relocate		:	RELOCATE
remove			:	REMOVE
recover			:	RECOVER
reset			:	RESET
restore			:	RESTORE
retrieve		:	RETRIEVE
right			:	RIGHT
role			:	ROLE
secondary		:	SECONDARY
session			:	SESSION
set			:	SET
settsnodeinfo		:	SETTSNODEINFO
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
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 NODE ; listNodeAction
Statement		:	LIST SESSION ; dbSessionInfoAction
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		:	THREADINFO DB ; dbThreadInfoAction
Statement		:	THREADINFO DB INTVAL ; dbThreadLastQueryAction
Statement		:	THREADINFO ADM ; admThreadInfoAction
Statement		:	THREADINFO LOG ; logThreadInfoAction
Statement		:	LIST COPY ; copyInfoAction
Statement		:	LIST TRANSACTION FOR IDENTIFIER ; transactionInfoAction
#
Statement		:	ABORT DB THREAD INTVAL ; abortDbThreadAction
#
Statement		:	RETRIEVE TABLESET FROM STRINGVAL ; retrieveTableSetAction
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		:	COPY TABLESET IDENTIFIER ; copyTableSetAction
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		:	RESET TABLESET IDENTIFIER ; resetTableSetAction
Statement		:	ADD IDENTIFIER DATAFILE STRINGVAL SIZE INTVAL TO IDENTIFIER  ; addDataFileAction
Statement		:	CHECK TABLESET IDENTIFIER ; checkTableSetAction
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 ; listBackupAction
Statement		:	SYNC TABLESET IDENTIFIER SyncCmdOption MsgOption ; syncTableSetAction
Statement		:	RESTORE TABLESET IDENTIFIER FROM STRINGVAL ; restoreTableSetAction
Statement		:	RECOVER TABLESET IDENTIFIER PitOption ; 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 LOGUSER IDENTIFIER FOR IDENTIFIER ; setTSLogUserAction
Statement		:	ENABLE AUTOCORRECT FOR IDENTIFIER ; enableAutoCorrectAction
Statement		:	DISABLE AUTOCORRECT FOR IDENTIFIER ; disableAutoCorrectAction

# Query Cache Actions
Statement		:	ENABLE TABLECACHE FOR IDENTIFIER ; enableTableCacheAction
Statement		:	DISABLE TABLECACHE FOR IDENTIFIER ; disableTableCacheAction
Statement		:	ENABLE QUERYCACHE FOR IDENTIFIER ; enableQueryCacheAction
Statement		:	DISABLE QUERYCACHE FOR IDENTIFIER ; disableQueryCacheAction
#
Statement		:	LIST QUERYCACHE FOR IDENTIFIER ; listQueryCacheAction
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
#
Statement		:	LIST TABLECACHE FOR IDENTIFIER ; listTableCacheAction
Statement		:	CLEAN TABLECACHE FOR IDENTIFIER ; cleanTableCacheAction
Statement		:	SET TABLECACHE MAXENTRY INTVAL FOR IDENTIFIER ; setTableCacheEntryAction
Statement		:	SET TABLECACHE MAXSIZE INTVAL FOR IDENTIFIER ; setTableCacheSizeAction
#
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			:   	PRIMARY EQU STRINGVAL ; storePrimaryAttr
Attr			:   	SECONDARY EQU STRINGVAL ; storeSecondaryAttr
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
PitOption		:	TO STRINGVAL ; storePit
PitOption		:
#
# Undocumented operations for testing
#
Statement		:	GETDBSPEC ; getDbSpecAction
Statement		:	GETDBINFO ; getDbInfoAction
Statement		:	SETTSNODEINFO  IDENTIFIER IDENTIFIER IDENTIFIER IDENTIFIER ; setTableSetNodeAction
Statement		:	COPY FILE STRINGVAL ; copyFileAction
#
# Statements for debugging
#
Statement		:	DUMP TABLE IDENTIFIER FOR IDENTIFIER ; dumpTable
Statement		:	DUMP UINDEX IDENTIFIER FOR IDENTIFIER ; dumpUIndex
#
END






