-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dummy ClipboardExtendedPlugin (#3)
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
94 changes: 94 additions & 0 deletions
94
...i.swa.graal.squeak/src/de/hpi/swa/graal/squeak/nodes/plugins/ClipboardExtendedPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package de.hpi.swa.graal.squeak.nodes.plugins; | ||
|
||
import java.util.List; | ||
|
||
import com.oracle.truffle.api.dsl.GenerateNodeFactory; | ||
import com.oracle.truffle.api.dsl.NodeFactory; | ||
import com.oracle.truffle.api.dsl.Specialization; | ||
|
||
import de.hpi.swa.graal.squeak.exceptions.PrimitiveExceptions.PrimitiveFailed; | ||
import de.hpi.swa.graal.squeak.model.CompiledMethodObject; | ||
import de.hpi.swa.graal.squeak.model.PointersObject; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.AbstractPrimitiveFactoryHolder; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.AbstractPrimitiveNode; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.BinaryPrimitive; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.QuaternaryPrimitive; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.TernaryPrimitive; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.UnaryPrimitiveWithoutFallback; | ||
import de.hpi.swa.graal.squeak.nodes.primitives.SqueakPrimitive; | ||
|
||
public final class ClipboardExtendedPlugin extends AbstractPrimitiveFactoryHolder { | ||
@GenerateNodeFactory | ||
@SqueakPrimitive(names = "ioAddClipboardData") | ||
protected abstract static class PrimIOAddClipboardDataNode extends AbstractPrimitiveNode implements QuaternaryPrimitive { | ||
protected PrimIOAddClipboardDataNode(final CompiledMethodObject method) { | ||
super(method); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
@Specialization | ||
protected static final Object doAdd(final PointersObject receiver, final Object clipboard, final Object data, final Object dataFormat) { | ||
throw new PrimitiveFailed(); // TODO: implement primitive | ||
} | ||
} | ||
|
||
@GenerateNodeFactory | ||
@SqueakPrimitive(names = "ioClearClipboard") | ||
protected abstract static class PrimIOClearClipboardNode extends AbstractPrimitiveNode implements BinaryPrimitive { | ||
protected PrimIOClearClipboardNode(final CompiledMethodObject method) { | ||
super(method); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
@Specialization | ||
protected static final Object doClear(final PointersObject receiver, final Object clipboard) { | ||
throw new PrimitiveFailed(); // TODO: implement primitive | ||
} | ||
} | ||
|
||
@GenerateNodeFactory | ||
@SqueakPrimitive(names = "ioCreateClipboard") | ||
protected abstract static class PrimIOCreateClipboardNode extends AbstractPrimitiveNode implements UnaryPrimitiveWithoutFallback { | ||
protected PrimIOCreateClipboardNode(final CompiledMethodObject method) { | ||
super(method); | ||
} | ||
|
||
@Specialization | ||
protected static final Object doCreate(@SuppressWarnings("unused") final Object receiver) { | ||
throw new PrimitiveFailed(); // TODO: implement primitive | ||
} | ||
} | ||
|
||
@GenerateNodeFactory | ||
@SqueakPrimitive(names = "ioGetClipboardFormat") | ||
protected abstract static class PrimIOGetClipboardFormatNode extends AbstractPrimitiveNode implements TernaryPrimitive { | ||
protected PrimIOGetClipboardFormatNode(final CompiledMethodObject method) { | ||
super(method); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
@Specialization | ||
protected static final Object doGet(final PointersObject receiver, final Object clipboard, final long formatNumber) { | ||
throw new PrimitiveFailed(); // TODO: implement primitive | ||
} | ||
} | ||
|
||
@GenerateNodeFactory | ||
@SqueakPrimitive(names = "ioReadClipboardData") | ||
protected abstract static class PrimIOReadClipboardDataNode extends AbstractPrimitiveNode implements TernaryPrimitive { | ||
protected PrimIOReadClipboardDataNode(final CompiledMethodObject method) { | ||
super(method); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
@Specialization | ||
protected static final Object doRead(final PointersObject receiver, final Object clipboard, final Object dataFormat) { | ||
throw new PrimitiveFailed(); // TODO: implement primitive | ||
} | ||
} | ||
|
||
@Override | ||
public List<? extends NodeFactory<? extends AbstractPrimitiveNode>> getFactories() { | ||
return ClipboardExtendedPluginFactory.getFactories(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters