how can i catch any comment everywhere?
I wrote a c-like idl for my project. I want to get allmost all comment in my syntax tree. but it allways got conflict.
enum abc
{
// comment for v1
v1 = 1; // comment for v1 too.
// comment for v2
v2
};
tok_doc = . // use c-like comment
tok_enum = . // equal "enum"
tok_identifier = . // like c identifier
tok_int_constant = . // int const value(like 1,2,3..)
DOC = {tok_doc} .
OptEnd = [";"] .
Enum = tok_enum tok_identifier "{" EnumItems "}" OptEnd .
EnumItems = {EnumItem} .
EnumItem = DOC tok_identifier [ "=" tok_int_constant ] OptEnd DOC .