ABNF is documented here: http://en.wikipedia.org/wiki/Augmented_Backus <http://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form> -Naur_Form
You will first have to understand the differences and convert in to a LL ANTLR grammar. I'm not sure but ABNF might allow left recursion. In that case you need to remove left recursions from the grammar. There are standard methods to do it. Here is the theory behind it : http://www-und.ida.liu.se/~TDDA89/Notes/left.rec.pdf. And here is an article from ANTLR wiki: http://www.antlr.org/wiki/display/ANTLR3/Left-Recursion+Removal+-+Print+Edit ion Replacing backtracking by Left factoring can also be done very methodologically. You just have to remove the necessity for infinite lookahead. Refer http://www.cse.iitk.ac.in/research/mtech1998/9811115/node29.html to understand what left factoring is. If you still have doubts, send us a small segment that you are not able to left factor along with what you have tried. Regards, Indhu PS: Please address the mail to the group to get quicker and better replies. From: Bharath R [mailto:[email protected]] Sent: Friday, September 11, 2009 11:47 AM To: 'Indhu Bharathi' Subject: RE: [antlr-interest] Optimized code generation Hi , Thanx a lot for ur reply. Sorry for asking the question on basic of ANTLR , could you pls tell me how should I left factor my grammar. Currently I am working in SIP Protocol , where the RFC 3966 defines the TEL URI Grammar in ABNF format. This format need to be converted into the parser understandable way. So I have used antlrworks for writing my grammar file. And eventually end up with a complex state where I could not able to compile the grammar without "backtrack=true". Regards Bharath R HUAWEI TECHNOLOGIES CO.,LTD. huawei_logo Address: Huawei Industrial Base Bantian Longgang Shenzhen 518129, P.R.China www.huawei.com ---------------------------------------------------------------------------- --------------------------------------------------------- This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! _____ From: Indhu Bharathi [mailto:[email protected]] Sent: Thursday, September 10, 2009 10:37 PM To: [email protected]; 'antlr-interest' Subject: RE: [antlr-interest] Optimized code generation Yes, backtracking will affect performance. If you are concerned about performance, don't use backtrack and try left factoring your grammar instead. From: [email protected] [mailto:[email protected]] On Behalf Of Bharath R Sent: Thursday, September 10, 2009 5:25 PM To: 'antlr-interest' Subject: [antlr-interest] Optimized code generation Hi All , Pls let me know what are all the option that I could use , to get the generated code with more performance. ( Need to be fast in parsing ). I have enabled " backtracking = true " , will this hits the performance ??? Without this option some ambiquity is coming. Pls help me in providing any better performace tuning option that I could set for code generation. Thanx in advance Bharath R HUAWEI TECHNOLOGIES CO.,LTD. huawei_logo Address: Huawei Industrial Base Bantian Longgang Shenzhen 518129, P.R.China www.huawei.com ---------------------------------------------------------------------------- --------------------------------------------------------- This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
<<inline: image001.jpg>>
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
