Related articles |
---|
Project on Compiler alluri@utdallas.edu (1994-01-13) |
Re: Project on Compiler jhall@garden.WPI.EDU (1994-01-13) |
Re: new version of PCCTS parrt@s1.arc.umn.edu (Terence Parr) (1994-01-14) |
Newsgroups: | comp.compilers |
From: | Terence Parr <parrt@s1.arc.umn.edu> |
Keywords: | tools, PCCTS |
Organization: | Compilers Central |
References: | 94-01-044 94-01-050 |
Date: | Fri, 14 Jan 1994 22:47:23 GMT |
jhall@garden.WPI.EDU (John Clinton Hall) writes:
> PCCTS is available for anonymous ftp, although I don't remember the site
> address (Terence, please refresh my memory). Also, the new version is
> supposed to generate C++ Parser and Scanner objects, but I don't even know
> if the new version is out yet, since I just got back from a vacation.
> (Terence, is it out yet?)
The ftp site is marvin.ecn.purdue.edu in pub/pccts. Latest version as of
August 1993 is 1.10. I'm working on the nice C++ parser and scanner
object stuff as we speak, but am behind my original schedule for a variety
of reasons. It'll be into February sometime when the new version comes
out. Lots more goodies including token classes like this:
#tokclass MOP { "\*" "/" }
#tokclass AOP { "\-" "\+" }
#tokclass OP { MOP AOP }
aexpr : mexpr ( AOP mexpr )* ;
mexpr : atom ( MOP atom )* ;
The reference to a token class results in a quick set membership rather
than the usual test for each member of a subrule ala:
aexpr : mexpr ( ("\-"|"\+") mexpr )* ;
For you C++ junkies we have added grammar classes (kind of like some
YACC-based tools like YACC++ from Compiler Resources):
class Expr {
aexpr : mexpr ( AOP mexpr )* ;
mexpr : atom ( MOP atom )* ;
}
Then your C++ code can define objects of type Expr and invoke individual rules
via:
main()
{
MyTokenStream scan; /* create one of my scanners (if you don't use DLG) */
Expr parser(&scan);/* create a parser of type Expr hooked to my scanner */
parser.e(); /* start parsing at rule 'aexpr' of that parser */
}
Anyhoo, should be out RSN...
Regards,
Terence Parr
AHPCRC, U of MN
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.