Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)
getSymbol()
    

        def getSymbol (key):
    """getSymbol()
    """
    if bisonSymbols.has_key(key):
	return bisonSymbols[key]
    newSymbol = BisonSymbols()
    newSymbol.tag = key[:]
    newSymbol.klass = SUNKNOWN
    bisonSymbols[key] = newSymbol
    return newSymbol
        


src/m/y/mython-HEAD/basil/parsing/BisonParser.py   mython(Download)
	self.startVal = None
	self.productions = []
	errtoken = BisonSymbols.getSymbol("error")
	errtoken.klass = BisonSymbols.STOKEN
	errtoken.userTokenNumber = 256
	undeftoken = BisonSymbols.getSymbol("$undefined")
	self.genSymCount = self.genSymCount + 1
	tokenName = '@%d' % self.genSymCount
	sym = BisonSymbols.getSymbol(tokenName)
	sym.klass = BisonSymbols.SNTERM
	sym.value = self.nVars

src/m/y/mython-HEAD/basil/parsing/BisonLexor.py   mython(Download)
	    self.ungetc()
	    self.strval = tokenBuf
	    self.symval = BisonSymbols.getSymbol(tokenBuf)
	    return IDENTIFIER
	elif c in string.digits:
			break
	    self.strval = "'" + tokenBuf + "'"
	    self.symval = BisonSymbols.getSymbol(self.strval)
	    self.symval.klass = BisonSymbols.STOKEN
	    if self.symval.userTokenNumber == None:
		    break
	    self.strval = tokenBuf
	    self.symval = BisonSymbols.getSymbol(tokenBuf)
	    self.symval.klass = BisonSymbols.STOKEN
	    return IDENTIFIER