Go to the documentation of this file.00001
00002
00003
00004 import sys
00005 import rocon_uri.rule_parser as rule_parser
00006
00007 rule=['sqs ::= parms fileid ',
00008 'parms::= sep car* sep ',
00009 'sep ::= r"\S" ',
00010 'car ::= r"." ^sep ',
00011 'fileid::= r"\S"* ']
00012
00013 parms=' '.join(sys.argv[1:])
00014
00015 cmp=rp.match(rule,parms)
00016 if cmp==None:
00017 print "Error in parsing:"
00018 else:
00019 id=None
00020 try:
00021 id=open(cmp.fileid)
00022 for l in id.readlines():
00023 if l.find(cmp.car)>-1:
00024 print l[:-1]
00025 except Exception,e:
00026 print e
00027 else:
00028 if id!=None: id.close()