Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of topic question: EBNF

Status
Not open for further replies.

toolkit

Programmer
Aug 5, 2001
771
GB
Aplogies for posting this out of topic question, but I couldn't find a forum that deals with syntactic metalanguages. I was just wondering if any of you Java gurus have any experience of using ISO/IEC 14977 Extended BNF (Backus-Naur Form) for defining syntax.

Lets give a quick example:
Code:
uk date format = day, delimiter, month, delmiter, year ;
day = 2 * digit ;
month = 2 * digit ;
year = 4 * digit ;
digit = ( "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" );
delimiter = ( "/" | "-" | "." );

My question relates to defining a decimal fractional part for a fixed precision number:
Code:
fractional part = ".", ( precision * digit ) ;
precision = digit ;

Is this valid -> to specify the multuplier to be precision? All the examples I have seen have used actual numbers as opposed to a non-terminal symbol.

Thanks for any advice, cheers Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top