Skip to content
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

ATL Eclipse Modeling Tools #16

Open
jouinifatma opened this issue Nov 6, 2024 · 0 comments
Open

ATL Eclipse Modeling Tools #16

jouinifatma opened this issue Nov 6, 2024 · 0 comments

Comments

@jouinifatma
Copy link

I tried to create an ATL file that contains the transformation from a model to another. Basically, I developed 3 models: an abstract user interface, concrete UI, and final UI. There are 2 transformations created: AUI2CUI.atl and CUI2FUI.atl.
I have a problem with the second file that I did not recognize. The error is below:

mismatched input '(' expecting SEMI CUI2FUI.atl /ATLTransformationProject/Trans_Rules line 30, column 19 ATL Problem
can you pleaze help me to hundle this problem, however i'm not an expert on java and eclipse.
Capture d'écran 2024-11-05 101852

the file is below:

`
-- @path CUI=/ATLTransformationProject/Meta_Model/MyCUI.ecore
-- @path FUI=/ATLTransformationProject/Meta_Model/MyFUI.ecore
module CUI2FUI;
create OUT : FUI from IN : CUI;


rule CUIModelToFUIModel {
from
cuiModel : CUI!CUIModel
to
fuiModel : FUI!FUIModel ( ) }


-- Règle pour transformer l'énumération UIView en une classe UITextType
rule UIViewToUITextType {
from
uiView : CUI!UIView -- Référence à l'énumération dans le modèle source
to
textType : FUI!UITextType ( -- Nouvelle classe dans le modèle cible
name <- uiView.name, -- Copie le nom de l'énumération en nom de classe
UITextField <- thisModule.createAttribute(uiView, 'UITextField'),
UIDatePicker <- thisModule.createAttribute(uiView, 'UIDatePicker'),
UITextContentTypeEmailAddress <- thisModule.createAttribute(uiView, 'UITextContentTypeEmailAddress'),
UITextContentTypeTelephoneNumber <- thisModule.createAttribute(uiView, 'UITextContentTypeTelephoneNumber'),
UITextView <- thisModule.createAttribute(uiView, 'UITextView')
)
}

-- Helper pour créer des attributs dans la classe UITextType
helper def : createAttribute(uiView : CUI!UIView, attributeName : String) : FUI!Attribute =
FUI!Attribute (
name <- attributeName,
value <- if uiView.ownedLiteral->exists(l | l.name = attributeName)
then attributeName
else null
);


rule UIButtonTypeToUIButton {
from
cuiButtonType : CUI!UIButtonType
to
fuiButton : FUI!UIButton ( ) }


rule CICToWidget {
from
cuiCIC : CUI!CIC
to
fuiWidget : FUI!Widget ( ) }


rule CCToUIView {
from
cuiCC : CUI!CC
to
fuiView : FUI!UIView (
id <- cuiCC.id ) }


rule UITextComponentToUITextField {
from
cuiTextComponent : CUI!UITextComponent
to
fuiTextField : FUI!UITextField ( ) }
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant