parser.py: Implementing match() method