def insert(self, ParentToken, ExpectedText=None, ExpectedType=None, ChildTokenType=None):
		if(ChildTokenType == None):
			ChildToken=self.token()
		else:
			ChildToken=Token(ChildTokenType)
		
		ChildToken.Subroutine=self.CurrentSubroutine
		ChildToken.Class=self.CurrentClass

		if(ExpectedText != None and ChildToken.text() != None):
			if(ExpectedText != ChildToken.text()):
				try:
					raise Exception("Error parsing!  Expected: '"+ExpectedText+"'.  Received: '"+ChildToken.text()+"'.\n")
				except Exception, err:
					sys.stderr.write(str(err))
					return
Exemplo n.º 2
0
    def insert(self,
               ParentToken,
               ExpectedText=None,
               ExpectedType=None,
               ChildTokenType=None):
        if (ChildTokenType == None):
            ChildToken = self.token()
        else:
            ChildToken = Token(ChildTokenType)

        ChildToken.Subroutine = self.CurrentSubroutine
        ChildToken.Class = self.CurrentClass

        if (ExpectedText != None and ChildToken.text() != None):
            if (ExpectedText != ChildToken.text()):
                try:
                    raise Exception("Error parsing!  Expected: '" +
                                    ExpectedText + "'.  Received: '" +
                                    ChildToken.text() + "'.\n")
                except Exception, err:
                    sys.stderr.write(str(err))
                    return