d19f10d43a
This library can be used to create animated 3D User Interfaces. This library is currently under heavy development, so it's not part of the build by default. In order to build this library, you must define BUILD_RENDERSCRIPT=true in your build environment. You will also have to manually edit build/core/prelink-linux-arm.map And add libRS and libRS_jni at the end like this (exact address may change.) libRS.so 0x9A100000 libRS_jni.so 0x9A000000
172 lines
2.8 KiB
Plaintext
172 lines
2.8 KiB
Plaintext
%option stack
|
|
|
|
%x comment
|
|
%x api_entry
|
|
%x api_entry2
|
|
%x api_entry_param
|
|
%x var_type
|
|
|
|
DIGIT [0-9]
|
|
ID [a-zA-Z_][a-zA-Z0-9_]*
|
|
|
|
|
|
int num_lines = 0;
|
|
|
|
typedef struct {
|
|
int isConst;
|
|
int type;
|
|
int bits;
|
|
int ptrLevel;
|
|
char name[256];
|
|
char typename[256];
|
|
} VarType;
|
|
|
|
VarType *currType = 0;
|
|
|
|
typedef struct {
|
|
char name[256];
|
|
int sync;
|
|
int paramCount;
|
|
VarType ret;
|
|
VarType params[16];
|
|
} ApiEntry;
|
|
|
|
ApiEntry apis[128];
|
|
int apiCount = 0;
|
|
|
|
int typeNextState;
|
|
|
|
%%
|
|
|
|
"/*" BEGIN(comment);
|
|
<comment>[^*\n]* /* eat anything that's not a '*' */
|
|
<comment>"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
|
|
<comment>\n ++num_lines;
|
|
<comment>"*"+"/" BEGIN(INITIAL);
|
|
|
|
<*>" " //printf("found ' '\n");
|
|
<*>"\n" ++num_lines; //printf("found lf \n");
|
|
|
|
{ID} {
|
|
memset(&apis[apiCount], 0, sizeof(ApiEntry));
|
|
memcpy(apis[apiCount].name, yytext, yyleng);
|
|
BEGIN(api_entry);
|
|
}
|
|
|
|
<api_entry>"{" {
|
|
BEGIN(api_entry2);
|
|
}
|
|
|
|
<api_entry2>"sync" {
|
|
apis[apiCount].sync = 1;
|
|
}
|
|
|
|
<api_entry2>"ret" {
|
|
currType = &apis[apiCount].ret;
|
|
typeNextState = api_entry2;
|
|
BEGIN(var_type);
|
|
}
|
|
|
|
<api_entry2>"param" {
|
|
currType = &apis[apiCount].params[apis[apiCount].paramCount];
|
|
apis[apiCount].paramCount++;
|
|
typeNextState = api_entry_param;
|
|
BEGIN(var_type);
|
|
}
|
|
|
|
<var_type>"const" {
|
|
currType->isConst = 1;
|
|
}
|
|
|
|
<var_type>"i8" {
|
|
currType->type = 1;
|
|
currType->bits = 8;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"i16" {
|
|
currType->type = 1;
|
|
currType->bits = 16;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"i32" {
|
|
currType->type = 1;
|
|
currType->bits = 32;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"i64" {
|
|
currType->type = 1;
|
|
currType->bits = 64;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"u8" {
|
|
currType->type = 2;
|
|
currType->bits = 8;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"u16" {
|
|
currType->type = 2;
|
|
currType->bits = 16;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"u32" {
|
|
currType->type = 2;
|
|
currType->bits = 32;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"u64" {
|
|
currType->type = 2;
|
|
currType->bits = 64;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"f" {
|
|
currType->type = 3;
|
|
currType->bits = 32;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>"d" {
|
|
currType->type = 3;
|
|
currType->bits = 64;
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<var_type>{ID} {
|
|
currType->type = 4;
|
|
currType->bits = 32;
|
|
memcpy(currType->typename, yytext, yyleng);
|
|
BEGIN(typeNextState);
|
|
}
|
|
|
|
<api_entry_param>"*" {
|
|
currType->ptrLevel ++;
|
|
}
|
|
|
|
<api_entry_param>{ID} {
|
|
memcpy(currType->name, yytext, yyleng);
|
|
BEGIN(api_entry2);
|
|
}
|
|
|
|
|
|
<api_entry2>"}" {
|
|
apiCount++;
|
|
BEGIN(INITIAL);
|
|
}
|
|
|
|
|
|
%%
|
|
|
|
|
|
int yywrap()
|
|
{
|
|
return 1;
|
|
}
|
|
|