# Path: progSpec.py
# def cdlog(lvl, mesg):
#     global MaxLogLevelToShow
#     global lastLogMesgs
#     global highestLvl
#     highestLvl=lvl
#     resizeLogArray(lvl)
#     lastLogMesgs[lvl]=mesg
#     for i in range(highestLvl+1, len(lastLogMesgs)):
#         lastLogMesgs[i]=''
#     if(lvl<=MaxLogLevelToShow):
#         if(lvl==0): print('')
#         printAtLvl(lvl, mesg, '|    ')
# 
# def cdErr(mesg):
#     global lastLogMesgs
#     global highestLvl
#     highestLvl+=1
#     lastLogMesgs[highestLvl]="\n\nError: "+mesg
#     exit(1)


from inspect import getsourcefile
from os.path import abspath
from pprint import pprint
from progSpec import cdlog, cdErr
from pyparsing import ParseResults
import os
import re
import codeDogParser
import progSpec

    for libPath in libPaths:
        if isinstance(feature, ParseResults) and len(feature)==1:
            feature = feature[0]
        if os.path.basename(libPath) == feature+".Lib.dog":
            return libPath
    return ""

def findLibraryChildren(libID):
    """Given a lib prefix string (ie. Logger) return list of paths to children
    LIB files (ie. Logger.CPP.Lib.dog, Logger.Android.Lib.dog)"""
    libs=[]
    for item in libPaths:
        itemBaseName = os.path.basename(item)
        if(itemBaseName.endswith('Lib.dog') and itemBaseName.startswith(libID)):
            innerName = itemBaseName[len(libID)+1:-8]
            if (innerName != '' and innerName.find('.')==-1):
                libs.append(item)
    return libs

def replaceFileName(fileMatch):
    global currentFilesPath
    fileName = fileMatch.group(1)
    currentWD = os.getcwd()
    pathName = abspath(currentWD) +"/"+fileName
    if not os.path.isfile(pathName):
        dirname, filename = os.path.split(abspath(getsourcefile(lambda:0)))
        pathName = dirname +"/"+fileName
        if not os.path.isfile(pathName):
            pathName = currentFilesPath +"/"+fileName

# Path: progSpec.py
# def cdlog(lvl, mesg):
#     global MaxLogLevelToShow
#     global lastLogMesgs
#     global highestLvl
#     highestLvl=lvl
#     resizeLogArray(lvl)
#     lastLogMesgs[lvl]=mesg
#     for i in range(highestLvl+1, len(lastLogMesgs)):
#         lastLogMesgs[i]=''
#     if(lvl<=MaxLogLevelToShow):
#         if(lvl==0): print('')
#         printAtLvl(lvl, mesg, '|    ')
# 
# def cdErr(mesg):
#     global lastLogMesgs
#     global highestLvl
#     highestLvl+=1
#     lastLogMesgs[highestLvl]="\n\nError: "+mesg
#     exit(1)


# Path: libraryMngr.py
from inspect import getsourcefile
from os.path import abspath
from pprint import pprint
from progSpec import cdlog, cdErr
from pyparsing import ParseResults
import os
import re
import codeDogParser
import progSpec


    for libPath in libPaths:
        if isinstance(feature, ParseResults) and len(feature)==1:
            feature = feature[0]
        if os.path.basename(libPath) == feature+".Lib.dog":
            return libPath
    return ""

def findLibraryChildren(libID):
    """Given a lib prefix string (ie. Logger) return list of paths to children
    LIB files (ie. Logger.CPP.Lib.dog, Logger.Android.Lib.dog)"""
    libs=[]
    for item in libPaths:
        itemBaseName = os.path.basename(item)
        if(itemBaseName.endswith('Lib.dog') and itemBaseName.startswith(libID)):
            innerName = itemBaseName[len(libID)+1:-8]
            if (innerName != '' and innerName.find('.')==-1):
                libs.append(item)
    return libs

def replaceFileName(fileMatch):
    global currentFilesPath
    fileName = fileMatch.group(1)
    currentWD = os.getcwd()
    pathName = abspath(currentWD) +"/"+fileName
    if not os.path.isfile(pathName):
        dirname, filename = os.path.split(abspath(getsourcefile(lambda:0)))
        pathName = dirname +"/"+fileName
        if not os.path.isfile(pathName):
            pathName = currentFilesPath +"/"+fileName

            if not os.path.isfile(pathName):