Re: Question about porting mzscheme code
"Nikita Sidorov" <[email protected]> Mon, 09 Feb 2009 22:52:36 +0200
| Newsgroups | gmane.comp.java.sisc.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Dan, Once I was also looking for a parser for sisc. I ended up using Dominique Boucher's LALR(1) parser generator that could be found here: http://www.iro.umontreal.ca/~boucherd/Lalr/documentation/lalr.html#A-portable-and-efficient-LALR(1)-parser-generator-for-Scheme http://code.google.com/p/lalr-scm/ (seems to be more recent) As for the lexer I had to write it myself. I hope it will help you. Nikita On Mon, 09 Feb 2009 22:32:02 +0200, D. O'Keeffe <[email protected]> wrote: > Hey Joshua, > Thanks for the reply. The module definitions looks something like: > > ;;ce-parser.scm > ;; module provides the get-ce-expr function that takes in an expression > ;; to parse in string form and returns the resulting parsed expression. > (module ce-parser mzscheme > (require > (lib "yacc.ss" "parser-tools") > (lib "lex.ss" "parser-tools") > (prefix : (lib "lex-sre.ss" "parser-tools"))) > (require "cep-structs.scm") > (require "initiate.scm") > > ... > > ;;get-ce-expr: string -> ce-expr > (define get-ce-expr > (lambda (expr-string) > ...)) > > (provide get-ce-expr)) > > ;; cep-structs.scm > (module cep-structs mzscheme > .... > (provide (all-defined) (all-from mzscheme)) > > ;; initiate.scm > (module initiate mzscheme > (require "cep-structs.scm") > (require "terminate.scm") > (require "cep-utils.scm") > .... > (provide create-ce-expr)) > > ;; terminate.scm > (module terminate mzscheme > (require "cep-structs.scm") > .... > (provide terminate-ce-expr)) > > ;; cep-util.scm > (module cep-util mzscheme > (require "cep-structs.scm") > (require (lib "list.ss" "mzlib")) > .... > (provide (all-defined))) > > > If it helps to clarify things, the parser tools code can be found at > http://pre.plt-scheme.org/plt/collects/parser-tools/ > > The main queries I have are with respect to the changes needed in terms > of > syntax etc. to perform the correct imports and exports between modules > and > loading of libraries. From reading the sisc user manual, it would seem > that > the sisc module system is based on that of chez scheme. Is this correct? > Are there any other major differences that you think I should be aware > of? > I think once I manage to get my mzscheme code working in sisc I'll be ok > (i.e. I think I understand how to use it from java). Thanks for your > help! > Dan > > On Feb 8 2009, Joshua Herman wrote: > >> Can you give us part of the code at least the libraries it uses? sisc >> is a >> better implementation though. >> >> >>> Hey all, I'm trying to determine the best way to port some code I have >>> written in mzscheme to be used by a java program. I've been looking >>> into >>> both kawa and sisc. Performance isn't especially critical, as I'm only >>> using it as part of a simulation/experiment I need to perform for a >>> paper I'm writing. The code depends on the plt scheme parser-utils >>> library, but other than that I don't think it contains anything that >>> might present too many problems. However, I'm relatively new to scheme >>> (this code is the first (and only!) project I've written in it), and >>> time is of the essence. If anyone can tell me which approach is likely >>> to be quicker (or of a better approach) I'd appreciate it. Thanks, D >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Create and Deploy Rich Internet Apps outside the browser with >>> Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use >>> existing skills and code to build responsive, highly engaging >>> applications that combine the power of local resources and data with >>> the >>> reach of the web. Download the Adobe AIR SDK and Ajax docs to start >>> building applications today- http://p.sf.net/sfu/adobe-com >>> _______________________________________________ Sisc-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/sisc-users >>> >> > > > ------------------------------------------------------------------------------ > Create and Deploy Rich Internet Apps outside the browser with > Adobe(R)AIR(TM) > software. With Adobe AIR, Ajax developers can use existing skills and > code to > build responsive, highly engaging applications that combine the power of > local > resources and data with the reach of the web. Download the Adobe AIR SDK > and > Ajax docs to start building applications > today-http://p.sf.net/sfu/adobe-com > _______________________________________________ > Sisc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sisc-users > ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com