Interface CompilationContext
- All Superinterfaces:
eu.bandm.tools.lljava.live.BlockContext<CompilationContext>,eu.bandm.tools.lljava.live.CompilationContext<CompilationContext>,eu.bandm.tools.lljava.live.EnvironmentContext<CompilationContext>,eu.bandm.tools.lljava.live.InstructionsContext<CompilationContext>,eu.bandm.tools.lljava.live.InvocationContext<CompilationContext>,eu.bandm.tools.lljava.live.LabelContext,eu.bandm.tools.lljava.live.StateContext<CompilationContext>,eu.bandm.tools.lljava.live.SubMethodsContext<CompilationContext>,eu.bandm.tools.lljava.live.TracingContext,eu.bandm.tools.lljava.live.VariableContext
- All Known Implementing Classes:
LLJavaCompilationContext
The machine model for code generation is (a simplification of) the JVM. Classes that implement this interface may generate actual JVM bytecode, or translate to other target architectures transparently.
Code generation is strictly modular; the code generator for a particular fragment does not need to know how it is embedded in the code of a generated method; it is executed with this context object being focused to a particular block of sub-method code structure.
Every block is connected to its environment by typed input and output
variables. The generated code may load data from any inputs and
must store data to all outputs, respectively. It must not
use non-local control flow constructs such as return instructions or
catch blocks (there are no operations to explicitly emit such
constructs in this API). Furthermore, it should avoid throwing
exceptions.
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.bandm.tools.lljava.live.EnvironmentContext
eu.bandm.tools.lljava.live.EnvironmentContext.EnvFieldInfo<T>Nested classes/interfaces inherited from interface eu.bandm.tools.lljava.live.LabelContext
eu.bandm.tools.lljava.live.LabelContext.LabelNested classes/interfaces inherited from interface eu.bandm.tools.lljava.live.VariableContext
eu.bandm.tools.lljava.live.VariableContext.Variable -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInterfaceMethod(Class<?> interfaceType, Method interfaceMethod, Consumer<? super CompilationContext> generator) voidaddMainProcess(Process main) <C extends CompilableDataFlow>
voidaddMainSignalSource(Class<C> signalType, Class<?> valueType, String getterName, C source) voidaddNonLocalizedState(Class<?> type, Object owner, String name) voideu.bandm.tools.lljava.live.VariableContext.VariablefindLocalizableState(Class<?> type, Object owner, String name) static CompilationContextnewInstance(String componentClassName) static <T> CompilationContextnewInstance(T component) Methods inherited from interface eu.bandm.tools.lljava.live.BlockContext
block, block, endBlock, expr, expr, exprInputs, exprInputs, getInput, getInputs, getOutput, getOutput, getOutputs, hasInputs, hasOutputs, loadInput, loadOutput, self, startBlock, storeOutput, storeOutput, storeOutput, storeOutputMethods inherited from interface eu.bandm.tools.lljava.live.CompilationContext
addInterface, compileClass, eval, eval, eval, eval, getComponentClassName, getType, list, list, list, loadVarargs, loadVarargs, subtypeOracle, switchUnique, whileNonZeroMethods inherited from interface eu.bandm.tools.lljava.live.EnvironmentContext
createFactory, createFactory, findEnv, findEnvField, findEnvUnstored, getEnvFields, instantiate, instantiate, instantiateUpTo, instantiateUpTo, loadEnv, loadEnv, loadEnvField, loadEnvVariableMethods inherited from interface eu.bandm.tools.lljava.live.InstructionsContext
add, add, and, binary, binary, branch, branchIfEq, branchIfGEq, branchIfGT, branchIfLEq, branchIfLT, branchIfNegative, branchIfNEq, branchIfNonNegative, branchIfNonNull, branchIfNonPositive, branchIfNonZero, branchIfNull, branchIfPositive, branchIfZero, cmp, cmpGT, cmpLT, constant, constant, constant, constant, constant, constantNull, convertTo, div, div, dup, get, ifElse, ifElse, ifEq, ifEq, ifEq, ifGEq, ifGEq, ifGEq, ifGT, ifGT, ifGT, ifLEq, ifLEq, ifLEq, ifLT, ifLT, ifLT, ifNegative, ifNegative, ifNEq, ifNEq, ifNEq, ifNonNegative, ifNonNegative, ifNonNull, ifNonNull, ifNonPositive, ifNonPositive, ifNonZero, ifNonZero, ifNonZero, ifNull, ifNull, ifPositive, ifPositive, ifZero, ifZero, ifZero, instanceOf, invoke, isEq, isGEq, isGT, isLEq, isLT, isNegative, isNEq, isNonNegative, isNonNull, isNonPositive, isNonZero, isNull, isPositive, isZero, lazyAnd, lazyOr, length, load, load, load, load, load, load, load, loadArray, loadNull, loadPrimitive, loadThis, move, move, move, move, move, move, move, moveNull, mul, mul, neg, newArray, newInstance, nop, not, or, pop, put, query, rem, rem, return_, serve, serving, shl, shr, store, store, storeArray, sub, sub, switchUnique, throw_, ushr, xorMethods inherited from interface eu.bandm.tools.lljava.live.InvocationContext
invoke, invoke, invokeDynamic, invokeInterface, invokeSpecial, invokeStatic, invokeVirtual, newInstance, newInstanceMethods inherited from interface eu.bandm.tools.lljava.live.LabelContext
createLabel, insertMethods inherited from interface eu.bandm.tools.lljava.live.StateContext
findState, initializeState, initializeState, initializeState, initially, initially, loadState, storeState, storeStateMethods inherited from interface eu.bandm.tools.lljava.live.SubMethodsContext
endMethod, invokeSubMethod, invokeSubMethod, startMethodMethods inherited from interface eu.bandm.tools.lljava.live.TracingContext
isTracing, setTracingMethods inherited from interface eu.bandm.tools.lljava.live.VariableContext
createLocalVariable, createVirtualVariable, getParameter
-
Method Details
-
addInterfaceMethod
void addInterfaceMethod(Class<?> interfaceType, Method interfaceMethod, Consumer<? super CompilationContext> generator) -
addMainSignalSource
<C extends CompilableDataFlow> void addMainSignalSource(Class<C> signalType, Class<?> valueType, String getterName, C source) -
addMainProcess
-
newInstance
-
newInstance
-
enableLocalizedState
void enableLocalizedState() -
addNonLocalizedState
-
findLocalizableState
-