Alan Manuel Gloria:
> How about "SAME"? "|" ??

Yep, that's my plan.

> (isn't that usually used for "alternative" in
> most parser parser syntaxes?)

Sure, but like any language, constants get quoted, so there's no ambiguity in 
ANTLR (or Parsec).

> I'm a little busy this week to next week (big Xmas celebration(s)), so
> my only contributions will be random ideas, sadly.

Okay.  I'm going to try a few experiments with ANTLR.  What I've learned so far:
* There are minor syntax differences from current notation.  It uses ":" not 
"::=", and ";" terminates productions.   Its error reports are confusing if you 
do them differently, so look for that *first* when an error is reported.  
Annoyingly it doesn't accept "-" in names (e.g., "s-expr"), but it accepts 
underscore (e.g., "s_expr"), so that's liveable.
* More significantly, you must have exactly ONE definition for a production.  
You can't say:
  i_expr : one_way;
  i_expr : another_way;
it must be:
   i_expr : one_way | another_way;
* And you can't even have the same prefixes within one production, so instead 
of:
  i_expr: a b | a c ;
you must say:
  i_expr: a (b | c);

The last two points are a little limiting/annoying.  I guess this would make it 
a little easier to show the BNF/code correspondence, but I fear that this limit 
will make the BNFs more complicated than they need to be.

Getting it *all* to work with ANTLR is a pain.  Indeed, I can so some parsing, 
but still haven't gotten the Java compiler working properly on either Windows 
or Fedora.  I haven't tried very hard yet, to be fair.

On the other hand, the ANTLRWorks GUI is kind of snappy.  Syntax coloring is 
useful, of course.  The graphical display of how an input was parsed into a 
tree *is* especially useful.  It can also graphically show rules; these are 
really pretty but they look pretty useless to me.

I've ordered an ANTLR and Haskell book for myself for Xmas.  Merry Christmas to 
me!  


>  Laptop hdd also crashed recently, so I need to fix my new keys for proper 
> sourceforge
> access.

Ugh!! Sorry to hear that.  Hope things go better from here on.

--- David A. Wheeler

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to