c70d7e31bbb8b2d2eb5c36210e89316db2b82d03
[fw/sdcc] / sim / ucsim / cmd.src / cmdlexcl.h
1 #ifndef CMDLEXCL_HEADER
2 #define CMDLEXCL_HEADER
3
4 //#ifndef __FLEX_LEXER_H
5 //#include <FlexLexer.h>
6 //#endif
7 #include "flex_lexer.h"
8
9 #include "pobjcl.h"
10
11
12 class cl_ucsim_lexer: public yyFlexLexer
13 {
14 protected:
15   char *string_to_parse;
16   char *string_ptr;
17 public:
18   cl_ucsim_lexer(void): yyFlexLexer()
19   {
20     string_to_parse= string_ptr= 0;
21   }
22   cl_ucsim_lexer(char *str): yyFlexLexer()
23   {
24     string_to_parse= string_ptr= strdup(str);
25   }
26   virtual ~cl_ucsim_lexer(void)
27   {
28     if (string_to_parse)
29       {
30         free(string_to_parse);
31         string_to_parse= 0;
32       }
33   }
34   void activate_lexer_to_parse_into(void *yylv);
35 protected:
36   int LexerInput(char *buf, int max_size);
37 public:
38   int check_id(char *token);
39 };
40
41
42 #endif