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

Re: gnubol: reference characterizers



PCCTS has syntactic backtracking (ie try multiple alternate
syntaxes) and semantic predicates (ie a formalised way of doing
the lexer feedback hack, whereby the lexer passes '88-level' or
'standard-data-item
' as the type based on the symbol table, rather just
'identifier'). 

Qualified references within IF conditions don't neatly fit into
either category. I think it would be possible to get around it by
firing an error if the wrong type of qualified identifier occurs
in the wrong context, then PCCTS would retry.

The alternative is the standard lexer feedback hack similar to
what I did in the preprocessor where I looked ahead to see if the
identifier was subject to a reference modification. Best avoided
if possible. I'm not expert enough at PCCTS yet to say what's the
best way to go. 

Doing this as a separate pass may be overkill, and may not be a
good idea because you need the information from the symbol table
to decide if it is an 88 level or not (or it could even be both
an 88 and a <50 level which would be an error, I think).

Tim Josling


Michael McKernan wrote:
> 
> >>>>> "Bob" == RKRayhawk  <RKRayhawk@aol.com>
> >>>>> wrote the following on Tue, 2 Nov 1999 11:29:21 EST
> 
>       ...
> 
>   Bob> I would like to again encourage a technique that intercepts
>   Bob> the tokens between the lexer and the parser for the purpose of
>   Bob> characterizing _references_ before they reach the grammar
>   Bob> rules.
> 
> This seems like a good idea.  Where has it been used?  It would
> require that the partially built symbol table be able to support
> properly scoped lookups, but that doesn't seem like a problem.
> 
> I will probably still come down on the side of using the semantic
> predicates in pccts for the same purpose (among others) because they
> offer more generality.  If that option were not available, though,
> I'd be very interested in what you suggest.

--
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.