EBNF/BNF Form (1 Viewer)

DoubleD

....Theonly One
Joined
Aug 15, 2004
Messages
100
Location
NE NSW
Gender
Male
HSC
2005
I'm asking for some reference sites for BNF/EBNF and the etc, i'm asking as at school we use the heinman SDD book(absolutly shocking.. shame we're only a poor school, and havingt about 23 people(like 5 do work) in it it's not that easy to go and buy a better one)

So i'm asking for some reference sites for ENF/BNf, the book seems to have explained it wrong.. .and even then, it was supposed to make programming unambiguopus? well it's done the oppisite in that book, we can't tell if it means one thing or another!
one answer is like this:
Exponent = E [+] < integer > | E [-] < integer >

Now is that supposed to be
E [+] {{{< integer > OR another E}}}} [-] < integer >
When it should be writen like this i would think:

Exponent = (E [+] < integer >) | (E [-] < integer >)

or even

Exponent = E [+|-] < integer >

Get the idea? it's just plain written hopelessly.. any links?

-=DD32/DoubleD=-
Back later..
*EDIT: Theres some < integer > things that weren't showing up.. didn't reaslei there was html alowd..
 
Last edited:

hornetfig

Member
Joined
Jun 27, 2004
Messages
65
Location
Sydney. oddly
Gender
Male
HSC
2003
for your particular example, what it really means to indicate (I think) is

Exponent = E[+|-]

which allows E, E+ or E- (how an exponent would be written). Your inference

Exponent = (E[+]) | (E[-])

The way is is written also allows this but it seems a bit redundant.
But from the way it is written

Exponent = E [+] | E [-]

this strictly means you can have

EE
EE-
E
E-
E+-

which seems to be clearly in error.
 

raymes

Member
Joined
Jan 21, 2004
Messages
116
Location
Sydney
Gender
Male
HSC
2004
both the ways you have re-written it are completely correct.
i had the same dillema as you at one stage because it is not uncommon for ebnf to be written sloppily as in your example. one example (off the top of my head), a multiple choice question from the 2003 trial CSSA paper had an ebnf statement which was difficult to interpret for the above reason
 

DoubleD

....Theonly One
Joined
Aug 15, 2004
Messages
100
Location
NE NSW
Gender
Male
HSC
2005
ok thanks for those answers.. i thought i was right, and the heinmann sdd book ddin't mention anythign at al abotu the grouping brackets (), i only worked those out after alengthy google search thinking it was logical that there'd be some kind of grouping..

What book does everyone recomend?(if i was to consider looking int oanother book)

-=DD32/DoubleD=-
 

raymes

Member
Joined
Jan 21, 2004
Messages
116
Location
Sydney
Gender
Male
HSC
2004
sam davis' book is good but again, the HSC book does a pretty brief job of explaining metalanguages, mainly because its covered in more detail in his preliminary book
 

dark`secrets

<insert title>
Joined
Dec 23, 2003
Messages
2,703
Gender
Undisclosed
HSC
N/A
umm shouldnt there be some notes regarding ebnf or bnf on the resource page?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top