|
|
Re: what is syntactic predicates ? [message #1732777 is a reply to message #1732776] |
Fri, 20 May 2016 07:54 |
Sachin Samaram Messages: 271 Registered: April 2016 |
Senior Member |
|
|
Thanks. One more question
I have so many keywords for dbms query like
DbmsKeyWords: ('sql'|'insert'|'into'|'values'|'delete'|'update'|'set'|'select'|'distinct'|'from'|'where'|'exists'|'in'|'is'|'any'|'all'|'some'|'and' |'or'|'left'|'right'|'inner'|'outer'|'join'
|'char'|'datetime'|'float'|'int'|'long'|'create'|'table'|'database'|'drop'|'between'| 'group by'|'having'|'like'| 'escape'|'order'|'asc'|'desc'|'not'|'null'|'avg'|'min'|'max'
|'sum'|'primary'|'foreign'|'key'|'references'|'like'|'escape'|'with'|'engine'|'close'|'column_names'| 'connection'|'close_all_connections'|'declare'|'cursors'|'continue'|'execute'|'cursor'
|'using'|'rpc'|'alias'|'binary'|'catquery'| 'to'|'separator' |'heading'| 'on'|'off'|'column'|'names'|'format'|'occur'|'start'|'unique'|'connected'|'continue_bottom'|'continue_down'|
'continue_top'|'continue_up'|'store'|'file'|'onentry'|'onerror'| 'onexit'|'application' |'autocommit'|'begin'|'browse'|'cancel'|'commit'|'completion'|'run'|'rollback'|'user'|'database'|
'datasource'|'server'|'procedure'|'stored_sub'|'save'|'flush'|'timeout'|'transaction');
Parser compiling fine the above rule but if I use the above rule inside other like
DbmsStmt: 'dbms' (dbmsKeyWords+=DbmsKeyWords)+ & (exp+=Expression); it is not working. Can you please tell me how to achieve it?
Example for DBMS queries:
DBMS WITH CURSOR b1133_in_exec EXECUTE
DBMS CLOSE CURSOR b1133_in_exec
DBMS SQL CREATE TEMP TABLE complaint_errors ( batch_id CHAR (20), \
iss_agency_cd CHAR (3) , \
officer_id CHAR (5) , \
compl_nbr CHAR (11), \
def_name CHAR (50), \
chrg_nbr CHAR (2) , \
field_name CHAR (36), \
error_message CHAR (50), \
reject_ind CHAR (1), \
message_id CHAR (10)) \
WITH NO LOG
DBMS DECLARE get_dummy CURSOR FOR \
SELECT parm_val_int dummy_per\
FROM parameters WHERE parm_nbr = 29
DBMS WITH CURSOR get_dummy EXECUTE
DBMS CLOSE CURSOR get_dummy
b1133_db_table_name = "INTERNAL_EVENT"
DBMS DECLARE get_event CURSOR FOR \
SELECT event_cd b1133_event_cd\
FROM internal_event \
WHERE process_id = "BPS1133" \
AND internal_event_id = 4
DBMS WITH CURSOR get_event EXECUTE
DBMS CLOSE CURSOR get_event
The keywords like DBMS, WITH, CURSOR etc should be displayed keyword color.
|
|
|
|
Re: what is syntactic predicates ? [message #1732782 is a reply to message #1732778] |
Fri, 20 May 2016 08:15 |
Sachin Samaram Messages: 271 Registered: April 2016 |
Senior Member |
|
|
I don't know what term should I use. But my simple question is I have a dbms query as for example:
DBMS SQL CREATE TEMP TABLE complaint_errors ( batch_id CHAR (20), \
iss_agency_cd CHAR (3) , \
officer_id CHAR (5) , \
compl_nbr CHAR (11), \
def_name CHAR (50), \
chrg_nbr CHAR (2) , \
field_name CHAR (36), \
error_message CHAR (50), \
reject_ind CHAR (1), \
message_id CHAR (10)) \
WITH NO LOG
Here in the above grammar I want show DBMS, SQL, CREATE, TEMP, TABLE, CHAR, WITH, NO, LOG as keywords.
I tried as shown in above comment and also used terminal rule. No luck.
Please find the attached grammar file for dbms.
[Updated on: Fri, 20 May 2016 01:14] Report message to a moderator
|
|
|
Re: what is syntactic predicates ? [message #1732788 is a reply to message #1732782] |
Fri, 20 May 2016 08:26 |
|
well that is not what i call a minimal grammar.
then your grammar does not built at all due ambiguity. i assume you have enabled backtracking.
and ignoreCase as well.
then the DbmsStmt rule is nowhere called.
thus you cannot expect it wo work
i assue it goes into Statements alternatives.
but as said: in this grammar there is way too much stuff to tackle down the problem.
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
Re: what is syntactic predicates ? [message #1732822 is a reply to message #1732821] |
Fri, 20 May 2016 13:01 |
|
Hi,
i do not have the time and mood to fix your complete grammar.
it has too many problems to takle down at once.
thus the only thing i can do i to offer your help on a stripped down example.
this example would help you to understand your problem better.
and you should not introduce new stuff into a grammar that is already "exploding".
=> solve your problems step by step.
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.03871 seconds