codesimian
Class Compile.Symbol

java.lang.Object
  extended by codesimian.CS
      extended by codesimian.IndependentCS
          extended by codesimian.Compile.Symbol
All Implemented Interfaces:
CodeSimian
Enclosing class:
Compile

Deprecated.

public static class Compile.Symbol
extends IndependentCS

ERROR: Symbol doesnt instantiate correctly, probably in CSFactory.

represents a hard-coded SYMBOL type in CodeSimian code.
Currently 2/06 there are only 3 symbols: # ( )
Its best to keep the language simple, so software can later understand its own code.


Field Summary
 java.lang.String keyword
          Deprecated.  
 char symbol
          Deprecated.  
 
Fields inherited from class codesimian.CS
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS
 
Constructor Summary
Compile.Symbol(char symbol, java.lang.String keyword)
          Deprecated.  
 
Method Summary
 double DForProxy()
          Deprecated. Execute this CS and cast to double.
 java.lang.String keyword()
          Deprecated. Returns the keyword of this CS or (after more code is finished) returns parent().name();

Keyword() needs to be removed.
 int minP()
          Deprecated. Minimum quantity of Params.
 CS newInstance()
          Deprecated. The primary way to instantiate subclasses of CS.
 
Methods inherited from class codesimian.IndependentCS
B, BForProxy, C, CForProxy, countP, D, decrementMyFuel, deleteP, description, F, FForProxy, fuel, getExec, heap, I, IForProxy, insertD, insertL, insertL, insertL1, insertP, J, JForProxy, L, L, LForProxy, LForProxy, maxP, myFuel, name, P, parent, prevD, prevL, PType, S, setD, setD, setFuel, setL, setL, setL, setL1, setMyFuel, setP, setPrevExec, SForProxy, toString, V, VForProxy, Z, ZForProxy
 
Methods inherited from class codesimian.CS
addB, addC, addD, addF, addI, addJ, addL, addP, addP, addP, addP, addP, addS, addZ, clone, cost, deleteP, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, getObject, GETS, GETZ, indexP, indexPName, insertB, insertC, insertF, insertI, insertJ, insertS, insertZ, isIllusion, L, L, L, maxD, minD, overwrites, parsePriority, PB, PC, PD, PF, PI, PJ, PL, prevB, prevC, prevF, prevI, prevJ, prevS, prevZ, proxyOf, PS, PZ, reflect, reflect, reflect6, setB, SETB, setB, setC, SETC, setC, setCost, SETD, setDescription, setExec, setF, SETF, setF, setHeap, setI, SETI, setI, setJ, setJ, SETJ, SETL, setL, setL, setName, setObject, setParent, setParsePriority, setProxyOf, setPType, setS, setS, SETS, setTester, setZ, SETZ, setZ, tester, toJavaCode, voidReflect
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

symbol

public final char symbol
Deprecated. 

keyword

public final java.lang.String keyword
Deprecated. 
Constructor Detail

Compile.Symbol

public Compile.Symbol(char symbol,
                      java.lang.String keyword)
Deprecated. 
Method Detail

minP

public int minP()
Deprecated. 
Description copied from class: CS
Minimum quantity of Params. countP() may be below minP() only a short time during compiling, and you must not EXECUTE this CS during that time or you risk an error. TODO: 9/07 that has become a problem with some classes like S, which calls x.C() when x is added, but x may have been added during compiling when x.countP() < x.minP().

Overrides:
minP in class IndependentCS

DForProxy

public double DForProxy()
Deprecated. 
Description copied from class: CS
Execute this CS and cast to double.

D() and DForProxy() are the 2 most important functions in CS. They execute this CS. All other execute functions, by default, return DForProxy cast to their own type.

For example, J() calls the proxy which calls JForProxy() which calls DForProxy(). D() calls the proxy which calls DForProxy().

By default, all other primitive EXECUTE functions defer to D.
Functions that EXECUTE this CS: L(Class) L(int,Class,int) Z() B() C() S() I() J() F() D() V()

Overrides:
DForProxy in class IndependentCS

keyword

public java.lang.String keyword()
Deprecated. 
Description copied from class: CS
Returns the keyword of this CS or (after more code is finished) returns parent().name();

Keyword() needs to be removed. Keyword() can only be removed from CS.java when the primary way to instantiate the default CS types is by using newInstance() on one of the CSs in a list of default CSs.

When you instantiate someCS with someCS.parent().newInstance(), someCS.keyword() can be replaced by someCS.parent().name().

keyword() appears in the code hundreds of times. Be careful when refactoring it out.

There is intentionally no setKeyword(String) in this interface. Dont add it.

Overrides:
keyword in class IndependentCS
See Also:
CS.parent(), CS.newInstance(), CS.name()

newInstance

public CS newInstance()
Deprecated. 
Description copied from class: CS
The primary way to instantiate subclasses of CS. CodeSimian is partially a PROTOTYPE LANGUAGE.

Copies the INSTANCE CS and pointers to its childs.
anyCS.P(2) == anyCS.newInstance().P(2)


anyCS.getClass() and anyCS.newInstance().getClass() do not have to share any ancestor class except CS.class. Classes that use artificial-intelligence may choose to return a different class type to improve themselves, but that class type should try to BEHAVE SIMILARLY and must have the SAME childs when newInstance() returns it.

If a subclass is uses variables in a strange way, it may need to override newInstance() to copy them.

Returns a new CS instance of this "type". This has the same name and purpose as java.lang.Class.newInstance().

Its vague. Subclasses of CS that have trees or networks of objects that the CS depends on might need to copy the whole tree etc, or might use the same tree, or only copy the root etc. Example: the Function class might need to override newInstance() differently.

Overrides:
newInstance in class IndependentCS