Function List - Nesting

Function List - Nesting

2
NewbieNewbie
2

    Mar 30, 2008#1

    hi

    is this possible in function list view?

    for example say i have the following c function definition :

    void main_program(int in){

    call_function_1();
    call_function_2();
    ...
    }


    then in the function list it would show up as follows:

    main_program
    ...call_function_1
    ...call_function_2

    only one level of nesting would be good enough.

    thanks

    6,675585
    Grand MasterGrand Master
    6,675585

      Mar 30, 2008#2

      No, nesting is not possible. And call_function_1(); is not a function definition, it is a call of a function. Normally only function definitions (should be) are in the function list.
      Best regards from an UC/UE/UES for Windows user from Austria

      262
      MasterMaster
      262

        Mar 31, 2008#3

        I agree with Mofi that the function list generally should contain, well function definitions.

        But I work with NATURAL source code and beside functions (SUBROUTINES) I want some other constructs of the language in my function list nested and indented.

        So I right click in the function list and remove the checkmark from the "sort list" option.

        Then I make sure that the other language constructs "capture" whitespace in front of the command. Example:
        /Function String = "^\d{4} DEFINE SUBROUTINE[ ]+([\w_\-]+)"
        ...
        /Function String 3 = "^\d{4}[ ]*?([ ]CALLNAT[ ]+[']?[\w\-]+[']?)"
        ...

        Notice that I capture a blank in front of CALLNAT:
        ([ ]CALLNAT
        which indents the CALLNAT (function call) slightly from the functions in the function list.

        It looks something like this:

        Code: Select all

        A-STACK-FUNKTIONSNAVNE
           STACK COMMAND 'FOOO-P82'
        E-RETTELSE-TIL-TEKST
           CALLNAT 'NFOOBAR0'
        F-KONTROLLER
        (more than one whitespace is added to better illustrate my point).

        A 'dirty' workaround but it's ok for my use.

        So if you are able to write a pattern that will match your function calls in your C code you should be able to do the same when you integrate it into the existing C wordfile definition (search for "Syntax Highlighting" in the UE help for more info.).

        2
        NewbieNewbie
        2

          Mar 31, 2008#4

          thanks i will try to implement something now i know there is a sort of solution to it.