Модераторы: Daevaorn

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> правильная реализация reflection+introspection, в С/С++ путем написания плагина для GCC. 
:(
    Опции темы
boostcoder
Дата 23.7.2011, 20:57 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



начитавшись манов по разработке расширений для GCC решил: хватит с меня макросов и кодогенерации осложненной нехваткой возможностей препроцессора и информации о типах доступной на стадии препроцессирования!!! smile буду писать плагин.

интересует мнение форумчан:
какой вы видите reflection и introspection в С/С++? и чего вам от них надо?

спасибо.


Это сообщение отредактировал(а) boostcoder - 24.7.2011, 16:32
PM WWW   Вверх
xvr
Дата 24.7.2011, 11:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Комодератор
Сообщений: 7046
Регистрация: 28.8.2007
Где: Дублин, Ирландия

Репутация: 60
Всего: 223



Цитата(boostcoder @  23.7.2011,  20:57 Найти цитируемый пост)
буду писать плагин.

Может взять готовый? GCC-XML

PM MAIL   Вверх
boostcoder
Дата 24.7.2011, 14:21 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(xvr @  24.7.2011,  11:32 Найти цитируемый пост)
Может взять готовый? GCC-XML

я как-то пытался понять что это и с чем его едят, и ничего понял smile

Добавлено через 26 секунд
попытаюсь снова..
PM WWW   Вверх
boostcoder
Дата 24.7.2011, 15:22 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



что-то ответов маловато.. наверное всех уже достали мои темы связанные с кодогенерацией smile 

что мне видится необходимым:
1. генерация сериализаторов/десериализаторов. думаю использовать для этого прагмы.
Код

// полная сериализация/десериализация.
#pragma serialize full
struct type {
   int x;
   int y;
};

// частичная сериализация/десериализация.
#pragma serialize partial x
struct type {
   int x;
   int y;
};

// раздельная сериализация/десериализация.
#pragma serialize in(x), out(x, y)
struct type {
   int x;
   int y;
};




в процессе написания...
PM WWW   Вверх
volatile
Дата 24.7.2011, 15:44 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Завсегдатай
Сообщений: 2107
Регистрация: 7.1.2011

Репутация: 37
Всего: 85



 smile 

boostcoder, плагины это конечно хорошо, но вы ведь навсегда свой проект привязываете к конеретной среде разработки.
Хорошо если вам никогда не придется переписывать это на другую IDE...
Но кто даст гарантию, что это вдруг когда-нибудь не понадобится?
PM MAIL   Вверх
boostcoder
Дата 24.7.2011, 15:59 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(volatile @  24.7.2011,  15:44 Найти цитируемый пост)
к конеретной среде разработки

Цитата(volatile @  24.7.2011,  15:44 Найти цитируемый пост)
переписывать это на другую IDE

эм... плагин для GCC.

Цитата(volatile @  24.7.2011,  15:44 Найти цитируемый пост)
Но кто даст гарантию, что это вдруг когда-нибудь не понадобится?

так а проблема в чем? я и сам могу gcc и mingw`ы собирать. или я вас не понял?
PM WWW   Вверх
volatile
Дата 24.7.2011, 16:09 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Завсегдатай
Сообщений: 2107
Регистрация: 7.1.2011

Репутация: 37
Всего: 85



я имел ввиду если нужен будет не gcc.

PM MAIL   Вверх
boostcoder
Дата 24.7.2011, 16:10 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(volatile @  24.7.2011,  16:09 Найти цитируемый пост)
нужен будет не gcc

разве такое возможно? зачем? почему?
PM WWW   Вверх
xvr
Дата 24.7.2011, 16:11 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Комодератор
Сообщений: 7046
Регистрация: 28.8.2007
Где: Дублин, Ирландия

Репутация: 60
Всего: 223



Цитата(boostcoder @  24.7.2011,  14:21 Найти цитируемый пост)
я как-то пытался понять что это и с чем его едят, и ничего понял

Это backend для gcc. Вместо генерации кода выводит внутреннее представление в виде XML. Правда выводится далеко не все внутреннее представление, а только декларации (вроде). Для introspection/reflection должно хватить

Есть еще один путь - парсить отладочную информацию (DWARF2 например)


PM MAIL   Вверх
boostcoder
Дата 24.7.2011, 16:24 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(xvr @  24.7.2011,  16:11 Найти цитируемый пост)
Это backend для gcc. Вместо генерации кода выводит внутреннее представление в виде XML.

да. уже проверил.

Цитата(xvr @  24.7.2011,  16:11 Найти цитируемый пост)
 только декларации (вроде)

да. тоже проверил.
и да, должно хватить.

из этого:
Код


struct type1 {
};

struct type2 {
   int x;
};

struct type3: type2 {
   int y;
};



получаем это:
Код

  <Function id="_60" name="__builtin_isgreaterequal" returns="_144" context="_1" location="f0:138" file="f0" line="138" extern="1" attributes="nothrow const">
    <Ellipsis/>
  </Function>
  <Struct id="_61" name="type1" context="_1" mangled="5type1" demangled="type1" location="f1:2" file="f1" line="2" artificial="1" size="8" align="8" members="_155 _156 _157 _158 " bases=""/>
  <Struct id="_62" name="type2" context="_1" mangled="5type2" demangled="type2" location="f1:5" file="f1" line="5" artificial="1" size="32" align="32" members="_159 _160 _161 _162 _163 " bases=""/>
  <Struct id="_63" name="type3" context="_1" mangled="5type3" demangled="type3" location="f1:9" file="f1" line="9" artificial="1" size="64" align="32" members="_164 _165 _166 _167 _168 " bases="_62 ">
    <Base type="_62" access="public" virtual="0" offset="0"/>
  </Struct>
  <Function id="_64" name="__builtin_log10f" returns="_142" context="_1" mangled="log10f" location="f0:64" file="f0" line="64" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:64" file="f0" line="64"/>
  </Function>
  <Function id="_65" name="__builtin_log10l" returns="_143" context="_1" mangled="log10l" location="f0:65" file="f0" line="65" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:65" file="f0" line="65"/>
  </Function>
  <Function id="_66" name="__builtin_ctzl" returns="_145" context="_1" location="f0:97" file="f0" line="97" extern="1" attributes="nothrow const">
    <Argument type="_169" location="f0:97" file="f0" line="97"/>
  </Function>
  <Function id="_67" name="__builtin_powif" returns="_142" context="_1" location="f0:73" file="f0" line="73" extern="1" attributes="nothrow pure no vops">
    <Argument type="_142" location="f0:73" file="f0" line="73"/>
    <Argument type="_145" location="f0:73" file="f0" line="73"/>
  </Function>
  <Function id="_68" name="__builtin_powil" returns="_143" context="_1" location="f0:74" file="f0" line="74" extern="1" attributes="nothrow pure no vops">
    <Argument type="_143" location="f0:74" file="f0" line="74"/>
    <Argument type="_145" location="f0:74" file="f0" line="74"/>
  </Function>
  <Function id="_69" name="__builtin_modff" returns="_142" context="_1" mangled="modff" location="f0:68" file="f0" line="68" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:68" file="f0" line="68"/>
    <Argument type="_170" location="f0:68" file="f0" line="68"/>
  </Function>
  <Function id="_70" name="__builtin_exp" returns="_140" context="_1" mangled="exp" location="f0:45" file="f0" line="45" extern="1" attributes="nothrow">
    <Argument type="_140" location="f0:45" file="f0" line="45"/>
  </Function>
  <Function id="_71" name="__builtin_modfl" returns="_143" context="_1" mangled="modfl" location="f0:69" file="f0" line="69" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:69" file="f0" line="69"/>
    <Argument type="_171" location="f0:69" file="f0" line="69"/>
  </Function>
  <Function id="_72" name="__builtin_prefetch" returns="_150" context="_1" location="f0:17" file="f0" line="17" extern="1" attributes="no vops">
    <Argument name="ADDR" type="_152" location="f0:17" file="f0" line="17"/>
    <Ellipsis/>
  </Function>
  <Function id="_73" name="__builtin_tan" returns="_140" context="_1" mangled="tan" location="f0:84" file="f0" line="84" extern="1" attributes="nothrow pure no vops">
    <Argument type="_140" location="f0:84" file="f0" line="84"/>
  </Function>
  <Function id="_74" name="__builtin_fabsf" returns="_142" context="_1" mangled="fabsf" location="f0:49" file="f0" line="49" extern="1" attributes="nothrow const">
    <Argument type="_142" location="f0:49" file="f0" line="49"/>
  </Function>
  <Function id="_75" name="__builtin_fabsl" returns="_143" context="_1" mangled="fabsl" location="f0:50" file="f0" line="50" extern="1" attributes="nothrow const">
    <Argument type="_143" location="f0:50" file="f0" line="50"/>
  </Function>
  <Function id="_76" name="__builtin_inf" returns="_140" context="_1" location="f0:18" file="f0" line="18" extern="1" attributes="nothrow const"/>
  <Namespace id="_77" name="__cxxabiv1" context="_1" members="" mangled="_Z10__cxxabiv1" demangled="__cxxabiv1"/>
  <Function id="_78" name="__builtin_frame_address" returns="_151" context="_1" location="f0:15" file="f0" line="15" extern="1">
    <Argument name="LEVEL" type="_153" location="f0:15" file="f0" line="15"/>
  </Function>
  <Function id="_79" name="__builtin_cabs" returns="_140" context="_1" mangled="cabs" location="f0:91" file="f0" line="91" extern="1" attributes="nothrow pure no vops">
    <Argument type="_149" location="f0:91" file="f0" line="91"/>
  </Function>
  <Function id="_80" name="__builtin_atan2f" returns="_142" context="_1" mangled="atan2f" location="f0:32" file="f0" line="32" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:32" file="f0" line="32"/>
    <Argument type="_142" location="f0:32" file="f0" line="32"/>
  </Function>
  <Function id="_81" name="__builtin_atan2l" returns="_143" context="_1" mangled="atan2l" location="f0:33" file="f0" line="33" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:33" file="f0" line="33"/>
    <Argument type="_143" location="f0:33" file="f0" line="33"/>
  </Function>
  <Function id="_82" name="__builtin_isinf" returns="_144" context="_1" mangled="isinf" location="f0:139" file="f0" line="139" extern="1" attributes="nothrow const">
    <Ellipsis/>
  </Function>
  <Function id="_83" name="__builtin_fpclassify" returns="_144" context="_1" location="f0:135" file="f0" line="135" extern="1">
    <Ellipsis/>
  </Function>
  <Function id="_84" name="__builtin_ccoshf" returns="_147" context="_1" mangled="ccoshf" location="f0:105" file="f0" line="105" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:105" file="f0" line="105"/>
  </Function>
  <Function id="_85" name="__builtin_ccoshl" returns="_148" context="_1" mangled="ccoshl" location="f0:107" file="f0" line="107" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:107" file="f0" line="107"/>
  </Function>
  <Function id="_86" name="__builtin_atan" returns="_140" context="_1" mangled="atan" location="f0:30" file="f0" line="30" extern="1" attributes="nothrow pure no vops">
    <Argument type="_140" location="f0:30" file="f0" line="30"/>
  </Function>
  <Function id="_87" name="__builtin_sinhf" returns="_142" context="_1" mangled="sinhf" location="f0:78" file="f0" line="78" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:78" file="f0" line="78"/>
  </Function>
  <Function id="_88" name="__builtin_sinhl" returns="_143" context="_1" mangled="sinhl" location="f0:79" file="f0" line="79" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:79" file="f0" line="79"/>
  </Function>
  <Function id="_89" name="__builtin_sqrtf" returns="_142" context="_1" mangled="sqrtf" location="f0:82" file="f0" line="82" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:82" file="f0" line="82"/>
  </Function>
  <Function id="_90" name="__builtin_sqrtl" returns="_143" context="_1" mangled="sqrtl" location="f0:83" file="f0" line="83" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:83" file="f0" line="83"/>
  </Function>
  <Function id="_91" name="__builtin_frexpf" returns="_142" context="_1" mangled="frexpf" location="f0:57" file="f0" line="57" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:57" file="f0" line="57"/>
    <Argument type="_154" location="f0:57" file="f0" line="57"/>
  </Function>
  <Function id="_92" name="__builtin_frexpl" returns="_143" context="_1" mangled="frexpl" location="f0:58" file="f0" line="58" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:58" file="f0" line="58"/>
    <Argument type="_154" location="f0:58" file="f0" line="58"/>
  </Function>
  <Function id="_93" name="__builtin_cpowf" returns="_147" context="_1" mangled="cpowf" location="f0:129" file="f0" line="129" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:129" file="f0" line="129"/>
    <Argument type="_147" location="f0:129" file="f0" line="129"/>
  </Function>
  <Function id="_94" name="__builtin_cpowl" returns="_148" context="_1" mangled="cpowl" location="f0:131" file="f0" line="131" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:131" file="f0" line="131"/>
    <Argument type="_148" location="f0:131" file="f0" line="131"/>
  </Function>
  <Function id="_95" name="__builtin_tanhf" returns="_142" context="_1" mangled="tanhf" location="f0:87" file="f0" line="87" extern="1" attributes="nothrow pure no vops">
    <Argument type="_142" location="f0:87" file="f0" line="87"/>
  </Function>
  <Function id="_96" name="__builtin_tanhl" returns="_143" context="_1" mangled="tanhl" location="f0:88" file="f0" line="88" extern="1" attributes="nothrow pure no vops">
    <Argument type="_143" location="f0:88" file="f0" line="88"/>
  </Function>
  <Function id="_97" name="__builtin_cabsf" returns="_142" context="_1" mangled="cabsf" location="f0:90" file="f0" line="90" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:90" file="f0" line="90"/>
  </Function>
  <Function id="_98" name="__builtin_cabsl" returns="_143" context="_1" mangled="cabsl" location="f0:92" file="f0" line="92" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:92" file="f0" line="92"/>
  </Function>
  <Function id="_99" name="__builtin_powf" returns="_142" context="_1" mangled="powf" location="f0:70" file="f0" line="70" extern="1" attributes="nothrow">
    <Argument type="_142" location="f0:70" file="f0" line="70"/>
    <Argument type="_142" location="f0:70" file="f0" line="70"/>
  </Function>
  <Function id="_100" name="__builtin_powi" returns="_140" context="_1" location="f0:72" file="f0" line="72" extern="1" attributes="nothrow pure no vops">
    <Argument type="_140" location="f0:72" file="f0" line="72"/>
    <Argument type="_145" location="f0:72" file="f0" line="72"/>
  </Function>
  <Function id="_101" name="__builtin_powl" returns="_143" context="_1" mangled="powl" location="f0:71" file="f0" line="71" extern="1" attributes="nothrow">
    <Argument type="_143" location="f0:71" file="f0" line="71"/>
    <Argument type="_143" location="f0:71" file="f0" line="71"/>
  </Function>
  <Function id="_102" name="__builtin_ccos" returns="_149" context="_1" mangled="ccos" location="f0:103" file="f0" line="103" extern="1" attributes="nothrow pure no vops">
    <Argument type="_149" location="f0:103" file="f0" line="103"/>
  </Function>
  <Function id="_103" name="__builtin_expect" returns="_169" context="_1" location="f0:16" file="f0" line="16" extern="1" attributes="nothrow const">
    <Argument name="EXP" type="_169" location="f0:16" file="f0" line="16"/>
    <Argument name="C" type="_169" location="f0:16" file="f0" line="16"/>
  </Function>
  <Function id="_104" name="__builtin_popcountl" returns="_145" context="_1" location="f0:100" file="f0" line="100" extern="1" attributes="nothrow const">
    <Argument type="_169" location="f0:100" file="f0" line="100"/>
  </Function>
  <Function id="_105" name="__builtin_inff" returns="_142" context="_1" location="f0:19" file="f0" line="19" extern="1" attributes="nothrow const"/>
  <Function id="_106" name="__builtin_infl" returns="_143" context="_1" location="f0:20" file="f0" line="20" extern="1" attributes="nothrow const"/>
  <Function id="_107" name="__builtin_cos" returns="_140" context="_1" mangled="cos" location="f0:39" file="f0" line="39" extern="1" attributes="nothrow pure no vops">
    <Argument type="_140" location="f0:39" file="f0" line="39"/>
  </Function>
  <Function id="_108" name="__builtin_ctz" returns="_145" context="_1" location="f0:96" file="f0" line="96" extern="1" attributes="nothrow const">
    <Argument type="_145" location="f0:96" file="f0" line="96"/>
  </Function>
  <Function id="_109" name="__builtin_return_address" returns="_151" context="_1" location="f0:14" file="f0" line="14" extern="1">
    <Argument name="LEVEL" type="_153" location="f0:14" file="f0" line="14"/>
  </Function>
  <Function id="_110" name="__builtin_isnan" returns="_144" context="_1" mangled="isnan" location="f0:144" file="f0" line="144" extern="1" attributes="nothrow const">
    <Ellipsis/>
  </Function>
  <Function id="_111" name="__builtin_csinhf" returns="_147" context="_1" mangled="csinhf" location="f0:117" file="f0" line="117" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:117" file="f0" line="117"/>
  </Function>
  <Function id="_112" name="__builtin_csinhl" returns="_148" context="_1" mangled="csinhl" location="f0:119" file="f0" line="119" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:119" file="f0" line="119"/>
  </Function>
  <Function id="_113" name="__builtin_csqrtf" returns="_147" context="_1" mangled="csqrtf" location="f0:120" file="f0" line="120" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:120" file="f0" line="120"/>
  </Function>
  <Function id="_114" name="__builtin_csqrtl" returns="_148" context="_1" mangled="csqrtl" location="f0:122" file="f0" line="122" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:122" file="f0" line="122"/>
  </Function>
  <Function id="_115" name="__builtin_floor" returns="_140" context="_1" mangled="floor" location="f0:51" file="f0" line="51" extern="1" attributes="nothrow const">
    <Argument type="_140" location="f0:51" file="f0" line="51"/>
  </Function>
  <Function id="_116" name="__builtin_ldexp" returns="_140" context="_1" mangled="ldexp" location="f0:59" file="f0" line="59" extern="1" attributes="nothrow">
    <Argument type="_140" location="f0:59" file="f0" line="59"/>
    <Argument type="_145" location="f0:59" file="f0" line="59"/>
  </Function>
  <Function id="_117" name="__builtin_ccosf" returns="_147" context="_1" mangled="ccosf" location="f0:102" file="f0" line="102" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:102" file="f0" line="102"/>
  </Function>
  <Function id="_118" name="__builtin_ccosh" returns="_149" context="_1" mangled="ccosh" location="f0:106" file="f0" line="106" extern="1" attributes="nothrow pure no vops">
    <Argument type="_149" location="f0:106" file="f0" line="106"/>
  </Function>
  <Function id="_119" name="__builtin_ccosl" returns="_148" context="_1" mangled="ccosl" location="f0:104" file="f0" line="104" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:104" file="f0" line="104"/>
  </Function>
  <Function id="_120" name="__builtin_islessgreater" returns="_144" context="_1" location="f0:143" file="f0" line="143" extern="1" attributes="nothrow const">
    <Ellipsis/>
  </Function>
  <Function id="_121" name="__builtin_ctanhf" returns="_147" context="_1" mangled="ctanhf" location="f0:126" file="f0" line="126" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:126" file="f0" line="126"/>
  </Function>
  <Function id="_122" name="__builtin_ctanhl" returns="_148" context="_1" mangled="ctanhl" location="f0:128" file="f0" line="128" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:128" file="f0" line="128"/>
  </Function>
  <Function id="_123" name="__builtin_ceilf" returns="_142" context="_1" mangled="ceilf" location="f0:37" file="f0" line="37" extern="1" attributes="nothrow const">
    <Argument type="_142" location="f0:37" file="f0" line="37"/>
  </Function>
  <Function id="_124" name="__builtin_ceill" returns="_143" context="_1" mangled="ceill" location="f0:38" file="f0" line="38" extern="1" attributes="nothrow const">
    <Argument type="_143" location="f0:38" file="f0" line="38"/>
  </Function>
  <Function id="_125" name="__builtin_csinf" returns="_147" context="_1" mangled="csinf" location="f0:114" file="f0" line="114" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:114" file="f0" line="114"/>
  </Function>
  <Function id="_126" name="__builtin_csinh" returns="_149" context="_1" mangled="csinh" location="f0:118" file="f0" line="118" extern="1" attributes="nothrow pure no vops">
    <Argument type="_149" location="f0:118" file="f0" line="118"/>
  </Function>
  <Function id="_127" name="__builtin_csinl" returns="_148" context="_1" mangled="csinl" location="f0:116" file="f0" line="116" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:116" file="f0" line="116"/>
  </Function>
  <Function id="_128" name="__builtin_acos" returns="_140" context="_1" mangled="acos" location="f0:24" file="f0" line="24" extern="1" attributes="nothrow">
    <Argument type="_140" location="f0:24" file="f0" line="24"/>
  </Function>
  <Function id="_129" name="__builtin_ctzll" returns="_145" context="_1" location="f0:98" file="f0" line="98" extern="1" attributes="nothrow const">
    <Argument type="_146" location="f0:98" file="f0" line="98"/>
  </Function>
  <Function id="_130" name="__builtin_cargf" returns="_142" context="_1" mangled="cargf" location="f0:93" file="f0" line="93" extern="1" attributes="nothrow pure no vops">
    <Argument type="_147" location="f0:93" file="f0" line="93"/>
  </Function>
  <Function id="_131" name="__builtin_cargl" returns="_143" context="_1" mangled="cargl" location="f0:95" file="f0" line="95" extern="1" attributes="nothrow pure no vops">
    <Argument type="_148" location="f0:95" file="f0" line="95"/>
  </Function>
  <Function id="_132" name="__builtin_cosf" returns="_142" context="_1" mangled="cosf" location="f0:40" file="f0" line="40" extern="1" attributes="nothrow pure no vops">
    <Argument type="_142" location="f0:40" file="f0" line="40"/>
  </Function>
  <Function id="_133" name="__builtin_cosh" returns="_140" context="_1" mangled="cosh" location="f0:41" file="f0" line="41" extern="1" attributes="nothrow">
    <Argument type="_140" location="f0:41" file="f0" line="41"/>
  </Function>
  <Function id="_134" name="__builtin_cosl" returns="_143" context="_1" mangled="cosl" location="f0:44" file="f0" line="44" extern="1" attributes="nothrow pure no vops">
    <Argument type="_143" location="f0:44" file="f0" line="44"/>
  </Function>
  <Function id="_135" name="__builtin_isgreater" returns="_144" context="_1" location="f0:137" file="f0" line="137" extern="1" attributes="nothrow const">
    <Ellipsis/>
  </Function>
  <Function id="_136" name="__builtin_sinf" returns="_142" context="_1" mangled="sinf" location="f0:76" file="f0" line="76" extern="1" attributes="nothrow pure no vops">
    <Argument type="_142" location="f0:76" file="f0" line="76"/>
  </Function>
  <Function id="_137" name="__builtin_sinh" returns="_140" context="_1" mangled="sinh" location="f0:77" file="f0" line="77" extern="1" attributes="nothrow">
    <Argument type="_140" location="f0:77" file="f0" line="77"/>
  </Function>
  <Function id="_138" name="__builtin_sinl" returns="_143" context="_1" mangled="sinl" location="f0:80" file="f0" line="80" extern="1" attributes="nothrow pure no vops">
    <Argument type="_143" location="f0:80" file="f0" line="80"/>
  </Function>
  <Function id="_139" name="__builtin_csin" returns="_149" context="_1" mangled="csin" location="f0:115" file="f0" line="115" extern="1" attributes="nothrow pure no vops">
    <Argument type="_149" location="f0:115" file="f0" line="115"/>
  </Function>
  <FundamentalType id="_140" name="double" size="64" align="64"/>
  <PointerType id="_141" type="_172c" size="32" align="32"/>
  <FundamentalType id="_142" name="float" size="32" align="32"/>
  <FundamentalType id="_143" name="long double" size="96" align="32"/>
  <FundamentalType id="_144" name="bool" size="8" align="8"/>
  <FundamentalType id="_145" name="int" size="32" align="32"/>
  <FundamentalType id="_146" name="long long int" size="64" align="64"/>
  <FundamentalType id="_147" name="complex float" size="64" align="32"/>
  <FundamentalType id="_148" name="complex long double" size="192" align="32"/>
  <FundamentalType id="_149" name="complex double" size="128" align="64"/>
  <FundamentalType id="_150" name="void" align="8"/>
  <PointerType id="_151" type="_150" size="32" align="32"/>
  <PointerType id="_152" type="_150c" size="32" align="32"/>
  <FundamentalType id="_153" name="unsigned int" size="32" align="32"/>
  <PointerType id="_154" type="_145" size="32" align="32"/>
  <Destructor id="_155" name="type1" artificial="1" throw="" context="_61" access="public" mangled="_ZN5type1D1Ev *INTERNAL* " demangled="type1::~type1()" location="f1:2" file="f1" line="2" endline="2" inline="1">
  </Destructor>
  <OperatorMethod id="_156" name="=" returns="_175" artificial="1" throw="" context="_61" access="public" mangled="_ZN5type1aSERKS_" demangled="type1::operator=(type1 const&amp;)" location="f1:2" file="f1" line="2" endline="2" inline="1">
    <Argument type="_176" location="f1:2" file="f1" line="2"/>
  </OperatorMethod>
  <Constructor id="_157" name="type1" artificial="1" throw="" context="_61" access="public" mangled="_ZN5type1C1ERKS_ *INTERNAL* " demangled="type1::type1(type1 const&amp;)" location="f1:2" file="f1" line="2" inline="1">
    <Argument type="_176" location="f1:2" file="f1" line="2"/>
  </Constructor>
  <Constructor id="_158" name="type1" artificial="1" throw="" context="_61" access="public" mangled="_ZN5type1C1Ev *INTERNAL* " demangled="type1::type1()" location="f1:2" file="f1" line="2" inline="1"/>
  <Field id="_159" name="x" type="_145" offset="0" context="_62" access="public" location="f1:6" file="f1" line="6"/>
  <Destructor id="_160" name="type2" artificial="1" throw="" context="_62" access="public" mangled="_ZN5type2D1Ev *INTERNAL* " demangled="type2::~type2()" location="f1:5" file="f1" line="5" endline="5" inline="1">
  </Destructor>
  <OperatorMethod id="_161" name="=" returns="_177" artificial="1" throw="" context="_62" access="public" mangled="_ZN5type2aSERKS_" demangled="type2::operator=(type2 const&amp;)" location="f1:5" file="f1" line="5" endline="5" inline="1">
    <Argument type="_178" location="f1:5" file="f1" line="5"/>
  </OperatorMethod>
  <Constructor id="_162" name="type2" artificial="1" throw="" context="_62" access="public" mangled="_ZN5type2C1ERKS_ *INTERNAL* " demangled="type2::type2(type2 const&amp;)" location="f1:5" file="f1" line="5" endline="5" inline="1">
    <Argument type="_178" location="f1:5" file="f1" line="5"/>
  </Constructor>
  <Constructor id="_163" name="type2" artificial="1" throw="" context="_62" access="public" mangled="_ZN5type2C1Ev *INTERNAL* " demangled="type2::type2()" location="f1:5" file="f1" line="5" inline="1"/>
  <Field id="_164" name="y" type="_145" offset="32" context="_63" access="public" location="f1:10" file="f1" line="10"/>
  <Destructor id="_165" name="type3" artificial="1" throw="" context="_63" access="public" mangled="_ZN5type3D1Ev *INTERNAL* " demangled="type3::~type3()" location="f1:9" file="f1" line="9" endline="9" inline="1">
  </Destructor>
  <OperatorMethod id="_166" name="=" returns="_179" artificial="1" throw="" context="_63" access="public" mangled="_ZN5type3aSERKS_" demangled="type3::operator=(type3 const&amp;)" location="f1:9" file="f1" line="9" endline="9" inline="1">
    <Argument type="_180" location="f1:9" file="f1" line="9"/>
  </OperatorMethod>
  <Constructor id="_167" name="type3" artificial="1" throw="" context="_63" access="public" mangled="_ZN5type3C1ERKS_ *INTERNAL* " demangled="type3::type3(type3 const&amp;)" location="f1:9" file="f1" line="9" endline="9" inline="1">
    <Argument type="_180" location="f1:9" file="f1" line="9"/>
  </Constructor>
  <Constructor id="_168" name="type3" artificial="1" throw="" context="_63" access="public" mangled="_ZN5type3C1Ev *INTERNAL* " demangled="type3::type3()" location="f1:9" file="f1" line="9" endline="9" inline="1"/>
  <FundamentalType id="_169" name="long int" size="32" align="32"/>
  <PointerType id="_170" type="_142" size="32" align="32"/>
  <PointerType id="_171" type="_143" size="32" align="32"/>
  <ReferenceType id="_175" type="_61" size="32" align="32"/>
  <ReferenceType id="_176" type="_61c" size="32" align="32"/>
  <ReferenceType id="_177" type="_62" size="32" align="32"/>
  <ReferenceType id="_178" type="_62c" size="32" align="32"/>
  <ReferenceType id="_179" type="_63" size="32" align="32"/>
  <ReferenceType id="_180" type="_63c" size="32" align="32"/>
  <FundamentalType id="_172" name="char" size="8" align="8"/>
  <CvQualifiedType id="_172c" type="_172" const="1"/>
  <CvQualifiedType id="_150c" type="_150" const="1"/>
  <CvQualifiedType id="_61c" type="_61" const="1"/>
  <CvQualifiedType id="_62c" type="_62" const="1"/>
  <CvQualifiedType id="_63c" type="_63" const="1"/>
  <File id="f0" name="/usr/share/gccxml-0.9/GCC/4.5/gccxml_builtins.h"/>
  <File id="f1" name="main1.cpp"/>
</GCC_XML>


многое не понятно. но члены вижу. нужно в доку посерьезней глянуть.

Добавлено через 1 минуту и 9 секунд
начало xml вырезал, а то форум ругался. там были только builtin функции/типы/переменные.

Добавлено через 2 минуты и 35 секунд
Цитата(xvr @  24.7.2011,  16:11 Найти цитируемый пост)
парсить отладочную информацию (DWARF2 например)

по моему, поздно что-то генерить в код, когда уже сгенерина отладочная инфа. или предлагаете двойной проход?

Добавлено через 5 минут и 39 секунд
и при использовании gcc-xml, выходной файл придется скармливать кодогенератору, я Вас правильно понял?
при использовании плагинов же, код можно обрабатывать и генерировать тем же плагином. ну или разделить парсер и генератор на два плагина.
PM WWW   Вверх
boostcoder
Дата 24.7.2011, 17:19 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



еще хочется интроспекции типа такой:
Код

__attribute__(("introspection_get_var", t))->method(); // получить переменную c именем t и вызвать метод.


вроде как согласно манам, это возможно. буду пробовать.

Добавлено @ 17:20
вот только нужно решить что удобней, аттрибуты или прагмы... согласно докам, обработка аттрибутов и прагм ничем не отличается. т.е. обработчики получают одинаковую инфу о контексте.

Это сообщение отредактировал(а) boostcoder - 24.7.2011, 18:12
PM WWW   Вверх
boostcoder
Дата 24.7.2011, 18:11 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(boostcoder @  24.7.2011,  17:19 Найти цитируемый пост)
своеобразный аналог auto

глупая идея. исключить smile
PM WWW   Вверх
xvr
Дата 24.7.2011, 18:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Комодератор
Сообщений: 7046
Регистрация: 28.8.2007
Где: Дублин, Ирландия

Репутация: 60
Всего: 223



Цитата(boostcoder @  24.7.2011,  16:24 Найти цитируемый пост)
по моему, поздно что-то генерить в код, когда уже сгенерина отладочная инфа. или предлагаете двойной проход?

Угу
Цитата(boostcoder @  24.7.2011,  16:24 Найти цитируемый пост)
и при использовании gcc-xml, выходной файл придется скармливать кодогенератору, я Вас правильно понял?

Да

Цитата(boostcoder @  24.7.2011,  16:24 Найти цитируемый пост)
при использовании плагинов же, код можно обрабатывать и генерировать тем же плагином. ну или разделить парсер и генератор на два плагина. 

Да, это явный плюс. В принципе такой плагин можно сделать на основе того же gcc-xml, а можно и не на основе  smile 
PM MAIL   Вверх
boostcoder
Дата 24.7.2011, 18:39 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(xvr @  24.7.2011,  18:32 Найти цитируемый пост)
такой плагин можно сделать на основе того же gcc-xml

по моему нет. gcc-xml это пропатченный gcc. т.е. и плагинами там и не пахнет. а разбирать его код ой как сложно smile

Добавлено через 2 минуты и 19 секунд
Цитата(boostcoder @  24.7.2011,  16:24 Найти цитируемый пост)
или разделить парсер и генератор на два плагина

кстати дочитал до того места, где объясняется как плагины могут "общаться" между собой.
PM WWW   Вверх
boostcoder
Дата 24.7.2011, 19:14 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pattern`щик
****


Профиль
Группа: Завсегдатай
Сообщений: 5458
Регистрация: 1.4.2010

Репутация: 49
Всего: 110



Цитата(boostcoder @  24.7.2011,  17:19 Найти цитируемый пост)
// получить переменную c именем t и вызвать метод.

тут, я думаю нужно получать ближайшую в скопе переменную с этим именем.
или как?

конечно, знание ЯП с нормальной introspection очень помогло бы в понимании...
PM WWW   Вверх
Ответ в темуСоздание новой темы Создание опроса
Правила форума "С++:Общие вопросы"
Earnest Daevaorn

Добро пожаловать!

  • Черновик стандарта C++ (за октябрь 2005) можно скачать с этого сайта. Прямая ссылка на файл черновика(4.4мб).
  • Черновик стандарта C (за сентябрь 2005) можно скачать с этого сайта. Прямая ссылка на файл черновика (3.4мб).
  • Прежде чем задать вопрос, прочтите это и/или это!
  • Здесь хранится весь мировой запас ссылок на документы, связанные с C++ :)
  • Не брезгуйте пользоваться тегами [code=cpp][/code].
  • Пожалуйста, не просите написать за вас программы в этом разделе - для этого существует "Центр Помощи".
  • C++ FAQ

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Earnest Daevaorn

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | C/C++: Общие вопросы | Следующая тема »


 




[ Время генерации скрипта: 0.0789 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.