EBNF rule into BNF

Hi I am having a lot of trouble with this problem and I came across a lot of sites but found this post How to convert BNF to EBNF to be very helpful but I just don't know where to start with this example.

<decimal_literal> --> (0|1|2|3|4|5|6|8|9){0|1|2|3|4|5|6|7|8|9|_}

In this rule the parenthesis and curly braces are metasymbols. It needs more than 1 rule and may need to introduce 1 or more new non-terminals.

This is the textbook I am using http://umsl.edu/~mfrp9/misc/cpl.pdf page 131 shows an example but I can't apply it to this problem. If someone can please explain the solution to this problem step by step so I can learn it to do similar problems is greatly appreciated.

Answers


This looks plausible as a translation to the BNF from p131 of the book.

<decimal_literal> ⟶ <decimal_digit>
    | <decimal_literal> <decimal_digit_or_underscore>

<decimal_digit> ⟶ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<decimal_digit_or_underscore> ⟶ <decimal_digit> | _

Need Your Help

Access java.sql.connection from ActiveRecord JRuby?

ruby-on-rails activerecord jruby jxls

I am using Jruby and Rails 3 with jxls, a Java library to generate reports in Excel.

Example of a build.xml for an EAR that deploys in WebSphere 6

java-ee deployment ant websphere ear

I'm trying to convince my providers to use ANT instead of Rational Application Development so anyone can recompile, recheck, redeploy the solution anyplace, anytime, anyhow. :P

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.