我在 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
请帮忙?我很困惑如何解决这个问题!谢谢