Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353658 - Support bitwise operators
Summary: Support bitwise operators
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 16:24 EDT by Matt Heitz CLA
Modified: 2017-02-23 14:18 EST (History)
2 users (show)

See Also:


Attachments
testcase (1.71 KB, text/plain)
2011-09-26 22:10 EDT, Matt Heitz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Heitz CLA 2011-08-02 16:24:56 EDT
Support & | xor along with the assigning forms, &= |= xor=
Comment 1 Matt Heitz CLA 2011-08-27 13:45:10 EDT
As of 8/27, this is mostly done.  The only part left is that we generate bad code for the assigning forms when the LHS is nullable.  We'll generate something like "int3n &= int2" which will result in a NullPointerException if either operand is null.
Comment 2 Kathy Carroll CLA 2011-08-30 14:17:48 EDT
Shouldn't eglx.lang.ESmallInt.egl also have the bitwise operators in it.  I assume this is why I'm get these validation errors:

Multiple markers at this line
	- IWN.JavaGen.9998.e 53/1163 Exception occurred: java.lang.RuntimeException: 
	 org.eclipse.edt.mof.egl.NoSuchFunctionError
	- IWN.JavaGen.9999.e 53/1163 Stack Trace: java.lang.RuntimeException: org.eclipse.edt.mof.egl.NoSuchFunctionError

For
    actual SmallInt;
    int2 SmallInt;
    int1 SmallInt;
    actual = int1 & int2;

I'm not sure if this is a generation, language, or compiler problem
Comment 3 Matt Heitz CLA 2011-08-30 14:25:56 EDT
No, we only support bitwise operators with ints in EDT.  That's a compiler bug.
Comment 4 Jeff Douglas CLA 2011-09-02 12:56:39 EDT
I've committed the code for the generator side to throw an exception (based on the new nullable spec), however before this is complete the nullable spec has to be implemented (next iteration) and the runtime has to be changed to match the EGL definition file.
Comment 5 Matt Heitz CLA 2011-09-26 22:10:27 EDT
Created attachment 204042 [details]
testcase
Comment 6 Matt Heitz CLA 2011-09-26 22:10:59 EDT
This is finished.  My testcase is attached.
Comment 7 Matt Heitz CLA 2011-09-27 10:16:54 EDT
Closing all JavaGen enhancements that are in the Resolved state.