Is there a library for .NET that does brackets or expression reduction and optimization?

Is there a library for .NET that does brackets or expression reduction and optimization? Something that will take an expression, such as (A and (((B) | (C)) | D))) and return

A and (B | C | D)

But also take (A and A) and return A

+3
source share
2 answers

This relates more to the field of standalone analyzer / lexical analyzer. But ANTLR has a pretty nice binding to C # if it suits your goals.

It would probably not be very much work to write a simple parser for strings of this kind and do the reduction yourself.

+2
0

Source: https://habr.com/ru/post/1739662/


All Articles