Csound Csound-dev Csound-tekno Search About

[Cs-dev] Added improved error reporting

Date2011-05-16 00:48
FromSteven Yi
Subject[Cs-dev] Added improved error reporting
Hi All,

I've just made a commit that improves the error reporting for the new
parser.  The code I committed is based on the code found in this
article:

http://www.ibm.com/developerworks/opensource/library/l-flexbison/index.html

For example, this is an error statement for a test CSD I had:

error: syntax error, unexpected T_FUNCTION (token "int") line 25: int = indx

I tried to modify the error message reporting to look more like the
old parser, though we could certainly however we like.  The format is
to show "error:" followed by the error message, then the token where
the error occured, then line number, then the line of the text that
the failure occured.

The code I added uses some global values; I think however that the
parser in general could not be run concurrently with another parse run
as flex/bison seems to have some global values defined.  I think if we
block concurrent runs of parsing, we'd be fine.

John and I also talked about making the error message better (mapping
things like T_FUNCTION to function).  That's certainly a next step to
take. I think though seeing the line in error and the token it failed
on is a good step forward.

Also, in trying to create a error to show a message, I did find a
legitimate error/crash with the parser we need to fix.  Having
something like:

if klen then

endif

where there is no parentheses will segfault.  Also having something like:

if (klen ) then

endif

will also segfault.

Thanks!
steven

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-05-16 08:43
Frommenno
SubjectRe: [Cs-dev] Added improved error reporting
Hi Steven,

i wanted to build Csound with the new error report system and followed my
usual steps (http://www.csounds.com/node/1373), but got an error that may
well have to do with the new script?
I work on Ubuntu10.04 64bit (KXStudio).

regards
Menno

menno@muziek:/media/ManualUSB/csound5$ scons -j 3 buildDSSI=1
buildImageOpcodes=1 buildInterfaces=1 buildJavaWrapper=1 buildNewParser=1
buildPythonOpcodes=1 buildUtilities=1 buildVirtual=1 Lib64=0 useDouble=1
usePortAudio=1 usePortMidi=1 useALSA=1 useJack=1 useFLTK=1 Word64=1
buildPythonWrapper=1 smoothSort=1 includeMP3=1 buildCsoundAC=1
buildStkOpcodes=1 buildBeats=1 dynamicCsoundLibrary=1 buildOSC=1 useOSC=1 >
compile.txt

scons: warning: The Options class is deprecated; use the Variables class
instead.
File "/media/ManualUSB/csound5/SConstruct", line 75, in 
./H/csound.h:452: Warning(451): Setting a const char * variable may leak
memory.
interfaces/cs_glue.hpp:507: Warning(473): Returning a pointer or reference
in a director method is not recommended.
interfaces/CppSound.hpp:36: Warning(453): Can't apply (std::vector< double >
*INPUT). No typemaps are defined.
interfaces/CppSound.hpp:88: Warning(813): Warning for CppSound proxy: Base
CsoundFile ignored. Multiple inheritance is not supported in Java.
Engine/csound_orc.y: conflicts: 54 shift/reduce, 39 reduce/reduce
Engine/csound_orc.l: In function ‘get_next_line’:
Engine/csound_orc.l:758: error: ‘false’ undeclared (first use in this
function)
Engine/csound_orc.l:758: error: (Each undeclared identifier is reported only
once
Engine/csound_orc.l:758: error: for each function it appears in.)
Engine/csound_orc.l:764: error: ‘true’ undeclared (first use in this
function)
scons: *** [Engine/csound_orclex.os] Error 1

--
View this message in context: http://csound.1045644.n5.nabble.com/Added-improved-error-reporting-tp4398831p4399642.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo

Date2011-05-16 14:44
FromSteven Yi
SubjectRe: [Cs-dev] Added improved error reporting
Hi Menno,

I replaced use of true/false with 1/0 and have committed to git.
Could you pull and try a recompile?

Thanks!
steven

On Mon, May 16, 2011 at 3:43 AM, menno  wrote:
> Hi Steven,
>
> i wanted to build Csound with the new error report system and followed my
> usual steps (http://www.csounds.com/node/1373), but got an error that may
> well have to do with the new script?
> I work on Ubuntu10.04 64bit (KXStudio).
>
> regards
> Menno
>
> menno@muziek:/media/ManualUSB/csound5$ scons -j 3 buildDSSI=1
> buildImageOpcodes=1 buildInterfaces=1 buildJavaWrapper=1 buildNewParser=1
> buildPythonOpcodes=1 buildUtilities=1 buildVirtual=1 Lib64=0 useDouble=1
> usePortAudio=1 usePortMidi=1 useALSA=1 useJack=1 useFLTK=1 Word64=1
> buildPythonWrapper=1 smoothSort=1 includeMP3=1 buildCsoundAC=1
> buildStkOpcodes=1 buildBeats=1 dynamicCsoundLibrary=1 buildOSC=1 useOSC=1 >
> compile.txt
>
> scons: warning: The Options class is deprecated; use the Variables class
> instead.
> File "/media/ManualUSB/csound5/SConstruct", line 75, in 
> ./H/csound.h:452: Warning(451): Setting a const char * variable may leak
> memory.
> interfaces/cs_glue.hpp:507: Warning(473): Returning a pointer or reference
> in a director method is not recommended.
> interfaces/CppSound.hpp:36: Warning(453): Can't apply (std::vector< double >
> *INPUT). No typemaps are defined.
> interfaces/CppSound.hpp:88: Warning(813): Warning for CppSound proxy: Base
> CsoundFile ignored. Multiple inheritance is not supported in Java.
> Engine/csound_orc.y: conflicts: 54 shift/reduce, 39 reduce/reduce
> Engine/csound_orc.l: In function ‘get_next_line’:
> Engine/csound_orc.l:758: error: ‘false’ undeclared (first use in this
> function)
> Engine/csound_orc.l:758: error: (Each undeclared identifier is reported only
> once
> Engine/csound_orc.l:758: error: for each function it appears in.)
> Engine/csound_orc.l:764: error: ‘true’ undeclared (first use in this
> function)
> scons: *** [Engine/csound_orclex.os] Error 1
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Added-improved-error-reporting-tp4398831p4399642.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-05-16 15:16
Frommenno
SubjectRe: [Cs-dev] Added improved error reporting
There was no error building Csound anymore, thanks Steven. 
Using the new parser i will report any (error)messages that i really do not
understand.

bye,
Menno


--
View this message in context: http://csound.1045644.n5.nabble.com/Added-improved-error-reporting-tp4398831p4400535.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net