[antlr-interest] Logical Expression parser

Nazim Oztahtaci nazim_oztahtaci at hotmail.com
Mon Feb 15 14:57:37 PST 2010


Hi,
I want to write a parser using ANTLR grammar. I would like to translate the logical expression to Sum of Product form. I give you the example below.

Steps for expression: ((a AND b)
OR (c AND d))' ->de morgan: (a' OR b') AND (c' OR
d')->distribution: (a' AND c') OR (a' AND d'.....). So I will have
DNF form in the result. I plan to use Antlr. I will write the grammar
and then create the necessary files on the C#. First it would be great
if you confirm me about it. I will just have AND OR operators and NOT.
For instance (a OR NOT b) means actually (a or b)not. Also (a NOT OR b
NOT) means a' OR b'. Do you have any example grammar for this task? I
found one in codeproject but doesnt explain in bried detailly. Or at least someone can guide me little bit.

Best regards & Thanks for your time
Nazim 		 	   		  
_________________________________________________________________
Windows Live: Arkadaşlarınız size e-posta gönderdiklerinde Flickr, Twitter ve Digg'deki hareketlerinizi görürler.
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:tr-tr:SI_SB_3:092010


More information about the antlr-interest mailing list