Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!cam-news-feed3.bbnplanet.com!cam-news-hub1.bbnplanet.com!su-news-hub1.bbnplanet.com!news.bbnplanet.com!pacbell.com!amdahl.com!ogma.ccc.amdahl.com!netnews
From: "Trecom" <asperd@trecom.com>
Subject: How provide input to parser
X-Nntp-Posting-Host: 159.199.162.17
Message-ID: <01bc202e$fa39aec0$11a2c79f@Asperd.trecom>
Sender: netnews@ccc.amdahl.com (Usenet Administration)
Organization: Trecom Business Systems
X-Newsreader: Microsoft Internet News 4.70.1155
Date: Fri, 21 Feb 1997 19:37:10 GMT
Lines: 23

I am trying to write a parser for C in Prolog and am perplexed by two
problems:

1) How do I give such a parser lists of input that are of manageable
length?  Say I try to parse a C program that has 10,000 tokens.  I assume
it is not reasonable to attempt passing a list containing all of the 10,000
tokens to the highest level predicate.
 
2) How do I handle error processing?  When using Lex and Yacc, for example,
I can specify the locations at which error processing and recovery can
occur.  Recovery typically involves throwing away tokens until one is
recognized by the parser.  Is the same technique used in Prolog parsing?

I would appreciate recommendations of books or articles having to do with
computer language parsing using Prolog.  'The Art of Prolog' discusses
parsing, but doesn't show how the input is developed.  'The Craft of
Prolog' discusses a Prolog tokenizer, but I can't see the connection
between that and the typical "toy" DCG examples I find in various texts. 
All of these "toys" are meant to parse small natural language sentences.  I
find all of these examples tantalizing, but incomplete for my purposes.

Thanks,
Don Asper        
