>dont u think even the one u classified as a beginner category is way ahead for a beginner.
It's just simple textual substitution. I think anyone who can read from a file and parse a simple string should have little trouble with it.
>how to connect to the prepocessor.
The preprocessor is just a separate program that you run on the source code before really compiling it. For example, you have a .ec file that uses extended C:
Code:
#include <stdio.h>
int
main(void)
{
printf("My extended C program\n");
for i := 1 to 10 {
printf("%d\n", i);
}
printf("Bye bye!\n");
return 0;
}
Then you would run the preprocessor program independently of the compiler to get a .c file (assuming you call your preprocessor program ppec and it takes two arguments, the first being the extended C and the second being the resulting C source file):
Code:
$ ppec prog.ec prog.c
$ cat prog.c
#include <stdio.h>
int
main(void)
{
printf("My extended C program\n");
{
int i;
for (i = 1; i <= 10; i++) {
printf("%d\n", i);
}
}
printf("Bye bye!\n");
return 0;
}
Then you run the compiler on that C source file:
Code:
$ gcc prog.c
$ ./a.out
My extended C program
1
2
3
4
5
6
7
8
9
10
Bye bye!