hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Programmatic generation/manipulation of F# source code?

Last post 03-11-2008, 9:27 by Robert. 1 replies.
Sort Posts: Previous Next
  •  03-10-2008, 17:20 5268

    Programmatic generation/manipulation of F# source code?

    I'd like to use F# as a target language.

    Is there a hook to get at parse tree of F# source code?

    -OR- an XML schema and XML <-> F# translator?

    -OR- open source access to an F# parser?

    -OR- a Scheme-list equivalent to F# source code, that is strictly a nested list, without any of the syntactic sugar that makes is easier for humans to read (but more work for programs to generate or manipulate)?

    ~TMSteve

     

  •  03-11-2008, 9:27 5284 in reply to 5268

    Re: Programmatic generation/manipulation of F# source code?

    The F# source is inculded in the distrib, so you have access to the parse, but not under an open source licence.

    F# offers two the code dom [1] and quotations. The code dom allows you to dymically generate F# code and compile it. The code dom was primiraly created for C#/VB.NET so its very "statement originated", not great for F# but still usable. Quotations are probably more interesting to you, the allow you to grab an AST like object for parts of F# code. Tomas has a great article and provides a viewer for quotations here [2], and Don talks a little quotations in this here [3].

    [1] http://www.codeplex.com/fscodedom

    [2] http://tomasp.net/blog/quotvis.aspx

    [3] http://blogs.msdn.com/dsyme/archive/2006/01/27/FSharpMeetsLinqOne.aspx


    Robert Pickering
    http://strangelights.com
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems