Building a Functional Analyzer in F # Using Visual Studio 2013 with FsLex and FsYacc

I've been trying for a while to get the parser to compile and work in F # Visual Studio 2013. I've read many other posts that were already helpful, both on Stack Overflow and on this page: https://en.wikibooks.org/wiki/ F_Sharp_Programming / Lexing_and_Parsing but nothing works. I know how to write a parser and everything I just can't get to compile correctly, and creating .fsl and .fsp files in Visual Studio 2013 doesn't seem very intuitive. This link: https://github.com/fsprojects/FsLexYacc/tree/master/tests/LexAndYaccMiniProject was helpful, but lacked Lexer.fs, Parser.fs and Parser.fsi. Any help on this would be greatly appreciated. I am using the FsLexYacc package which can be installed in the package manager. Thanks in advance.

Edit: An attempt to improve the question by adding more information.
1) In Visual Studio, I created a new console project and imported the FsLexYacc package
2) I created a .fs file that contains type definitions and such as in the example links above.
3) This is where I have problems. I know what to put inside a .fsp and .fsl file, but I don't know how to create them in visual studio and get them to compile correctly using the FsLex and FsYacc tools. The github link above details editing the .fsproj file, but nothing I've tried has worked. I am guessing to get the tools to create the .fsp and .fsl files that the tools create from a simple .fs file, but I'm not sure and I don't know exactly how to do this, so an clarification would be great.

To reproduce my problem, follow the steps on the wiki page, or copy the files from the github link to a new project, I cannot compile either independently.

This question is similar to mine, but I also couldn't get mine to work after the following answers: Using FsLex / Yacc in Vs2013

+3


source to share





All Articles