Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Alf verifier or validator
Alf verifier or validator [message #1362673] Sat, 17 May 2014 19:33 Go to next message
John Smith is currently offline John SmithFriend
Messages: 12
Registered: March 2014
Junior Member
Dear All,

Is there any way to programmatically execute the Alf syntax verifier on a specified .alf file (resource)?

I need to do formal model transformation from an .alf file, and I have to make sure, that the .alf file was syntactically valid.

Moreover, is there a way to execute the verifier, and receive a boolean value, indicating that the specified .alf file was syntactically valid?

Thank you for your help in advance!


Best regards,
John

[Updated on: Sun, 18 May 2014 13:59]

Report message to a moderator

Re: Alf verifier or validator [message #1364255 is a reply to message #1362673] Sun, 18 May 2014 11:51 Go to previous messageGo to next message
John Smith is currently offline John SmithFriend
Messages: 12
Registered: March 2014
Junior Member
I have found the org.eclipse.papyrus.uml.alf.validation.AlfJavaValidator class which may be responsible for the syntax validation. (Source: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/plain/plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/validation/AlfJavaValidator.java)

How can I access that class? Which Eclipse Papyrus Alf plug-in contains it?
Moreover, which plug-ins contain those classes, that AlfJavaValidator requires?


Edit: I have found the answer: org.eclipse.papyrus.uml.alf containts that class, that is in the Papyrus UML (Incubation) project.

Question: As far as I have seen, the AlfJavaValidator does not check the syntax of the statements. For instance, if I write

let a^someting : Integer = 0


then the syntax highlighter marks the line, as it is incorrect, because of the ^ character. How can I reach that class or method that is responsible for this syntax check?

Thank you for your help!

Best regards,
John

[Updated on: Sun, 18 May 2014 13:59]

Report message to a moderator

Re: Alf verifier or validator [message #1366694 is a reply to message #1364255] Mon, 19 May 2014 12:32 Go to previous messageGo to next message
John Smith is currently offline John SmithFriend
Messages: 12
Registered: March 2014
Junior Member
Solution:

Resource original = (org.eclipse.emf.ecore.resource.Resource) resource;
if(original.getErrors().size() != 0 || original.getWarnings().size() != 0 || Diagnostician.INSTANCE.validate(resource.getContents().get(0)).getSeverity() != Diagnostic.OK){
 // input invalid
} else {
 // input valid
}

[Updated on: Mon, 19 May 2014 12:34]

Report message to a moderator

Re: Alf verifier or validator [message #1403318 is a reply to message #1366694] Tue, 22 July 2014 22:21 Go to previous message
cyril dufrechou is currently offline cyril dufrechouFriend
Messages: 35
Registered: September 2013
Member
Hi,
Can you tell me how to install the ALF verifier and if it's applicable to PAPYRUS IDE?
Regards
Cyril
Previous Topic:Requirements management in PAPYRUS
Next Topic:Something strange with specialization
Goto Forum:
  


Current Time: Fri Apr 26 06:54:37 GMT 2024

Powered by FUDForum. Page generated in 0.03262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top