From: LogicProgrammer <logicprogram...@gmail.com>
Date: Wed, 18 Nov 2009 16:32:19 -0800 (PST)
Local: Wed, Nov 18 2009 7:32 pm
Subject: Re: Question on Grammar Specification
Also, I understand how to parse a single string, but what I want to
parse an entire file? Suppose that I had a rule which says something like this:
STATEMENT ::= TERM [, TERM]* '.'
i.e - a statement is a comma-delimited sequence of 1 or more terms
PROGRAM ::= STATEMENT+
On a successful parse I would like to get a list of all of the
How would I attempt something like this?
Thanks again.
On Nov 18, 5:15 pm, LogicProgrammer <logicprogram...@gmail.com> wrote:
> Also if I want the the results of a parse to be represented as a
> string object, am I correct that I would append '> str' to the end of > the corresponding grammar rule? > On Nov 18, 5:13 pm, LogicProgrammer <logicprogram...@gmail.com> wrote:
> > Hi All,
> > I'm attempting to define a grammar for a simple logic programming
> > OBJECT :== a-z[a-zA-Z0-9]* %alpha-numeric string which begins
> > PRED :== OBJECT
> > To my understanding I should be able to use LEPL along the following
> > OBJECT = Token('[a-z][a-zA-Z0-9]*')
> > etc.
> > For some reason though (probably a stupid mistake on my part) this
> > parser = TERM.parse_string
> > Am I doing something completely wrong?
> > Thank you kindly,
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||