From: Ken A. <kan...@bb...> - 2004-07-07 00:01:40
|
Wow! Geoffrey suggested i look at ANTLR, and it seemed like a good idea, and you've already implemented something way beyond what i was thinking of!! If we could work a description of your applcation into a JScheme use case, that would be great!. At 01:43 PM 7/6/2004 +0100, Harman, Peter wrote: >Hi > >Thought you might be interested that I am already using ANTLR with JScheme for a project. My (initial) reason for using JScheme is to create a computer-algebra library for use in Java [for rearranging / differentiating equations], computer algebra is best done in Lisp / Scheme and I have other code I want to interface with which is in Java, so JScheme was an obvious choice. Using ANTLR I can define the syntax for equations, and the parser will output the Abstract Syntax Tree in Lisp form, so "y = m*x + c" becomes "(= y (+ (* m x) c))", my scheme code can for instance rearrange this to "(= x (/ (- y c) m))" and this can be output as "x = (y - c) / m". > >The reason I say that was my initial reason for using JScheme is that I am also now using JScheme to generate code from the equations (to solve them numerically), for which the quasi-string notation is brilliant. > >Peter > > >-----Original Message----- >From: jsc...@li... >[mailto:jsc...@li...]On Behalf Of Ken >Anderson >Sent: 02 July 2004 22:19 >To: Jscheme Users >Subject: [Jscheme-user] new killer apps for jscheme? > > >Geoffrey sent me an article on ANTLR, a Java/C++ parser generator. >I normally avoid such tools because their manual doesn't fit in my head long enough between uses. Many common parsing problems are little more the lexing, such as tab delimited, fixed with fields, and i have good lexing technology in my head. The problem is i don't have a good parsing approach yet, and i've been waiting a long time. I'd like to use parser combinators but i've never worked on it enough to get a real example working. I have used Mitch Wand's LL1 generator to parse CORBA IDL. But ANTLR got me thinking... > >1. What if we could show some examples of using ANTLR and JScheme to get quick little mini languages, or Scheme like languages with alternative syntax, as Tim has been talking about. > >2. We could use ANTLR's lexer to generate a llexer and use JScheme to provide the little be more that you need than lexing to your data organized. > >3. Use Jscheme lexer in the above item. > >We aught to be able to take a specification like: >Here's a tab separated file. >The first line describes the fields. >The fields can be int, double, or String, you figure out which. >Write me a Java bean that describes each row. >Write me a reader that will read such a file and return a Vector of objects. > >k > > > >------------------------------------------------------- >This SF.Net email sponsored by Black Hat Briefings & Training. >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - >digital self defense, top technical experts, no vendor pitches, >unmatched networking opportunities. Visit www.blackhat.com >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user >- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender immediately and delete this e-mail from your system. > >Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ricardo (save for reports and other documentation formally approved and signed for release to the intended recipient). > >Only Directors or Duly Authorised Officers are authorised to enter into legally binding obligations on behalf of Ricardo unless the obligation is contained within a Ricardo Purchase Order. > >Ricardo may monitor outgoing and incoming e-mails and other telecommunications on its e-mail and telecommunications systems. By replying to this e-mail you give your consent to such monitoring. > >The recipient should check this email and any attachments for the presence of viruses. >Ricardo accepts no liability for any damage caused by any virus transmitted by this email. > >'Ricardo' means Ricardo Plc and its subsidiary companies. > >Ricardo plc is a public limited company registered in England with registered number 00222915. The registered office of Ricardo plc is Bridge Works, Shoreham-by-Sea, West Sussex, BN43 5FG. > >- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > >------------------------------------------------------- >This SF.Net email sponsored by Black Hat Briefings & Training. >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - >digital self defense, top technical experts, no vendor pitches, >unmatched networking opportunities. Visit www.blackhat.com >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |