Hide this comment

AFAIK, there's exactly one existing parser for the full F# language and that's the fslex/fsyacc-based one that is used for implementing the F# compiler and Visual Studio integration.

Writing your own parser for basic syntax F# highlighting purposes isn't difficult, but trying to implement a new parser for the full F# grammar would be a major undertaking. The grammar description in the language spec (which currently seems to be offline) is heavily geared toward the current fslex/fsyacc implementation, in particular with regard to various special lexer and parser "filtering" rules. Also, a parser alone probably wouldn't be enough for many interesting IDE features. Due to the ubiquitous use of type inference in F# you probably need a more or less complete compiler frontend.

Have you thought about basing a MonoDevelop language service on the existing F# compiler?

Microsoft is planning to open source the compiler source, maybe you can get a special permission to use its parser as the foundation for a language service in MonoDevelop. You might get around licensing issues by running the language service as a separate process.

By on 5/21/2010 7:54 AM ()Reply
Hide this comment

Have you thought about basing a MonoDevelop language service on the existing F# compiler?
Microsoft is planning to open source the compiler source, maybe you can get a special permission to use its parser as the foundation for a language service in MonoDevelop. You might get around licensing issues by running the language service as a separate process.

This.

If you look at "service.fsi" in the compiler source, it exposes the compiler interface consumed by the Visual Studio language service; if you can reuse the existing compiler, 90% of the work is already done.

If there are open source or licensing concerns, you can mail us at fsbugs@microsoft.com and we can try to solve those issues.

By on 5/21/2010 9:02 AM ()Reply
Hide this comment

I am denied to use existing code until it is open source. So I've started implementing open source parser with antlr.

Currently, I base it on lex.fsl and pars.fsy, but reading them is extremely difficult. I've seen some large document before which contained some kind of grammar description, but failed to google it.

Can anyone point me to it?

UPD. found one

By on 7/3/2010 11:13 PM ()Reply
Hide this comment

Was it the spec draft?

[link:research.microsoft.com]

By on 7/6/2010 5:33 AM ()Reply
Hide this comment
By on 5/21/2010 7:41 AM ()Reply
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper

Logging in...