I am trying to implement a library with extended parsing capabilities. I decided that I will use fsyacc because I knew it from the university. Unfortunately I encountered following problem.
I defined a class for the head of my grammar (Head) and place its implementation in a single file. Then I defined parser as:
...
%start head
%type <Head> head
...
Fsyacc generates seeparated module (Parser). In order to succeed it has to be compiled in following order: Head.fs
Parser.fs
In order to make this library similar to what you can find in .NET I would like to add a static Parse method to Head. Unfortunately I would need to make use of methods from Parser module.
I know that such type dependencies can be solved with 'and' operator but it is only applicable to types defined in one file.
Is there any other way to create types that depend on each other even when they are in separate files? I was looking for declaration/implementation separation mechanism like the one in C/C++ but I couldn't find anything.