Re: question to PCCTS users (Terence J Parr)
Fri, 26 Feb 1993 20:35:53 GMT

          From comp.compilers

Related articles
question to PCCTS users (1993-02-23)
Re: question to PCCTS users (1993-02-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Terence J Parr)
Keywords: PCCTS, tools
Organization: Compilers Central
References: 93-02-126
Date: Fri, 26 Feb 1993 20:35:53 GMT

Bill Nell ( writes:

> 1) When compiling antlr with itself I get the following warnings.
> ../bin/antlr antlr.g
> Antlr parser generator Version 1.06 1989-1992
> antlr.g, line 345: warning: optional path and alt(s) of (..)* ambiguous
> upon { "#errclass" }
[ other messages deleted ]
> Is this normal?

Yep. These ambiguities are handled correctly by ANTLR. Most arise from
"ambiguous" productions added to generate good error messages for
erroneous ANTLR descriptions.

[ From ANTLR BUGS100 file: ]
> > Be aware that switching between input streams will not work because
> > characters are lost when switching to a new stream.

> My questions are: Do multiple parsers/multiple parser invocations work
> now? And, I am confused about the last line in the last paragraph. To me
> it basically means that a PCCTS lexer/parser would not be able to handle
> things like #include files, where you would have to switch the input
> buffer to read from a new file.

1.06 PCCTS does indeed drop characters when you switch input streams and
then try to switch back; specifically, the lookahead char used by the DLG
automaton is not saved (lost). To solve this, we have created DLG save
and restore state functions and an example that uses these functions to
handle nested #include statements.

Files dlgdef.h.fix and dlgauto.h.fix are available from the ftp site or
the mailserver to replace your existing dlgdef.h and dlgauto.h files. The
example is in file nesting.g. Contact with a
Subject: line of

Subject: email file

where 'file' is one of dlgdef.h.fix, dlgauto.h.fix, nesting.g to obtain
these files.

The ftp site, [] in directory
pub/pccts, has the files as well.

Terence Parr
Will Cohen
Purdue Electrical Engineering

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.