This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
-
请问flex如何分析得出头文件"include<xxx.h>"的具体token location , 不太清楚该如何下手... |
Beta Was this translation helpful? Give feedback.
Answered by
wu-kan
Feb 20, 2022
Replies: 1 comment 2 replies
-
可以看一下经过预处理之后的代码,其中 $ cat test/h_functional/105_long_array2.sysu.c | clang -cc1 -Isylib -E
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 321 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2
# 1 "sylib/sylib.h" 1
# 10 "sylib/sylib.h"
int getint(), getch(), getarray(int a[]);
void putint(int a), putch(int a), putarray(int n, int a[]);
void _sysy_starttime(int lineno);
void _sysy_stoptime(int lineno);
# 2 "<stdin>" 2
int a[4096];
int f1(int b[])
{
a[5] = 4000;
a[4000] = 3;
a[4095] = 7;
b[a[4095]] = a[2216] + 9;
return a[a[5]];
}
int main()
{
_sysy_starttime(15);
int b[4][1024] = {{}, {1}, {2, 3}, {4, 5, 6}};
int c[1024][4] = {{1, 2}, {3, 4}};
putint(f1(c[0]));
putch(10);
return c[2][0];
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
wu-kan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可以看一下经过预处理之后的代码,其中
# 1 "sylib/sylib.h" 1
指出了头文件中的 token location;随后# 2 "<stdin>" 2
回到原文件。其他内容如# 1 "<built-in>" 1
用于处理clang内置类型(如__int128
)在本实验中可以忽略。