J
jc
i'm developing a project using vc++.
the main exe is a win32 application. it needs two dlls. one is my own
implementation of string operations. the other dll is to parse a2l
files(it is similar to xml files, but it is based on asap2 standard).
i created the parser using bison and flex. then ported the code to vc+
+ environment including the files lex.yy.c(output from the flex
scanner) a2lgrammar.tab.cpp(output from bison) for post processing the
parser output and creating the data structure. the result is a dll
file that i link with my application.
all was well till i realized that this post processing the parser
output(while the parser can finish parsing the file in less than a
minute for a typical a2l file will be around 150,000 lines) takes
around 10 minutes, during the entire application freezes. so i decided
to call the parsing using a separate thread.
i call the parser with the file name. before i call the parser
function i initialize the parser manually.
i reach the parser application in two different paths. in one path
there is a conf file, which has the info about the a2l file and from
there it calls the parser application. this goes well with no problem.
but if i try to load the a2l file directly then the filename pointer
gets corrupted. in different ways
sometimes when i enter the thread
sometimes when i initialize the dll
sometimes when i parse the file
but nothing happens when i call the a2l parse and process thread after
i load the conf file.
i spent a week trying to figure this out and realized that this is
beyond me.
any help and pointer will be appreciated
thanks
jc
the main exe is a win32 application. it needs two dlls. one is my own
implementation of string operations. the other dll is to parse a2l
files(it is similar to xml files, but it is based on asap2 standard).
i created the parser using bison and flex. then ported the code to vc+
+ environment including the files lex.yy.c(output from the flex
scanner) a2lgrammar.tab.cpp(output from bison) for post processing the
parser output and creating the data structure. the result is a dll
file that i link with my application.
all was well till i realized that this post processing the parser
output(while the parser can finish parsing the file in less than a
minute for a typical a2l file will be around 150,000 lines) takes
around 10 minutes, during the entire application freezes. so i decided
to call the parsing using a separate thread.
i call the parser with the file name. before i call the parser
function i initialize the parser manually.
i reach the parser application in two different paths. in one path
there is a conf file, which has the info about the a2l file and from
there it calls the parser application. this goes well with no problem.
but if i try to load the a2l file directly then the filename pointer
gets corrupted. in different ways
sometimes when i enter the thread
sometimes when i initialize the dll
sometimes when i parse the file
but nothing happens when i call the a2l parse and process thread after
i load the conf file.
i spent a week trying to figure this out and realized that this is
beyond me.
any help and pointer will be appreciated
thanks
jc