[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnubol: [rpragana@acm.org: Some comments about a cobol parser]



Reply-To: 
 
----- Forwarded message from Rildo Pragana <rpragana@acm.org> -----

Delivered-To: tweedy@lusars.net
Date: Mon, 22 Nov 1999 20:52:49 -0200 (EDT)
From: Rildo Pragana <rpragana@acm.org>
X-Sender: root@percproj
To: Laura Tweedy <tweedy@lusars.net>
Subject: Some comments about a cobol parser

Dear Laura Tweedy,

I'm one of the developers of rpcobol (the Tiny Cobol as we call it).
I have found much discussion about the requirements of a backtracking
compiler-compiler for generating a parser for cobol85. Well, I agree in
part, because something like "PERFORM identifier1 OF identifier2 ..."
have several syntatic forms that could not be guessed in advance without
several tokens ahead, if identifier1 is not known to be a variable or
paragraph.

But suppose we separate our parsing in phases, such that all variables,
declared at the data division, could be detected and separate tokens are
given by the scanner (say VARIABLE and LABEL) when an identifier is
found.  We already know (at the procedure division) what is VARIABLE. As
all variables are declared in advance, the scanner could make everything
LABEL if not found at the symbol table, so there is no need to
backtrack in such constructs anymore.  Why this is interesting? Because in
this case, we can use a proven tool like yacc/bison to make our parser and
it should be much more faster and error prone.

If you want to see what we have been doing, please look at the latest
releases at our home page:
http://members.xoom.com/rpragana/cobol.html

Please tell me what you think.

with my best regards,  (sorry if my english is too bad)
Rildo
 _____   _ __    __       __      __      ___      __  Rildo Pragana
/\ '__`\/\`'__\/'__`\   /'_ `\  /'__`\  /' _ `\  /'__`\ P.O. Box 721
\ \ \L\ \ \ \//\ \L\.\_/\ \L\ \/\ \L\.\_/\ \/\ \/\ \L\.\_ Camaragibe
 \ \ ,__/\ \_\\ \__/.\_\ \____ \ \__/.\_\ \_\ \_\ \__/.\_\ PE Brazil
  \ \ \/  \/_/ \/__/\/_/\/___L\ \/__/\/_/\/_/\/_/\/__/\/_/ 54792-990
   \ \_\ rpragana@acm.org /\____/ FPGA/uControllers * Linux * tcl/tk
    \/_/ +55-81-459-1776  \_/__/  http://members.xoom.com/rpragana/


----- End forwarded message -----

-- 
Laura Tweedy .. tweedy@lusars.net
"If you're going through Hell, keep going..." -- Winston Churchill

--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.