~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

Modernize our call to the parser, no more casting required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
using namespace std;
38
38
 
39
39
/* Stay outside of the namespace because otherwise bison goes nuts */
40
 
int base_sql_lex(void *arg, void *yysession);
 
40
int base_sql_lex(void *arg, drizzled::Session *yysession);
41
41
 
42
42
namespace drizzled
43
43
{
44
44
 
45
 
static int lex_one_token(void *arg, void *yysession);
 
45
static int lex_one_token(void *arg, drizzled::Session *yysession);
46
46
 
47
47
/**
48
48
  save order by and tables in own lists.
607
607
  - MY_LEX_OPERATOR_OR_IDENT    Last state was an ident, text or number
608
608
                                (which can't be followed by a signed number)
609
609
*/
610
 
int base_sql_lex(void *arg, void *yysession)
 
610
int base_sql_lex(void *arg, drizzled::Session *session)
611
611
{
612
 
  drizzled::Session *session= (drizzled::Session *)yysession;
613
612
  drizzled::Lex_input_stream *lip= session->m_lip;
614
613
  YYSTYPE *yylval=(YYSTYPE*) arg;
615
614
  int token;
627
626
    return token;
628
627
  }
629
628
 
630
 
  token= drizzled::lex_one_token(arg, yysession);
 
629
  token= drizzled::lex_one_token(arg, session);
631
630
 
632
631
  switch(token) {
633
632
  case WITH:
638
637
      to transform the grammar into a LALR(1) grammar,
639
638
      which sql_yacc.yy can process.
640
639
    */
641
 
    token= drizzled::lex_one_token(arg, yysession);
 
640
    token= drizzled::lex_one_token(arg, session);
642
641
    if (token == ROLLUP_SYM)
643
642
    {
644
643
      return WITH_ROLLUP_SYM;
663
662
namespace drizzled
664
663
{
665
664
 
666
 
int lex_one_token(void *arg, void *yysession)
 
665
int lex_one_token(void *arg, drizzled::Session *session)
667
666
{
668
667
  register unsigned char c= 0; /* Just set to shutup GCC */
669
668
  bool comment_closed;
670
669
  int   tokval, result_state;
671
670
  unsigned int length;
672
671
  enum my_lex_states state;
673
 
  Session *session= (Session *)yysession;
674
672
  Lex_input_stream *lip= session->m_lip;
675
673
  LEX *lex= session->lex;
676
674
  YYSTYPE *yylval=(YYSTYPE*) arg;