fsyacc

Representing optional syntax and repetition with OcamlYacc / FsYacc

I'm trying to build up some skills in lexing/parsing grammars. I'm looking back on a simple parser I wrote for SQL, and I'm not altogether happy with it -- it seems like there should have been an easier way to write the parser. SQL tripped me up because it has a lot of optional tokens and repitition. For example: SELECT * FROM t1 INNER...

Are parsers generated by FSYacc thread safe?

If I generate a parser using FSYacc will it be thread safe? The only reason I ask is because the functions Parsing.rhs_start_pos and Parsing.symbol_end_pos don't appear to have any state passed into them, which would lead me to assume that they are getting the current NonTerminal/Symbols from a shared location, is this correct? Afte...

fslex lexing javascript regular expressions

I am attempting to lex javascript regular exression literals. These start with a "/" and end with a "/" (and sometimes some other modifiers). The issue is that the only way to determine whether it is a regular expression as opposed to a division operator is by reading the tokens previous to the "/" character. One can read a little mor...

What is the difference between lex/yacc and fslex/fsyacc?

I'm learning F# because I'd like to write a lexer and parser. I have a tiny bit of experience with this sort of processing but really need to learn it properly as well as F#. When learning the lexing/parsing functionality of F#, is studying lex and yacc sufficient? Or are there some differences that means code for lex/yacc will not wor...

F# 2.0 with Powerpack 2.0, fslex error 1

In namespace RSLispV3.RunTime: http://pastebin.com/XNb9qi11 LispParser.fsy: http://pastebin.com/pymF1Vvm LispLexer.fsl: http://pastebin.com/pfXdDuxs I got in MSBuild the PowerPacks targets, calling them from the .fsprog. When building with VS2008 I get error: "fslex.exe" exited with code 1. Help? ...

Crazy errors with FsLex and FsYacc

I am trying to compile this project: http://ramon.org.il/Here.zip But I get a bunch of non-sense errors. They got text I am familiar with, but in the position there is nothing like that (like unexpected ')' at an empty row). Help me, please! ...

Steps and involvement of implementing a parser (in .Net - and in this case XPath 2.0)

Hi, In the lack of any good free XPath 2.0 implementations for .Net build upon Linq to XML I have thought about implementing my own (also for the experience). But just to be clear (and not building something that exists) these are the XPath 2.0 implementations I have found: Saxon .Net Query Machine - I had problems with this - excepti...

Is it possible to define types that depend on each other and are defined in separated files?

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...