X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fparser.h;h=661207761223ab1094b91aac5ec3932bcc11f561;hb=963b5f2df23dc1c70bdc70d4aecb76f50651997b;hp=5e0c421bb7eae2b1e7104ae9ae5d82ff4b19858c;hpb=8a2d0e7181075408c8fa1b35b2a755e200863997;p=lttv.git diff --git a/ltt/branches/poly/ltt/parser.h b/ltt/branches/poly/ltt/parser.h index 5e0c421b..66120776 100644 --- a/ltt/branches/poly/ltt/parser.h +++ b/ltt/branches/poly/ltt/parser.h @@ -34,10 +34,9 @@ void *table_find_int(table *t, int *key); typedef enum _token_type { ENDFILE, - COMA, - LPARENTHESIS, - RPARENTHESIS, - SEMICOLON, + FORWARDSLASH, + LANGLEBRACKET, + RANGLEBRACKET, EQUAL, QUOTEDSTRING, NUMBER, @@ -58,14 +57,14 @@ typedef struct _parse_file { void ungetToken(parse_file * in); char *getToken(parse_file *in); -char *getComa(parse_file *in); -char *getLParenthesis(parse_file *in); -char *getRParenthesis(parse_file *in); -char *getSemiColon(parse_file *in); +char *getForwardslash(parse_file *in); +char *getLAnglebracket(parse_file *in); +char *getRAnglebracket(parse_file *in); char *getQuotedString(parse_file *in); char *getName(parse_file *in); -int getNumber(parse_file *in); -char * getEqual(parse_file *in); +int getNumber(parse_file *in); +char *getEqual(parse_file *in); +char seekNextChar(parse_file *in); void skipComment(parse_file * in); void skipEOL(parse_file * in); @@ -88,6 +87,7 @@ typedef enum _data_type { ARRAY, SEQUENCE, STRUCT, + UNION, NONE } data_type; @@ -120,12 +120,20 @@ typedef struct _event { char *name; char *description; type_descriptor *type; - int nested; } event; +typedef struct _facility { + char * name; + char * description; + sequence events; + sequence unnamed_types; + table named_types; +} facility; + int getSize(parse_file *in); -unsigned long getTypeChecksum(unsigned long aCrc, type_descriptor * type, int * nestedStruct); +unsigned long getTypeChecksum(unsigned long aCrc, type_descriptor * type); +void parseFacility(parse_file *in, facility * fac); void parseEvent(parse_file *in, event *ev, sequence * unnamed_types, table * named_types); void parseTypeDefinition(parse_file *in, sequence * unnamed_types, table * named_types); type_descriptor *parseType(parse_file *in, type_descriptor *t, sequence * unnamed_types, table * named_types); @@ -135,6 +143,15 @@ type_descriptor * find_named_type(char *name, table * named_types); void generateChecksum(char * facName, unsigned long * checksum, sequence * events); +/* get attributes */ +char * getNameAttribute(parse_file *in); +char * getFormatAttribute(parse_file *in); +int getSizeAttribute(parse_file *in); +int getValueAttribute(parse_file *in); +char * getValueStrAttribute(parse_file *in); + +char * getDescription(parse_file *in); + static char *intOutputTypes[] = { "int8_t", "int16_t", "int32_t", "int64_t", "short int", "int", "long int" };