Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » JDTVisitor Assignment Node
JDTVisitor Assignment Node [message #1766361] Tue, 20 June 2017 14:38
Tiago Martins is currently offline Tiago MartinsFriend
Messages: 23
Registered: May 2017
Junior Member
I am trying to understand how MoDisco recursively iterate the java ast.

For instance, I searched in the Source Code and an Assignment is composed by a left expression (Maybe VariableDeclarationImpl class) and then a right expression...

However in the following code, first in the visit of the Assignment node is created the assignment in the factory and in the endVisit method is added the left and right expression if already exists, but in which part of the code the left and right expression is added? I don't understand... can someone please explain me?

I need to understand this in order to implement my own technology layer and new discoverer.

public boolean visit(final org.eclipse.jdt.core.dom.Assignment node) {
		Assignment element = this.factory.createAssignment();
		this.binding.put(node, element);
		return true;
	}

	@Override
	public void endVisit(final org.eclipse.jdt.core.dom.Assignment node) {
		Assignment element = (Assignment) this.binding.get(node);
		initializeNode(element, node);

		element.setOperator(AssignmentKind.get(node.getOperator().toString()));

		if (this.binding.get(node.getLeftHandSide()) != null) {
			element.setLeftHandSide(JDTVisitorUtils.completeExpression(
					this.binding.get(node.getLeftHandSide()), this));
		}
		if (this.binding.get(node.getRightHandSide()) != null) {
			element.setRightHandSide(JDTVisitorUtils.completeExpression(
					this.binding.get(node.getRightHandSide()), this));
		}
	}
Previous Topic:Discoverer Not Appearing in UI (Discoverers list)
Next Topic:How did MoDisco generated the file java.ecore
Goto Forum:
  


Current Time: Mon Sep 24 17:09:01 GMT 2018

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

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

Back to the top