2014-02-11 05:42:59 -08:00
|
|
|
#ifndef __EO_TOKENIZER_H__
|
|
|
|
#define __EO_TOKENIZER_H__
|
|
|
|
|
|
|
|
#include <Eina.h>
|
2014-02-17 04:05:52 -08:00
|
|
|
#include <Eolian.h>
|
2014-02-11 05:42:59 -08:00
|
|
|
#include "eo_definitions.h"
|
|
|
|
|
|
|
|
/* TOKENIZER */
|
|
|
|
|
2014-03-18 07:44:38 -07:00
|
|
|
#define BUFSIZE 256*1024
|
2014-02-11 05:42:59 -08:00
|
|
|
|
|
|
|
typedef struct _eo_tokenizer
|
|
|
|
{
|
|
|
|
/* ragel vars */
|
|
|
|
int cs; /* current machine state */
|
|
|
|
int act; /* last pattern matched */
|
|
|
|
char *ts; /* current token match start */
|
|
|
|
char *te; /* current token match end */
|
|
|
|
char *p; /* data start */
|
|
|
|
char *pe; /* data end */
|
|
|
|
char *eof; /* eof = (EOF ? pe : NULL) */
|
|
|
|
/* int stack[10]; /1* state stack used by fret fcall ... *1/ */
|
|
|
|
/* int top; /1* stack pointer *1/ */
|
|
|
|
|
|
|
|
const char *source;
|
|
|
|
int current_line;
|
|
|
|
int current_nesting;
|
|
|
|
int max_nesting;
|
|
|
|
Eo_Method_Type current_methods_type;
|
|
|
|
char buf[BUFSIZE];
|
|
|
|
struct {
|
|
|
|
char *tok;
|
|
|
|
int line;
|
|
|
|
} saved;
|
|
|
|
|
|
|
|
Eina_List *classes;
|
2014-04-30 02:03:09 -07:00
|
|
|
Eina_List *typedefs;
|
2014-02-11 05:42:59 -08:00
|
|
|
struct {
|
2014-02-26 10:02:10 -08:00
|
|
|
Eina_List **params;
|
2014-02-17 04:05:52 -08:00
|
|
|
Eolian_Class_Type kls_type;
|
2014-04-30 02:03:09 -07:00
|
|
|
const char *typedef_alias;
|
2014-02-11 05:42:59 -08:00
|
|
|
Eo_Class_Def *kls;
|
2014-04-30 02:03:09 -07:00
|
|
|
Eo_Type_Def *type_def;
|
2014-02-11 05:42:59 -08:00
|
|
|
Eo_Property_Def *prop;
|
|
|
|
Eo_Method_Def *meth;
|
|
|
|
Eo_Param_Def *param;
|
|
|
|
Eo_Accessor_Def *accessor;
|
|
|
|
Eo_Accessor_Param *accessor_param;
|
|
|
|
Eina_List *str_items;
|
2014-02-15 22:54:49 -08:00
|
|
|
Eo_Event_Def *event;
|
2014-02-11 05:42:59 -08:00
|
|
|
Eo_Implement_Def *impl;
|
2014-04-03 06:20:58 -07:00
|
|
|
int fscope;
|
2014-02-11 05:42:59 -08:00
|
|
|
} tmp;
|
|
|
|
|
2014-06-18 02:08:43 -07:00
|
|
|
} Eo_Lexer;
|
2014-02-11 05:42:59 -08:00
|
|
|
|
|
|
|
int eo_tokenizer_init();
|
|
|
|
|
|
|
|
int eo_tokenizer_shutdown();
|
|
|
|
|
2014-06-18 02:08:43 -07:00
|
|
|
Eo_Lexer* eo_tokenizer_get(void);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-06-18 02:08:43 -07:00
|
|
|
Eina_Bool eo_tokenizer_walk(Eo_Lexer *toknz, const char *source);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-06-18 02:08:43 -07:00
|
|
|
void eo_tokenizer_dump(Eo_Lexer *toknz);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-06-18 02:08:43 -07:00
|
|
|
void eo_tokenizer_free(Eo_Lexer *toknz);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
|
|
|
Eina_Bool eo_tokenizer_database_fill(const char *filename);
|
|
|
|
|
|
|
|
#endif /* __EO_TOKENIZER_H__ */
|