Bug 12128 – C++ conversion error: not parsed until the end of the file
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
visuald
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-10T01:40:00Z
Last change time
2015-11-28T09:32:53Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2014-02-10T01:40:23Z
I've tried converting this codebase:
http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.12.tar.gz
C++ Conversion Wizard Dialog settings:
-----
Input Dir:
C:\dev\projects\CRtAudio_Interface\src\rtaudio_c-4.0.12
Output Dir:
C:\dev\projects\CRtAudio_Interface\src\rtaudio_c-4.0.12\convert
Files and directories:
*.cpp
*.h
Preprocessor expansions:
__WINDOWS_DS__=1
Keyword Prefix:
d_
Package Prefix:
rtaudio_d
-----
When hitting convert for each C++ file I get back these errors:
RtAudio.cpp
C:\dev\projects\CRtAudio_Interface\src\rtaudio_c-4.0.12\RtAudio.cpp(108): not parsed until the end of the file
----------------
RtAudio.h
C:\dev\projects\CRtAudio_Interface\src\rtaudio_c-4.0.12\RtAudio.h(515): not parsed until the end of the file
----------------
RtError.h
C:\dev\projects\CRtAudio_Interface\src\rtaudio_c-4.0.12\RtError.h(41): not parsed until the end of the file
----------------
3 of 3 files failed to parse, aborting
Using VisualD 0.3.37
Any ideas what I'm doing wrong?
Comment #1 by r.sagitario — 2014-02-10T15:17:09Z
The files reveal some deficiencies in the converters C++ parser, mostly it seems not to deal with scoped identifiers. Here is a list of "Pre Token Replacements" that let it get beyond the initial parsing:
*.*:: RtAudio::Api => RtAudio_Api
*.*:: RtAudio::StreamParameters => RtAudio_StreamParameters
*.*:: RtAudio::StreamOptions => RtAudio_StreamOptions
*.*:: RtError::Type => RtError_Type
*.*:: RtError::$_ident => RtErrorCode($_ident)
*.*:: RtAudio::DeviceInfo => RtAudio_DeviceInfo
throw() =>
*.*::std:: =>
virtual~ => /*virtual*/~
try { $try } catch( $ex ) { $catch } => $try
CALLBACK =>
Unfortunately the converter doesn't match declaration and implementation very well afterwards...
Comment #2 by andrej.mitrovich — 2014-02-11T02:45:04Z
(In reply to comment #1)
> The files reveal some deficiencies in the converters C++ parser, mostly it
> seems not to deal with scoped identifiers. Here is a list of "Pre Token
> Replacements" that let it get beyond the initial parsing:
>
> *.*:: RtAudio::Api => RtAudio_Api
> *.*:: RtAudio::StreamParameters => RtAudio_StreamParameters
> *.*:: RtAudio::StreamOptions => RtAudio_StreamOptions
> *.*:: RtError::Type => RtError_Type
> *.*:: RtError::$_ident => RtErrorCode($_ident)
> *.*:: RtAudio::DeviceInfo => RtAudio_DeviceInfo
> throw() =>
> *.*::std:: =>
> virtual~ => /*virtual*/~
> try { $try } catch( $ex ) { $catch } => $try
> CALLBACK =>
Small usability issue: It's really hard matching the left and right columns since they scroll independently and there's no line numbering.
Comment #3 by andrej.mitrovich — 2014-02-11T02:47:20Z
(In reply to comment #2)
> Small usability issue: It's really hard matching the left and right columns
> since they scroll independently and there's no line numbering.
Wait, I thought the part after => goes to the right column, my mistake.
But what is this column here for: http://i.imgur.com/zLUtQlX.png
Comment #4 by r.sagitario — 2014-02-11T12:34:12Z
> But what is this column here for: http://i.imgur.com/zLUtQlX.png
The left field contains replacements that are applied to the input before parsing it as C++, the right field is for replacements of the output of the C++ to D conversion before writing the file. If you enable "Write intermediate files" you can check the state after the different phases.
Comment #5 by r.sagitario — 2015-11-28T09:32:53Z
https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.43 brings some improvements. The biggest one is that other messages are no longer suppressed when the C++ parser is confused and emits "not parsed until the end of the file".
This allows to file more specific errors, so I'll close this one.