|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object codesimian.CS<CSGeneric> codesimian.DefaultCS codesimian.CompileAndExecInnerCsFile
public class CompileAndExecInnerCsFile
gets the bytes of an inner file, compiles it,
then pretends to be the compiled output forever.
WARNING: If you write code containing a compileAndExecInnerCsFile,
compile it, and convert it back to code,
the second code will be bigger than the first because it contains the
old file contents instead of dynamicly loading it by file name.
TODO: build a GUI wrapper to solve this problem...
This code does not work:
window(compileAndExecInnerCsFile('cs/anyfileofnonwindowjavaawtcomponent.cs'))
It doesnt work because the window gets the java.awt.Component value
of the compileAndExecInnerCsFile before the string filename is added to it.
Therefore compileAndExecInnerCsFile should immediately return an empty wrapper
and fill in the wrapper exactly when the filename is given,
but that has the problem of maybe the filename's chars arent all there yet.
Its a repeat of the same problem. However if its an S object,
the compiler hack of creating it all at once is used.
I dont want to depend on hacks. Find a simpler way to make the following code work:
window(compileAndExecInnerCsFile('cs/anyfileofnonwindowjavaawtcomponent.cs'))
I could check each filename as the filename is built 1 letter at a time
to see if each is a valid inner file name, but that has the problem
of shorter filenames possibly being a subset of longer filenames,
and the problem of requiring a listener be added to the filename object,
and listeners are not part of codesimians current design,
but it can be hacked through the PROXY objects.
Field Summary | |
---|---|
static java.lang.String |
fileNameSuffix
|
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Constructor Summary | |
---|---|
CompileAndExecInnerCsFile()
|
Method Summary | |
---|---|
java.lang.String |
description()
a short description of this CS, shorter than the javadoc, but long enough to tell what the params are for. |
double |
DForProxy()
Execute this CS and cast to double. |
static CS |
getAndCompileInternalCsFile(java.lang.String internalFileName,
CS compiler)
returns null if file not found or code cant be compiled. |
java.lang.String |
keyword()
For the CodeSimian language as a String. CodeSimian language keyword, like "+" "*" "max" ">" etc. Override this function if you want to specify a keyword other than how I derive them from the class name, like + for Add. Some CSs might never be intended to be used in the language by their keyword. The best example (4/05) is Num, because it is used in the language like "3.4" instead of "num()". |
java.lang.Object |
LForProxy(java.lang.Class type)
the default implementation can use many Class parameters. |
int |
maxP()
Maximum quantity of Params |
int |
minP()
For DForProxy(). Minimum number of parameters in param[] needed to call DForProxy(). Defines which indexs of param[] DForProxy() can use. Functions with a different number of parameters must override this. OVERRIDE THIS FUNCTION IF EXEC USES A DIFFERENT NUMBER OF PARAMETERS. Default is 1. |
static CS |
newInitializedFunction(CS parametersAndFunctionBody,
int parameterQuantity)
Example: newInitializedFunction( codesimian code: +(2#two 3#three 4#four three), 2 ) 2#two and both 3#threes are replaced, and the + becomes the function body. |
CS |
P(int index)
WARNING: if add CSs then delete them, they are still in the param[] array and can be returned in this function, despite them being out of valid range: index at least countP(). |
Methods inherited from class codesimian.DefaultCS |
---|
B, C, countP, decrementMyFuel, deleteP, F, fuel, getExec, getObject, heap, I, indexP, indexPName, insertB, insertC, insertD, insertF, insertI, insertJ, insertL, insertL, insertL1, insertP, insertS, insertZ, J, javaCode, LForProxy, myFuel, name, newInstance, objectToCS, objectToCSArray, objectToCSArray, prevD, prevL, PType, S, setB, setC, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, setObject, setP, setPrevExec, setPType, setS, setZ, start, toString, V, Z |
Methods inherited from class codesimian.CS |
---|
addB, addC, addD, addF, addI, addJ, addL, addP, addP, addP, addP, addP, addS, addZ, BForProxy, CForProxy, clone, cost, D, deleteP, FForProxy, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, GETS, GETZ, IForProxy, isIllusion, JForProxy, L, L, L, L, L, maxD, minD, overwrites, parent, parsePriority, PB, PC, PD, PF, PI, PJ, PL, prevB, prevC, prevF, prevI, prevJ, prevS, prevZ, proxyOf, PS, PZ, reflect, reflect, reflect6, setB, SETB, setC, SETC, setCost, SETD, setDescription, setF, SETF, setHeap, setI, SETI, setJ, SETJ, SETL, setL, setL, setParent, setParsePriority, setProxyOf, setS, SETS, setTester, setZ, SETZ, SForProxy, tester, toJavaCode, VForProxy, voidReflect, ZForProxy |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String fileNameSuffix
Constructor Detail |
---|
public CompileAndExecInnerCsFile()
Method Detail |
---|
public double DForProxy()
CS
DForProxy
in class DefaultCS
public java.lang.Object LForProxy(java.lang.Class type)
DefaultCS
LForProxy
in class DefaultCS
execProxy()
,
setExecProxy(CS)
public CS P(int index)
DefaultCS
P
in class DefaultCS
index
- range 0 (or neg?) to countP()-1 inclusiveCS.heap()
public java.lang.String keyword()
DefaultCS
keyword
in class DefaultCS
CS.parent()
,
CS.newInstance()
,
CS.name()
public static CS getAndCompileInternalCsFile(java.lang.String internalFileName, CS compiler) throws CodesimianCompileException
CodesimianCompileException
public static CS newInitializedFunction(CS parametersAndFunctionBody, int parameterQuantity)
public int minP()
DefaultCS
minP
in class DefaultCS
public int maxP()
CS
maxP
in class CS
public java.lang.String description()
CS
description
in class DefaultCS
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |