help with BNF

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Nov 2008
Posts: 10
Reputation: laki234 is an unknown quantity at this point 
Solved Threads: 0
laki234 laki234 is offline Offline
Newbie Poster

help with BNF

 
0
  #1
Nov 25th, 2008
hi

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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,971
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 286
ddanbe's Avatar
ddanbe ddanbe is online now Online
Posting Virtuoso

Re: help with BNF

 
0
  #2
Nov 26th, 2008
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.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 16
Reputation: gbertoli3 is an unknown quantity at this point 
Solved Threads: 0
gbertoli3 gbertoli3 is offline Offline
Newbie Poster

Re: help with BNF

 
0
  #3
Nov 26th, 2008
Is this even C#?
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 16
Reputation: gbertoli3 is an unknown quantity at this point 
Solved Threads: 0
gbertoli3 gbertoli3 is offline Offline
Newbie Poster

Re: help with BNF

 
0
  #4
Nov 26th, 2008
Then why is it in the C# Forum?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,971
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 286
ddanbe's Avatar
ddanbe ddanbe is online now Online
Posting Virtuoso

Re: help with BNF

 
0
  #5
Nov 26th, 2008
Originally Posted by gbertoli3
Is this even C#?
No it isn't...
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,971
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 286
ddanbe's Avatar
ddanbe ddanbe is online now Online
Posting Virtuoso

Re: help with BNF

 
0
  #6
Nov 26th, 2008
Cave ab homine unius libri.
There is to my knowledge no forum on BNF so he might as well have posted it here.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 16
Reputation: gbertoli3 is an unknown quantity at this point 
Solved Threads: 0
gbertoli3 gbertoli3 is offline Offline
Newbie Poster

Re: help with BNF

 
0
  #7
Nov 26th, 2008
Yeah I guess!
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,971
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 286
ddanbe's Avatar
ddanbe ddanbe is online now Online
Posting Virtuoso

Re: help with BNF

 
0
  #8
Nov 26th, 2008
Nice snippet. Why use unsafe code?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 16
Reputation: gbertoli3 is an unknown quantity at this point 
Solved Threads: 0
gbertoli3 gbertoli3 is offline Offline
Newbie Poster

Re: help with BNF

 
0
  #9
Nov 26th, 2008
Thanks!

I saw some snippets using unsafe code for Image Manipulation. When I compared the two Images the method using the unsafe code looked better.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,971
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 286
ddanbe's Avatar
ddanbe ddanbe is online now Online
Posting Virtuoso

Re: help with BNF

 
0
  #10
Nov 26th, 2008
Can be. Why not use assembler then, it will look even better.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Computer Science Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC