Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EGL Development Tools » Unable to compile EGL code(NullpointerException on invocation of EGL2IR.main();)
Unable to compile EGL code [message #755076] Mon, 07 November 2011 09:54 Go to next message
Bart Van Campenhout is currently offline Bart Van CampenhoutFriend
Messages: 9
Registered: February 2011
Junior Member
As I didn't find any documentation on this, here's the code that I figured out for compiling an EGL file into IR files:

I've added these plug in dependencies:
- org.eclipse.edt.mof.egl
- org.eclipse.edt.mof.eglx.services
- org.eclipse.edt.mof.eglx.persistence.sql
- org.eclipse.ect.compiler


	public static void compileFile(File toCompile, ArrayList<File> eglPathDirectories, File outputDir){
		String[] compileArgs = new String[7];
		int i = 0;
		compileArgs[i++] = SOURCE_PATH;
		StringBuffer eglPath = new StringBuffer();
		for (File file : eglPathDirectories) {
			eglPath.append(file.getAbsolutePath() + ";");
		}
		compileArgs[i++] = eglPath.toString();
		compileArgs[i++] = IR_OUTPUT_PATH;
		outputDir.mkdirs();
		compileArgs[i++] = outputDir.getAbsolutePath();
		compileArgs[i++] = IS_VAG_COMPATIBLE;
		compileArgs[i++] = CLEAN;
		compileArgs[i++] = toCompile.getAbsolutePath(); 
		
		
		EGL2IR.main(compileArgs);
	}


This code is called like this:
		File tocompFile = new File("C:/Users/BVC/TestIndigo/JUnitEGLSimple_EDT/EGLSource/haha/abc.egl");
		ArrayList<File> eglPathDirs = new ArrayList<File>();
		eglPathDirs.add(new File("C:/Users/BVC/TestIndigo/JUnitEGLSimple_EDT/EGLSource"));
		File outputDir = new File("C:/Temp/EGL_Bin_Small_New");
		Compile.compileFile(tocompFile, eglPathDirs, outputDir);




The exception I get is:
Processing Part: abc
Bootstrap initialize...
org.eclipse.edt.compiler.internal.core.builder.BuildException: java.lang.NullPointerException
	at org.eclipse.edt.compiler.AbstractProcessingQueue.process(AbstractProcessingQueue.java:189)
	at org.eclipse.edt.compiler.AbstractProcessingQueue.process(AbstractProcessingQueue.java:154)
	at org.eclipse.edt.compiler.tools.EGLC.compile(EGLC.java:135)
	at org.eclipse.edt.compiler.tools.EGL2IR.compile(EGL2IR.java:89)
	at org.eclipse.edt.compiler.tools.EGL2IR.main(EGL2IR.java:54)
	at org.eclipse.edt.compiler.tools.EGL2IR.main(EGL2IR.java:47)
	at edtapi.Compile.compileFile(Compile.java:43)
	at edtapi.actions.SampleAction.run(SampleAction.java:44)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.handleVisitPart(Egl2MofPart.java:414)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:383)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:216)
	at org.eclipse.edt.compiler.core.ast.Library.accept(Library.java:49)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2Mof.convert(Egl2Mof.java:160)
	at org.eclipse.edt.compiler.Processor.createIRFromBoundAST2(Processor.java:164)
	at org.eclipse.edt.compiler.Processor.level03Compile(Processor.java:120)
	at org.eclipse.edt.compiler.AbstractProcessingQueue.process(AbstractProcessingQueue.java:171)
	... 37 more

Re: Unable to compile EGL code [message #755107 is a reply to message #755076] Mon, 07 November 2011 12:26 Go to previous messageGo to next message
Bart Van Campenhout is currently offline Bart Van CampenhoutFriend
Messages: 9
Registered: February 2011
Junior Member
More info: I'm using the 0.7.M3 build.
Re: Unable to compile EGL code [message #755131 is a reply to message #755107] Mon, 07 November 2011 13:36 Go to previous messageGo to next message
Brian Svihovec is currently offline Brian SvihovecFriend
Messages: 55
Registered: July 2009
Member
Bart,

Please open a defect in Bugzilla -

https: //bugs.eclipse.org/bugs/enter_bug.cgi?product=EDT

(NOTE: The Eclipse forum won't let me post links yet, so you will need to remove the space between https: and //. This link goes directly to the 'Enter Bug' page for the EDT component)

The component would be Compiler.

Please include all of the information from your post.

-Brian
Re: Unable to compile EGL code [message #755147 is a reply to message #755076] Mon, 07 November 2011 14:19 Go to previous messageGo to next message
Paul Harmon is currently offline Paul HarmonFriend
Messages: 11
Registered: July 2009
Junior Member
The error you are getting could only be caused by our egl.mofar file not being read when the system parts are set up (which means that none of our system parts are initialized).

I am confused because the stack trace you have shown is from an EDT build (your Compiler.compileFile() code does not seem to be on the stack).

When you open the bug, could you provide the entire .log file.

Also, if possible, could you include the plugin that you developed?

Thanks,

Paul
Re: Unable to compile EGL code [message #755184 is a reply to message #755076] Mon, 07 November 2011 15:52 Go to previous message
Bart Van Campenhout is currently offline Bart Van CampenhoutFriend
Messages: 9
Registered: February 2011
Junior Member
Bug 363057 is submitted.
Previous Topic:WHY "The type SQLRecord cannot be resolved" ?
Next Topic:how to do @Overrides in EDT
Goto Forum:
  


Current Time: Thu Apr 18 09:23:15 GMT 2024

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

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

Back to the top