2013-06-03 151 views
0

我在AOP中工作,在Ubuntu虚拟框中使用AspeCt。我.acc代码:预期声明说明错误?

before(): execution(int main(void)) { 
    printf("Before test successful!\n"); 
} 
after(): execution(int main(void)) { 
    printf("world!\n"); 
} 
before(): 
call(foo) { 

printf("Before Foo!\n"); 

} 

.mc代码:

void foo(void) { 

printf("foo\n"); 

} 

int main() { 

printf("Hello everyone "); 
foo(); 
return 0; 

} 

和错误消息:

1:13: error: expected declaration specifiers before ':' token 
4:1: error : expected declaration specifiers before 'after' 
7:1: error: expected declaration specifiers before 'before' 
12:1 expected '{' at end of input 

帮助吗?我很难决定如何解决这个问题!谢谢

回答

0

解决了这个问题,你需要在Linux环境下用gcc预处理文件,分别保存为.acc和.mc文件。然后你需要通过acc来运行它们,并通过gcc再次生成.c文件。 ./a.out,你就完成了。