here is BNF grammer.Can anybody help me to understand it.

<bool exp> -> <bool term> { "&" <bool term>}

<bool exp> -> "!" "(" <bool exp> ")"

<bool exp> -> <relation> { "|" <relation>}
<relation> -> <exp> ("=" | "<" | ">") <exp>
<exp> -> <term> {"+" <term> | "-" <term>}
<term> -> <factor> { "*" <factor> | "/" <factor>}
<factor> -> <number> | "(" <exp> ")"

here.inside double quote marks are terminals symbols,but | alone is a meta-symbol in the grammer.

The last line <factor> -> <number> | "(" <exp> ")"
says that a <factor> is a <number> or a <exp> enclosed in brackets.
The line <term> -> <factor> { "*" <factor> | "/" <factor>} means that a <term> is a <factor> followed by zero or more <factor> things which are preceded by a * or / sign.
With this you should be able to find the rest yourself, otherwise : google BNF grammar.

Is this even C#?

No it isn't...

Then why is it in the C# Forum?

Cave ab homine unius libri.
There is to my knowledge no forum on BNF so he might as well have posted it here.

Nice snippet. Why use unsafe code?


I saw some snippets using unsafe code for Image Manipulation. When I compared the two Images the method using the unsafe code looked better.

Can be. Why not use assembler then, it will look even better.

You must be joking if you never heard the word "assembler"

I just wanted to know which one(s)! Sorry for the poor wording. I've never made / used an assembler, but I know what one is.