diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-03-08 22:05:09 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-03-08 22:05:09 (GMT) |
commit | 29a22c425f492427f45b71de937f2d99587c8d34 (patch) | |
tree | 36e8bb3ef73bc91e812ed63205d10bfced578660 /src/format/mangling/itanium_tok.l | |
parent | 674739bedc853681be5a2657a7a4f497d6e82c9b (diff) |
Added a partial support of the Itanium C++ ABI mangling.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@52 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/mangling/itanium_tok.l')
-rw-r--r-- | src/format/mangling/itanium_tok.l | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/src/format/mangling/itanium_tok.l b/src/format/mangling/itanium_tok.l new file mode 100644 index 0000000..5eef799 --- /dev/null +++ b/src/format/mangling/itanium_tok.l @@ -0,0 +1,116 @@ + +%{ + +#include "itanium_gram.h" + + +static unsigned int itanium_txt_length = 0; + + +/* Borne la longueur d'une chaîne à lire. */ +void set_itanium_text_length(unsigned int); + + +%} + + +%option noyywrap +%option yylineno + + +%x identifier + + +%% + + +_Z { return ITANIUM_SIGNATURE; } + +E { return EE; } +N { return NN; } +I { return II; } + +C1 { return C1; } +C2 { return C2; } +C3 { return C3; } +D0 { return C1; } +D1 { return D2; } +D2 { return D3; } + +v { return V; } +w { return W; } +b { return B; } +c { return C; } +a { return A; } +h { return H; } +s { return S; } +t { return T; } +i { return I; } +j { return J; } +l { return L; } +m { return M; } +x { return X; } +y { return Y; } +n { return N; } +o { return O; } +f { return F; } +d { return D; } +e { return E; } +g { return G; } +z { return Z; } +Dd { return DD; } +De { return DE; } +Df { return DF; } +Dh { return DH; } +Di { return DI; } +Ds { return DS; } +u { return U; } + +P { return TP; } +R { return TR; } +O { return TO; } +C { return TC; } +G { return TG; } + +r { return QR; } +V { return QV; } +K { return QK; } + +St { return ST; } +Sa { return SA; } +Sb { return SB; } +Ss { return SS; } +Si { return SI; } +So { return SO; } +Sd { return SD; } + + +[0-9]+ { yylval.val = atoi(yytext); return NUMBER; } + +<identifier>. { if (--itanium_txt_length == 0) BEGIN(INITIAL); yylval.car = *yytext; return CHAR; } + +<*>. { printf("error : '%s'\n", yytext); } + + +%% + + +/****************************************************************************** +* * +* Paramètres : length = taille de chaîne à lire. * +* * +* Description : Borne la longueur d'une chaîne à lire. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void set_itanium_text_length(unsigned int length) +{ + itanium_txt_length = length; + + BEGIN(identifier); + +} |