|help with EBNF grammar email@example.com (Paul Meaney) (2001-03-28)|
|Re: help with EBNF grammar firstname.lastname@example.org (William S. Lear) (2001-03-31)|
|Re: help with EBNF grammar email@example.com (Ralph Boland) (2001-03-31)|
|Re: help with EBNF grammar firstname.lastname@example.org (Mahesha N) (2001-03-31)|
|Re: help with EBNF grammar email@example.com (Raymond Limpus) (2001-03-31)|
|Re: help with EBNF grammar firstname.lastname@example.org (Mike Dimmick) (2001-03-31)|
|Re: help with EBNF grammar email@example.com (Barry Watson) (2001-04-04)|
|Re: help with EBNF grammar firstname.lastname@example.org (William S. Lear) (2001-04-04)|
|From:||"William S. Lear" <email@example.com>|
|Date:||31 Mar 2001 02:32:47 -0500|
|Posted-Date:||31 Mar 2001 02:32:47 EST|
"Paul Meaney" <firstname.lastname@example.org> writes:
> .... I have to
> write a parser that will evaluate input expressions to boolean true/
> false. I have never done anything like this before.
> In searching the web I have hit on the idea of using the JavaCC
> and defining my own grammar in Extended Backus- Naur Form to turn the
> input expression into a Java statement. However all the online
> documentation for EBNF is for 2nd/ 3rd year computing courses and are
> heavily mathematical in nature. Given my background I find it really
> difficult to understand what is going on.
> Does anyone know of any resources on the web/ good books on the
> subject that can teach someone who is not stupid the basics of EBNF,
> parse trees and recursive- descent parsing?
You could post here what you are trying to accomplish and perhaps we
could help. You may not need to know the deep theory of grammar in
order to accomplish your task. It's difficult to tell from your brief
description, but it sounds as if translating your statement into Java
code is a bit of overkill, if indeed all you want is a true/false
evaluation of the expression. With JavaCC, you will end up with a
class (parser) that you can use to parse expresssions and give you
this boolean result directly, rather than evaluating Java code.
Post away, I say, that is what these forums are for.
NB --- I am *not* a parser expert, but would be glad to offer what
help I can.
William S. Lear | Who is there that sees not that this inextricable labyrinth
r a e l @ | of reasons of state was artfully invented, lest the people
z o p y r a . | should understand their own affairs, and, understanding,
c o m | become inclined to conduct them? ---William Godwin, 1793
Return to the
Search the comp.compilers archives again.