dcsimg
Validating a script with more OR and AND Conditions inside one IF Loop takes a while to complete.
0 posts in topic
Thread View Thread View
TOPIC ACTIONS:
 

Validating a script with more OR and AND Conditio...
camilion
Mon Dec 16, 2013 10:29 AM

Hi,
 Please I am running an issue with this case. I have a script that I am trying to save to the database, but before saving  I need to validate the grammar of the rule with ANTLR. The issue is that its taking a while to parse the script below;

"

			IF  ((result1 = "Y" AND result2 = "Y") OR (result1 = "Y" AND result3 = "Y") OR
			(result1 = "Y" AND result4 = "Y") OR (result1 = "Y" AND result5 = "Y") OR
			(result1 = "Y" AND result6 = "Y") OR (result2 = "Y" AND result3 = "Y") OR
			(result2 = "Y" AND result4 = "Y") OR (result2 = "Y" AND result5 = "Y") OR
			(result2 = "Y" AND result6 = "Y") OR (result3 = "Y" AND result4 = "Y") OR
			(result3 = "Y" AND result5 = "Y") OR (result3 = "Y" AND result6 = "Y") OR
			(result4 = "Y" AND result5 = "Y") OR (result4 = "Y" AND result6 = "Y") OR
			(result5 = "Y" AND result6 = "Y") )
			RETURN true
		
"
I can't specify exactly a number of OR?AND from what it started to failed but when debugging the number was fluctuating between 14 and 22.
Its looks like its a limitations of the ANTLR, but not quite sure.
Please is somebody experience this issue before or could somebody provide me some insight on how to resolve this?
Thanks
About | Sitemap | Contact