Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EBNF or BNF for the LOGO programming language

Does anyone know where I can get the BNF or EBNF for the LOGO programming language?

like image 541
Vivin Paliath Avatar asked Jul 25 '11 16:07

Vivin Paliath


People also ask

What is the difference between BNF and EBNF?

BNF syntax can only represent a rule in one line, whereas in EBNF a terminating character, the semicolon, marks the end of a rule. Furthermore, EBNF includes mechanisms for enhancements, defining the number of repetitions, excluding alternatives, comments, etc.

What is EBNF used for?

In computer science, extended Backus–Naur form (EBNF) is a family of metasyntax notations, any of which can be used to express a context-free grammar. EBNF is used to make a formal description of a formal language such as a computer programming language.

What is BNF in programming?

BNF stands for Backus Naur Form notation. It is a formal method for describing the syntax of programming language which is understood as Backus Naur Formas introduced by John Bakus and Peter Naur in 1960. BNF and CFG (Context Free Grammar) were nearly identical.

Is Backus Naur form still used?

BNF today is one of the oldest computer-related languages still in use.


1 Answers

A BNF grammar might not be too useful in certain circumstances...

Writing a LOGO that's accurately compatible with existing/historical implementation isn't an easy task (I worked on such a project). The problem is that the parser doesn't do the full job, and the evaluator (interpreter) has to work with partial data. Consider this example:

proc1 a b proc2 c

It could mean proc1(a, b, proc2(c)) or proc1(a, b, proc2(), c) according to the number of parameters for proc1 & proc2.

Furthermore the LOGO interpreters I know, for example Berkely LOGO, seem from a cursory glance not to write a traditional parser that additionally has access to each procedure and its arity; instead they run the procedures and the procedures 'eat up' the number of parameters that they need. This makes the parser a little naive and the main role is that of an interpreter, and thus parsing is kind of unusual.

like image 80
Mohamed Samy Avatar answered Sep 22 '22 10:09

Mohamed Samy