I want to apply rules of BNF Grammar to produce derivation for : a_Num
Asked
Active
Viewed 989 times
1 Answers
3
Your question is a bit vague. But below is a BNF (ish) grammar for an integer number.
nz_digit = '1' | ... | '9';
digit = '0' | nz_digit;
digitseq = digit | digitseq, digit;
num = '0' | nz_digit, digitseq;

Toon Krijthe
- 52,876
- 38
- 145
- 202
-
1That's for an unsigned int, depending on the context one might need the minus sign, too. – johannes Nov 10 '09 at 13:36
-
Agreed, but he can add that himself, I just gave some basic example. – Toon Krijthe Nov 10 '09 at 13:42