Luiz-Monad / aspectc

Automatically exported from code.google.com/p/aspectc
0 stars 0 forks source link

tacc command cannot accept .acc files alone #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write an .acc file that contain both C and AspeCtC code
2. tacc to compile one single acc file with mixed code

What is the expected output? What do you see instead?
If the codes are correctly written, there should be no error, but 
currently, tacc will not accept one single file. It will give an error

Please use labels and text to provide additional information.
Reported by H.-Arno Jacobsen

Original description: 

Let's remember this as a bug for tacc. It would be nice, if we could fix 
that for 0.8. It would also help us to simplify the presentation of the 
examples on the web site.
 -a worked with acc and all in one file; I tried it again. However, now we 
cannot have all in one file and exclude the application of aspects to the 
code in the advice. Is this critical? Is this a bug?
tacc -o bin coreAspect.acc fails, see below
 tacc cannot accept "acc" files alone right now. For mixed code, I think
I have to do some work to modify tacc since this changes my current compile 
strategy.
2. With tacc and just one file with core and aspect together.This fails.
 sailor$ tacc -o abin coreAspect.acc
/home/arno/ac/.acc_dir/coreAspect_ac.c:13:2: warning: no newline at end of 
file
 /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-
cygwin/bin/ld:coreAspect.acc: file format not recognized; treating as 
linker script /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-
cygwin/bin/ld:coreAspect.acc:1: syntax error collect2: ld returned 1 exit 
status
void foo(char * a) {
printf("inside foo, a = %s\n", a);
 }
 int main() {
foo("abcde");
 }
void around(): call(void foo(char *)) {
     printf("in around advice: start\n");
     proceed();
     printf("in around advice: end\n"); }

Original issue reported on code.google.com by lzmliz...@gmail.com on 13 May 2010 at 7:05

GoogleCodeExporter commented 8 years ago
Test Case:
see the attechment.

>tacc main.acc -o a
>./a

Expected Output:

before main.
in main.
int a is modified.
a is '5'.

Tentative Solution:

Since the current compile strategy is:
acc xxx.mc xxx.acc 
-preparse the files and generate two .c files.

tacc xxx.c xxx.acc
-preparse the files and gcc compile the parsed files and generate .exe file.

ACC doesn't have the feature to compile one mixed file (mixed of .c and .acc 
code).
To do this, what we can do is that we can parse the mixed file and then use 
tacc just
as before.

To parse the mixed code, we can develop parsing algorithm or use existing 
parsing tools. 
The solution to this problem will be updated soon.

Original comment by kedeng1...@gmail.com on 13 May 2010 at 9:16

Attachments: