2013-06-03 6 views
0

저는 AOP에서 우분투 가상 박스에서 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를 통해 실행해야하고 그 결과 .c 파일을 gcc를 통해 다시 실행해야합니다. ./a.out 그리고 너 끝났어.

관련 문제