Closed GoogleCodeExporter closed 9 years ago
Hi Frederic,
These "error" messages might be misleading, they might just be normal errors
that occur during intermediate
parsing passes within ANTLR (there is lots of work in trying to reduce this
output).
Or it could indeed be a nasty parsing issue :-D
Could you try and isolate the code that produces this error (doing a simple
dichotomy : surround the second
half of the main header with a #if 0... #endif block, then narrow down to first
or second part...) ? It could boil
down to a single faulty C declaration.
Thanks for the bug report :)
Original comment by olivier.chafik@gmail.com
on 31 May 2009 at 9:02
Original comment by olivier.chafik@gmail.com
on 31 May 2009 at 9:03
Thanks for your answer.
even with a simple Header file I have this "Failed to match any alternative with
token" error.
Input header:
#define MY_INT 10
Generated JNA interface:
public interface StlibLibrary extends com.sun.jna.Library {
StlibLibrary INSTANCE =
(StlibLibrary)com.sun.jna.Native.loadLibrary(com.ochafik.lang.jnaerator.runtime.
LibraryExtractor.getLibraryPath("stlib",
true, StlibLibrary.class), StlibLibrary.class,
com.ochafik.lang.jnaerator.runtime.MangledFunctionMapper.DEFAULT_OPTIONS);
public static final int MY_INT = 10;
}
Command line:
java -jar .\lib\jna\jnaerator-v0.6-b367.jar -library stlib -o ./src/tmp
C:\Fdev\myheader.h
Error Log:
31-mai-2009 23:40:08 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] VISUAL_STUDIO_HOME=C:\Program Files\Microsoft Visual Studio
9.0
31-mai-2009 23:40:08 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] WINDOWS_SDK_HOME=C:\Program Files\Microsoft SDKs\Windows\v6.
0A
31-mai-2009 23:40:08 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] VISUAL_STUDIO_INCLUDES=C:\Program Files\Microsoft Visual Stu
dio 9.0\VC\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
31-mai-2009 23:40:08 com.ochafik.lang.jnaerator.JNAeratorConfigUtils getProp
INFO: [environment] JNAERATOR_FRAMEWORKS_PATH=C:\Program Files\Microsoft Visual
Studio 9.0\VC\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include;.
31-mai-2009 23:40:08 com.ochafik.lang.jnaerator.JNAeratorConfigUtils getProp
INFO: [environment] JNAERATOR_INCLUDE_PATH=/System/Library/Frameworks/CoreServic
es.framework/Versions/Current/Frameworks;/System/Library/Frameworks/ApplicationS
ervices.framework/Versions/Current/Frameworks;/System/Library/Frameworks;/Librar
y/Frameworks;C:\Documents and Settings\Fred/Library/Frameworks
os.arch = x86
line 0:-1 Failed to match any alternative with token [@-1,0:0='<no text>',<-1>,0
:-1]
File: null:0
Input:
Rule: 1413:1: castExpr returns [Expression expr] : ( '(' tr= mutableTyp
eRef ')' inner= castExpr | e= unaryExpr );
Stack: [expression, topLevelExprList, topLevelExpr, assignmentExpr, inli
neCondExpr, logOrExpr, logAndExpr, bitOrExpr, xorExpr, bitAndExpr, equalExpr, co
mpareExpr, shiftExpr, addExpr, multExpr, castExpr]
line 0:-1 Failed to match any alternative with token [@-1,0:0='<no text>',<-1>,0
:-1]
File: null:0
Input:
Rule: 1413:1: castExpr returns [Expression expr] : ( '(' tr= mutableTyp
eRef ')' inner= castExpr | e= unaryExpr );
Stack: [expression, topLevelExprList, topLevelExpr, assignmentExpr, inli
neCondExpr, logOrExpr, logAndExpr, bitOrExpr, xorExpr, bitAndExpr, equalExpr, co
mpareExpr, shiftExpr, addExpr, multExpr, castExpr]
Generating: (...)stlib\StlibLibrary.java
So it seems even the most basic "define" generate this error.
Fred
Original comment by frederic...@gmail.com
on 31 May 2009 at 9:44
Original comment by olivier.chafik@gmail.com
on 3 Jun 2009 at 1:28
Frederic,
Thanks for the update, I'll try to find a way to reduce the verbosity of ANTLR
as soon as my pile of critical issues
shrinks a bit :-)
Regards
Olivier
Original comment by olivier.chafik@gmail.com
on 11 Jun 2009 at 6:20
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/117
Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive
Original comment by olivier.chafik@gmail.com
on 1 Sep 2011 at 7:23
Original issue reported on code.google.com by
frederic...@gmail.com
on 30 May 2009 at 10:48Attachments: