├── .gitignore ├── LICENSE ├── README ├── javax.inject ├── .classpath ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF └── build.properties ├── net.dougqh.functional ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── src │ └── net │ │ └── dougqh │ │ ├── aggregator │ │ ├── Aggregator.java │ │ ├── ChainedProcessor.java │ │ ├── ConditionallyBlockingQueue.java │ │ ├── FilteringProcessor.java │ │ ├── InThreadAggregatingIterator.java │ │ ├── InputChannel.java │ │ ├── InputProvider.java │ │ ├── InputScheduler.java │ │ ├── OutputChannel.java │ │ ├── ParallelAggregatingIterator.java │ │ ├── Processor.java │ │ ├── QueueBasedInputChannel.java │ │ ├── QueueBasedOutputChannel.java │ │ ├── SimpleInputProcessor.java │ │ └── TransformProcessor.java │ │ ├── collections │ │ ├── CompositeIterable.java │ │ ├── CompositeIterator.java │ │ ├── EmptyIterator.java │ │ ├── EnumerationIterator.java │ │ ├── RecursiveIterable.java │ │ ├── RecursiveIterator.java │ │ ├── TransformIterable.java │ │ ├── TransformIterator.java │ │ ├── TransformedList.java │ │ └── TransformedListIterator.java │ │ └── functional │ │ ├── AndFilter.java │ │ ├── CompositeTransform.java │ │ ├── Filter.java │ │ ├── NotFilter.java │ │ ├── OrFilter.java │ │ └── Transform.java └── test-src │ └── net │ └── dougqh │ └── aggregator │ ├── AggregatorSuite.java │ ├── ChainedTest.java │ ├── FilteringTest.java │ ├── PassthroughProcessor.java │ ├── TestChannel.java │ └── TransformTest.java ├── net.dougqh.jak.core.assembler ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── src │ └── net │ │ └── dougqh │ │ └── jak │ │ └── assembler │ │ ├── BinaryComparisonCondition.java │ │ ├── BinaryLogicalCondition.java │ │ ├── BooleanCondition.java │ │ ├── JakAnnotationWriter.java │ │ ├── JakAsm.java │ │ ├── JakClassWriter.java │ │ ├── JakCodeWriter.java │ │ ├── JakCondition.java │ │ ├── JakConstantExpression.java │ │ ├── JakEnumWriter.java │ │ ├── JakExpression.java │ │ ├── JakExtendedTypeWriter.java │ │ ├── JakInterfaceWriter.java │ │ ├── JakMacro.java │ │ ├── JakTypeWriter.java │ │ ├── JakVariableExpression.java │ │ ├── JakWriter.java │ │ ├── SuperType.java │ │ ├── ThisType.java │ │ ├── TypeResolver.java │ │ └── UnaryLogicalCondition.java └── test-src │ └── net │ └── dougqh │ └── jak │ └── assembler │ └── JakConditionsTest.java ├── net.dougqh.jak.core.disassembler ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties └── src │ └── net │ └── dougqh │ └── jak │ └── disassembler │ ├── JakReader.java │ ├── JavaAnnotation.java │ ├── JavaClass.java │ ├── JavaCodeReader.java │ ├── JavaEnum.java │ ├── JavaFieldSet.java │ ├── JavaInterface.java │ ├── JavaMethod.java │ ├── JavaMethodSet.java │ ├── JavaSource.java │ ├── JavaType.java │ └── JavaTypeSet.java ├── net.dougqh.jak.core ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties └── src │ └── net │ └── dougqh │ └── jak │ ├── AnalysisHelper.java │ ├── Flags.java │ ├── FormalArguments.java │ ├── Jak.java │ ├── JakContext.java │ ├── JavaAnnotationDescriptor.java │ ├── JavaClassDescriptor.java │ ├── JavaElement.java │ ├── JavaEnumDescriptor.java │ ├── JavaField.java │ ├── JavaFieldImpl.java │ ├── JavaInterfaceDescriptor.java │ ├── JavaMethodDescriptor.java │ ├── JavaMethodSignature.java │ ├── JavaMethodStats.java │ ├── JavaModifiers.java │ ├── JavaOperation.java │ ├── JavaPackageDescriptor.java │ ├── JavaVariable.java │ ├── JavaVersion.java │ ├── Methods.java │ ├── TypeDescriptor.java │ ├── inject │ ├── InjectionRecipient.java │ └── Injector.java │ └── types │ ├── Any.java │ ├── ArgList.java │ ├── Category1.java │ ├── Category2.java │ ├── Primitive.java │ ├── Reference.java │ ├── Types.java │ ├── Union.java │ └── Utf8.java ├── net.dougqh.jak.demos ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── src │ ├── basicblocks │ │ ├── BasicBlock.java │ │ ├── BasicBlocks.java │ │ ├── FlowControl.java │ │ ├── JvmOperationMatcher.java │ │ ├── JvmOperationMatchers.java │ │ ├── JvmOperationMatchingIterator.java │ │ ├── Loop.java │ │ └── Loops.java │ └── registers │ │ └── DataFlowAnalysis.java └── test-src │ ├── BasicBlockAnalysis.java │ └── LoopUnrolling.java ├── net.dougqh.jak.jvm.assembler ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── API Ideas.txt ├── META-INF │ └── MANIFEST.MF ├── TODO.txt ├── build.properties ├── lib │ └── junit-4.8.2.jar ├── scratch-src │ ├── DecoderSwitch.java │ ├── Enum.java │ ├── GenFilter.java │ ├── GenHydrator.java │ ├── Generic.java │ ├── LogicalOps.java │ ├── MyEnum.java │ ├── ScrewedLoop.java │ ├── Section.java │ ├── SourceWriter.java │ └── Sync.java ├── src │ ├── .DS_Store │ └── net │ │ ├── .DS_Store │ │ └── dougqh │ │ ├── .DS_Store │ │ └── jak │ │ └── jvm │ │ └── assembler │ │ ├── .DS_Store │ │ ├── AnnotationValueWriter.java │ │ ├── AnnotationsAttribute.java │ │ ├── Attribute.java │ │ ├── Attributes.java │ │ ├── Byte2Slot.java │ │ ├── ConstantEntry.java │ │ ├── ConstantPool.java │ │ ├── DefaultJvmStack.java │ │ ├── DefaultLocals.java │ │ ├── Fields.java │ │ ├── FixedLengthAttribute.java │ │ ├── Interfaces.java │ │ ├── JakConfiguration.java │ │ ├── JakMonitor.java │ │ ├── JvmAnnotationWriter.java │ │ ├── JvmClassWriter.java │ │ ├── JvmCodeWriter.java │ │ ├── JvmCodeWriterImpl.java │ │ ├── JvmConditionVisitor.java │ │ ├── JvmCoreCodeWriter.java │ │ ├── JvmCoreCodeWriterImpl.java │ │ ├── JvmEnumWriter.java │ │ ├── JvmExpression.java │ │ ├── JvmExpressionVisitor.java │ │ ├── JvmExtendedTypeWriter.java │ │ ├── JvmInterfaceWriter.java │ │ ├── JvmMacro.java │ │ ├── JvmOutputStream.java │ │ ├── JvmPackageWriter.java │ │ ├── JvmTypeWriter.java │ │ ├── JvmWriter.java │ │ ├── Methods.java │ │ ├── TypeWriter.java │ │ ├── TypeWriterGroup.java │ │ ├── WritingContext.java │ │ └── macros │ │ ├── ArrayFor.java │ │ ├── DoWhile.java │ │ ├── For.java │ │ ├── IfConstruct.java │ │ ├── IterableFor.java │ │ ├── Synchronized.java │ │ ├── Ternary.java │ │ ├── TryConstruct.java │ │ ├── While.java │ │ ├── expr.java │ │ └── stmt.java └── test-src │ └── net │ └── dougqh │ └── jak │ ├── jvm │ └── assembler │ │ ├── FlagsTest.java │ │ ├── JakAssemblerTestSuite.java │ │ ├── JvmOutputStreamTest.java │ │ ├── LocalsTest.java │ │ ├── OperationTest.java │ │ ├── ScopeTest.java │ │ ├── api │ │ ├── AnnotationsTest.java │ │ ├── ArithmeticOpsTest.java │ │ ├── ArraysTest.java │ │ ├── BranchTest.java │ │ ├── CastTest.java │ │ ├── ClassLoaderTest.java │ │ ├── ConstantTest.java │ │ ├── EnumTest.java │ │ ├── ExceptionsTest.java │ │ ├── FieldsTest.java │ │ ├── GenericsTest.java │ │ ├── InvocationTest.java │ │ ├── JakAssemblerApiTestSuite.java │ │ ├── JvmTypeStackTest.java │ │ ├── LoadAndStoreTest.java │ │ ├── MacrosTest.java │ │ ├── ModifiersTest.java │ │ ├── NumbersTest.java │ │ ├── PackageTest.java │ │ ├── StackManipulationTest.java │ │ ├── StructuralTest.java │ │ ├── SynchronizationTest.java │ │ └── TestClassLoader.java │ │ └── macros │ │ └── api │ │ ├── ArrayForTest.java │ │ ├── DoWhileTest.java │ │ ├── ExpressionsTest.java │ │ ├── IfTest.java │ │ ├── IterableForTest.java │ │ ├── MacrosTestSuite.java │ │ ├── Nesting.java │ │ ├── SynchronizedTest.java │ │ ├── TryTest.java │ │ └── WhileTest.java │ └── matchers │ └── Matchers.java ├── net.dougqh.jak.jvm.core ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── src │ └── net │ │ └── dougqh │ │ └── jak │ │ └── jvm │ │ ├── Attributes.java │ │ ├── BaseJvmLocals.java │ │ ├── BaseJvmOperationProcessor.java │ │ ├── BaseJvmStack.java │ │ ├── Category.java │ │ ├── ConstantPoolConstants.java │ │ ├── JvmCodeSegment.java │ │ ├── JvmContext.java │ │ ├── JvmLocalsHelper.java │ │ ├── JvmLocalsTracker.java │ │ ├── JvmMethodStats.java │ │ ├── JvmOperationFilter.java │ │ ├── JvmOperationHydrator.java │ │ ├── JvmOperationProcessor.java │ │ ├── JvmOperationRewriter.java │ │ ├── JvmOperationRewritingFilter.java │ │ ├── JvmStackHelper.java │ │ ├── JvmStackTracker.java │ │ ├── JvmTypeStack.java │ │ ├── SimpleJvmLocalsTracker.java │ │ ├── SimpleJvmOperationProcessor.java │ │ ├── SimpleJvmStackTracker.java │ │ ├── TrackingJvmOperationProcessor.java │ │ ├── annotations │ │ ├── JvmOp.java │ │ ├── Symbol.java │ │ ├── SyntheticOp.java │ │ └── WrapOp.java │ │ ├── operations │ │ ├── ArrayLoadOperation.java │ │ ├── ArrayStoreOperation.java │ │ ├── BaseJvmOperation.java │ │ ├── BinaryOperation.java │ │ ├── BranchOperation.java │ │ ├── CastOperation.java │ │ ├── ComparisonOperation.java │ │ ├── ConstantOperation.java │ │ ├── FieldOperation.java │ │ ├── FixedConstantOperation.java │ │ ├── FixedLoadOperation.java │ │ ├── FixedStoreOperation.java │ │ ├── GetFieldOperation.java │ │ ├── IfComparisonOperation.java │ │ ├── IfOperation.java │ │ ├── IfZeroComparisonOperation.java │ │ ├── InvocationOperation.java │ │ ├── JumpPrototype.java │ │ ├── JvmOperation.java │ │ ├── JvmOperations.java │ │ ├── LoadOperation.java │ │ ├── NormalizeableOperation.java │ │ ├── ParameterizedConstantOperation.java │ │ ├── PutFieldOperation.java │ │ ├── ReturnOperation.java │ │ ├── StackManipulationOperation.java │ │ ├── StoreOperation.java │ │ ├── UnaryOperation.java │ │ ├── VariableLoadOperation.java │ │ ├── VariableStoreOperation.java │ │ ├── aaload.java │ │ ├── aastore.java │ │ ├── aconst_null.java │ │ ├── aload.java │ │ ├── aload_0.java │ │ ├── aload_1.java │ │ ├── aload_2.java │ │ ├── aload_3.java │ │ ├── anewarray.java │ │ ├── areturn.java │ │ ├── arraylength.java │ │ ├── astore.java │ │ ├── astore_0.java │ │ ├── astore_1.java │ │ ├── astore_2.java │ │ ├── astore_3.java │ │ ├── athrow.java │ │ ├── baload.java │ │ ├── bastore.java │ │ ├── bipush.java │ │ ├── caload.java │ │ ├── castore.java │ │ ├── checkcast.java │ │ ├── d2f.java │ │ ├── d2i.java │ │ ├── d2l.java │ │ ├── dadd.java │ │ ├── daload.java │ │ ├── dastore.java │ │ ├── dcmpg.java │ │ ├── dcmpl.java │ │ ├── dconst_0.java │ │ ├── dconst_1.java │ │ ├── ddiv.java │ │ ├── dload.java │ │ ├── dload_0.java │ │ ├── dload_1.java │ │ ├── dload_2.java │ │ ├── dload_3.java │ │ ├── dmul.java │ │ ├── dneg.java │ │ ├── drem.java │ │ ├── dreturn.java │ │ ├── dstore.java │ │ ├── dstore_0.java │ │ ├── dstore_1.java │ │ ├── dstore_2.java │ │ ├── dstore_3.java │ │ ├── dsub.java │ │ ├── dup.java │ │ ├── dup2.java │ │ ├── dup2_x1.java │ │ ├── dup2_x2.java │ │ ├── dup_x1.java │ │ ├── dup_x2.java │ │ ├── f2d.java │ │ ├── f2i.java │ │ ├── f2l.java │ │ ├── fadd.java │ │ ├── faload.java │ │ ├── fastore.java │ │ ├── fcmpg.java │ │ ├── fcmpl.java │ │ ├── fconst_0.java │ │ ├── fconst_1.java │ │ ├── fconst_2.java │ │ ├── fdiv.java │ │ ├── fload.java │ │ ├── fload_0.java │ │ ├── fload_1.java │ │ ├── fload_2.java │ │ ├── fload_3.java │ │ ├── fmul.java │ │ ├── fneg.java │ │ ├── frem.java │ │ ├── freturn.java │ │ ├── fstore.java │ │ ├── fstore_0.java │ │ ├── fstore_1.java │ │ ├── fstore_2.java │ │ ├── fstore_3.java │ │ ├── fsub.java │ │ ├── getfield.java │ │ ├── getstatic.java │ │ ├── goto_.java │ │ ├── i2b.java │ │ ├── i2c.java │ │ ├── i2d.java │ │ ├── i2f.java │ │ ├── i2l.java │ │ ├── i2s.java │ │ ├── iadd.java │ │ ├── iaload.java │ │ ├── iand.java │ │ ├── iastore.java │ │ ├── iconst_0.java │ │ ├── iconst_1.java │ │ ├── iconst_2.java │ │ ├── iconst_3.java │ │ ├── iconst_4.java │ │ ├── iconst_5.java │ │ ├── iconst_m1.java │ │ ├── idiv.java │ │ ├── if_acmpeq.java │ │ ├── if_acmpne.java │ │ ├── if_icmpeq.java │ │ ├── if_icmpge.java │ │ ├── if_icmpgt.java │ │ ├── if_icmple.java │ │ ├── if_icmplt.java │ │ ├── if_icmpne.java │ │ ├── ifeq.java │ │ ├── ifge.java │ │ ├── ifgt.java │ │ ├── ifle.java │ │ ├── iflt.java │ │ ├── ifne.java │ │ ├── ifnonnull.java │ │ ├── ifnull.java │ │ ├── iinc.java │ │ ├── iload.java │ │ ├── iload_0.java │ │ ├── iload_1.java │ │ ├── iload_2.java │ │ ├── iload_3.java │ │ ├── imul.java │ │ ├── ineg.java │ │ ├── instanceof_.java │ │ ├── invokeinterface.java │ │ ├── invokespecial.java │ │ ├── invokestatic.java │ │ ├── invokevirtual.java │ │ ├── ior.java │ │ ├── irem.java │ │ ├── ireturn.java │ │ ├── ishl.java │ │ ├── ishr.java │ │ ├── istore.java │ │ ├── istore_0.java │ │ ├── istore_1.java │ │ ├── istore_2.java │ │ ├── istore_3.java │ │ ├── isub.java │ │ ├── iushr.java │ │ ├── ixor.java │ │ ├── l2d.java │ │ ├── l2f.java │ │ ├── l2i.java │ │ ├── ladd.java │ │ ├── laload.java │ │ ├── land.java │ │ ├── lastore.java │ │ ├── lcmp.java │ │ ├── lconst_0.java │ │ ├── lconst_1.java │ │ ├── ldc.java │ │ ├── ldc2_w.java │ │ ├── ldc_w.java │ │ ├── ldiv.java │ │ ├── lload.java │ │ ├── lload_0.java │ │ ├── lload_1.java │ │ ├── lload_2.java │ │ ├── lload_3.java │ │ ├── lmul.java │ │ ├── lneg.java │ │ ├── lor.java │ │ ├── lrem.java │ │ ├── lreturn.java │ │ ├── lshl.java │ │ ├── lshr.java │ │ ├── lstore.java │ │ ├── lstore_0.java │ │ ├── lstore_1.java │ │ ├── lstore_2.java │ │ ├── lstore_3.java │ │ ├── lsub.java │ │ ├── lushr.java │ │ ├── lxor.java │ │ ├── monitorenter.java │ │ ├── monitorexit.java │ │ ├── multianewarray.java │ │ ├── new_.java │ │ ├── newarray.java │ │ ├── nop.java │ │ ├── pop.java │ │ ├── pop2.java │ │ ├── putfield.java │ │ ├── putstatic.java │ │ ├── return_.java │ │ ├── saload.java │ │ ├── sastore.java │ │ ├── sipush.java │ │ └── swap.java │ │ └── rewriters │ │ └── Normalizer.java └── test-src │ └── net │ └── dougqh │ └── jak │ └── jvm │ └── rewriters │ ├── NormalizationTest.java │ └── TestJvmOperationHydrator.java ├── net.dougqh.jak.jvm.disassembler ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── src │ └── net │ │ └── dougqh │ │ ├── io │ │ └── WrappedInputStream.java │ │ └── jak │ │ └── disassembler │ │ ├── Attribute.java │ │ ├── Attributes.java │ │ ├── ClassDirClassLocator.java │ │ ├── ClassFileFormatException.java │ │ ├── ClassLoaderClassLocator.java │ │ ├── ClassLocator.java │ │ ├── CodeAttribute.java │ │ ├── CompositeClassLocator.java │ │ ├── ConstantPool.java │ │ ├── DisassemblerException.java │ │ ├── Fields.java │ │ ├── Interfaces.java │ │ ├── JarClassLocator.java │ │ ├── JvmAnnotation.java │ │ ├── JvmClass.java │ │ ├── JvmEnum.java │ │ ├── JvmField.java │ │ ├── JvmFieldSet.java │ │ ├── JvmInputStream.java │ │ ├── JvmInterface.java │ │ ├── JvmMethod.java │ │ ├── JvmMethodSet.java │ │ ├── JvmReader.java │ │ ├── JvmType.java │ │ ├── JvmTypeInternals.java │ │ ├── JvmTypeSet.java │ │ └── Methods.java ├── test-src │ ├── net │ │ └── dougqh │ │ │ └── jak │ │ │ └── disassembler │ │ │ ├── JvmInputStreamTest.java │ │ │ ├── Tests.java │ │ │ └── api │ │ │ ├── BasicTest.java │ │ │ ├── ClassDirTest.java │ │ │ ├── JakDisassemblerApiTestSuite.java │ │ │ ├── JarTest.java │ │ │ └── NonTrivialClassTest.java │ └── testdata │ │ ├── NonTrivialClass.java │ │ ├── TrivialAnnotation.java │ │ ├── TrivialClass.java │ │ ├── TrivialEnum.java │ │ └── TrivialInterface.java ├── testdata │ ├── classdir │ │ ├── AnnotatedClass.class │ │ ├── Annotation$InnerAnnotation.class │ │ ├── Annotation$InnerClass.class │ │ ├── Annotation$InnerEnum.class │ │ ├── Annotation$InnerInterface.class │ │ ├── Annotation.class │ │ ├── Arrays.class │ │ ├── ComplexEnumeration$1.class │ │ ├── ComplexEnumeration$2.class │ │ ├── ComplexEnumeration$InnerAnnotation.class │ │ ├── ComplexEnumeration$InnerClass.class │ │ ├── ComplexEnumeration$InnerEnum.class │ │ ├── ComplexEnumeration$InnerInterface.class │ │ ├── ComplexEnumeration.class │ │ ├── ComplileTimeAnnotation.class │ │ ├── Constants$TestEnum.class │ │ ├── Constants.class │ │ ├── ExceptionHandling$Thrower.class │ │ ├── ExceptionHandling.class │ │ ├── Exceptions.class │ │ ├── Generics.class │ │ ├── HelloWorld.class │ │ ├── IStringsList.class │ │ ├── Increment.class │ │ ├── IntermediateEnumeration.class │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ ├── NewObject.class │ │ ├── Nums.class │ │ ├── Outer$Inner.class │ │ ├── Outer.class │ │ ├── Predicate.class │ │ ├── RunTimeAnnotation.class │ │ ├── Signum.class │ │ ├── StringList.class │ │ ├── Sum.class │ │ ├── Synchronization.class │ │ ├── Trivial.class │ │ ├── TrivialEnumeration.class │ │ ├── VarArgs.class │ │ └── foo │ │ │ ├── Foo.class │ │ │ └── bar │ │ │ └── Bar.class │ └── test.jar └── unused-src │ ├── JavaVisitor.java │ └── Tests.java ├── net.dougqh.jak.jvm.optimization ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── lib │ └── junit-4.8.2.jar ├── src │ └── net │ │ └── dougqh │ │ └── jak │ │ └── jvm │ │ └── optimizers │ │ ├── BinaryConstantFolding.java │ │ ├── Normalizer.java │ │ └── UnaryConstantFolding.java └── test-src │ └── net │ └── dougqh │ └── jak │ └── jvm │ └── optimizers │ ├── BinaryConstantFoldingTest.java │ ├── OptimizationSuite.java │ ├── TestJvmOperationHydrator.java │ └── UnaryConstantFoldingTest.java ├── net.dougqh.jak.repl ├── .classpath ├── .externalToolBuilders │ └── org.eclipse.pde.api.tools.apiAnalysisBuilder.launch ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── lib │ ├── jline-0.9.94.jar │ └── jline-src.zip ├── src │ └── net │ │ └── dougqh │ │ ├── jak │ │ └── repl │ │ │ ├── ArrayLiteralCommand.java │ │ │ ├── AutoRunCommand.java │ │ │ ├── AutoShowCommand.java │ │ │ ├── ClearCommand.java │ │ │ ├── ConfigCommand.java │ │ │ ├── EchoCommand.java │ │ │ ├── ExpressionCommand.java │ │ │ ├── FixedIdCommand.java │ │ │ ├── ImportCommand.java │ │ │ ├── ImportsCommand.java │ │ │ ├── JakRepl.java │ │ │ ├── ListCommand.java │ │ │ ├── MethodCommand.java │ │ │ ├── NumericLiteralCommand.java │ │ │ ├── OnOff.java │ │ │ ├── OperatorCommand.java │ │ │ ├── OptimizeCommand.java │ │ │ ├── ReplArgument.java │ │ │ ├── ReplCommand.java │ │ │ ├── ReplConfig.java │ │ │ ├── ReplConsole.java │ │ │ ├── ReplEnum.java │ │ │ ├── ReplFormatter.java │ │ │ ├── ReplImports.java │ │ │ ├── ReplJvmStack.java │ │ │ ├── ReplLocals.java │ │ │ ├── ReplMethod.java │ │ │ ├── ReplMonitor.java │ │ │ ├── ReplRecorder.java │ │ │ ├── ReplState.java │ │ │ ├── ReplStateCodeWriter.java │ │ │ ├── ResetCommand.java │ │ │ ├── RunCommand.java │ │ │ ├── ShowAliasCommand.java │ │ │ ├── ShowCommand.java │ │ │ ├── StatePart.java │ │ │ ├── StringLiteralCommand.java │ │ │ └── WriterDelegate.java │ │ └── reflection │ │ └── Delegate.java └── unused-src │ ├── Names.java │ ├── PrintingCoreCodeWriter.java │ └── ReplArgument.java ├── net.dougqh.java.meta ├── .classpath ├── .externalToolBuilders │ └── org.eclipse.pde.api.tools.apiAnalysisBuilder (1).launch ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── build.xml ├── build │ ├── classes │ │ ├── src │ │ │ └── net │ │ │ │ └── dougqh │ │ │ │ └── java │ │ │ │ └── meta │ │ │ │ └── types │ │ │ │ ├── ClassNameRefType.class │ │ │ │ ├── JavaGenericArrayType.class │ │ │ │ ├── JavaParameterizedType.class │ │ │ │ ├── JavaTypeBuilder.class │ │ │ │ ├── JavaTypeProvider.class │ │ │ │ ├── JavaTypeSignatureBuilder.class │ │ │ │ ├── JavaTypeVariable.class │ │ │ │ ├── JavaTypeVisitor.class │ │ │ │ ├── JavaTypes$1.class │ │ │ │ ├── JavaTypes$TypeVisitorImpl.class │ │ │ │ ├── JavaTypes.class │ │ │ │ ├── JavaWildcardExtendsType.class │ │ │ │ └── JavaWildcardSuperType.class │ │ └── test-src │ │ │ └── net │ │ │ └── dougqh │ │ │ └── java │ │ │ └── meta │ │ │ └── types │ │ │ └── api │ │ │ ├── JavaTypeBuildingTest$Signatures.class │ │ │ ├── JavaTypeBuildingTest.class │ │ │ ├── JavaTypeUtilsTest.class │ │ │ └── JavaTypesApiTestSuite.class │ ├── net.dougqh.java.meta.jar │ └── net.dougqh.java.meta.test.jar ├── lib │ └── junit-4.8.2.jar ├── src │ └── net │ │ └── dougqh │ │ └── java │ │ └── meta │ │ └── types │ │ ├── AptTypeVisitor.java │ │ ├── ClassNameRefType.java │ │ ├── JavaGenericArrayType.java │ │ ├── JavaParameterizedType.java │ │ ├── JavaTypeNames.java │ │ ├── JavaTypeProvider.java │ │ ├── JavaTypeVariable.java │ │ ├── JavaTypeVisitor.java │ │ ├── JavaTypes.java │ │ ├── JavaWildcardType.java │ │ ├── TypeAlias.java │ │ ├── primitives │ │ ├── boolean_.java │ │ ├── byte_.java │ │ ├── char_.java │ │ ├── double_.java │ │ ├── float_.java │ │ ├── int_.java │ │ ├── long_.java │ │ └── short_.java │ │ └── type.java └── test-src │ └── net │ └── dougqh │ └── java │ └── meta │ └── types │ └── api │ ├── JavaJvmTypesTest.java │ ├── JavaTypeBuildingTest.java │ ├── JavaTypeNamesTest.java │ ├── JavaTypePrimitivesTest.java │ ├── JavaTypeProviderTest.java │ ├── JavaTypesApiTestSuite.java │ ├── JavaTypesArrayTest.java │ └── JavaTypesTest.java └── net.dougqh.jist ├── .classpath ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.pde.core.prefs ├── META-INF └── MANIFEST.MF ├── build.properties └── src └── net └── dougqh └── jist └── Jist.java /.gitignore: -------------------------------------------------------------------------------- 1 | .metadata 2 | */bin/* 3 | *.class 4 | .DS_Store 5 | net.dougqh.jak.dalvik.core 6 | net.dougqh.jak.dalvik.assembler 7 | net.dougqh.jak.dalvik.disassembler -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | JAK is a fluent API for the generation of Java byte code. 2 | For those looking to learn more about byte code, JAK also includes a Repeat-Eval-Print-Loop (REPL) for experimenting with byte code. 3 | 4 | At this stage, JAK is nearly feature completely, but is still evolving and the API is subject to change. 5 | 6 | JAK is offered under a BSD license as detailed in the accompanying LICENSE file. -------------------------------------------------------------------------------- /javax.inject/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /javax.inject/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | javax.inject 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /javax.inject/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Jan 16 23:00:39 EST 2013 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /javax.inject/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Inject 4 | Bundle-SymbolicName: javax.inject 5 | Bundle-Version: 1.0.0 6 | Export-Package: javax.inject;version="1.0.0" 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | -------------------------------------------------------------------------------- /javax.inject/build.properties: -------------------------------------------------------------------------------- 1 | source.. = . 2 | output.. = . 3 | bin.includes = META-INF/,\ 4 | javax/ 5 | -------------------------------------------------------------------------------- /net.dougqh.functional/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.functional/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Mar 03 15:12:58 EST 2013 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.functional/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Mar 03 15:12:58 EST 2013 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.functional/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Aggregator 4 | Bundle-SymbolicName: net.dougqh.functional 5 | Bundle-Version: 1.0.0.0 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 7 | Export-Package: net.dougqh.aggregator, 8 | net.dougqh.collections, 9 | net.dougqh.functional 10 | Require-Bundle: org.junit4;bundle-version="4.8.1" 11 | -------------------------------------------------------------------------------- /net.dougqh.functional/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/Aggregator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | import java.util.Iterator; 4 | import java.util.concurrent.Executor; 5 | 6 | public final class Aggregator implements Iterable { 7 | private final InputProvider rootProvider; 8 | private final Processor processor; 9 | 10 | public Aggregator(final InputProvider rootProvider, final Processor processor) { 11 | this.rootProvider = rootProvider; 12 | this.processor = processor; 13 | } 14 | 15 | public final Iterator iterator() { 16 | return new InThreadAggregatingIterator(this.rootProvider, this.processor); 17 | } 18 | 19 | public final Iterator parallelIterator(final Executor executor, final int numWorkers) { 20 | return new ParallelAggregatingIterator(executor, numWorkers, this.rootProvider, this.processor); 21 | } 22 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/InputChannel.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | public interface InputChannel { 4 | public abstract I poll(); 5 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/InputProvider.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | 4 | public interface InputProvider { 5 | public abstract void run(final InputScheduler scheduler) throws Exception; 6 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/InputScheduler.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | public interface InputScheduler { 4 | public abstract int numThreads(); 5 | 6 | public abstract void schedule(final InputProvider provider) throws InterruptedException; 7 | 8 | public abstract void offer(final I result) throws InterruptedException; 9 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/OutputChannel.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | public interface OutputChannel { 4 | public abstract void offer(final O input); 5 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/Processor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | import net.dougqh.functional.Filter; 4 | import net.dougqh.functional.Transform; 5 | 6 | public abstract class Processor { 7 | public abstract void process( 8 | final InputChannel in, 9 | final OutputChannel out 10 | ) throws Exception; 11 | 12 | public Processor filter(final Filter filter) { 13 | return new FilteringProcessor(this, filter); 14 | } 15 | 16 | public Processor transform(final Transform transform) { 17 | return new TransformProcessor(this, transform); 18 | } 19 | 20 | public Processor chain(final Processor processor) { 21 | return new ChainedProcessor(this, processor); 22 | } 23 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/QueueBasedInputChannel.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | import java.util.Queue; 4 | 5 | final class QueueBasedInputChannel implements InputChannel { 6 | private final Queue queue; 7 | 8 | QueueBasedInputChannel(final Queue queue) { 9 | this.queue = queue; 10 | } 11 | 12 | @Override 13 | public final I poll() { 14 | return this.queue.poll(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/QueueBasedOutputChannel.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | import java.util.Queue; 4 | 5 | final class QueueBasedOutputChannel implements OutputChannel { 6 | private final Queue queue; 7 | 8 | QueueBasedOutputChannel(final Queue queue) { 9 | this.queue = queue; 10 | } 11 | 12 | public final void offer(final O input) { 13 | this.queue.offer(input); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/aggregator/SimpleInputProcessor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | public abstract class SimpleInputProcessor extends Processor { 4 | @Override 5 | public final void process( 6 | final InputChannel in, 7 | final OutputChannel out) 8 | throws Exception 9 | { 10 | for ( I input = in.poll(); input != null; input = in.poll() ) { 11 | this.process(input, out); 12 | } 13 | } 14 | 15 | public abstract void process( 16 | final I input, 17 | final OutputChannel out) 18 | throws Exception; 19 | } -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/collections/EmptyIterator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.collections; 2 | 3 | import java.util.Iterator; 4 | import java.util.NoSuchElementException; 5 | 6 | public final class EmptyIterator< E > implements Iterator< E > { 7 | public EmptyIterator() {} 8 | 9 | @Override 10 | public final boolean hasNext() { 11 | return false; 12 | } 13 | 14 | @Override 15 | public final E next() { 16 | throw new NoSuchElementException(); 17 | } 18 | 19 | @Override 20 | public final void remove() { 21 | throw new UnsupportedOperationException(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/collections/EnumerationIterator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.collections; 2 | 3 | import java.util.Enumeration; 4 | import java.util.Iterator; 5 | 6 | public final class EnumerationIterator< E > implements Iterator< E > { 7 | private final Enumeration< ? extends E > enumeration; 8 | 9 | public EnumerationIterator( final Enumeration< ? extends E > enumeration ) { 10 | this.enumeration = enumeration; 11 | } 12 | 13 | @Override 14 | public final boolean hasNext() { 15 | return this.enumeration.hasMoreElements(); 16 | } 17 | 18 | @Override 19 | public final E next() { 20 | return this.enumeration.nextElement(); 21 | } 22 | 23 | @Override 24 | public final void remove() { 25 | throw new UnsupportedOperationException(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/collections/TransformIterable.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.collections; 2 | 3 | import java.util.Arrays; 4 | import java.util.Iterator; 5 | 6 | public abstract class TransformIterable< I, O > implements Iterable< O > { 7 | private final Iterable< ? extends I > iterable; 8 | 9 | public TransformIterable( final I... inputs ) { 10 | this.iterable = Arrays.asList( inputs ); 11 | } 12 | 13 | public TransformIterable( final Iterable< ? extends I > iterable ) { 14 | this.iterable = iterable; 15 | } 16 | 17 | @Override 18 | public final Iterator< O > iterator() { 19 | return new TransformIterator< I, O >( this.iterable.iterator() ) { 20 | @Override 21 | protected final O transform( final I input ) { 22 | return TransformIterable.this.transform( input ); 23 | } 24 | }; 25 | } 26 | 27 | protected abstract O transform( final I input ); 28 | } 29 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/functional/CompositeTransform.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.functional; 2 | 3 | final class CompositeTransform extends Transform { 4 | private final Transform firstTransform; 5 | private final Transform secondTransform; 6 | 7 | public CompositeTransform( 8 | final Transform firstTransform, 9 | final Transform secondTransform) 10 | { 11 | this.firstTransform = firstTransform; 12 | this.secondTransform = secondTransform; 13 | } 14 | 15 | public final O transform(final I input) throws Exception { 16 | return this.secondTransform.transform(this.firstTransform.transform(input)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/functional/Filter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.functional; 2 | 3 | public abstract class Filter { 4 | public abstract boolean matches(final I value); 5 | 6 | public Filter and(final Filter filter) { 7 | return new AndFilter(this, filter); 8 | } 9 | 10 | public Filter or(final Filter filter) { 11 | return new OrFilter(this, filter); 12 | } 13 | 14 | public Filter not() { 15 | return new NotFilter(this); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/functional/NotFilter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.functional; 2 | 3 | final class NotFilter extends Filter { 4 | private final Filter filter; 5 | 6 | public NotFilter(final Filter filter) { 7 | this.filter = filter; 8 | } 9 | 10 | public boolean matches(I value) { 11 | return ! this.filter.matches(value); 12 | } 13 | 14 | @Override 15 | public final Filter not() { 16 | @SuppressWarnings("unchecked") 17 | Filter filter = (Filter)this.filter; 18 | return filter; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /net.dougqh.functional/src/net/dougqh/functional/Transform.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.functional; 2 | 3 | public abstract class Transform { 4 | public abstract O transform(final I input) throws Exception; 5 | 6 | public final Transform chain(final Transform transform) { 7 | return new CompositeTransform(this, transform); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.functional/test-src/net/dougqh/aggregator/AggregatorSuite.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | import org.junit.runners.Suite.SuiteClasses; 6 | 7 | @RunWith(Suite.class) 8 | @SuiteClasses({ 9 | FilteringTest.class, 10 | TransformTest.class, 11 | ChainedTest.class 12 | }) 13 | public final class AggregatorSuite {} 14 | -------------------------------------------------------------------------------- /net.dougqh.functional/test-src/net/dougqh/aggregator/PassthroughProcessor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | public final class PassthroughProcessor extends Processor { 4 | @Override 5 | public final void process( 6 | final InputChannel in, 7 | final OutputChannel out) 8 | throws Exception 9 | { 10 | for ( T input = in.poll(); input != null; input = in.poll() ) { 11 | out.offer(input); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /net.dougqh.functional/test-src/net/dougqh/aggregator/TestChannel.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.aggregator; 2 | 3 | import java.util.Arrays; 4 | import java.util.Iterator; 5 | import java.util.LinkedList; 6 | import java.util.List; 7 | 8 | final class TestChannel implements InputChannel, OutputChannel, Iterable { 9 | private final LinkedList list = new LinkedList(); 10 | 11 | public TestChannel(final T... values) { 12 | this.list.addAll(Arrays.asList(values)); 13 | } 14 | 15 | @Override 16 | public final void offer(final T offer) { 17 | this.list.addLast(offer); 18 | } 19 | 20 | @Override 21 | public final T poll() { 22 | if ( this.list.isEmpty() ) { 23 | return null; 24 | } else { 25 | return this.list.removeFirst(); 26 | } 27 | } 28 | 29 | public final List list() { 30 | return this.list; 31 | } 32 | 33 | @Override 34 | public final Iterator iterator() { 35 | return this.list.iterator(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.assembler.core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jdt.core.javanature 26 | org.eclipse.pde.PluginNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:03:50 EST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:03:51 EST 2011 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JAK Assembler Core 4 | Bundle-SymbolicName: net.dougqh.jak.core.assembler 5 | Bundle-Version: 1.0.0.0 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Require-Bundle: net.dougqh.java.meta;bundle-version="1.0.0", 9 | net.dougqh.jak.core;bundle-version="1.0.0", 10 | org.junit4;bundle-version="4.8.1" 11 | Export-Package: net.dougqh.jak.assembler 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakAnnotationWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | public interface JakAnnotationWriter extends JakTypeWriter {} 4 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakClassWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | public interface JakClassWriter extends JakExtendedTypeWriter { 4 | } 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakCodeWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public interface JakCodeWriter { 6 | public abstract JakCodeWriter startScope(); 7 | 8 | public abstract JakCodeWriter declare( final Type type, final String var ); 9 | 10 | public abstract JakCodeWriter alias( final String var, final String existingVar ); 11 | 12 | public abstract JakCodeWriter endScope(); 13 | 14 | public abstract JakCodeWriter startLabelScope(); 15 | 16 | public abstract JakCodeWriter label( final String label ); 17 | 18 | public abstract JakCodeWriter endLabelScope(); 19 | 20 | public abstract JakCodeWriter if_( final JakCondition condition, final String label ); 21 | 22 | public abstract JakCodeWriter macro( final JakMacro macro ); 23 | 24 | public abstract JakCodeWriter scope( final JakMacro macro ); 25 | } 26 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakEnumWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | public interface JakEnumWriter extends JakExtendedTypeWriter {} 4 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakInterfaceWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | public interface JakInterfaceWriter extends JakExtendedTypeWriter { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakMacro.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | public interface JakMacro {} 4 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakTypeWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.JavaAnnotationDescriptor; 6 | import net.dougqh.jak.JavaClassDescriptor; 7 | import net.dougqh.jak.JavaInterfaceDescriptor; 8 | 9 | public interface JakTypeWriter { 10 | public abstract JakClassWriter define( final JavaClassDescriptor classBuilder ); 11 | 12 | public abstract JakInterfaceWriter define( final JavaInterfaceDescriptor interfaceBuilder ); 13 | 14 | public abstract JakAnnotationWriter define( final JavaAnnotationDescriptor annotationBuilder ); 15 | 16 | public abstract Type thisType(); 17 | 18 | public abstract Type superType(); 19 | } 20 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/JakWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | import net.dougqh.jak.JavaAnnotationDescriptor; 4 | import net.dougqh.jak.JavaClassDescriptor; 5 | import net.dougqh.jak.JavaEnumDescriptor; 6 | import net.dougqh.jak.JavaInterfaceDescriptor; 7 | 8 | public interface JakWriter { 9 | public abstract JakClassWriter define( final JavaClassDescriptor descriptor ); 10 | 11 | public abstract JakInterfaceWriter define( final JavaInterfaceDescriptor descriptor ); 12 | 13 | public abstract JakEnumWriter define( final JavaEnumDescriptor descriptor ); 14 | 15 | public abstract JakAnnotationWriter define( final JavaAnnotationDescriptor descriptor ); 16 | } 17 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/SuperType.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | final class SuperType implements Type { 6 | protected static SuperType INSTANCE = new SuperType(); 7 | 8 | private SuperType() {} 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/ThisType.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.assembler; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | final class ThisType implements Type { 6 | protected static ThisType INSTANCE = new ThisType(); 7 | 8 | private ThisType() {} 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.core.disassembler 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:18:02 EST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:18:02 EST 2011 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JAK Disassembler Core 4 | Bundle-SymbolicName: net.dougqh.jak.core.disassembler 5 | Bundle-Version: 1.0.0.0 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Export-Package: net.dougqh.jak.disassembler 9 | Require-Bundle: net.dougqh.jak.core;bundle-version="1.0.0", 10 | net.dougqh.functional;bundle-version="1.0.0" 11 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JakReader.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | public interface JakReader { 4 | public abstract Iterable< JavaType > list(); 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaAnnotation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | //TODO: Should extends JavaInterface 4 | public interface JavaAnnotation extends JavaType {} 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaClass.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | 4 | public interface JavaClass { 5 | //public abstract List< JavaField > getFields(); 6 | 7 | public abstract JavaMethod getClassInitializer(); 8 | 9 | public abstract JavaMethodSet getConstructors(); 10 | 11 | public abstract JavaMethodSet getMethods(); 12 | } 13 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaCodeReader.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.IOException; 4 | 5 | import net.dougqh.jak.JavaOperation; 6 | 7 | public interface JavaCodeReader { 8 | public abstract boolean hasNext() throws IOException; 9 | 10 | public abstract JavaOperation next() throws IOException; 11 | } -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaEnum.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | //TODO: Should extends JavaType 4 | public interface JavaEnum extends JavaType {} 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaFieldSet.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import net.dougqh.functional.Filter; 4 | import net.dougqh.jak.JavaField; 5 | 6 | public interface JavaFieldSet extends Iterable{ 7 | public abstract boolean isEmpty(); 8 | 9 | public abstract int size(); 10 | 11 | public abstract T get(final int index); 12 | 13 | public abstract JavaFieldSet filter(final Filter predicate); 14 | } 15 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaInterface.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.util.List; 4 | 5 | public interface JavaInterface extends JavaType { 6 | public abstract List getMethods(); 7 | } 8 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaMethod.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.lang.reflect.Type; 4 | import java.util.List; 5 | 6 | import net.dougqh.jak.JavaElement; 7 | 8 | 9 | public interface JavaMethod extends JavaElement { 10 | public abstract String getName(); 11 | 12 | public abstract boolean isConstructor(); 13 | 14 | public abstract boolean isClassInitializer(); 15 | 16 | public abstract Type getReturnType(); 17 | 18 | public abstract List getParameterTypes(); 19 | 20 | //public abstract JavaCodeReader getCodeReader(); 21 | 22 | public abstract int getFlags(); 23 | 24 | public abstract boolean isPublic(); 25 | 26 | public abstract boolean isDefault(); 27 | 28 | public abstract boolean isProtected(); 29 | 30 | public abstract boolean isPrivate(); 31 | } 32 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaSource.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | public interface JavaSource { 4 | public abstract String getType(); 5 | 6 | public abstract String getName(); 7 | } 8 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaType.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.lang.reflect.Type; 4 | import java.util.List; 5 | 6 | import net.dougqh.jak.JavaElement; 7 | 8 | public interface JavaType extends JavaElement { 9 | public abstract String getName(); 10 | 11 | public abstract Type getParentType(); 12 | 13 | public abstract List< Type > getInterfaces(); 14 | 15 | public abstract int getFlags(); 16 | 17 | public abstract boolean isPublic(); 18 | 19 | public abstract boolean isDefault(); 20 | 21 | public abstract boolean isProtected(); 22 | 23 | public abstract boolean isPrivate(); 24 | } 25 | -------------------------------------------------------------------------------- /net.dougqh.jak.core.disassembler/src/net/dougqh/jak/disassembler/JavaTypeSet.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import net.dougqh.functional.Filter; 4 | 5 | public abstract class JavaTypeSet implements Iterable { 6 | public abstract T get(final String name); 7 | 8 | public abstract JavaClass getClass(final String name); 9 | 10 | public abstract JavaInterface getInterface(final String name); 11 | 12 | public abstract JavaEnum getEnum(final String name); 13 | 14 | public abstract JavaAnnotation getAnnotation(final String name); 15 | 16 | public abstract JavaTypeSet filter(final Filter filter); 17 | } 18 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Nov 14 22:48:05 EST 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Nov 14 22:48:05 EST 2010 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JAK Core 4 | Bundle-SymbolicName: net.dougqh.jak.core 5 | Bundle-Version: 1.0.0.1 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Export-Package: net.dougqh.jak, 9 | net.dougqh.jak.inject, 10 | net.dougqh.jak.types 11 | Require-Bundle: net.dougqh.java.meta;bundle-version="1.0.0", 12 | javax.inject;bundle-version="1.0.0", 13 | net.dougqh.functional;bundle-version="1.0.0" 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JakContext.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public interface JakContext { 6 | public abstract Type thisType(); 7 | 8 | public abstract Type localType(final String name, final Type expectedType); 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaAnnotationDescriptor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | import java.lang.annotation.Annotation; 4 | import java.lang.reflect.Type; 5 | import java.lang.reflect.TypeVariable; 6 | 7 | public final class JavaAnnotationDescriptor { 8 | private final int flags; 9 | private final String name; 10 | 11 | JavaAnnotationDescriptor( 12 | final JavaModifiers flagsBuilder, 13 | final String name ) 14 | { 15 | this.flags = flagsBuilder.flags(); 16 | this.name = name; 17 | } 18 | 19 | public final TypeDescriptor typeDescriptor() { 20 | return new TypeDescriptor( 21 | this.flags, 22 | this.name, 23 | new TypeVariable[] {}, 24 | Object.class, 25 | new Type[] { Annotation.class } ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaElement.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | public interface JavaElement { 4 | public abstract String getName(); 5 | 6 | public abstract int getFlags(); 7 | } 8 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaFieldImpl.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | final class JavaFieldImpl extends JavaField { 6 | private final int flags; 7 | private final Type type; 8 | private final String name; 9 | 10 | JavaFieldImpl( 11 | final JavaModifiers flagsBuilder, 12 | final Type type, 13 | final CharSequence name ) 14 | { 15 | this.flags = flagsBuilder.flags(); 16 | this.type = type; 17 | this.name = name.toString(); 18 | } 19 | 20 | public final int getFlags() { 21 | return this.flags; 22 | } 23 | 24 | public final String getName() { 25 | return this.name; 26 | } 27 | 28 | public final Type getType() { 29 | return this.type; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaMethodSignature.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public final class JavaMethodSignature { 6 | private final String methodName; 7 | private FormalArguments args = FormalArguments.EMPTY; 8 | 9 | JavaMethodSignature( final String methodName ) { 10 | this.methodName = methodName; 11 | } 12 | 13 | public final JavaMethodSignature args( final Type... types ) { 14 | this.args = FormalArguments.instance( types ); 15 | return this; 16 | } 17 | 18 | public final String name() { 19 | return this.methodName; 20 | } 21 | 22 | public final FormalArguments arguments() { 23 | return this.args; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaMethodStats.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | public interface JavaMethodStats {} 4 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | public interface JavaOperation { 4 | public abstract String getId(); 5 | 6 | public abstract int getCode(); 7 | 8 | public abstract String getOperator(); 9 | 10 | public abstract boolean isPolymorphic(); 11 | } 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaPackageDescriptor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | public final class JavaPackageDescriptor { 4 | private final String name; 5 | 6 | JavaPackageDescriptor( final String name ) { 7 | this.name = name; 8 | } 9 | 10 | public final String name() { 11 | return this.name; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaVariable.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public final class JavaVariable { 6 | private final Type type; 7 | private final String name; 8 | 9 | JavaVariable( 10 | final Type type, 11 | final String name ) 12 | { 13 | this.type = type; 14 | this.name = name; 15 | } 16 | 17 | public final String getName() { 18 | return this.name; 19 | } 20 | 21 | public final Type getType() { 22 | return this.type; 23 | } 24 | 25 | @Override 26 | public final String toString() { 27 | return this.name + ":" + this.type; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/JavaVersion.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | public enum JavaVersion { 4 | V1_1( 45, 3 ), 5 | V1_2( 46, 0 ), 6 | V1_3( 47, 0 ), 7 | V1_4( 48, 0 ), 8 | V1_5( 49, 0 ), 9 | V1_6( 50, 0 ); 10 | 11 | private final int major; 12 | private final int minor; 13 | 14 | JavaVersion( 15 | final int major, 16 | final int minor ) 17 | { 18 | this.major = (byte)major; 19 | this.minor = (byte)minor; 20 | } 21 | 22 | public static final JavaVersion getDefault() { 23 | return V1_6; 24 | } 25 | 26 | public final int getMajor() { 27 | return this.major; 28 | } 29 | 30 | public final int getMinor() { 31 | return this.minor; 32 | } 33 | 34 | public final boolean getSuperFlag() { 35 | return false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/Methods.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak; 2 | 3 | public final class Methods { 4 | public static final String INIT = ""; 5 | public static final String CLINIT = ""; 6 | 7 | private Methods() {} 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/inject/InjectionRecipient.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.inject; 2 | 3 | public interface InjectionRecipient { 4 | public abstract boolean shouldInject(); 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/inject/Injector.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.inject; 2 | 3 | public interface Injector { 4 | public void inject(final Object object); 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Any.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class Any { 4 | private Any() {} 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/ArgList.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class ArgList { 4 | private ArgList() {} 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Category1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class Category1 { 4 | private Category1() {} 5 | } -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Category2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class Category2 { 4 | private Category2() {} 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Primitive.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class Primitive { 4 | private Primitive() {} 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Reference.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class Reference { 4 | private Reference() {} 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Union.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public final class Union implements Type { 6 | private final Type[] types; 7 | 8 | public Union( final Type... types ) { 9 | this.types = types.clone(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.core/src/net/dougqh/jak/types/Utf8.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.types; 2 | 3 | public final class Utf8 { 4 | private Utf8() {} 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sat Jan 12 16:06:27 EST 2013 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Sat Jan 12 16:06:27 EST 2013 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Experimentation 4 | Bundle-SymbolicName: net.dougqh.jak.demos 5 | Bundle-Version: 1.0.0.0 6 | Import-Package: org.osgi.framework;version="1.3.0" 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Require-Bundle: net.dougqh.jak.jvm.core;bundle-version="1.0.0", 9 | net.dougqh.jak.core.disassembler;bundle-version="1.0.0", 10 | net.dougqh.jak.jvm.disassembler;bundle-version="1.0.0", 11 | net.dougqh.jak.core;bundle-version="1.0.0", 12 | javax.inject;bundle-version="1.0.0" 13 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/src/basicblocks/FlowControl.java: -------------------------------------------------------------------------------- 1 | package basicblocks; 2 | 3 | public class FlowControl { 4 | private FlowControl() {} 5 | 6 | public static final int signum( final int x ) { 7 | if ( x < 0 ) { 8 | return -1; 9 | } else if ( x == 0 ) { 10 | return 0; 11 | } else { 12 | return 1; 13 | } 14 | } 15 | 16 | public static final int sum( final int min, final int max ) { 17 | int sum = 0; 18 | for ( int x = min; x < max; ++x ) { 19 | sum +=x; 20 | } 21 | return sum; 22 | } 23 | 24 | public static final int gauss() { 25 | int sum = 0; 26 | for ( int i = 0; i < 100; ++i ) { 27 | sum += i; 28 | } 29 | return sum; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/src/basicblocks/JvmOperationMatcher.java: -------------------------------------------------------------------------------- 1 | package basicblocks; 2 | 3 | import net.dougqh.jak.jvm.operations.JvmOperation; 4 | 5 | public abstract class JvmOperationMatcher { 6 | private final Class opClass; 7 | 8 | public JvmOperationMatcher(final Class opClass) { 9 | this.opClass = opClass; 10 | } 11 | 12 | public final boolean matches(final Class opClass) { 13 | return this.opClass.isAssignableFrom(opClass); 14 | } 15 | 16 | public final boolean matches(final JvmOperation op) { 17 | if ( ! this.matches(op.getClass()) ) { 18 | return false; 19 | } 20 | 21 | @SuppressWarnings("unchecked") 22 | T castedOp = (T)op; 23 | return this.matchesCasted(castedOp); 24 | } 25 | 26 | public boolean matchesCasted(final T op) { 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /net.dougqh.jak.demos/test-src/BasicBlockAnalysis.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.io.IOException; 4 | 5 | import net.dougqh.jak.disassembler.JvmClass; 6 | import net.dougqh.jak.disassembler.JvmMethod; 7 | import basicblocks.BasicBlock; 8 | import basicblocks.BasicBlocks; 9 | import basicblocks.FlowControl; 10 | 11 | public class BasicBlockAnalysis { 12 | public static void main(String[] args) throws IOException { 13 | JvmClass jvmClass = JvmClass.read(FlowControl.class); 14 | printBlocksFor(jvmClass, "signum"); 15 | System.out.println(); 16 | printBlocksFor(jvmClass, "sum"); 17 | } 18 | 19 | private static final void printBlocksFor(final JvmClass jvmClass, final String methodName) { 20 | System.out.println(methodName); 21 | 22 | JvmMethod method = jvmClass.getMethod(methodName); 23 | for ( BasicBlock basicBlock: method.get(BasicBlocks.class) ) { 24 | System.out.println(basicBlock); 25 | System.out.println(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.jvm.assembler 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:21:44 EST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:21:44 EST 2011 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JAK JVM Assembler 4 | Bundle-SymbolicName: net.dougqh.jak.jvm.assembler 5 | Bundle-Version: 1.0.0.0 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Require-Bundle: net.dougqh.java.meta;bundle-version="1.0.0", 9 | net.dougqh.jak.core.assembler;bundle-version="1.0.0", 10 | net.dougqh.jak.core;bundle-version="1.0.0", 11 | net.dougqh.jak.jvm.core;bundle-version="1.0.0", 12 | net.dougqh.functional;bundle-version="1.0.0" 13 | Export-Package: net.dougqh.jak.jvm.assembler 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/lib/junit-4.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.assembler/lib/junit-4.8.2.jar -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/scratch-src/DecoderSwitch.java: -------------------------------------------------------------------------------- 1 | import java.lang.reflect.Field; 2 | import java.lang.reflect.Modifier; 3 | 4 | import net.dougqh.jak.jvm.operations.JvmOperation; 5 | 6 | 7 | public class DecoderSwitch { 8 | public static final void main(final String... args) { 9 | SourceWriter sourceWriter = new SourceWriter(); 10 | 11 | for ( Field field: JvmOperation.class.getFields() ) { 12 | if ( ! isOpConstant( field ) ) { 13 | continue; 14 | } 15 | 16 | sourceWriter.writeln( "case %s:", field.getName() ); 17 | sourceWriter.writeln( "processor.%s();", field.getName().toLowerCase() ); 18 | sourceWriter.writeln( "break;" ); 19 | sourceWriter.writeln(); 20 | } 21 | } 22 | 23 | private static final boolean isOpConstant( final Field field ) { 24 | return Modifier.isStatic( field.getModifiers() ) && 25 | field.getType().equals( byte.class ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/scratch-src/Enum.java: -------------------------------------------------------------------------------- 1 | import java.io.File; 2 | import java.io.IOException; 3 | 4 | import net.dougqh.jak.jvm.assembler.JvmEnumWriter; 5 | import net.dougqh.jak.jvm.assembler.JvmWriter; 6 | import static net.dougqh.jak.Jak.*; 7 | 8 | 9 | public final class Enum { 10 | public static final void main( final String... args ) throws IOException { 11 | JvmEnumWriter enumWriter = new JvmWriter().define( public_().final_().enum_( "MyEnum" ) ); 12 | 13 | enumWriter.define( "FOO" ); 14 | enumWriter.define( "BAR" ); 15 | enumWriter.define( "BAZ" ); 16 | 17 | enumWriter.writeTo( new File( "test" ) ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/scratch-src/Generic.java: -------------------------------------------------------------------------------- 1 | 2 | public class Generic< T > { 3 | public < U > Generic( final U value ) {} 4 | 5 | public final < U > U get( final Class< U > type ) { 6 | return null; 7 | } 8 | 9 | public final T get() { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/scratch-src/LogicalOps.java: -------------------------------------------------------------------------------- 1 | 2 | public class LogicalOps { 3 | public static final boolean and( boolean lhs, boolean rhs ) { 4 | return lhs && rhs; 5 | } 6 | 7 | public static final boolean or( boolean lhs, boolean rhs ) { 8 | return lhs || rhs; 9 | } 10 | 11 | public static final boolean xor( boolean lhs, boolean rhs ) { 12 | return lhs ^ rhs; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/scratch-src/MyEnum.java: -------------------------------------------------------------------------------- 1 | 2 | public enum MyEnum { 3 | FOO, 4 | BAR, 5 | QUUX 6 | } 7 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/scratch-src/Section.java: -------------------------------------------------------------------------------- 1 | 2 | public abstract class Section { 3 | private SourceWriter writer = null; 4 | 5 | final void write( final SourceWriter writer ) { 6 | this.writer = writer; 7 | try { 8 | this.write(); 9 | } finally { 10 | this.writer = null; 11 | } 12 | } 13 | 14 | public abstract void write(); 15 | 16 | protected final void writeln() { 17 | this.writer.writeln(); 18 | } 19 | 20 | protected final void writeln(final String format, final Object... args) { 21 | this.writer.writeln(format, args); 22 | } 23 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.assembler/src/.DS_Store -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.assembler/src/net/.DS_Store -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.assembler/src/net/dougqh/.DS_Store -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/.DS_Store -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/Attribute.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | abstract class Attribute { 4 | protected final WritingContext context; 5 | protected final ConstantPool constantPool; 6 | protected final String name; 7 | 8 | Attribute( 9 | final WritingContext context, 10 | final String name ) 11 | { 12 | this.context = context; 13 | this.constantPool = this.context.constantPool; 14 | this.name = name; 15 | } 16 | 17 | abstract int length(); 18 | 19 | abstract boolean isEmpty(); 20 | 21 | final void writeHeader( final JvmOutputStream out ) { 22 | ConstantEntry nameEntry = this.constantPool.addUtf8( this.name ); 23 | out.u2( nameEntry ).u4( this.length() ); 24 | } 25 | 26 | void prepare() { 27 | } 28 | 29 | abstract void writeBody( final JvmOutputStream out ); 30 | 31 | static interface DeferredAttribute {} 32 | } 33 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/Byte2Slot.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | 4 | abstract class Byte2Slot { 5 | abstract int offset(); 6 | 7 | abstract void u2( final int value ); 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/FixedLengthAttribute.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | abstract class FixedLengthAttribute extends Attribute { 4 | private final int length; 5 | 6 | FixedLengthAttribute( 7 | final WritingContext context, 8 | final String name, 9 | final int length ) 10 | { 11 | super( context, name ); 12 | this.length = length; 13 | } 14 | 15 | @Override 16 | final int length() { 17 | return this.length; 18 | } 19 | 20 | @Override 21 | boolean isEmpty() { 22 | return false; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/Interfaces.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | 4 | final class Interfaces { 5 | private final JvmOutputStream out = new JvmOutputStream( 16 ); 6 | private int count = 0; 7 | 8 | private final WritingContext context; 9 | 10 | Interfaces( final WritingContext context ) { 11 | this.context = context; 12 | } 13 | 14 | final Interfaces add( final Class< ? > anInterface ) { 15 | ++this.count; 16 | this.out.u2( this.context.constantPool.addClassInfo( anInterface ) ); 17 | return this; 18 | } 19 | 20 | final void write( final JvmOutputStream out ) { 21 | out.u2( this.count ); 22 | this.out.writeTo( out ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/JakMonitor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | import net.dougqh.jak.jvm.JvmLocalsTracker; 4 | import net.dougqh.jak.jvm.JvmStackTracker; 5 | 6 | public abstract class JakMonitor { 7 | static final JakMonitor NULL = new JakMonitor() {}; 8 | 9 | public JvmCoreCodeWriter monitor( final JvmCoreCodeWriter wrappedWriter ) { 10 | return wrappedWriter; 11 | } 12 | 13 | public JvmLocalsTracker monitor( final JvmLocalsTracker locals ) { 14 | return locals; 15 | } 16 | 17 | public JvmStackTracker monitor( final JvmStackTracker stack ) { 18 | return stack; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/JvmCoreCodeWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | import net.dougqh.jak.jvm.JvmLocalsTracker; 4 | import net.dougqh.jak.jvm.JvmOperationProcessor; 5 | import net.dougqh.jak.jvm.JvmStackTracker; 6 | 7 | 8 | public interface JvmCoreCodeWriter extends JvmOperationProcessor { 9 | public interface DeferredWrite { 10 | public abstract void write( 11 | final JvmCoreCodeWriter coreWriter, 12 | final boolean terminal ); 13 | } 14 | 15 | //Deferred write methods 16 | public abstract void defer( final DeferredWrite deferredWrite ); 17 | 18 | public abstract void prepare(); 19 | 20 | public abstract WritingContext context(); 21 | 22 | public abstract void finish(); 23 | 24 | public abstract JvmStackTracker stackMonitor(); 25 | 26 | public abstract JvmLocalsTracker localsMonitor(); 27 | 28 | public abstract int pos(); 29 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/JvmExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | import net.dougqh.jak.JakContext; 4 | 5 | public abstract class JvmExpressionVisitor extends JvmExpression.Visitor { 6 | public JvmExpressionVisitor( final JakContext context ) { 7 | super( context ); 8 | } 9 | 10 | @Override 11 | protected void const_( final boolean value ) { 12 | this.const_( value ? 1 : 0 ); 13 | } 14 | 15 | @Override 16 | protected void const_( final byte value ) { 17 | this.const_( (int)value ); 18 | } 19 | 20 | @Override 21 | protected void const_( final char value ) { 22 | this.const_( (int)value ); 23 | } 24 | 25 | @Override 26 | protected void const_( final short value ) { 27 | this.const_( (int)value ); 28 | } 29 | 30 | @Override 31 | protected abstract void const_( final int value ); 32 | } 33 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/JvmExtendedTypeWriter.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | import net.dougqh.jak.assembler.JakExtendedTypeWriter; 4 | 5 | public interface JvmExtendedTypeWriter extends JvmTypeWriter, JakExtendedTypeWriter {} 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/macros/While.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler.macros; 2 | 3 | import net.dougqh.jak.assembler.JakCondition; 4 | import net.dougqh.jak.jvm.assembler.JvmMacro; 5 | 6 | public final class While extends JvmMacro { 7 | private final JakCondition condition; 8 | private final stmt body; 9 | 10 | public While( final JakCondition condition, final stmt body ) { 11 | this.condition = condition; 12 | this.body = body; 13 | } 14 | 15 | @Override 16 | protected final void write() { 17 | startLabelScope(); 18 | try { 19 | startScope(); 20 | try { 21 | goto_( "test" ); 22 | 23 | label( "body" ); 24 | startScope(); 25 | macro( this.body ); 26 | endScope(); 27 | 28 | label( "test" ); 29 | if_( condition, "body" ); 30 | } finally { 31 | endScope(); 32 | } 33 | } finally { 34 | endLabelScope(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/macros/expr.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler.macros; 2 | 3 | import net.dougqh.jak.jvm.assembler.JvmExpression; 4 | 5 | public abstract class expr< T > extends JvmExpression< T > {} 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/src/net/dougqh/jak/jvm/assembler/macros/stmt.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler.macros; 2 | 3 | import net.dougqh.jak.jvm.assembler.JvmMacro; 4 | 5 | public abstract class stmt extends JvmMacro { 6 | @Override 7 | protected void write() { 8 | this.body(); 9 | } 10 | 11 | protected abstract void body(); 12 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/test-src/net/dougqh/jak/jvm/assembler/FlagsTest.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | import static net.dougqh.jak.matchers.Matchers.*; 4 | import static org.junit.Assert.*; 5 | import static net.dougqh.jak.Jak.*; 6 | 7 | import org.junit.Test; 8 | 9 | public final class FlagsTest { 10 | public final @Test void flags() { 11 | assertThat( 12 | final_().private_(), 13 | is( private_().final_() ) ); 14 | 15 | assertThat( 16 | abstract_().protected_(), 17 | is( protected_().abstract_() ) ); 18 | 19 | assertThat( 20 | native_().public_(), 21 | is( public_().native_() ) ); 22 | 23 | assertThat( 24 | transient_().volatile_(), 25 | is( volatile_().transient_() ) ); 26 | 27 | assertThat( 28 | varargs().strictfp_(), 29 | is( strictfp_().varargs() ) ); 30 | 31 | assertThat( 32 | synchronized_().final_(), 33 | is( final_().synchronized_() ) ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/test-src/net/dougqh/jak/jvm/assembler/JakAssemblerTestSuite.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler; 2 | 3 | import net.dougqh.jak.jvm.assembler.api.JakAssemblerApiTestSuite; 4 | import net.dougqh.jak.jvm.assembler.macros.api.MacrosTestSuite; 5 | 6 | import org.junit.runner.RunWith; 7 | import org.junit.runners.Suite; 8 | import org.junit.runners.Suite.SuiteClasses; 9 | 10 | @RunWith( Suite.class ) 11 | @SuiteClasses({ 12 | FlagsTest.class, 13 | JvmOutputStreamTest.class, 14 | OperationTest.class, 15 | LocalsTest.class, 16 | ScopeTest.class, 17 | JakAssemblerApiTestSuite.class, 18 | MacrosTestSuite.class }) 19 | public final class JakAssemblerTestSuite {} 20 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.assembler/test-src/net/dougqh/jak/jvm/assembler/macros/api/MacrosTestSuite.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.assembler.macros.api; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | import org.junit.runners.Suite.SuiteClasses; 6 | 7 | @RunWith(Suite.class) 8 | @SuiteClasses({ 9 | IterableForTest.class, 10 | ArrayForTest.class, 11 | IfTest.class, 12 | ExpressionsTest.class, 13 | TryTest.class, 14 | SynchronizedTest.class, 15 | WhileTest.class, 16 | DoWhileTest.class, 17 | Nesting.class 18 | }) 19 | public final class MacrosTestSuite {} 20 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.jvm.core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:26:54 EST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:26:54 EST 2011 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JAK JVM Core 4 | Bundle-SymbolicName: net.dougqh.jak.jvm.core 5 | Bundle-Version: 1.0.0.0 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Export-Package: net.dougqh.jak.jvm, 9 | net.dougqh.jak.jvm.annotations, 10 | net.dougqh.jak.jvm.operations, 11 | net.dougqh.jak.jvm.rewriters 12 | Require-Bundle: net.dougqh.java.meta;bundle-version="1.0.0", 13 | net.dougqh.jak.core;bundle-version="1.0.0", 14 | org.junit4;bundle-version="4.8.1", 15 | javax.inject;bundle-version="1.0.0" 16 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/Attributes.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm; 2 | 3 | public final class Attributes { 4 | public static final String CODE = "Code"; 5 | public static final String CONSTANT_VALUE = "ConstantValue"; 6 | public static final String SIGNATURE = "Signature"; 7 | public static final String EXCEPTIONS = "Exceptions"; 8 | public static final String INNER_CLASSES = "InnerClasses"; 9 | 10 | private Attributes() {} 11 | } 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/Category.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm; 2 | 3 | public enum Category { 4 | CAT1, 5 | CAT2 6 | } 7 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/ConstantPoolConstants.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm; 2 | 3 | public final class ConstantPoolConstants { 4 | public static final byte CLASS = 7; 5 | public static final byte FIELD_REF = 9; 6 | public static final byte METHOD_REF = 10; 7 | public static final byte INTERFACE_METHOD_REF = 11; 8 | public static final byte STRING = 8; 9 | public static final byte INTEGER = 3; 10 | public static final byte FLOAT = 4; 11 | public static final byte LONG = 5; 12 | public static final byte DOUBLE = 6; 13 | public static final byte NAME_AND_TYPE = 12; 14 | public static final byte UTF8 = 1; 15 | 16 | private ConstantPoolConstants() {} 17 | } 18 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/JvmCodeSegment.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm; 2 | 3 | import net.dougqh.jak.jvm.operations.JvmOperation; 4 | 5 | public interface JvmCodeSegment { 6 | public abstract Iterable operations(); 7 | 8 | public abstract void process(final JvmOperationProcessor processor); 9 | 10 | public abstract void process(final SimpleJvmOperationProcessor processor); 11 | } 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/JvmContext.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm; 2 | 3 | import net.dougqh.jak.JakContext; 4 | 5 | public interface JvmContext extends JakContext {} 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/JvmMethodStats.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm; 2 | 3 | public interface JvmMethodStats { 4 | public int codeLength(); 5 | 6 | public int maxStack(); 7 | 8 | public int maxLocals(); 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/annotations/JvmOp.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | import net.dougqh.jak.jvm.operations.JvmOperation; 10 | 11 | @Documented 12 | @Target( ElementType.METHOD ) 13 | @Retention( RetentionPolicy.RUNTIME ) 14 | public @interface JvmOp { 15 | public abstract Class value(); 16 | 17 | public abstract boolean repl() default true; 18 | } 19 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/annotations/Symbol.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Target( ElementType.PARAMETER ) 11 | @Retention( RetentionPolicy.RUNTIME ) 12 | public @interface Symbol {} -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/annotations/SyntheticOp.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Target( ElementType.METHOD ) 11 | @Retention( RetentionPolicy.RUNTIME ) 12 | public @interface SyntheticOp { 13 | public abstract String id() default ""; 14 | 15 | public abstract Class[] stackOperandTypes() default {}; 16 | 17 | public abstract Class[] stackResultTypes() default {}; 18 | 19 | public abstract boolean repl() default true; 20 | } 21 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/annotations/WrapOp.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | import net.dougqh.jak.jvm.operations.JvmOperation; 10 | 11 | @Documented 12 | @Target( ElementType.METHOD ) 13 | @Retention( RetentionPolicy.RUNTIME ) 14 | public @interface WrapOp { 15 | public abstract Class value(); 16 | 17 | public abstract Class[] stackOperandTypes() default {}; 18 | 19 | public abstract Class[] stackResultTypes() default {}; 20 | 21 | public abstract boolean repl() default true; 22 | } 23 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/ArrayLoadOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public abstract class ArrayLoadOperation extends BaseJvmOperation { 6 | public abstract Type arrayType(); 7 | 8 | public abstract Type elementType(); 9 | 10 | @Override 11 | public String getOperator() { 12 | return null; 13 | } 14 | 15 | @Override 16 | public boolean isPolymorphic() { 17 | return false; 18 | } 19 | 20 | @Override 21 | public final Type[] getCodeOperandTypes() { 22 | return NO_ARGS; 23 | } 24 | 25 | @Override 26 | public final Type[] getStackOperandTypes() { 27 | return new Type[] { this.arrayType(), int.class }; 28 | } 29 | 30 | @Override 31 | public Type[] getStackResultTypes() { 32 | return new Type[] { this.elementType() }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/ArrayStoreOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public abstract class ArrayStoreOperation extends BaseJvmOperation { 6 | public abstract Type arrayType(); 7 | 8 | public abstract Type elementType(); 9 | 10 | @Override 11 | public String getOperator() { 12 | return null; 13 | } 14 | 15 | @Override 16 | public boolean isPolymorphic() { 17 | return false; 18 | } 19 | 20 | @Override 21 | public final Type[] getCodeOperandTypes() { 22 | return NO_ARGS; 23 | } 24 | 25 | @Override 26 | public final Type[] getStackOperandTypes() { 27 | return new Type[] { this.arrayType(), int.class, this.elementType() }; 28 | } 29 | 30 | @Override 31 | public final Type[] getStackResultTypes() { 32 | return NO_RESULTS; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/BaseJvmOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | 4 | public abstract class BaseJvmOperation 5 | implements JvmOperation, JvmOperation.Internals 6 | { 7 | protected static final Class< ? >[] NO_ARGS = {}; 8 | protected static final Class< ? >[] NO_RESULTS = {}; 9 | 10 | protected Integer pos; 11 | 12 | protected BaseJvmOperation() {} 13 | 14 | @Override 15 | public final Internals internals() { 16 | return this; 17 | } 18 | 19 | @Override 20 | public final void initPos(final int pos) { 21 | this.pos = pos; 22 | } 23 | 24 | @Override 25 | public final Integer pos() { 26 | return this.pos; 27 | } 28 | 29 | @Override 30 | public String getOperator() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public boolean isPolymorphic() { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/BranchOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import net.dougqh.jak.jvm.JvmOperationProcessor.Jump; 4 | 5 | public abstract class BranchOperation extends BaseJvmOperation { 6 | private final Jump jump; 7 | 8 | public BranchOperation(final Jump jump) { 9 | this.jump = jump; 10 | } 11 | 12 | public abstract boolean isConditional(); 13 | 14 | public final Jump jump() { 15 | return this.jump; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/CastOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public abstract class CastOperation extends BaseJvmOperation { 6 | public abstract Type fromType(); 7 | 8 | public abstract Type toType(); 9 | 10 | @Override 11 | public final boolean isPolymorphic() { 12 | return false; 13 | } 14 | 15 | @Override 16 | public final String getOperator() { 17 | return null; 18 | } 19 | 20 | @Override 21 | public Type[] getCodeOperandTypes() { 22 | //DQH - not final because it is overridden by checkcast 23 | return NO_ARGS; 24 | } 25 | 26 | @Override 27 | public final Type[] getStackOperandTypes() { 28 | return new Type[] { this.fromType() }; 29 | } 30 | 31 | @Override 32 | public final Type[] getStackResultTypes() { 33 | return new Type[] { this.toType() }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/ComparisonOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public abstract class ComparisonOperation extends BaseJvmOperation { 6 | public abstract Type lhsType(); 7 | 8 | public abstract Type rhsType(); 9 | 10 | @Override 11 | public final boolean isPolymorphic() { 12 | return false; 13 | } 14 | 15 | @Override 16 | public final String getOperator() { 17 | return null; 18 | } 19 | 20 | @Override 21 | public final Type[] getCodeOperandTypes() { 22 | return NO_ARGS; 23 | } 24 | 25 | @Override 26 | public final Type[] getStackOperandTypes() { 27 | return new Type[] { this.lhsType(), this.lhsType() }; 28 | } 29 | 30 | @Override 31 | public final Type[] getStackResultTypes() { 32 | return new Type[] { int.class }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/FixedConstantOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | 4 | public abstract class FixedConstantOperation extends ConstantOperation { 5 | public final boolean isFixed() { 6 | return true; 7 | } 8 | 9 | @Override 10 | public String toString() { 11 | return this.getId(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/FixedLoadOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | public abstract class FixedLoadOperation extends LoadOperation { 4 | @Override 5 | public final boolean isFixed() { 6 | return true; 7 | } 8 | 9 | @Override 10 | public final boolean equals(Object obj) { 11 | return (obj != null) && this.getClass().equals(obj.getClass()); 12 | } 13 | 14 | @Override 15 | public final int hashCode() { 16 | return this.getClass().hashCode(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/FixedStoreOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | public abstract class FixedStoreOperation extends StoreOperation { 4 | @Override 5 | public final boolean isFixed() { 6 | return true; 7 | } 8 | 9 | @Override 10 | public final boolean equals(Object obj) { 11 | return (obj != null) && this.getClass().equals(obj.getClass()); 12 | } 13 | 14 | @Override 15 | public final int hashCode() { 16 | return this.getClass().hashCode(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/IfComparisonOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor.Jump; 6 | 7 | public abstract class IfComparisonOperation extends IfOperation { 8 | public IfComparisonOperation(final Jump jump) { 9 | super(jump); 10 | } 11 | 12 | public abstract Type lhsType(); 13 | 14 | public abstract Type rhsType(); 15 | 16 | @Override 17 | public final Type[] getStackOperandTypes() { 18 | return new Type[] { this.lhsType(), this.rhsType() }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/IfZeroComparisonOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor.Jump; 6 | 7 | public abstract class IfZeroComparisonOperation extends IfOperation { 8 | public IfZeroComparisonOperation( final Jump jump ) { 9 | super(jump); 10 | } 11 | 12 | public abstract Type type(); 13 | 14 | @Override 15 | public final Type[] getStackOperandTypes() { 16 | return new Type[] { this.type() }; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/JumpPrototype.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import net.dougqh.jak.jvm.JvmOperationProcessor.Jump; 4 | 5 | 6 | final class JumpPrototype extends Jump { 7 | @Override 8 | public final Integer pos() { 9 | return 0; 10 | } 11 | 12 | @Override 13 | public final String toString() { 14 | return "jumpPrototype"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/NormalizeableOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import net.dougqh.jak.jvm.JvmOperationProcessor; 4 | 5 | public interface NormalizeableOperation extends JvmOperation { 6 | public boolean canNormalize(); 7 | 8 | public void normalize( final JvmOperationProcessor processor ); 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/ParameterizedConstantOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | 4 | public abstract class ParameterizedConstantOperation extends ConstantOperation { 5 | public final boolean isFixed() { 6 | return false; 7 | } 8 | 9 | @Override 10 | public String toString() { 11 | return this.getId() + " " + this.value(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/StackManipulationOperation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public abstract class StackManipulationOperation extends BaseJvmOperation { 6 | @Override 7 | public final String getOperator() { 8 | return null; 9 | } 10 | 11 | @Override 12 | public final Type[] getCodeOperandTypes() { 13 | return NO_ARGS; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/areturn.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | import net.dougqh.jak.types.Reference; 7 | 8 | public final class areturn extends ReturnOperation { 9 | public static final String ID = "areturn"; 10 | public static final byte CODE = ARETURN; 11 | 12 | public static final areturn instance() { 13 | return new areturn(); 14 | } 15 | 16 | private areturn() {} 17 | 18 | @Override 19 | public final String getId() { 20 | return ID; 21 | } 22 | 23 | @Override 24 | public final int getCode() { 25 | return CODE; 26 | } 27 | 28 | @Override 29 | public final Type type() { 30 | return Reference.class; 31 | } 32 | 33 | @Override 34 | public final void process( final JvmOperationProcessor processor ) { 35 | processor.areturn(); 36 | } 37 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/d2f.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class d2f extends CastOperation { 8 | public static final String ID = "d2f"; 9 | public static final byte CODE = D2F; 10 | 11 | public static final d2f instance() { 12 | return new d2f(); 13 | } 14 | 15 | private d2f() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.d2f(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/d2i.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class d2i extends CastOperation { 8 | public static final String ID = "d2i"; 9 | public static final byte CODE = D2I; 10 | 11 | public static final d2i instance() { 12 | return new d2i(); 13 | } 14 | 15 | private d2i() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.d2i(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/d2l.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class d2l extends CastOperation { 8 | public static final String ID = "d2l"; 9 | public static final byte CODE = D2L; 10 | 11 | public static final d2l instance() { 12 | return new d2l(); 13 | } 14 | 15 | private d2l() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.d2l(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dcmpg.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dcmpg extends ComparisonOperation { 8 | public static final String ID = "dcmpg"; 9 | public static final byte CODE = DCMPG; 10 | 11 | public static final dcmpg instance() { 12 | return new dcmpg(); 13 | } 14 | 15 | private dcmpg() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type lhsType() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final Type rhsType() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dcmpg(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dcmpl.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dcmpl extends ComparisonOperation { 8 | public static final String ID = "dcmpl"; 9 | public static final byte CODE = DCMPL; 10 | 11 | public static final dcmpl instance() { 12 | return new dcmpl(); 13 | } 14 | 15 | private dcmpl() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type lhsType() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final Type rhsType() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dcmpl(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dload_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dload_0 extends FixedLoadOperation { 8 | public static final String ID = "dload_0"; 9 | public static final byte CODE = DLOAD_0; 10 | 11 | public static final dload_0 instance() { 12 | return new dload_0(); 13 | } 14 | 15 | private dload_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dload_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dload_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dload_1 extends FixedLoadOperation { 8 | public static final String ID = "dload_1"; 9 | public static final byte CODE = DLOAD_1; 10 | 11 | public static final dload_1 instance() { 12 | return new dload_1(); 13 | } 14 | 15 | private dload_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dload_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dload_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dload_2 extends FixedLoadOperation { 8 | public static final String ID = "dload_2"; 9 | public static final byte CODE = DLOAD_2; 10 | 11 | public static final dload_2 instance() { 12 | return new dload_2(); 13 | } 14 | 15 | private dload_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dload_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dload_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dload_3 extends FixedLoadOperation { 8 | public static final String ID = "dload_3"; 9 | public static final byte CODE = DLOAD_3; 10 | 11 | public static final dload_3 instance() { 12 | return new dload_3(); 13 | } 14 | 15 | private dload_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dload_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dreturn.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dreturn extends ReturnOperation { 8 | public static final String ID = "dreturn"; 9 | public static final byte CODE = DRETURN; 10 | 11 | public static final dreturn instance() { 12 | return new dreturn(); 13 | } 14 | 15 | private dreturn() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final void process( final JvmOperationProcessor processor ) { 34 | processor.dreturn(); 35 | } 36 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dstore_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dstore_0 extends FixedStoreOperation { 8 | public static final String ID = "dstore_0"; 9 | public static final byte CODE = DSTORE_0; 10 | 11 | public static final dstore_0 instance() { 12 | return new dstore_0(); 13 | } 14 | 15 | private dstore_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final int slot() { 34 | return 0; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dstore_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dstore_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dstore_1 extends FixedStoreOperation { 8 | public static final String ID = "dstore_1"; 9 | public static final byte CODE = DSTORE_1; 10 | 11 | public static final dstore_1 instance() { 12 | return new dstore_1(); 13 | } 14 | 15 | private dstore_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final int slot() { 34 | return 1; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dstore_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dstore_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dstore_2 extends FixedStoreOperation { 8 | public static final String ID = "dstore_2"; 9 | public static final byte CODE = DSTORE_2; 10 | 11 | public static final dstore_2 instance() { 12 | return new dstore_2(); 13 | } 14 | 15 | private dstore_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final int slot() { 34 | return 2; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dstore_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dstore_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class dstore_3 extends FixedStoreOperation { 8 | public static final String ID = "dstore_3"; 9 | public static final byte CODE = DSTORE_3; 10 | 11 | public static final dstore_3 instance() { 12 | return new dstore_3(); 13 | } 14 | 15 | private dstore_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return double.class; 30 | } 31 | 32 | @Override 33 | public final int slot() { 34 | return 3; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.dstore_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dup2_x2.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/dup2_x2.java -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/f2d.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class f2d extends CastOperation { 8 | public static final String ID = "f2d"; 9 | public static final byte CODE = F2D; 10 | 11 | public static final f2d instance() { 12 | return new f2d(); 13 | } 14 | 15 | private f2d() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return float.class; 30 | } 31 | 32 | @Override 33 | public Type toType() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.f2d(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/f2i.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class f2i extends CastOperation { 8 | public static final String ID = "f2i"; 9 | public static final byte CODE = F2I; 10 | 11 | public static final f2i instance() { 12 | return new f2i(); 13 | } 14 | 15 | private f2i() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return float.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.f2i(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/f2l.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class f2l extends CastOperation { 8 | public static final String ID = "f2l"; 9 | public static final byte CODE = F2L; 10 | 11 | public static final f2l instance() { 12 | return new f2l(); 13 | } 14 | 15 | private f2l() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return float.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.f2l(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fcmpg.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fcmpg extends ComparisonOperation { 8 | public static final String ID = "fcmpg"; 9 | public static final byte CODE = FCMPG; 10 | 11 | public static final fcmpg instance() { 12 | return new fcmpg(); 13 | } 14 | 15 | private fcmpg() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type lhsType() { 29 | return float.class; 30 | } 31 | 32 | @Override 33 | public final Type rhsType() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fcmpg(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fcmpl.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fcmpl extends ComparisonOperation { 8 | public static final String ID = "fcmpl"; 9 | public static final byte CODE = FCMPL; 10 | 11 | public static final fcmpl instance() { 12 | return new fcmpl(); 13 | } 14 | 15 | private fcmpl() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type lhsType() { 29 | return float.class; 30 | } 31 | 32 | @Override 33 | public final Type rhsType() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fcmpl(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fload_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fload_0 extends FixedLoadOperation { 8 | public static final String ID = "fload_0"; 9 | public static final byte CODE = FLOAD_0; 10 | 11 | public static final fload_0 instance() { 12 | return new fload_0(); 13 | } 14 | 15 | private fload_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fload_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fload_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fload_1 extends FixedLoadOperation { 8 | public static final String ID = "fload_1"; 9 | public static final byte CODE = FLOAD_1; 10 | 11 | public static final fload_1 instance() { 12 | return new fload_1(); 13 | } 14 | 15 | private fload_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fload_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fload_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fload_2 extends FixedLoadOperation { 8 | public static final String ID = "fload_2"; 9 | public static final byte CODE = FLOAD_2; 10 | 11 | public static final fload_2 instance() { 12 | return new fload_2(); 13 | } 14 | 15 | private fload_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fload_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fload_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fload_3 extends FixedLoadOperation { 8 | public static final String ID = "fload_3"; 9 | public static final byte CODE = FLOAD_3; 10 | 11 | public static final fload_3 instance() { 12 | return new fload_3(); 13 | } 14 | 15 | private fload_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 3; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fload_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/freturn.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class freturn extends ReturnOperation { 8 | public static final String ID = "freturn"; 9 | public static final byte CODE = FRETURN; 10 | 11 | public static final freturn instance() { 12 | return new freturn(); 13 | } 14 | 15 | private freturn() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return float.class; 30 | } 31 | 32 | @Override 33 | public final void process( final JvmOperationProcessor processor ) { 34 | processor.freturn(); 35 | } 36 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fstore_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fstore_0 extends FixedStoreOperation { 8 | public static final String ID = "fstore_0"; 9 | public static final byte CODE = FSTORE_0; 10 | 11 | public static final fstore_0 instance() { 12 | return new fstore_0(); 13 | } 14 | 15 | private fstore_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fstore_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fstore_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fstore_1 extends FixedStoreOperation { 8 | public static final String ID = "fstore_1"; 9 | public static final byte CODE = FSTORE_1; 10 | 11 | public static final fstore_1 instance() { 12 | return new fstore_1(); 13 | } 14 | 15 | private fstore_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fstore_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fstore_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fstore_2 extends FixedStoreOperation { 8 | public static final String ID = "fstore_2"; 9 | public static final byte CODE = FSTORE_2; 10 | 11 | public static final fstore_2 instance() { 12 | return new fstore_2(); 13 | } 14 | 15 | private fstore_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fstore_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/fstore_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class fstore_3 extends FixedStoreOperation { 8 | public static final String ID = "fstore_3"; 9 | public static final byte CODE = FSTORE_3; 10 | 11 | public static final fstore_3 instance() { 12 | return new fstore_3(); 13 | } 14 | 15 | private fstore_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 3; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.fstore_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/i2b.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class i2b extends CastOperation { 8 | public static final String ID = "i2b"; 9 | public static final byte CODE = I2B; 10 | 11 | public static final i2b instance() { 12 | return new i2b(); 13 | } 14 | 15 | private i2b() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return byte.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.i2b(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/i2c.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class i2c extends CastOperation { 8 | public static final String ID = "i2c"; 9 | public static final byte CODE = I2C; 10 | 11 | public static final i2c instance() { 12 | return new i2c(); 13 | } 14 | 15 | private i2c() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return char.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.i2c(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/i2d.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class i2d extends CastOperation { 8 | public static final String ID = "i2d"; 9 | public static final byte CODE = I2D; 10 | 11 | public static final i2d instance() { 12 | return new i2d(); 13 | } 14 | 15 | private i2d() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.i2d(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/i2f.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class i2f extends CastOperation { 8 | public static final String ID = "i2f"; 9 | public static final byte CODE = I2F; 10 | 11 | public static final i2f instance() { 12 | return new i2f(); 13 | } 14 | 15 | private i2f() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.i2f(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/i2l.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class i2l extends CastOperation { 8 | public static final String ID = "i2l"; 9 | public static final byte CODE = I2L; 10 | 11 | public static final i2l instance() { 12 | return new i2l(); 13 | } 14 | 15 | private i2l() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.i2l(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/i2s.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class i2s extends CastOperation { 8 | public static final String ID = "i2s"; 9 | public static final byte CODE = I2S; 10 | 11 | public static final i2s instance() { 12 | return new i2s(); 13 | } 14 | 15 | private i2s() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return short.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.i2s(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/iload_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class iload_0 extends FixedLoadOperation { 8 | public static final String ID = "iload_0"; 9 | public static final byte CODE = ILOAD_0; 10 | 11 | public static final iload_0 instance() { 12 | return new iload_0(); 13 | } 14 | 15 | private iload_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.iload_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/iload_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class iload_1 extends FixedLoadOperation { 8 | public static final String ID = "iload_1"; 9 | public static final byte CODE = ILOAD_1; 10 | 11 | public static final iload_1 instance() { 12 | return new iload_1(); 13 | } 14 | 15 | private iload_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.iload_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/iload_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class iload_2 extends FixedLoadOperation { 8 | public static final String ID = "iload_2"; 9 | public static final byte CODE = ILOAD_2; 10 | 11 | public static final iload_2 instance() { 12 | return new iload_2(); 13 | } 14 | 15 | private iload_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.iload_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/iload_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class iload_3 extends FixedLoadOperation { 8 | public static final String ID = "iload_3"; 9 | public static final byte CODE = ILOAD_3; 10 | 11 | public static final iload_3 instance() { 12 | return new iload_3(); 13 | } 14 | 15 | private iload_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 3; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.iload_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/ireturn.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class ireturn extends ReturnOperation { 8 | public static final String ID = "ireturn"; 9 | public static final byte CODE = IRETURN; 10 | 11 | public static final ireturn instance() { 12 | return new ireturn(); 13 | } 14 | 15 | private ireturn() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return int.class; 30 | } 31 | 32 | @Override 33 | public final void process( final JvmOperationProcessor processor ) { 34 | processor.ireturn(); 35 | } 36 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/istore_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class istore_0 extends FixedStoreOperation { 8 | public static final String ID = "istore_0"; 9 | public static final byte CODE = ISTORE_0; 10 | 11 | public static final istore_0 instance() { 12 | return new istore_0(); 13 | } 14 | 15 | private istore_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.istore_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/istore_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class istore_1 extends FixedStoreOperation { 8 | public static final String ID = "istore_1"; 9 | public static final byte CODE = ISTORE_1; 10 | 11 | public static final istore_1 instance() { 12 | return new istore_1(); 13 | } 14 | 15 | private istore_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.istore_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/istore_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class istore_2 extends FixedStoreOperation { 8 | public static final String ID = "istore_2"; 9 | public static final byte CODE = ISTORE_2; 10 | 11 | public static final istore_2 instance() { 12 | return new istore_2(); 13 | } 14 | 15 | private istore_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.istore_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/istore_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class istore_3 extends FixedStoreOperation { 8 | public static final String ID = "istore_3"; 9 | public static final byte CODE = ISTORE_3; 10 | 11 | public static final istore_3 instance() { 12 | return new istore_3(); 13 | } 14 | 15 | private istore_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 3; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.istore_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/l2d.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class l2d extends CastOperation { 8 | public static final String ID = "l2d"; 9 | public static final byte CODE = L2D; 10 | 11 | public static final l2d instance() { 12 | return new l2d(); 13 | } 14 | 15 | private l2d() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return long.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return double.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.l2d(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/l2f.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class l2f extends CastOperation { 8 | public static final String ID = "l2f"; 9 | public static final byte CODE = L2F; 10 | 11 | public static final l2f instance() { 12 | return new l2f(); 13 | } 14 | 15 | private l2f() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return long.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return float.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.l2f(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/l2i.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class l2i extends CastOperation { 8 | public static final String ID = "l2i"; 9 | public static final byte CODE = L2I; 10 | 11 | public static final l2i instance() { 12 | return new l2i(); 13 | } 14 | 15 | private l2i() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type fromType() { 29 | return long.class; 30 | } 31 | 32 | @Override 33 | public final Type toType() { 34 | return int.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.l2i(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lcmp.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lcmp extends ComparisonOperation { 8 | public static final String ID = "lcmp"; 9 | public static final byte CODE = LCMP; 10 | 11 | public static final lcmp instance() { 12 | return new lcmp(); 13 | } 14 | 15 | private lcmp() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type lhsType() { 29 | return long.class; 30 | } 31 | 32 | @Override 33 | public final Type rhsType() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lcmp(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lload_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lload_0 extends FixedLoadOperation { 8 | public static final String ID = "lload_0"; 9 | public static final byte CODE = LLOAD_0; 10 | 11 | public static final lload_0 instance() { 12 | return new lload_0(); 13 | } 14 | 15 | private lload_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lload_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lload_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lload_1 extends FixedLoadOperation { 8 | public static final String ID = "lload_1"; 9 | public static final byte CODE = LLOAD_1; 10 | 11 | public static final lload_1 instance() { 12 | return new lload_1(); 13 | } 14 | 15 | private lload_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lload_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lload_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lload_2 extends FixedLoadOperation { 8 | public static final String ID = "lload_2"; 9 | public static final byte CODE = LLOAD_2; 10 | 11 | public static final lload_2 instance() { 12 | return new lload_2(); 13 | } 14 | 15 | private lload_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lload_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lload_3.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lload_3 extends FixedLoadOperation { 8 | public static final String ID = "lload_3"; 9 | public static final byte CODE = LLOAD_3; 10 | 11 | public static final lload_3 instance() { 12 | return new lload_3(); 13 | } 14 | 15 | private lload_3() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 3; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lload_3(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lreturn.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lreturn extends ReturnOperation { 8 | public static final String ID = "lreturn"; 9 | public static final byte CODE = LRETURN; 10 | 11 | public static final lreturn instance() { 12 | return new lreturn(); 13 | } 14 | 15 | private lreturn() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return long.class; 30 | } 31 | 32 | @Override 33 | public final void process( final JvmOperationProcessor processor ) { 34 | processor.lreturn(); 35 | } 36 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lstore_0.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lstore_0 extends FixedStoreOperation { 8 | public static final String ID = "lstore_0"; 9 | public static final byte CODE = LSTORE_0; 10 | 11 | public static final lstore_0 instance() { 12 | return new lstore_0(); 13 | } 14 | 15 | private lstore_0() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 0; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lstore_0(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lstore_1.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lstore_1 extends FixedStoreOperation { 8 | public static final String ID = "lstore_1"; 9 | public static final byte CODE = LSTORE_1; 10 | 11 | public static final lstore_1 instance() { 12 | return new lstore_1(); 13 | } 14 | 15 | private lstore_1() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 1; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lstore_1(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/lstore_2.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class lstore_2 extends FixedStoreOperation { 8 | public static final String ID = "lstore_2"; 9 | public static final byte CODE = LSTORE_2; 10 | 11 | public static final lstore_2 instance() { 12 | return new lstore_2(); 13 | } 14 | 15 | private lstore_2() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final int slot() { 29 | return 2; 30 | } 31 | 32 | @Override 33 | public final Type type() { 34 | return long.class; 35 | } 36 | 37 | @Override 38 | public final void process( final JvmOperationProcessor processor ) { 39 | processor.lstore_2(); 40 | } 41 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/src/net/dougqh/jak/jvm/operations/return_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.operations; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationProcessor; 6 | 7 | public final class return_ extends ReturnOperation { 8 | public static final String ID = "return"; 9 | public static final byte CODE = RETURN; 10 | 11 | public static final return_ instance() { 12 | return new return_(); 13 | } 14 | 15 | private return_() {} 16 | 17 | @Override 18 | public final String getId() { 19 | return ID; 20 | } 21 | 22 | @Override 23 | public final int getCode() { 24 | return CODE; 25 | } 26 | 27 | @Override 28 | public final Type type() { 29 | return void.class; 30 | } 31 | 32 | @Override 33 | public final void process( final JvmOperationProcessor processor ) { 34 | processor.return_(); 35 | } 36 | } -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.core/test-src/net/dougqh/jak/jvm/rewriters/TestJvmOperationHydrator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.rewriters; 2 | 3 | import java.util.LinkedList; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationHydrator; 6 | import net.dougqh.jak.jvm.operations.JvmOperation; 7 | 8 | public final class TestJvmOperationHydrator extends JvmOperationHydrator { 9 | private final LinkedList opQueue = new LinkedList(); 10 | 11 | @Override 12 | protected final void process(final JvmOperation operation) { 13 | this.opQueue.addLast(operation); 14 | } 15 | 16 | public final JvmOperation get() { 17 | return this.opQueue.removeFirst(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.jvm.disassembler 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:23:36 EST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jan 10 23:23:36 EST 2011 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JAK JVM Disassembler 4 | Bundle-SymbolicName: net.dougqh.jak.jvm.disassembler 5 | Bundle-Version: 1.0.0.0 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Require-Bundle: net.dougqh.jak.core;bundle-version="1.0.0", 9 | net.dougqh.jak.jvm.core;bundle-version="1.0.0", 10 | org.junit4;bundle-version="4.8.1", 11 | net.dougqh.jak.core.disassembler;bundle-version="1.0.0", 12 | net.dougqh.java.meta;bundle-version="1.0.0", 13 | net.dougqh.functional;bundle-version="1.0.0" 14 | Export-Package: net.dougqh.jak.disassembler 15 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/ClassFileFormatException.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.IOException; 4 | 5 | public final class ClassFileFormatException extends IOException { 6 | private static final long serialVersionUID = 1L; 7 | 8 | public ClassFileFormatException( final String msg ) { 9 | super( msg ); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/ClassLoaderClassLocator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import net.dougqh.aggregator.InputScheduler; 7 | 8 | final class ClassLoaderClassLocator implements ClassLocator { 9 | private final ClassLoader classLoader; 10 | 11 | ClassLoaderClassLocator( final ClassLoader classLoader ) { 12 | this.classLoader = classLoader; 13 | } 14 | 15 | @Override 16 | public void enumerate(final InputScheduler scheduler) { 17 | //TODO: Implement this if the classloader is URLClassLoader 18 | } 19 | 20 | @Override 21 | public final InputStream load(final String className) throws IOException { 22 | return this.classLoader.getResourceAsStream( className.replace( '.', '/' ) + ".class" ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/ClassLocator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import net.dougqh.aggregator.InputScheduler; 7 | 8 | public interface ClassLocator { 9 | public abstract void enumerate(final InputScheduler scheduler) 10 | throws InterruptedException; 11 | 12 | public abstract InputStream load(final String className) throws IOException; 13 | 14 | public interface ClassBlock { 15 | public abstract void process(final ClassProcessor processor) throws IOException; 16 | } 17 | 18 | public interface ClassProcessor { 19 | public abstract void process(final InputStream in) throws IOException; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/DisassemblerException.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.IOException; 4 | 5 | public class DisassemblerException extends RuntimeException { 6 | private static final long serialVersionUID = -3029705351195189837L; 7 | 8 | public DisassemblerException( final IOException e ) { 9 | super( e ); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/JvmAnnotation.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | public final class JvmAnnotation 4 | extends JvmType 5 | implements JavaAnnotation 6 | { 7 | JvmAnnotation( final JvmTypeInternals typeReader ) { 8 | super( typeReader ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/JvmEnum.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | public final class JvmEnum 4 | extends JvmType 5 | implements JavaEnum 6 | { 7 | JvmEnum( final JvmTypeInternals typeReader ) { 8 | super( typeReader ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/JvmInterface.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | public final class JvmInterface 7 | extends JvmType 8 | implements JavaInterface 9 | { 10 | public static final JvmClass read(final Class aClass) throws IOException { 11 | JvmReader reader = new JvmReader().addClassLoader(aClass.getClassLoader()); 12 | return reader.read(aClass); 13 | } 14 | 15 | JvmInterface( final JvmTypeInternals typeReader ) { 16 | super( typeReader ); 17 | } 18 | 19 | public final List getFields() { 20 | return this.type.getFields(); 21 | } 22 | 23 | @Override 24 | public final List getMethods() { 25 | return this.type.getMethods(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/src/net/dougqh/jak/disassembler/JvmTypeSet.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import net.dougqh.functional.Filter; 4 | 5 | public abstract class JvmTypeSet extends JavaTypeSet { 6 | @Override 7 | public abstract JvmTypeSet filter(final Filter filter); 8 | 9 | public final JvmClass getClass(final String name) { 10 | return (JvmClass)this.get(name); 11 | } 12 | 13 | public final JvmInterface getInterface(final String name) { 14 | return (JvmInterface)this.get(name); 15 | } 16 | 17 | @Override 18 | public final JvmAnnotation getAnnotation(final String name) { 19 | return (JvmAnnotation)this.getAnnotation(name); 20 | } 21 | 22 | @Override 23 | public final JvmEnum getEnum(final String name) { 24 | return (JvmEnum)this.getEnum(name); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/net/dougqh/jak/disassembler/Tests.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler; 2 | 3 | import java.io.File; 4 | 5 | public final class Tests { 6 | private static final File TESTDATA_DIR = new File( "testdata" ); 7 | 8 | public static final File jar( final String jarName ) { 9 | return new File( TESTDATA_DIR, jarName ); 10 | } 11 | 12 | public static final File dir( final String dirName ) { 13 | return new File( TESTDATA_DIR, dirName ); 14 | } 15 | 16 | private Tests() {} 17 | } 18 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/net/dougqh/jak/disassembler/api/JakDisassemblerApiTestSuite.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.disassembler.api; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | import org.junit.runners.Suite.SuiteClasses; 6 | 7 | @RunWith( Suite.class ) 8 | @SuiteClasses( { 9 | BasicTest.class, 10 | JarTest.class, 11 | ClassDirTest.class 12 | } ) 13 | public final class JakDisassemblerApiTestSuite {} 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/testdata/NonTrivialClass.java: -------------------------------------------------------------------------------- 1 | package testdata; 2 | 3 | import java.io.Serializable; 4 | 5 | public final class NonTrivialClass 6 | extends Object 7 | implements Serializable, Runnable 8 | { 9 | private static final long serialVersionUID = -6805746361650409460L; 10 | 11 | public static final int CONSTANT = 20; 12 | public static boolean DEBUG = false; 13 | 14 | private final int x; 15 | private int y; 16 | 17 | NonTrivialClass( final int x, final int y ) { 18 | this.x = x; 19 | this.y = y; 20 | } 21 | 22 | @Override 23 | public final void run() { 24 | System.out.println(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/testdata/TrivialAnnotation.java: -------------------------------------------------------------------------------- 1 | package testdata; 2 | 3 | public @interface TrivialAnnotation { 4 | } 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/testdata/TrivialClass.java: -------------------------------------------------------------------------------- 1 | package testdata; 2 | 3 | public class TrivialClass {} 4 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/testdata/TrivialEnum.java: -------------------------------------------------------------------------------- 1 | package testdata; 2 | 3 | public enum TrivialEnum { 4 | } 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/test-src/testdata/TrivialInterface.java: -------------------------------------------------------------------------------- 1 | package testdata; 2 | 3 | public interface TrivialInterface { 4 | } 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/AnnotatedClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/AnnotatedClass.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerAnnotation.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerClass.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerEnum.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerEnum.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation$InnerInterface.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Annotation.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Arrays.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Arrays.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$1.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$2.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerAnnotation.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerClass.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerEnum.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerEnum.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration$InnerInterface.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplexEnumeration.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplileTimeAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ComplileTimeAnnotation.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Constants$TestEnum.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Constants$TestEnum.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Constants.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Constants.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ExceptionHandling$Thrower.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ExceptionHandling$Thrower.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/ExceptionHandling.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/ExceptionHandling.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Exceptions.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Exceptions.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Generics.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Generics.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/HelloWorld.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/HelloWorld.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/IStringsList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/IStringsList.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Increment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Increment.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/IntermediateEnumeration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/IntermediateEnumeration.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/NewObject.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/NewObject.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Nums.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Nums.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Outer$Inner.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Outer$Inner.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Outer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Outer.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Predicate.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Predicate.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/RunTimeAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/RunTimeAnnotation.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Signum.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Signum.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/StringList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/StringList.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Sum.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Sum.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Synchronization.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Synchronization.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/Trivial.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/Trivial.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/TrivialEnumeration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/TrivialEnumeration.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/VarArgs.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/VarArgs.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/foo/Foo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/foo/Foo.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/classdir/foo/bar/Bar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/classdir/foo/bar/Bar.class -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.disassembler/testdata/test.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.disassembler/testdata/test.jar -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jak.jvm.optimization 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Aug 26 18:29:21 EDT 2012 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Aug 26 18:29:21 EDT 2012 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Optimization 4 | Bundle-SymbolicName: net.dougqh.jak.jvm.optimization 5 | Bundle-Version: 1.0.0.0 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Require-Bundle: net.dougqh.jak.core;bundle-version="1.0.0", 9 | net.dougqh.jak.jvm.core;bundle-version="1.0.0" 10 | Export-Package: net.dougqh.jak.jvm.optimizers 11 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/lib/junit-4.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.jvm.optimization/lib/junit-4.8.2.jar -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/test-src/net/dougqh/jak/jvm/optimizers/OptimizationSuite.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.optimizers; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | import org.junit.runners.Suite.SuiteClasses; 6 | 7 | 8 | @RunWith(Suite.class) 9 | @SuiteClasses({ 10 | UnaryConstantFoldingTest.class, 11 | BinaryConstantFoldingTest.class 12 | }) 13 | public final class OptimizationSuite {} 14 | -------------------------------------------------------------------------------- /net.dougqh.jak.jvm.optimization/test-src/net/dougqh/jak/jvm/optimizers/TestJvmOperationHydrator.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.jvm.optimizers; 2 | 3 | import java.util.LinkedList; 4 | 5 | import net.dougqh.jak.jvm.JvmOperationHydrator; 6 | import net.dougqh.jak.jvm.operations.JvmOperation; 7 | 8 | public final class TestJvmOperationHydrator extends JvmOperationHydrator { 9 | private final LinkedList opQueue = new LinkedList(); 10 | 11 | @Override 12 | protected final void process(final JvmOperation operation) { 13 | this.opQueue.addLast(operation); 14 | } 15 | 16 | public final JvmOperation get() { 17 | return this.opQueue.removeFirst(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/.externalToolBuilders/org.eclipse.pde.api.tools.apiAnalysisBuilder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/.gitignore: -------------------------------------------------------------------------------- 1 | /generated 2 | /generated 3 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Fri Aug 13 08:21:35 EDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Fri Aug 13 08:21:35 EDT 2010 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Java Assembler REPL 4 | Bundle-SymbolicName: net.dougqh.jak.repl 5 | Bundle-Version: 1.0.0.1 6 | Bundle-Vendor: Douglas Q Hawkins 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 8 | Require-Bundle: net.dougqh.jak.core.assembler;bundle-version="1.0.0", 9 | net.dougqh.jak.jvm.assembler;bundle-version="1.0.0", 10 | net.dougqh.java.meta;bundle-version="1.0.0", 11 | net.dougqh.jak.core;bundle-version="1.0.0", 12 | net.dougqh.jak.jvm.core;bundle-version="1.0.0", 13 | net.dougqh.jak.jvm.optimization;bundle-version="1.0.0", 14 | net.dougqh.functional;bundle-version="1.0.0" 15 | Class-Path: net.dougqh.meta.java.jar net.dougqh.jak.jar jline-0.9.94.jar 16 | Main-Class: net.dougqh.jak.repl.JakRepl 17 | 18 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/lib/jline-0.9.94.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.repl/lib/jline-0.9.94.jar -------------------------------------------------------------------------------- /net.dougqh.jak.repl/lib/jline-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.jak.repl/lib/jline-src.zip -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/AutoRunCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | final class AutoRunCommand extends ConfigCommand { 4 | public static final String ID = "autoRun"; 5 | public static final AutoRunCommand INSTANCE = new AutoRunCommand(); 6 | 7 | private AutoRunCommand() { 8 | super( ID ); 9 | } 10 | 11 | @Override 12 | final boolean get( final ReplConfig config ) { 13 | return config.autoRun(); 14 | } 15 | 16 | @Override 17 | final void set( final ReplConfig config, final boolean value ) { 18 | config.autoRun( value ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ClearCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class ClearCommand extends FixedIdCommand { 7 | static final String ID = "clear"; 8 | static final ClearCommand INSTANCE = new ClearCommand(); 9 | 10 | private ClearCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List< String > args ) 19 | throws IOException 20 | { 21 | checkNoArguments( args ); 22 | 23 | repl.console().clear(); 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/EchoCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | 4 | final class EchoCommand extends ConfigCommand { 5 | static final String ID = "echo"; 6 | static final EchoCommand INSTANCE = new EchoCommand(); 7 | 8 | private EchoCommand() { 9 | super( ID ); 10 | } 11 | 12 | @Override 13 | final void set( final ReplConfig config, final boolean value ) { 14 | config.echo( value ); 15 | } 16 | 17 | @Override 18 | final boolean get( final ReplConfig config ) { 19 | return config.echo(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/FixedIdCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | abstract class FixedIdCommand extends ReplCommand { 4 | protected final String id; 5 | 6 | FixedIdCommand( final String id ) { 7 | this.id = id; 8 | } 9 | 10 | @Override 11 | final boolean matches( final String command ) { 12 | return this.id.equals( command ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ImportCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class ImportCommand extends FixedIdCommand { 7 | public static final String ID = "import"; 8 | public static final ImportCommand INSTANCE = new ImportCommand(); 9 | 10 | private ImportCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List< String > args ) 19 | throws IOException 20 | { 21 | if ( args.size() != 1 ) { 22 | repl.console().printUsage( ID, String.class ); 23 | return false; 24 | } 25 | 26 | try { 27 | repl.imports().addImport( args.get( 0 ) ); 28 | return true; 29 | } catch ( ClassNotFoundException e ) { 30 | repl.console().printError( e.getMessage() ); 31 | return false; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ImportsCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class ImportsCommand extends FixedIdCommand { 7 | public static final String ID = "imports"; 8 | public static final ImportsCommand INSTANCE = new ImportsCommand(); 9 | 10 | private ImportsCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List< String > args ) 19 | throws IOException 20 | { 21 | checkNoArguments( args ); 22 | 23 | repl.imports().print( repl.console() ); 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ListCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class ListCommand extends FixedIdCommand { 7 | static final String ID = "list"; 8 | static final ListCommand INSTANCE = new ListCommand(); 9 | 10 | private ListCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List< String > args ) 19 | throws IOException 20 | { 21 | checkNoArguments( args ); 22 | 23 | repl.recorder().list( repl.console() ); 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/OptimizeCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | public final class OptimizeCommand extends FixedIdCommand { 7 | static final String ID = "optimize"; 8 | static final OptimizeCommand INSTANCE = new OptimizeCommand(); 9 | 10 | public OptimizeCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List args) 19 | throws IOException 20 | { 21 | repl.recorder().optimize(); 22 | repl.recorder().list( repl.console() ); 23 | return true; 24 | } 25 | 26 | @Override 27 | final boolean runProgramAfterCommand() { 28 | return false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ReplCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | abstract class ReplCommand { 8 | static final List< String > NO_ARGS = Collections.emptyList(); 9 | 10 | abstract boolean matches( final String command ); 11 | 12 | abstract boolean run( 13 | final JakRepl repl, 14 | final String command, 15 | final List< String > args ) 16 | throws IOException; 17 | 18 | boolean runProgramAfterCommand() { 19 | return false; 20 | } 21 | 22 | protected static final void checkNoArguments( final List< String > args ) { 23 | if ( ! args.isEmpty() ) { 24 | throw new IllegalArgumentException(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ReplEnum.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | interface ReplEnum< E extends Enum< E > > { 4 | public abstract String id(); 5 | } 6 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ResetCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class ResetCommand extends FixedIdCommand { 7 | static final String ID = "reset"; 8 | static final ResetCommand INSTANCE = new ResetCommand(); 9 | 10 | private ResetCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List< String > args ) 19 | throws IOException 20 | { 21 | checkNoArguments( args ); 22 | 23 | repl.resetProgram(); 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/RunCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class RunCommand extends FixedIdCommand { 7 | public static final String ID = "run"; 8 | public static final RunCommand INSTANCE = new RunCommand(); 9 | 10 | private RunCommand() { 11 | super( ID ); 12 | } 13 | 14 | @Override 15 | final boolean run( 16 | final JakRepl repl, 17 | final String command, 18 | final List< String > args ) 19 | throws IOException 20 | { 21 | checkNoArguments( args ); 22 | 23 | repl.runProgram( false ); 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /net.dougqh.jak.repl/src/net/dougqh/jak/repl/ShowAliasCommand.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.jak.repl; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | final class ShowAliasCommand extends ReplCommand { 7 | static final ShowAliasCommand INSTANCE = new ShowAliasCommand(); 8 | 9 | private ShowAliasCommand() {} 10 | 11 | @Override 12 | final boolean matches( final String command ) { 13 | try { 14 | StatePart.parse( command ); 15 | return true; 16 | } catch ( IllegalArgumentException e ) { 17 | return false; 18 | } 19 | } 20 | 21 | @Override 22 | final boolean run( 23 | final JakRepl repl, 24 | final String command, 25 | final List< String > args ) 26 | throws IOException 27 | { 28 | checkNoArguments( args ); 29 | 30 | StatePart part = StatePart.parse( command ); 31 | part.print( repl.lastState(), repl.console() ); 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/.externalToolBuilders/org.eclipse.pde.api.tools.apiAnalysisBuilder (1).launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sat May 01 12:53:37 EDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Sat May 01 12:53:37 EDT 2010 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Java Meta 4 | Bundle-SymbolicName: net.dougqh.java.meta 5 | Bundle-Version: 1.0.0.1 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 7 | Bundle-Vendor: Douglas Q Hawkins 8 | Require-Bundle: org.junit4;bundle-version="4.5.0";resolution:=optional 9 | Export-Package: net.dougqh.java.meta.types, 10 | net.dougqh.java.meta.types.primitives 11 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/ClassNameRefType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/ClassNameRefType.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaGenericArrayType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaGenericArrayType.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaParameterizedType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaParameterizedType.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeBuilder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeBuilder.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeProvider.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeProvider.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeSignatureBuilder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeSignatureBuilder.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeVariable.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeVisitor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypeVisitor.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypes$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypes$1.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypes$TypeVisitorImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypes$TypeVisitorImpl.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypes.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaTypes.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaWildcardExtendsType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaWildcardExtendsType.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaWildcardSuperType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/src/net/dougqh/java/meta/types/JavaWildcardSuperType.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypeBuildingTest$Signatures.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypeBuildingTest$Signatures.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypeBuildingTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypeBuildingTest.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypeUtilsTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypeUtilsTest.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypesApiTestSuite.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/classes/test-src/net/dougqh/java/meta/types/api/JavaTypesApiTestSuite.class -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/net.dougqh.java.meta.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/net.dougqh.java.meta.jar -------------------------------------------------------------------------------- /net.dougqh.java.meta/build/net.dougqh.java.meta.test.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/build/net.dougqh.java.meta.test.jar -------------------------------------------------------------------------------- /net.dougqh.java.meta/lib/junit-4.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dougqh/JAK/e10da7384cce6466530c12378ee782a1d8209b51/net.dougqh.java.meta/lib/junit-4.8.2.jar -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/ClassNameRefType.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | final class ClassNameRefType implements Type { 6 | private final String name; 7 | 8 | ClassNameRefType( final CharSequence name ) { 9 | this.name = name.toString(); 10 | } 11 | 12 | final String getName() { 13 | return this.name; 14 | } 15 | 16 | @Override 17 | public final int hashCode() { 18 | return this.name.hashCode(); 19 | } 20 | 21 | @Override 22 | public final boolean equals( final Object obj ) { 23 | if ( obj == this ) { 24 | return true; 25 | } else if ( ! ( obj instanceof ClassNameRefType ) ) { 26 | return false; 27 | } else { 28 | ClassNameRefType that = (ClassNameRefType)obj; 29 | return this.name.equals( that.name ); 30 | } 31 | } 32 | 33 | @Override 34 | public final String toString() { 35 | return this.name; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/JavaTypeNames.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types; 2 | 3 | public final class JavaTypeNames { 4 | private JavaTypeNames() {} 5 | 6 | public static final String fromPeristedName( final String persistedName ) { 7 | return persistedName.substring( 1, persistedName.length() - 1 ).replace( '/', '.' ); 8 | } 9 | 10 | public static final String toPersistedName( final String normalName ) { 11 | return "L" + normalName.replace( '.', '/' ) + ";"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/JavaTypeProvider.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | public interface JavaTypeProvider extends Type { 6 | //TODO: Should return a Type[] 7 | //This is needed to provide a correct definition for 8 | //both UnionType-s and JavaTypeVariable-s. 9 | public abstract Type get(); 10 | } 11 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/TypeAlias.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention( RetentionPolicy.RUNTIME ) 9 | @Target( ElementType.TYPE ) 10 | public @interface TypeAlias { 11 | public abstract Class value(); 12 | } 13 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/boolean_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( boolean.class ) 6 | public final class boolean_ { 7 | private boolean_() {} 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/byte_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | 6 | @TypeAlias( byte.class ) 7 | public final class byte_ { 8 | private byte_() {} 9 | } 10 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/char_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( char.class ) 6 | public final class char_ { 7 | private char_() {} 8 | } -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/double_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( double.class ) 6 | public final class double_ { 7 | private double_() {} 8 | } -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/float_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( float.class ) 6 | public final class float_ { 7 | private float_() {} 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/int_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( int.class ) 6 | public final class int_ { 7 | private int_() {} 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/long_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( long.class ) 6 | public final class long_ { 7 | private long_() {} 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/primitives/short_.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.primitives; 2 | 3 | import net.dougqh.java.meta.types.TypeAlias; 4 | 5 | @TypeAlias( short.class ) 6 | public final class short_ { 7 | private short_() {} 8 | } 9 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/src/net/dougqh/java/meta/types/type.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types; 2 | 3 | import java.lang.reflect.ParameterizedType; 4 | import java.lang.reflect.Type; 5 | 6 | public abstract class type< T > implements JavaTypeProvider { 7 | @Override 8 | public final Type get() { 9 | ParameterizedType superType = (ParameterizedType)this.getClass().getGenericSuperclass(); 10 | return superType.getActualTypeArguments()[0]; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/test-src/net/dougqh/java/meta/types/api/JavaTypeNamesTest.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.api; 2 | 3 | import net.dougqh.java.meta.types.JavaTypeNames; 4 | 5 | import org.junit.Test; 6 | import static junit.framework.Assert.*; 7 | 8 | public final class JavaTypeNamesTest { 9 | public final @Test void fromPersistedName() { 10 | assertEquals( 11 | "java.lang.Object", 12 | JavaTypeNames.fromPeristedName( "Ljava/lang/Object;" ) ); 13 | 14 | assertEquals( 15 | "java.util.List", 16 | JavaTypeNames.fromPeristedName( "Ljava/util/List;" ) ); 17 | } 18 | 19 | public final @Test void toPersistedName() { 20 | assertEquals( 21 | "Ljava/lang/Object;", 22 | JavaTypeNames.toPersistedName( "java.lang.Object" ) ); 23 | 24 | assertEquals( 25 | "Ljava/util/List;", 26 | JavaTypeNames.toPersistedName( "java.util.List" ) ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/test-src/net/dougqh/java/meta/types/api/JavaTypeProviderTest.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.api; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.lang.reflect.Type; 6 | 7 | import net.dougqh.java.meta.types.JavaTypeProvider; 8 | import net.dougqh.java.meta.types.JavaTypes; 9 | 10 | import org.hamcrest.CoreMatchers; 11 | import org.hamcrest.Matcher; 12 | import org.junit.Test; 13 | 14 | public class JavaTypeProviderTest { 15 | @Test 16 | public final void resolve() { 17 | JavaTypeProvider intProvider = new JavaTypeProvider() { 18 | @Override 19 | public final Type get() { 20 | return int.class; 21 | } 22 | }; 23 | 24 | assertThat( JavaTypes.resolve(intProvider), is(int.class) ); 25 | } 26 | 27 | private static final Matcher is(final Type type) { 28 | return CoreMatchers.is(type); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /net.dougqh.java.meta/test-src/net/dougqh/java/meta/types/api/JavaTypesApiTestSuite.java: -------------------------------------------------------------------------------- 1 | package net.dougqh.java.meta.types.api; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | import org.junit.runners.Suite.SuiteClasses; 6 | 7 | @RunWith( Suite.class ) 8 | @SuiteClasses( { 9 | JavaTypeNamesTest.class, 10 | JavaTypesTest.class, 11 | JavaTypeBuildingTest.class, 12 | JavaTypesArrayTest.class, 13 | JavaJvmTypesTest.class, 14 | JavaTypeProviderTest.class, 15 | JavaTypePrimitivesTest.class } ) 16 | public final class JavaTypesApiTestSuite {} 17 | -------------------------------------------------------------------------------- /net.dougqh.jist/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /net.dougqh.jist/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.dougqh.jist 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /net.dougqh.jist/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Mar 07 08:51:39 EST 2013 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /net.dougqh.jist/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Mar 07 08:51:39 EST 2013 2 | eclipse.preferences.version=1 3 | pluginProject.equinox=false 4 | pluginProject.extensions=false 5 | resolve.requirebundle=false 6 | -------------------------------------------------------------------------------- /net.dougqh.jist/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Jist 4 | Bundle-SymbolicName: net.dougqh.jist 5 | Bundle-Version: 1.0.0.0 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 7 | -------------------------------------------------------------------------------- /net.dougqh.jist/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | --------------------------------------------------------------------------------