View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed May 26, 2021 1:30 pm Post subject: |
|
|
If you use file extensions consistently (for fixed and free format Fortran) then Plato can be configured accordingly.
In the Settings dialog (on the Tools menu), select "Text Editor", then "Language settings" and finally Free or Fixed format Fortran.
In the edit box for "File Filter", set the relevant file extensions. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2819 Location: South Pole, Antarctica
|
Posted: Wed May 26, 2021 5:51 pm Post subject: |
|
|
Are f, for, f90, f95 extensions reserved for fixed and free format by the Standard or just traditionally? Anyway, it is very easy to detect what format it is automatically. Artificial intelligence will substitute 50% of humans in 20 years and we are talking about elementary |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed May 26, 2021 6:11 pm Post subject: |
|
|
They are not in the Standard but are commonly assumed. FTN95 makes the same assumption.
If you want to send me your algorithm for automatically testing for fixed/free format then I will see if I can add it to Plato and FTN95. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2819 Location: South Pole, Antarctica
|
Posted: Wed May 26, 2021 11:12 pm Post subject: |
|
|
The FTN95 can do that itself by pre-processing the source code with and without /free or /fixed . It is doing that very fast as only beginning 10-20 errors will stop it.
If the file is fixed form but compiled as /free FTN95 gives many errors with diagnostics like
*** Invalid character '*' at start of line, statement not recognised
and if free format source compiled as fixed format source it gives errors like
*** Invalid characters in label field of FIXED format source, Statement not recognised
Other indicators -
1) columns 1 through 5 are reserved for statement labels for fixed format and not for free
2) letter C or an * placed in column 1 indicates that the statement is a comment for fixed and give error with /free
3) words continuing after 72th character are for /free unless there is no restriction with 72 characters are given with special compilation key
4) continuations of free format source end with &
etc also give the clue if this is fixed source or free one. The simplest 30 minutes program which checks 1) and 2) already gives 99% chance that the source code is identified, all 4 will give 99.99%. This is not a self-driving AI problems like in Tesla electric car
If problem will occur, and they will with not yet debugged code, or text is too small (like just one line Hello World) the preprocessor may ask the user: "The text too small, has non-standard syntax or not yet fully debugged, with probability 98% it looks like a fixed format source. Do you agree to treat it as fixed one?"
Other approach is to use Metcalf's converter from fixed to free format source code for it is freely available. Preprocessing fortran source with it but without real conversion and just counting in how many lines it had similar troubles like FTN95 above had, will also tell if this is actually fixed source or not
Quote: | https://people.math.sc.edu/Burkardt/f_src/f77_to_f90/f77_to_f90.f90 |
Ones Mecej4 gave me the program which extracts snippets out of large code. It preprocessed the source code with much larger details than i even know. And you also know much more than me in these matters
This human-computer communication with the user will make Plato simpler and more enjoyable to work with. Answering its Yes No is simpler than digging inside and trying to find where the hell is this or that settings |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Thu May 27, 2021 8:18 am Post subject: |
|
|
Dan
Thank you for your detailed reply. Unfortunately I don't know how to respond without getting into a long conversation. |
|
Back to top |
|
|
|