function main(data) {
        let tree = self.parsing.parsingAction(data); //get AST
        self.clearPanel();
        if (self.parsing.syntaxCheck(tree)) { //syntax errors
            self.check.unusedFunctions = [];
            self.typecheck.perform(tree.rootNode.child(0)); //typechecking
            self.check.unusedFunction(typecheck.typeEnv);  //check for unused functions when all functions are type checked
            self.check.duplicitCode(); //compare functions in the source file to find redundant code
            self.buildTree(); //tree view in the left panel
        }
    }
/**
     * The main controller function. Starting point of the static analysis workflow.
     * @param data - string containing source file contents
     */
The main controller function. Starting point of the static analysis workflow.
@param data - string containing source file contents
The main controller function . Starting point of the static analysis workflow . @param data - string containing source file contents
function main(data) {
        let tree = self.parsing.parsingAction(data); 
        self.clearPanel();
        if (self.parsing.syntaxCheck(tree)) { 
            self.check.unusedFunctions = [];
            self.typecheck.perform(tree.rootNode.child(0)); 
            self.check.unusedFunction(typecheck.typeEnv);  
            self.check.duplicitCode(); 
            self.buildTree(); 
        }
    }
function main ( data ) { let tree = self . parsing . parsingAction ( data ) ; self . clearPanel ( ) ; if ( self . parsing . syntaxCheck ( tree ) ) { self . check . unusedFunctions = [ ] ; self . typecheck . perform ( tree . rootNode . child ( 0 ) ) ; self . check . unusedFunction ( typecheck . typeEnv ) ; self . check . duplicitCode ( ) ; self . buildTree ( ) ; } }
The main controller function.
The main controller function .
//get AST //syntax errors //typechecking //check for unused functions when all functions are type checked //compare functions in the source file to find redundant code //tree view in the left panel