Hey everyone,

I want to write a BNF for a particular language.

Can anyone recommend a good resource/guide for generating a BNF for a language?

I'm just wondering is there a formula to follow before I start examining every possible statement!

Cheers

Tom

I think this sort of thing should just be... intuitively straightforward. The only part that might not be is the question of how to deal with different operator precedences.

What is a program? It's merely a sequence of top level definitions!

<program> ::= <top-level-definition> <program> | <top-level-definition>

What is a top-level definition? And so on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.