Skip to content

Can't find the FSharp.Text.Lexing and FSharp.Text.Parsing lib? #148

Open

Description

@kam1986

Hey I'm currently trying to compile the example code om my Linux (Manjaro)

I have altered the 'end' in the .fsy file since this coursed a rejection at compile time because it is a keyword.

I then try to compile the code once more.
it then give a lot of error messages back, but the two I think are the root of the rest, is that it can't find FSharp.Text.Lexing and FSharp.Text.Parsing

/../Parser.fs(4,18): error FS0039: The namespace 'Lexing' is not defined.

/../Parser.fs(5,18): error FS0039: The namespace 'Parsing' is not defined.

/../Parser.fs(80,40): error FS0039: The type 'Parsing' is not defined.

My MakeFile looks like this

.PHONY: all clean

fsl = fslex
fsp = fsyacc
fsc = fsharpc --nologo

Program = Program.exe
LexerGen = Lexer.fs
ParserGen = Parser.fs

Parser = Parser.dll
Lexer = Lexer.dll

all: $(Program)

$(LexerGen): Lexer.fsl
$(fsl) Lexer.fsl -o $(LexerGen)

$(ParserGen): Parser.fsy
$(fsp) -v --module Parser Parser.fsy -o $(ParserGen)

$(Lexer): $(LexerGen) $(Parser)
$(fsc) -a $(LexerGen) -r $(Parser) -o $(Lexer)

$(Parser): $(ParserGen)
$(fsc) -a $(ParserGen) -o $(Parser)

$(Program): Program.fsx $(Parser) $(Lexer)
$(fsc) Program.fsx -r $(Lexer) -r $(Parser) -o $(Program)

and the code are the same as in the lexer, parser and program given on this site

Activity

  1. teo-tsirpanis commented on May 31, 2021

    @teo-tsirpanis
    Contributor

    Hello, is there a particular reason why you use Makefiles? Building code in .NET is a much more complex process than simply calling the language's compiler, and doing it with make is an unsupported and extremely unusual and counterproductive occurrence.

    How to fix the issue? Create an F# project either with Visual Studio or the dotnet CLI tool, and install the FsLexYacc and FsLexYacc.Runtime NuGet packages. In your Makefile you call the compiler once for the parser and once for the lexer, but it would be much easier for you if they were on the same project.

    Let me know if anything went well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions