~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
/* A lexical scanner on a temporary buffer with a yacc interface */
18
18
 
 
19
#include "config.h"
19
20
#define DRIZZLE_LEX 1
20
 
#include "config.h"
21
21
#include "drizzled/configmake.h"
22
22
#include "drizzled/item/num.h"
23
23
#include "drizzled/error.h"
30
30
 
31
31
using namespace std;
32
32
 
 
33
/* Stay outside of the namespace because otherwise bison goes nuts */
 
34
int DRIZZLElex(void *arg, void *yysession);
 
35
 
 
36
namespace drizzled
 
37
{
 
38
 
33
39
static int lex_one_token(void *arg, void *yysession);
34
 
int DRIZZLElex(void *arg, void *yysession);
35
40
 
36
41
/**
37
42
  save order by and tables in own lists.
572
577
  return ((unsigned char) str[-1] <= (unsigned char) cmp[-1]) ? smaller : bigger;
573
578
}
574
579
 
 
580
} /* namespace drizzled */
575
581
/*
576
582
  DRIZZLElex remember the following states from the following DRIZZLElex()
577
583
 
581
587
*/
582
588
int DRIZZLElex(void *arg, void *yysession)
583
589
{
584
 
  Session *session= (Session *)yysession;
585
 
  Lex_input_stream *lip= session->m_lip;
 
590
  drizzled::Session *session= (drizzled::Session *)yysession;
 
591
  drizzled::Lex_input_stream *lip= session->m_lip;
586
592
  YYSTYPE *yylval=(YYSTYPE*) arg;
587
593
  int token;
588
594
 
599
605
    return token;
600
606
  }
601
607
 
602
 
  token= lex_one_token(arg, yysession);
 
608
  token= drizzled::lex_one_token(arg, yysession);
603
609
 
604
610
  switch(token) {
605
611
  case WITH:
610
616
      to transform the grammar into a LALR(1) grammar,
611
617
      which sql_yacc.yy can process.
612
618
    */
613
 
    token= lex_one_token(arg, yysession);
 
619
    token= drizzled::lex_one_token(arg, yysession);
614
620
    if (token == ROLLUP_SYM)
615
621
    {
616
622
      return WITH_ROLLUP_SYM;
632
638
  return token;
633
639
}
634
640
 
 
641
namespace drizzled
 
642
{
 
643
 
635
644
int lex_one_token(void *arg, void *yysession)
636
645
{
637
646
  register unsigned char c= 0; /* Just set to shutup GCC */
2172
2181
                                            current_index_hint_clause,
2173
2182
                                            str, length));
2174
2183
}
 
2184
 
 
2185
} /* namespace drizzled */