Removed old VTReeNode commented-out code
This commit is contained in:
parent
60b97f90aa
commit
12087b8fdf
|
@ -493,176 +493,7 @@ public final class TypeChecker
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* Checks all TypedEntity(s) (so Variables and Functions)
|
||||
* such that their types (variable type/return type) are
|
||||
* valid type names
|
||||
*
|
||||
* This is called on a Container
|
||||
*
|
||||
* TODO: Should we also do expression parsing or rather do another call for that
|
||||
* mmmmh
|
||||
*/
|
||||
// private VTreeNode currentNode;
|
||||
// private void checkTypedEntitiesTypeNames(Container c)
|
||||
// {
|
||||
// /* This VTreeNode */
|
||||
// VTreeNode thisNode;
|
||||
|
||||
// if(c == modulle)
|
||||
// {
|
||||
// thisNode = root;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* Create a VTreeNode for this Statement */
|
||||
// assert(cast(Statement)c);
|
||||
// thisNode = new VTreeNode(cast(Statement)c);
|
||||
|
||||
// gprintln("dsdf");
|
||||
|
||||
// /* Get my parent's VTreeNode */
|
||||
// /* TODO: This parent of, ah we should make functions be containers, like we gonna need that for constutcor processing etc, and fucntions, mutual recursion there too */
|
||||
// Statement cS = cast(Statement)c;
|
||||
// VTreeNode parentNode = hasVisited(cast(Statement)cS.parentOf());
|
||||
|
||||
// gprintln("dsdf");
|
||||
// gprintln(parentNode);
|
||||
// gprintln(c);
|
||||
|
||||
// /* TODO: My grand resolver fuuuuck the parent is not in da tree */
|
||||
// /* TODO: Static classes moment */
|
||||
|
||||
// /* TODO: We should do this recursively rather, because we exit it is fine technically so the tree will be valid */
|
||||
|
||||
// /* Child-self to parent VTreeNode */
|
||||
// parentNode.addChild(thisNode);
|
||||
// gprintln("dsdf");
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// TypedEntity[] typedEntities;
|
||||
|
||||
// foreach (Statement statement; c.getStatements())
|
||||
// {
|
||||
// if (statement !is null && cast(TypedEntity) statement)
|
||||
// {
|
||||
// typedEntities ~= cast(TypedEntity) statement;
|
||||
// }
|
||||
// }
|
||||
|
||||
// /* Attempt to resolve the types of the variables */
|
||||
// foreach(TypedEntity typedEntity; typedEntities)
|
||||
// {
|
||||
// /* TypedEntity's type */
|
||||
// string typeString = typedEntity.getType();
|
||||
|
||||
// /* TODO: Resolve type here (either built-in or class type) */
|
||||
// Type type = getType(c, typeString);
|
||||
|
||||
// /* Make sure type is valid */
|
||||
// if(!type)
|
||||
// {
|
||||
// Parser.expect("Invalid type \""~typeString~"\"");
|
||||
// }
|
||||
|
||||
// gprintln("Type: "~to!(string)(type));
|
||||
|
||||
|
||||
// /* TODO: Visit it (mark it as such) */
|
||||
// VTreeNode thisEntity = new VTreeNode(typedEntity);
|
||||
|
||||
|
||||
|
||||
// /* TODO: Check type here */
|
||||
|
||||
// /* If it is primitive then no further checking */
|
||||
// if(cast(Number)type)
|
||||
// {
|
||||
// /* TODO: Mark it as ready-for-reference */
|
||||
|
||||
// /* TODO: Expression checking */
|
||||
// thisNode.addChild(thisEntity);
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* If it is a Class type */
|
||||
// if(cast(Clazz)type)
|
||||
// {
|
||||
// Clazz clazzType = cast(Clazz)type;
|
||||
|
||||
// /* TODO: Check constructor */
|
||||
|
||||
// /* TODO: We need to start marking things */
|
||||
// /* TODO: Do actual checks here now */
|
||||
|
||||
// /* TODO: If the type is of the current class we are in then it is fine? */
|
||||
// if(clazzType == c)
|
||||
// {
|
||||
// gprintln("Container we are in matches type of TypedEdntity being processed");
|
||||
|
||||
// /* TODO: In that case mark the entity as fine */
|
||||
// thisNode.addChild(thisEntity);
|
||||
// // clazzType.mark();
|
||||
// }
|
||||
// /* If the type is visited already (good for rwcuasiev case mutal class references) */
|
||||
// else if(hasVisited(clazzType))
|
||||
// {
|
||||
// /* TODO: This could actually solve the abive too? */
|
||||
// /* This is basically saying the TypedEntity's type is a CLass that has been visited so we can assume it is safe to add */
|
||||
// /* We don't wanna visit it again (as stackoevrflow) from mutaul recursion then */
|
||||
// thisNode.addChild(thisEntity);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* TODO: Also make it fine? mmuutal recusive refernce */
|
||||
// /* TODO: Got it, we NEED a dependency tree, to know chihs is being processed previosuly */
|
||||
|
||||
// /* TODO: Now check this class and follow it's path */
|
||||
// checkClass(clazzType);
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// // /**
|
||||
// // * Get all classes
|
||||
// // */
|
||||
// // Clazz[] classes;
|
||||
// // foreach (Statement statement; c.getStatements())
|
||||
// // {
|
||||
// // if (statement !is null && cast(Clazz) statement)
|
||||
// // {
|
||||
// // classes ~= cast(Clazz) statement;
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // /**
|
||||
// // * TODO: Here I am testing on dependeny constrtuction
|
||||
// // * 1. Only for classes
|
||||
// // * 2. Only for their static member (assignment is assumed not to happen)
|
||||
// // */
|
||||
// // foreach(Clazz currentClass; classes)
|
||||
// // {
|
||||
// // gprintln("DependencyConstruction: Class Container found '"~to!(string)(currentClass)~"'");
|
||||
|
||||
// // /* Mark this as reliant on modulle (then) */
|
||||
|
||||
// // /* Check recursively */
|
||||
// // checkClass_DepTest(currentClass);
|
||||
// // }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue