diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-08-10 00:17:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-08-10 00:17:32 (GMT) |
commit | 088a489002fd1c9a62d5cafe693dc73cc271ee18 (patch) | |
tree | a147acd77fab3b66d541326349d08dae29ec0e8c /src/format/mangling/itanium_tok.l | |
parent | bcfcb4ec8b4cf9a35b77e93d172e7dae81e8872a (diff) |
Improved Itanium demangling.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@179 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/mangling/itanium_tok.l')
-rw-r--r-- | src/format/mangling/itanium_tok.l | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/src/format/mangling/itanium_tok.l b/src/format/mangling/itanium_tok.l index e8fb7f1..a4c330b 100644 --- a/src/format/mangling/itanium_tok.l +++ b/src/format/mangling/itanium_tok.l @@ -10,6 +10,13 @@ static unsigned int itanium_txt_length = 0; /* Borne la longueur d'une chaîne à lire. */ void set_itanium_text_length(unsigned int); +/* Autorise la lecture des opérateurs. */ +void allow_itanium_operators(void); + +/* Autorise la lecture des opérateurs. */ +void exclude_itanium_operators(void); + + %} @@ -19,11 +26,14 @@ void set_itanium_text_length(unsigned int); %x identifier +%x operators %% +<INITIAL,operators>{ + _Z { return ITANIUM_SIGNATURE; } E { return EE; } @@ -86,6 +96,9 @@ Si { return SI; } So { return SO; } Sd { return SD; } +} /* INITIAL,operators> */ + +<operators>{ nw { return OPER_NEW; } na { return OPER_NEW_ARRAY; } @@ -134,6 +147,9 @@ pt { return OPER_POINTER_TO; } cl { return OPER_CLASS; } ix { return OPER_INDEX; } +} /* operators */ + +<INITIAL,operators>{ S_ { return SUBSTI_FIRST; } S[0-9a-z]_ { yylval.val = atoi(yytext + 1); return SUBSTI_N; } @@ -145,9 +161,11 @@ T[0-9]*_ { yylval.val = atoi(yytext + 1); return TPARAM_N; } [0-9]+ { yylval.val = atoi(yytext); return NUMBER; } +} /* <INITIAL,operators> */ + <identifier>. { if (--itanium_txt_length == 0) BEGIN(INITIAL); yylval.car = *yytext; return CHAR; } -<*>[ ] +<INITIAL,operators>[ ] <*>. { printf("error : '%s'\n", yytext); } @@ -173,3 +191,41 @@ void set_itanium_text_length(unsigned int length) BEGIN(identifier); } + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Autorise la lecture des opérateurs. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void allow_itanium_operators(void) +{ + BEGIN(operators); + +} + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Autorise la lecture des opérateurs. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void exclude_itanium_operators(void) +{ + BEGIN(INITIAL); + +} |