Re: New symbolic/numeric/dynamic/intuitive programming language



In article <rem-2008feb24-002@xxxxxxxxx>,
rem642b@xxxxxxxxx (Robert Maas, see http://tinyurl.com/uh3t) wrote:

COBOL actually had at least one good idea: PICture clauses. ...
(Asking about BNF used likewise in any modern programming language.)
From: Michael Press <rub...@xxxxxxxxxxx>
Are you saying that lex and yacc fail this test?

Neither of those is a general-purpose programming language.

Furthermore lex uses regular expressions, not BNF.

I can't tell from 'man yacc' what format it uses for the syntax
spec. Google turns up <http://en.wikipedia.org/wiki/Yacc> which
says it uses something similar to BNF, but the resultant
(generated) parser requires a lexical analyzer, such as lex.
So I guess you meant the combination together? Still that's only a
way to generate C sourcecode for a parser for syntax, which would
then have to be somehow integrated into a program, which would
presumably have to be written in C. That C program would then have
to do all the work of building the abstract parse tree in RAM to
represent the syntax that had been parsed. Even so, I see no
obvious way to generate formatted output, i.e. reverse the parsing
task, using the same BNF definition of the syntax.

Yes, lex, yacc, and C work together to compile a
program that can parse for syntax. The yacc source
files specify the grammar. No, the reverse is not
part of the process.

--
Michael Press
.



Relevant Pages

  • Re: New symbolic/numeric/dynamic/intuitive programming language
    ... Are you saying that lex and yacc fail this test? ... Furthermore lex uses regular expressions, not BNF. ... I can't tell from 'man yacc' what format it uses for the syntax ...
    (sci.math)
  • Re: Redirect stdin ?
    ... get a workaround (as of I wouldn't be aware of Lex & Yacc a bit) ... generated code from lex and yacc". ... One interpretation is that you do not want to hand-modify the C code ... yacc would generate would take the supplied input routine into account. ...
    (comp.lang.c)
  • Re: A Readable C Code without #DEFINEs ...
    ... > I am using LEX and YACC and they produce this grossly unreadable C code ... Hopefully the input files are readable, ... > Is there a switch is C, or, if you know about a hidden switch in either ...
    (comp.lang.c.moderated)
  • Re: How is a compiler written
    ... >> The Dragon Book is a good one suggestion, ... >> best way to write a compiler is with lex and yacc is not. ...
    (comp.lang.c)
  • Re: A Readable C Code without #DEFINEs ...
    ... you feel the need to actually modify the lex or yacc ... your design that prevent you from using these tools correctly. ...
    (comp.lang.c.moderated)