-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于数组的处理 #13
Comments
farray是原作者实现的,可以参考 CFortranTranslator/for90std/farray.h Lines 588 to 599 in 299110e
里面用裸指针和手工内存管理实现了fortran的数组。 关于为什么这样设计,参考原作者的文档: https://github.com/YHN-ice/CFortranTranslator/blob/299110ef6d0898790572f620a9edf3bcf5925f38/docs/brief/array.md 这里给出一些具体实现转换的代码位置,或许可以作为阅读源码的起点: 语法解析 CFortranTranslator/src/grammar/for90.y Lines 717 to 727 in 299110e
代码生成
另外,提issue时如果附上代码,最好translator的input和output一起给出,可参考其他issue。截图最好注明来源。 |
我留意到文件中有说明将数组和函数进行合并处理,请问具体是如何将fortran数组译为c++对应的存储结构呢?我在自己测试的代码中发现fortran数组在c++中翻译为了一种struct,我想知道为什么不直接翻译为c++数组。
另外,我还对数组的存取方式感到疑惑,例如:
其中,a和b在声明时均是long double引用,而使用时却类似于数组名,INOUT(i)函数代表下标为i,我想知道这是如何作为数组访问的。
The text was updated successfully, but these errors were encountered: