Extending scripting API for basic C++ constructs?

Issue #77 new
smogm NA created an issue

Is it possible to extend the scripting API of vera++, to get detailled information about more complex c++ constructs.

Let's say something like "getClassMethods", which detects lines in the format of

[additional specifiers] returntype className::methodName([parameters])

and returning a list with the separated components (is definition or declaration?, specifiers like const or static, return type, class name, method name, parameter list, line number etc).

Or something like "getFunctions", which does the same for non-class functions.

My Problem is, that it is very hard to detect code with line breaks in the parameter list or somewhere of a function or method definition/declaration with regular expressions, and parsing over multiple lines for code like this:

void testFunction(int a,
int b)
{
   // some code
}

Also a very nice feature would be to get, maybe as additional return data of "getClassMethods", the first and last line of the code of the function or method.

Thank you!

Comments (2)

  1. Jason Sachs

    Sounds like smogm is asking for grammar-level parsing, not just lexical tokenizing. I was going to make the same comment.

  2. Log in to comment