J
jacob navia
The IDE of lcc-win32 is specifically done for the C language.
Besides the obvious syntax coloring, we have an automatic
index (which functions are defined in the current document).
For parsing this, no full fledged compilation is necessary. The
algorithm I follow is very simple:
1: Strip comments and char strings.
2: In the remaining text search at level
zero (when no braces have been seen)
for the characters ')' and then '{'.
Those are the starts of the functions in the text.
Scan backwards to gather the definition, forwards
to the next matching closing brace for the body.
This has been working since several years but I have
never proved it. Can it be possible to write in standard
C the character sequence
) ... {
besides at the start of a function definition?
I think C99 allows
struct f { int a,b; };
struct f = (struct f){1,2};
But this is a bit pathological since
struct f = { 1 , 2};
works too.
In any case wedit is not fooled by that, but
besides this one, is there any other I haven't
seen?
Thanks for your time.
Besides the obvious syntax coloring, we have an automatic
index (which functions are defined in the current document).
For parsing this, no full fledged compilation is necessary. The
algorithm I follow is very simple:
1: Strip comments and char strings.
2: In the remaining text search at level
zero (when no braces have been seen)
for the characters ')' and then '{'.
Those are the starts of the functions in the text.
Scan backwards to gather the definition, forwards
to the next matching closing brace for the body.
This has been working since several years but I have
never proved it. Can it be possible to write in standard
C the character sequence
) ... {
besides at the start of a function definition?
I think C99 allows
struct f { int a,b; };
struct f = (struct f){1,2};
But this is a bit pathological since
struct f = { 1 , 2};
works too.
In any case wedit is not fooled by that, but
besides this one, is there any other I haven't
seen?
Thanks for your time.