[FRPythoneers] Re: [lug] MEAS Data file format
dajo at frii.com
Wed Aug 16 16:57:41 MDT 2000
> Yes, I see what you mean. So, what I meant was: "Write a formal
> grammar"; probably a BNF grammar.
OK you got me on this one. What is BNF?
Backus-Naur-Form. A way of expressing a context-free grammar, first
introduced when it was used to describe Algol 60. John Backus and
Peter Naur I think. Chomsky produced a hierarcy of grammars with four
(?) levels of complexity. Really sticking out my from-memory neck: I
think that they are regular expressions, context-free, context
dependent and natural language. Read about it in your spare time :)
I filched this from the web. This is a formal way of specifying a
<full-expression>::=<a-expression> | <b-expression> | <c-expression>
dajo: "a full-expression is an a-expression or a b-expression or a c-expr"
<a-expression>::= A <full-expression>
dajo: "an a-expression is the letter A followed by a full-expression"
dajo: "a b-expression is the letter B followed by an a-expression"
<c-expression>::= C | C <b-expression>
dajo: "a c-expression is the letter C or the letter C followed by a
If you look at this you can see that a valid full-expression must end
with the letter C. Other things too. But you see how neat, concise,
precise and simple it is.
Which are legal?: AC, ABC, AAAAAABAAC, AAAAAAAA, BAC, ABAC
More information about the FRPythoneers