Are there any special samples pack for testing parser grammar(C/C++, yacc or something else grammar), that will cover most of C/C++ grammar features starting from simple expressions like:
int a;
int b;
b=a+a+b-a+b;
printf("hello");
or
template<class R, class T,
class B1, class B2,
class A1, class A2, class A3>
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
{
typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
}
with difinitions what type of test it is(like: “this test is for checking work with pointer’s”).
GCC has a lot of test-cases in the source, so if your grammar is open source under GPL, then you can use that.
Otherwise, try finding large open source projects and just feeding that through it – you’ll obviously have to verify that it is correct, and since no two compilers produce the same output [whatever stage you look at it], you will have to figure out “what it’s supposed to be” yourself. Or write something that can translate the intermediate files from GCC to the same format as your grammar output, and compare…