Customize code checker [message #901966] |
Wed, 15 August 2012 10:57 |
Charalampos Alexopoulos Messages: 13 Registered: July 2012 |
Junior Member |
|
|
Hi
The language that i implement support predefined functions like:
cylinder(r1, r2, r, h)
Except the conventional way to call this function, you can also can call it using parameters names like:
cylinder(r1=5, r2=3, h=20)
or
cylinder(h=20, r=30)
As you can see from the above example, you can not only use as many of the parameters you want but you can also mix the order. To implement this i make the following simplified grammar:
Code:
(cube+=Cylinder)*
;
Cylinder:
'cylinder' '(' (var+=Var (',' var+=Var)*)?')' ';'
;
Var:
name=ID '=' NUMBER
;
terminal NUMBER returns ecore::EBigDecimal:
('0'..'9')* ('.' ('0'..'9')+)?;
terminal INT returns ecore::EInt:
'this one has been deactivated';
I thing that what i need is to do a parameters validation in the CylinderImpl class. So what i did so far is to do the checkout in "eIsSet" method of "CylinderImpl.java", but i don't know how to throw a warning or error message to the editor.
Thank you in advance
Charalampos Alexopoulos
|
|
|
|
Powered by
FUDForum. Page generated in 0.03746 seconds