Lisp HUG Maillist Archive

foreign-parser in OS 10.3

Hi All,

I attempted to use the Foreign Parser on LW in OS 10.3, but could not 
get it to work with the simple c function given as the example in the 
FLI manual (the Unix/Linux example since there is no OS X example).

I first call (require "foreign-parser") and it loads everything it 
needs to.  But when I call the (foreign-parser:process-foreign-file 
"test.c" :case-sensitive nil) function, something goes wrong. During 
the
;;; Process-foreign-file : Level 1 parsing
of this file, many warnings pop up.  These warnings I suspect are from 
the header files included (stdio.h and string.h), then the test.c file 
also yields warnings and the function terminates (i suspect 
prematurely).

It creates test-diff.lisp in the same directory as test.c, however it 
is lacking the code derived from test.c (it contains the header file 
code derivations).

Does anyone know what's wrong and how it can be fixed?

Any help is greatly appreciated.

Thanks

Stefano B.

Here's a snippet of the output

CL-USER 10 > (foreign-parser:process-foreign-file "test.c" 
:case-sensitive nil)
;;;    Output dff file #P"test-dff.lisp"
;;;    Parsing source file "test.c"

;;; Process-foreign-file : Preprocessing file

;;; Process-foreign-file : Level 1 parsing

[/usr/include/stdio.h:277]: Warning: Unexpected symbol 
"__builtin_va_list".
[/usr/include/stdio.h:277]: Warning: Unexpected symbol ")".
[/usr/include/stdio.h:277]: Warning: Unexpected symbol ";".
Discarding input symbol ";"
....
[/usr/include/string.h:119]: Warning: Unexpected symbol "size_t".
Discarding input symbol "size_t"
[/usr/include/string.h:119]: Warning: Unexpected symbol ";".
Replacing symbol ";" with symbol #\,
[/test.c:4]: Warning: Unexpected symbol "modify".
Inserting new symbol #\(
[/test.c:4]: Warning: Unexpected symbol "*".
Inserting new symbol #\(
[/test.c:5]: Warning: Unexpected symbol "{".
[/test.c:6]: Warning: Unexpected symbol "char".
[/test.c:6]: Warning: Unexpected symbol "temp".
Discarding input symbol "temp"
[/test.c:6]: Warning: Unexpected symbol ";".
Replacing symbol ";" with symbol #\,
[/test.c:7]: Warning: Unexpected symbol ";".
Replacing symbol ";" with symbol #\,
[/test.c:8]: Warning: Unexpected symbol ";".
[/test.c:9]: Warning: Unexpected symbol "}".
[/test.c:10]: Warning: Unexpected symbol "".
Error: Unexpected end of file
;;; Process-foreign-file : Selecting foreign forms
Warning: Illegal declaration : ("}")
NIL

CL-USER 11 > 


Re: foreign-parser in OS 10.3

Unable to parse email body. Email id is 2382

Updated at: 2020-12-10 08:56 UTC