[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] Reusing parser tests
|
Richard,
You're right about the suite() methods, I guess I always run the complete suite so I never ran into the problem.
I made some changes to the AST classes but these are mainly for convenience, now building an AST requires a lot less code. The AST nodes now have constructor methods that take child nodes as arguments so you don't have to call a bunch of set() methods, and the getPropertyInParent() method is called automatically. These are not breaking changes, code that builds the AST the old way still works.
There aren't any significant changes in the structure of the AST or the AST interfaces that I am aware of. There have been some changes to the IASTTranslationUnit interface but these haven't affected me so you should be fine too.
Mike Kucera
Software Developer
IBM CDT Team, Toronto
mkucera@xxxxxxxxxx
"Richard Miskin" ---05/02/2008 04:31:00 AM---Mike,
"Richard Miskin" <Richard.Miskin@xxxxxxx>
Sent by: cdt-dev-bounces@xxxxxxxxxxx
05/02/2008 04:30 AM
Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx> |
|
|
Mike,
I started having a proper look at reusing the CDT tests with my ILanguage using a similar set up to you and it seems to work well. (By well I mean I’ve got tests failing with my code - but that gives me something to work on!)
One thing I’ve noticed is that if I don’t implement something like this:
public static TestSuite suite() {
return suite(EDGCompletionParser2Tests.class);
}
In classes whose parent has one then the original tests are run rather than my new one. The same thing seems to be happening for the LR tests e.g. LRCompleteParser2Tests. I’m far from being an expert on junit so this could just be down to the way I’m launching the tests (right clicking on a class in the package explorer and clicking Run As > JUnit Plugin Test) but I thought I’d better let you know.
I’m currently working on the CDT 4.0.3 code base but I’m hoping to move up to CDT 5 now the API is frozen. Are you aware of any significant issues I’m likely to hit in the AST related code?
Cheers,
Richard
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Mike Kucera
Sent: Tuesday 29 April 2008 16:15
To: CDT General developers list.
Subject: RE: [cdt-dev] Reusing parser tests
Richard,
It definitely sounds like you may find the lrparser framework useful for your needs.
Currently support for C99 is pretty much done, although I don't have support for GCC extensions yet. I've extended the C99 LR parser to add support for UPC (Unified Parallel C) to CDT. If you want to see what a language extension looks like using this framework take a look at the UPC plugin which is also in CVS. Nobody other than me is really using this stuff yet so I would love any comments or suggestions you might have.
Support for C++ is still a work in progress, but its coming along quite well.
Mike Kucera
Software Developer
IBM CDT Team, Toronto
mkucera@xxxxxxxxxx
"Richard Miskin" ---04/28/2008 10:47:10 AM---Mike,
"Richard Miskin" <Richard.Miskin@xxxxxxx>
Sent by: cdt-dev-bounces@xxxxxxxxxxx
04/28/2008 10:46 AM
Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx> |
|
|
Mike,
Sounds like you’ll be working on exactly the sort of thing I’d need. I’ll try and have a look at the lrparser test plugin in the next day or so to see what you’ve done - I assume that’s in CVS.
The ILanguage I’m adding is based on the C/C++ parser from EDG. Our commercial product (Cantata++) uses this and it is configured in such a way that we can enable/disable language features at run time. This means the same exes support MSVC, GCC, Sun’s CC and many target compilers. In particular we can specify options to accept different language keywords in various places, e.g. near or far.
We have a user interface for this that is based on Eclipse/CDT but a problem we’ve seen is that customers have code that uses language extensions that works with our parser and their compiler but causes problems for the CDT GNU parser. This isn’t really surprising as gcc won’t accept it either, but it is an issue for our customers.
In addition we provide the ability to generate and edit test scripts, but this is based on a combination of information produced by our tool at compile time and information gleaned from the AST. With my ILanguage implementation every IASTNode can contain additional data that is useful to us and we wouldn’t have to rely on the files generated at compile time. This would be a big plus for us as there are situations where the way the EDG parser describes an item doesn’t necessarily match to the way it is in the AST.
The theory is that If we can get our parser into Eclipse then everything should ‘just work’. Unfortunately the structure of the EDG Intermediate Language doesn’t closely match the AST all the time and EDG parser is written in C so there’s a nice JNI layer involved.
The question of how far I am through implementing it is a tricky one; I’m further through C than C++ but testing it is a little tricky. The main reason I want to try reusing the existing CDT tests is to give myself a better idea of what I’m missing. Also I’ve not attempted to support code completion yet.
Cheers,
Richard
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Mike Kucera
Sent: Friday 25 April 2008 14:47
To: CDT General developers list.
Subject: Re: [cdt-dev] Reusing parser tests
I'm reusing many of the tests for my own ILanguage implementation. Its pretty cumbersome at the moment, because the tests don't actually call the parser through ILanguage. Instead they call the CDT core parser directly. The way I was able to reuse the tests was to subclass each one individually and override whatever parse() method the test has. Take a look in the lrparser test plugin to see how it works.
I am planning on doing something to improve the situation. I want to refactor the tests to use ILanguage and make it easy to specify your own ILanguage to run. It would also be useful to turn off individual tests because not all parsers are created equal. Now that CDT has language extensibility it needs to have extensible and reusable test suites also.
This is something I will probably be working on very soon. If you have any comments please let me know.
I'm also curious, what's your language that you're adding? How far are you in implementing it? I'm working on a parser framework that will make it easier to add language extensions to CDT. If you are working on an extension to C or C++ then we should talk.
Mike Kucera
Software Developer
IBM CDT Team, Toronto
mkucera@xxxxxxxxxx
"Richard Miskin" ---04/25/2008 03:23:04 AM---Hi,
"Richard Miskin" <Richard.Miskin@xxxxxxx>
Sent by: cdt-dev-bounces@xxxxxxxxxxx
04/25/2008 03:22 AM
Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx> |
|
|
Hi,
I’m in the process of creating a new ILanguage that uses our parser to produce a CDT AST (with bindings etc). I’ve got some tests that I’ve written myself but I was wondering whether it would be viable to reuse any of the existing tests from the CDT project.
Any views?
Cheers,
Richard
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the addressee, any disclosure, reproduction, copying, distribution, or other dissemination or use of this communication is strictly prohibited. If you have received this transmission in error please notify the sender immediately and then delete this email.
Any representations or commitments expressed in this email are subject to contract.
This message has been scanned for viruses and dangerous content. However, it is essential that the recipient also checks this message using commercially available mail scanning and anti-virus software. IPL Information Processing Limited accepts no liability for any loss or damage resulting from any virus or other dangerous content in this message.
IPL Information Processing Limited is registered in England and Wales under company registration number 1418818. Registration took place at Cardiff on 10 May 1979. IPL Information Processing Limited's registered office and normal place of business is Eveleigh House, Grove Street, Bath, BA1 5LR, United Kingdom. IPL is also registered for Value Added Tax (VAT) under registration number GB 601 2931 83._______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the addressee, any disclosure, reproduction, copying, distribution, or other dissemination or use of this communication is strictly prohibited. If you have received this transmission in error please notify the sender immediately and then delete this email.
Any representations or commitments expressed in this email are subject to contract.
This message has been scanned for viruses and dangerous content. However, it is essential that the recipient also checks this message using commercially available mail scanning and anti-virus software. IPL Information Processing Limited accepts no liability for any loss or damage resulting from any virus or other dangerous content in this message.
IPL Information Processing Limited is registered in England and Wales under company registration number 1418818. Registration took place at Cardiff on 10 May 1979. IPL Information Processing Limited's registered office and normal place of business is Eveleigh House, Grove Street, Bath, BA1 5LR, United Kingdom. IPL is also registered for Value Added Tax (VAT) under registration number GB 601 2931 83._______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the addressee, any disclosure, reproduction, copying, distribution, or other dissemination or use of this communication is strictly prohibited. If you have received this transmission in error please notify the sender immediately and then delete this email.
Any representations or commitments expressed in this email are subject to contract.
This message has been scanned for viruses and dangerous content. However, it is essential that the recipient also checks this message using commercially available mail scanning and anti-virus software. IPL Information Processing Limited accepts no liability for any loss or damage resulting from any virus or other dangerous content in this message.
IPL Information Processing Limited is registered in England and Wales under company registration number 1418818. Registration took place at Cardiff on 10 May 1979. IPL Information Processing Limited's registered office and normal place of business is Eveleigh House, Grove Street, Bath, BA1 5LR, United Kingdom. IPL is also registered for Value Added Tax (VAT) under registration number GB 601 2931 83._______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
![GIF image](gifpdQpMTHjbY.gif)
![GIF image](gifAoK0j3Bcnj.gif)
![GIF image](gifb8BcQnAY6x.gif)
![GIF image](gifpRunALjmRs.gif)
![GIF image](gifIP22JEWsa9.gif)
![GIF image](gifyLtfckoXZS.gif)
![GIF image](gif4EbMctZcso.gif)