tags:

views:

33

answers:

1

Hi everybody,

I got some problem with my FSLex which I can't solve... All I know is that fslex.exe exited with code 1...

The F# code at the top was tested in F# Interactive, so the problem isn't there (I can't see how).

Lexer: http://pastebin.com/qnDnUh59

And Parser.fsi: http://pastebin.com/sGyLqZbN

Thanks, Ramon.

+1  A: 

Non-zero error means the lexer failed, usually it'll describe the failure too. When I compile, I get exited with code 1 along with this:

Unexpected character '\'

let id = [\w'.']+ 
----------^

Lexer doesn't like char literals outside of quotes, and it doesn't understand the meaning of \w either. According to FsLex source code, FsLex only understands the following escape sequences:

let escape c =
 match c with
 | '\\' -> '\\'
 | '\'' -> '\''
 | 'n' -> '\n'
 | 't' -> '\t'
 | 'b' -> '\b'
 | 'r' -> '\r'
 | c -> c

This fixed version of your lexer compiles fine for me: http://pastebin.com/QGNk3VKD

Juliet
Bless you! I forgot that the errors that Visual Studio hides can be still seen through command line. Many thanks!
Ramon Snir