code: func (s *Scanner) Lex(v *yySymType) int {
  	tok, pos, lit := s.scan()
  	v.offset = pos.Offset
  	v.ident = lit
  	if tok == identifier {
  		tok = handleIdent(v)
  	}
  	if tok == identifier {
  		if tok1 := isTokenIdentifier(lit, &s.buf); tok1 != 0 {
  			tok = tok1
  		}
  	}
  
  	switch tok {
  	case intLit:
  		return toInt(s, v, lit)
  	case floatLit:
  		return toFloat(s, v, lit)
  	case decLit:
  		return toDecimal(s, v, lit)
  	case hexLit:
  		return toHex(s, v, lit)
  	case bitLit:
  		return toBit(s, v, lit)
  	case userVar, sysVar, cast, curDate, extract:
  		v.item = lit
  		return tok
  	case null:
  		v.item = nil
  	case quotedIdentifier:
  		tok = identifier
  	}
  	if tok == unicode.ReplacementChar && s.r.eof() {
  		return 0
  	}
  	return tok
  }
docs: // Lex returns a token and store the token value in v.
  // Scanner satisfies yyLexer interface.
  // 0 and invalid are special token id this function would return:
  // return 0 tells parser that scanner meets EOF,
  // return invalid tells parser that scanner meets illegal character.