tags:

views:

25

answers:

1
+1  A: 

I've never used this swig package, but have used the camlp4 grammar module. You probably have camlp4, so I'm guessing the issue is the syntax being used. You can check for camlp4 and the grammar module, find the camlp4 directory by,camlp4 -where and see if that directory has, /Camlp4Parsers/Camlp4GrammarParser.[cmi|cmo|cmx|o]

If it's the syntax, I pulled up some code for a camlp4 grammar, and the expressions are structured slightly differently (I'm unsure if that format is invalid or not, but it's at least not how I've structured it before)

[[ | expr1 | expr2 ]]

should be

[ [ expr1] | [expr2] ]
nlucaroni
@nlucaroni : I added the result with 'camlp4 -where'. I guess the grammar module is not installed. Could you teach me how to install the module?
prosseek
No, it actually looks the opposite. I think you misunderstand me, does the directory returned from that command have the Camlp4Parsers directory? Then it's installed.
nlucaroni
@nlucaroni : I checked the Camlp4Parsers are installed correctly. And for the syntax, the code has too many '|'s, so it's not simple task to check. Thanks for the answer.
prosseek
that's why vim is awesome... check my update.
nlucaroni
@nlucaroni : I also see there's a preprocessor error (I added the error message). Together with that, the swig regenerates the interface file. Anyway, modify the code to run "ocamlc -I ` camlp4 -where` -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml" gives me the same error. I guess it's swig to solve this issue.
prosseek