Реализовал парсер очистки и построения решения

This commit is contained in:
rzaitov 2013-10-31 14:17:36 +04:00
parent 6e1ec01a13
commit 5f3edd5f00
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,31 @@
from parser.LineParser import LineParser
import re
class CleanBuildParser(LineParser):
def __init__(self, commandToken):
assert commandToken is not None
self.__commandToken = commandToken
def parseLine(self, line):
assert line is not None
filePathRegexp = r"'(?P<path>[./ a-zA-Z]+\.sln)'"
slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'$"
regexpSource = self.startsWithKeywordToken(self.__commandToken) + filePathRegexp + self.keywordToken('for') + slnConfigRegexp
regexp = re.compile(regexpSource, re.UNICODE)
match = regexp.match(line)
self._guardMatch(match, line, regexpSource)
path = match.group('path')
slnConfig = match.group('config')
return (path, slnConfig)
def isValidLine(self, line):
assert line is not None
isValid = line.startswith(self.__commandToken)
return isValid

View File

@ -0,0 +1 @@
__author__ = 'rzaitov'