TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
flexlexer.h
Go to the documentation of this file.
1 // -*-C++-*-
2 // FlexLexer.h -- define interfaces for lexical analyzer classes generated
3 // by flex
4 
5 // Copyright (C) 1993 The Regents of the University of California.
6 // All rights reserved.
7 //
8 // This code is derived from software contributed to Berkeley by
9 // Kent Williams and Tom Epperly.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions
13 // are met:
14 
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 
21 // Neither the name of the University nor the names of its contributors
22 // may be used to endorse or promote products derived from this software
23 // without specific prior written permission.
24 
25 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
26 // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
27 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE.
29 
30 // This file defines FlexLexer, an abstract class which specifies the
31 // external interface provided to flex C++ lexer objects, and yyFlexLexer,
32 // which defines a particular lexer class.
33 //
34 // If you want to create multiple lexer classes, you use the -P flag
35 // to rename each yyFlexLexer to some other xxFlexLexer. You then
36 // include <FlexLexer.h> in your other sources once per lexer class:
37 //
38 // #undef yyFlexLexer
39 // #define yyFlexLexer xxFlexLexer
40 // #include <flexlexer.h>
41 //
42 // #undef yyFlexLexer
43 // #define yyFlexLexer zzFlexLexer
44 // #include <flexlexer.h>
45 // ...
46 
47 #ifndef __FLEX_LEXER_H
48 // Never included before - need to define base class.
49 #define __FLEX_LEXER_H
50 
51 #include <iostream>
52 # ifndef FLEX_STD
53 # define FLEX_STD std::
54 # endif
55 
56 extern "C++" {
57 
58 struct yy_buffer_state;
59 typedef int yy_state_type;
60 
61 class FlexLexer {
62 public:
63  virtual ~FlexLexer() { }
64 
65  const char* YYText() const { return yytext; }
66  int YYLeng() const { return yyleng; }
67 
68  virtual void
69  yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
70  virtual struct yy_buffer_state*
71  yy_create_buffer( FLEX_STD istream* s, int size ) = 0;
72  virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
73  virtual void yyrestart( FLEX_STD istream* s ) = 0;
74 
75  virtual int yylex() = 0;
76 
77  // Call yylex with new input/output sources.
78  int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 )
79  {
80  switch_streams( new_in, new_out );
81  return yylex();
82  }
83 
84  // Switch to new input/output streams. A nil stream pointer
85  // indicates "keep the current one".
86  virtual void switch_streams( FLEX_STD istream* new_in = 0,
87  FLEX_STD ostream* new_out = 0 ) = 0;
88 
89  int lineno() const { return yylineno; }
90 
91  int debug() const { return yy_flex_debug; }
92  void set_debug( int flag ) { yy_flex_debug = flag; }
93 
94 protected:
95  char* yytext;
96  int yyleng;
97  int yylineno; // only maintained if you use %option yylineno
98  int yy_flex_debug; // only has effect with -d or "%option debug"
99 };
100 
101 }
102 #endif // FLEXLEXER_H
103 
104 #if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
105 // Either this is the first time through (yyFlexLexerOnce not defined),
106 // or this is a repeated include to define a different flavor of
107 // yyFlexLexer, as discussed in the flex manual.
108 #define yyFlexLexerOnce
109 
110 extern "C++" {
111 
112 class yyFlexLexer : public FlexLexer {
113 public:
114  // arg_yyin and arg_yyout default to the cin and cout, but we
115  // only make that assignment when initializing in yylex().
116  yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 );
117 
118  virtual ~yyFlexLexer();
119 
120  void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
121  struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size );
122  void yy_delete_buffer( struct yy_buffer_state* b );
123  void yyrestart( FLEX_STD istream* s );
124 
125  void yypush_buffer_state( struct yy_buffer_state* new_buffer );
126  void yypop_buffer_state();
127 
128  virtual int yylex();
129  virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 );
130  virtual int yywrap();
131 
132 protected:
133  virtual int LexerInput( char* buf, int max_size );
134  virtual void LexerOutput( const char* buf, int size );
135  virtual void LexerError( const char* msg );
136 
137  void yyunput( int c, char* buf_ptr );
138  int yyinput();
139 
140  void yy_load_buffer_state();
141  void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s );
142  void yy_flush_buffer( struct yy_buffer_state* b );
143 
147 
148  void yy_push_state( int new_state );
149  void yy_pop_state();
150  int yy_top_state();
151 
154  int yy_get_next_buffer();
155 
156  FLEX_STD istream* yyin; // input source for default LexerInput
157  FLEX_STD ostream* yyout; // output sink for default LexerOutput
158 
159  // yy_hold_char holds the character lost when yytext is formed.
161 
162  // Number of characters read into yy_ch_buf.
164 
165  // Points to current character in buffer.
166  char* yy_c_buf_p;
167 
168  int yy_init; // whether we need to initialize
169  int yy_start; // start state number
170 
171  // Flag which is used to allow yywrap()'s to do buffer switches
172  // instead of setting up a fresh yyin. A bit of a hack ...
174 
175 
178  struct yy_buffer_state ** yy_buffer_stack;
179  void yyensure_buffer_stack(void);
180 
181  // The following are not always needed, but may be depending
182  // on use of certain flex features (like REJECT or yymore()).
183 
186 
189 
193 
194  int yy_lp;
196 
201 };
202 
203 }
204 
205 #endif // yyFlexLexer || ! yyFlexLexerOnce
206 
struct yy_buffer_state ** yy_buffer_stack
Stack as an array.
Definition: flexlexer.h:178
virtual void switch_streams(FLEX_STD istream *new_in, FLEX_STD ostream *new_out=0)
void yy_delete_buffer(struct yy_buffer_state *b)
virtual ~FlexLexer()
Definition: flexlexer.h:63
char * yytext
Definition: flexlexer.h:95
void yy_push_state(int new_state)
int yy_more_len
Definition: flexlexer.h:198
int yy_top_state()
int yy_full_lp
Definition: flexlexer.h:192
size_t yy_buffer_stack_top
index of top of stack.
Definition: flexlexer.h:176
size_t yy_buffer_stack_max
capacity of stack.
Definition: flexlexer.h:177
#define FLEX_STD
Definition: flexlexer.h:53
int yy_start
Definition: flexlexer.h:169
int yy_did_buffer_switch_on_eof
Definition: flexlexer.h:173
int lineno() const
Definition: flexlexer.h:89
yy_state_type yy_last_accepting_state
Definition: flexlexer.h:184
struct yy_buffer_state * yy_create_buffer(FLEX_STD istream *s, int size)
virtual int yylex()
int yy_start_stack_ptr
Definition: flexlexer.h:144
yyFlexLexer(FLEX_STD istream *arg_yyin=0, FLEX_STD ostream *arg_yyout=0)
int yy_get_next_buffer()
void yy_load_buffer_state()
yy_state_type * yy_state_ptr
Definition: flexlexer.h:188
voidpf void uLong size
Definition: ioapi.h:136
virtual void yy_delete_buffer(struct yy_buffer_state *b)=0
int yyleng
Definition: flexlexer.h:96
voidpf void * buf
Definition: ioapi.h:136
virtual void switch_streams(FLEX_STD istream *new_in=0, FLEX_STD ostream *new_out=0)=0
const char * YYText() const
Definition: flexlexer.h:65
yy_state_type yy_get_previous_state()
int YYLeng() const
Definition: flexlexer.h:66
int debug() const
Definition: flexlexer.h:91
void set_debug(int flag)
Definition: flexlexer.h:92
virtual struct yy_buffer_state * yy_create_buffer(FLEX_STD istream *s, int size)=0
int * yy_full_state
Definition: flexlexer.h:191
char * yy_last_accepting_cpos
Definition: flexlexer.h:185
virtual void LexerOutput(const char *buf, int size)
virtual void LexerError(const char *msg)
char * yy_c_buf_p
Definition: flexlexer.h:166
void yy_switch_to_buffer(struct yy_buffer_state *new_buffer)
void yyunput(int c, char *buf_ptr)
int yy_state_type
Definition: flexlexer.h:58
int yy_more_offset
Definition: flexlexer.h:199
FLEX_STD istream * yyin
Definition: flexlexer.h:156
int * yy_start_stack
Definition: flexlexer.h:146
int yy_flex_debug
Definition: flexlexer.h:98
void yy_pop_state()
int yy_n_chars
Definition: flexlexer.h:163
int yy_more_flag
Definition: flexlexer.h:197
void yyrestart(FLEX_STD istream *s)
void yy_init_buffer(struct yy_buffer_state *b, FLEX_STD istream *s)
int yy_looking_for_trail_begin
Definition: flexlexer.h:195
virtual void yy_switch_to_buffer(struct yy_buffer_state *new_buffer)=0
int yylineno
Definition: flexlexer.h:97
void yypop_buffer_state()
int yylex(FLEX_STD istream *new_in, FLEX_STD ostream *new_out=0)
Definition: flexlexer.h:78
yy_state_type * yy_state_buf
Definition: flexlexer.h:187
int yy_start_stack_depth
Definition: flexlexer.h:145
virtual void yyrestart(FLEX_STD istream *s)=0
virtual ~yyFlexLexer()
char yy_hold_char
Definition: flexlexer.h:160
virtual int yywrap()
virtual int LexerInput(char *buf, int max_size)
void yyensure_buffer_stack(void)
void yypush_buffer_state(struct yy_buffer_state *new_buffer)
void yy_flush_buffer(struct yy_buffer_state *b)
virtual int yylex()=0
char * yy_full_match
Definition: flexlexer.h:190
int yy_prev_more_offset
Definition: flexlexer.h:200
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
FLEX_STD ostream * yyout
Definition: flexlexer.h:157