Skip to content

An work in progress example of how to use JaMoPP to modify existing Java code.

License

Notifications You must be signed in to change notification settings

ChristianBusch/JaMoPP-mod-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JaMoPP-mod-example

An work in progress example of how to use JaMoPP to modify existing Java code.

Running the code will modify the CalculatorPow.java file by inserting this code direcly ahead of the first methods first instruction*:

if( false ) {
   int answer = 42;
} else {
}

So out of this:

package input;

public class CalculatorPow {

	public double compute(double i) {
		double result = Math.pow(i,2);
		return result;
	}
}

...becomes this:

package input;

public class CalculatorPow {

	public double compute(double i) {
		if (false) {
			int answer = 42;
		}else {
		}
		double result = Math.pow(i,2);
		return result;
	}
}

* actually the first LocalVariableStatement

Note:

In order to build the code you currently need some projects in your workspace.
This is due some problems with m2eclipse and the JaMoPP maven repository I currently encounter and will likely change in the near future.

The projects you need are:

  • org.emftext.language.java
  • org.emftext.language.java.resource

You will find them under https://github.com/DevBoost/JaMoPP

About

An work in progress example of how to use JaMoPP to modify existing Java code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages