def parseInput(inputStr): cdlog(2, "Parsing build-specs...") progSpec.saveTextToErrFile(inputStr) try: localResults = progSpecParser.parseString(inputStr, parseAll=True) except ParseBaseException as pe: cdErr("While parsing: {}".format(pe)) return localResults
def AddToObjectFromText(ProgSpec, clsNames, inputStr, description): macroDefs = {} # This var is not used here. If needed, make it an argument. inputStr = comment_remover(inputStr) #print '####################\n',inputStr, "\n######################^\n\n\n" errLevl=logLvl(); cdlog(errLevl, 'Parsing: '+description) progSpec.saveTextToErrFile(inputStr) # (map of classes, array of objectNames, string to parse) try: results = objectList.parseString(inputStr, parseAll = True) except ParseException , pe: cdErr( "Error parsing generated class {}: {}".format(description, pe))
def parseCodeDogLibTags(inputString): tmpMacroDefs={} inputString = comment_remover(inputString) extractMacroDefs(tmpMacroDefs, inputString) inputString = doMacroSubstitutions(tmpMacroDefs, inputString) progSpec.saveTextToErrFile(inputString) try: localResults = libTagParser.parseString(inputString, parseAll = False) except ParseException , pe: cdErr( "Error parsing lib tags: {}".format( pe))