public String methodLLParser(){
        //this.displayTokenStack();
        do{
            //System.out.println("input stack top: "+tokens.peek().getToken());
            //System.out.println("productions: "+productions+"\n\n");
            try{
                if(!tokens.peek().getToken().equals(productions.peek())){
                    if(productions.peek().equals("epsilon")){            // Peek of production stack is epsilon
                        adjustTreePtr();
                        productions.pop();
                    } else{                                              
                        if(lookUpTable.isTerminal(productions.peek())){  // Peek of both stacks are terminals and dont match
                            errorDetected = true;
                            errorMessage = "Error found while parsing "+tokens.peek().getToken();
                        } else{                                          // Peek of both stacks dont match and there is a production
                            errorDetected = splitProductionTop();
                        }
                    }
                } else {                                                // Peek of input stack is terminal and matches production stack
                    adjustTreePtr();
                    tokens.pop();
                    productions.pop();
                }
            }catch(EmptyStackException ex){ 
                errorDetected = true;
                errorMessage = "Error found while parsing code";
            }
        }while(errorDetected == false && !tokens.empty());

        if(tokens.empty() && !productions.empty()){
            errorMessage = "Error found while parsing code.";
        } else if(errorDetected == false){
            errorMessage = "Syntax check - Success!";
        }        
        
        return errorMessage;
    }