@
@	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
archlog			:	ARCHLOG
assign			:	ASSIGN
backup			:	BACKUP
begin			:	BEGIN_TOKEN
binary			:	BINARY
bufile			:	BUFILE
bustat			:	BUSTAT
tsticket		:	TSTICKET
by			:	BY
check			:	CHECK
checkpoint		:	CHECKPOINT
cleanup			:	CLEANUP
close			:	CLOSE
connect			:	CONNECT
copy			:	COPY
correct			:	CORRECT
create			:	CREATE
datafile		:	DATAFILE
db			:	DB
define			:	DEFINE
disable			:	DISABLE
drop			:	DROP
dump			:	DUMP
enable			:	ENABLE
end			:	END_TOKEN
export			:	EXPORT
file			:	FILE
filter			:	FILTER
for			:	FOR
forceload		:	FORCELOAD
from			:	FROM
getdbspec		:	GETDBSPEC
gettslist		:	GETTSLIST
getnodelist		:	GETNODELIST
getdbinfo		:	GETDBINFO
import			:	IMPORT
initfile		:	INITFILE
keep			:	KEEP
list			:	LIST
lock			:	LOCK
lockstat		:	LOCKSTAT
log			:	LOG
logfile			:	LOGFILE
logmng			:	LOGMNG
lognum			:	LOGNUM
logsize			:	LOGSIZE
identified		:	IDENTIFIED
uindex			:	UINDEX
mediator		:	MEDIATOR
message			:	MESSAGE
node			:	NODE
nologging		:	NOLOGGING
object			:	OBJECT
off			:	OFF
on			:	ON
path			:	PATH
passwd			:	PASSWD
permission		:	PERMISSION
plain			:	PLAIN
pool			:	POOL
primary			:	PRIMARY
quit			:	QUIT
rawmode			:	RAWMODE
relocate		:	RELOCATE
remove			:	REMOVE
recover			:	RECOVER
reset			:	RESET
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
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 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 TO ROLE 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 ROLE 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		:	END_TOKEN BACKUP FOR IDENTIFIER MsgOption KeepTicketOpt  ; endBackupAction
Statement		:	SYNC TABLESET IDENTIFIER SyncCmdOption MsgOption ; syncTableSetAction
Statement		:	RECOVER TABLESET IDENTIFIER PitOption ; recoverTableSetAction
Statement		:	SET LOGMNG STRINGVAL TimeoutOpt ; setLogMngAction
Statement		:	SHOW LOGMNG ; showLogMngAction
#
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 TSROOT STRINGVAL FOR IDENTIFIER ; setTSRootPathAction
Statement		:	SET TSTICKET STRINGVAL FOR IDENTIFIER ; setTSTicketAction
Statement		:	SET LOGNUM INTVAL FOR IDENTIFIER ; setTSLogNumAction
Statement		:	SET LOGSIZE INTVAL FOR IDENTIFIER ; setTSLogSizeAction
Statement		:	SET SORTAREASIZE INTVAL FOR IDENTIFIER ; setTSSortAreaSizeAction
#
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 LogOpt ; importTableAction
Statement		:	IMPORT XPMode TABLESET IDENTIFIER FROM STRINGVAL LogOpt ; importTableSetAction
Statement		:	IMPORT XPMode TABLESET STRUCTURE IDENTIFIER FROM STRINGVAL LogOpt ; importTableSetStructureAction
#
KeepTicketOpt		:	KEEP TSTICKET ; keepTicketAction
KeepTicketOpt		:	
SyncCmdOption		:	WITH STRINGVAL TimeoutOpt ; syncCmdAction
SyncCmdOption		:
TimeoutOpt		:	TIMEOUT INTVAL ; timeoutAction
TimeoutOpt		:
LogOpt			:	NOLOGGING ; nologAction
LogOpt			:
MsgOption		:	MESSAGE STRINGVAL ; msgAction 
MsgOption		:
StartOptList		:	StartOptList StartOpt
StartOptList		:		
StartOpt		:	CLEANUP ; cleanupAction
StartOpt		:	FORCELOAD ; forceloadAction
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			:   	SORTAREASIZE EQU INTVAL ; storeSortAreaAttr
Attr			:   	TSROOT EQU STRINGVAL ; storeTSRootAttr
Attr			:   	TSTICKET EQU STRINGVAL ; storeTSTicketAttr
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






