-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Things to do for Bert Verhees #17
Comments
Hi Pieter, I appreciate the work you do, and I admire the craftsmanship. But I test grammars in another way, less integrated, but more on the level Working on this detail level, testing every parsing rule in the grammar has The advantage of this approach is that the tests are easy to understand, Do you think that is useful? I will write these tests anyway for future So I will start, writing tests, and publish them in a forked git I will notify you where to find the work. Feel free to criticize it, I am am sure there are many other ways to do so.Your request to fix a regular expression, I will check it. Which expression a look, maybe I see something you did not see.Regarding the CTemporal types, that the parser works ok, but the tree problem is well enough described in those emails?Let me explain my position. I am an independent developer, nobody is paying Thanks for giving the opportunity. Bert
|
Hello Bert, there are not really emails (although you can receive them this way), but github issues. You can find them on https://github.com/openEHR/adl-antlr/issues . #7 explains the regular expression problem. The CTemporal types is not strange at all - i just have not implemented them yet, the grammar works fine and it is not an antlr problem - just missing java code. I think any testing in this case is useful. In any case, it's open source software, you can add anything you want in your own forks :) This grammar is mainly work by Thomas though, not me, I implemented a java library on top of it and tested the grammar that way. |
Hi Pieter, thanks for your explanation. I know that the work is mainly Thomas's work. I appreciate his I think testing is useful, because, I know from the previous grammar, Which will be very good for the next 10 years, I guess. In the afternoon, I take a look to the at the regular expression issue. Best regard On 28-10-15 10:31, Pieter Bos wrote:
|
Re: testing code / test cases - if we can produce a nice library of test cases to add to this (adl-antlr) project it would be nice - I don't want it to just be the raw grammar - it should become a resource that a developer can use directly. To do that, I'll need help ;-) |
On 28-10-15 14:31, Thomas Beale wrote:
Can you give an example of what you intend and what the purpose is? I remember in the old grammar, there was an error, there was a 13606 But I believe you want a solution like that? I agree that testing the raw grammar is not used very often, it is When googling, I found some test-tools on Antlr, until now, I tested my So, concluding, I don't know what is wise to do. Maybe Terence Parr is the right person to ask. If you can come to a wise decision, I am happy to help you create it |
At the moment the test resource I am using is the adl-archetypes reference archetype set - what we use to test the parser and validator in the ADL Workbench. Each of these archetypes is intended to either illustrate some AOM/ADL feature in its working form, or else demonstrate a single kind of failure corresponding to a 'V' code, e.g. VCACA etc, which are the validity codes defined in the AOM, and that ADL WB emits. Testing Antlr rules seems easier by testing each rule individually, and therefore using small fragments of archetypes, e.g. just a single C_COMPLEX_OBJECT structure etc. A test set based on this approach would presumably consist of many small files like this, and an automated test rig to run them all against specific rules; then we would also want to test full arcetypes and generate the same V-codes out from the reference archetypes. Doing this probably means upgrading the current Antlr rules to include the V-codes due to specific error conditions. |
On 28-10-15 16:20, Thomas Beale wrote:
|
Hi Thomas, in the ANTLR Reference is a complete chapter (9 Error Reporting and Recovery) about error-handling/reporting, and explanation and example how to change error messages. It is just a matter of adding your own errorhandling which translates the errors. You can find the predefined errors in org.antlr4.v4.tool.ErrorType and ErrorSeverity |
Indeed (I have the book) - I'll get onto this at some point, but if anyone wants to work out a few patterns, I'll be happy to incorporate them. Since I'm not normally a Java programmer, I'll need to make sure that what we do in this project is the 'normal' way to do it. |
I can help you with that, we have the test-pattern Rong used, that could be a good starting point. I must see how to create the necessary boilerplate. Maybe you have already some archetypes for test-purposes, and according error messages/codes from the ADL Workbench, which you want the parser to produce. And I must say, I must study the syntax from ADL2.0 (I postponed that ;-) But I must study that anyway, so this is a good occasion. So, if it is OK for you, I start this afternoon, and have at least the boilerplate code ready, and a first test. After that, things can go fast. |
Hi Thomas, I checked the boilerplate code, it is in fact very simple, create a parser, add your errorlistener and parse the file, the errorlistener will then contain the errors that occured. And for checking the AOM-classes, in fact Pieter Bos has build a good fundament. I think, this is ready, except for ADL-Workbench conforming errorhandling Maybe you have test archetypes, they are easy to implement in the parser, with expected errors. |
The error handling in Archie is still very primitive. The basic structures are in place (an ANTLR ErrorListener and a place to put errors and warnings), but that's it - the error messages are really primitive. I suggest something like the Bean Validation to handle archetype model validation and errors. If there is a list of standard errors - great, let's use it. This is however not the first thing on my todo-list. |
Pieter, error handling in ANTLR is, IMHO, good enough, it breaks at severe errors, and runs further at non severe errors. I believe there are five levels of severity. I don't know what the adl-workbench has, Thomas knows, so it is for him to decide if it is possible to use that error-system, and maybe partly. So, best thing to do is to wait for his opinion on this, and then, if appropriate, make a plan. |
Since @BertVerhees asked for things to do, a list of suggestions of things he can do:
In archie (https://github.com/nedap/archie) :
The text was updated successfully, but these errors were encountered: