Skip to main content



      Home
Home » Modeling » MoDisco » JDTVisitor Assignment Node
JDTVisitor Assignment Node [message #1766361] Tue, 20 June 2017 10:38
Eclipse UserFriend
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: Thu May 15 06:28:20 EDT 2025

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

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

Back to the top