|
| 1 | + |
| 2 | +1. Added preprocessing stage for fixed-form files. This currently uses a grammar, FixedForm.sdf, a transformation program, fixed-to-free, and unparsing rules, FreeForm.pp. This will likely be replaced by a C++ program to allow for more functionality (for example, Holleriths in format statements). |
| 3 | + |
| 4 | +2. Refactored grammar in Main.sdf to include obsolete features (FortranObsolete.sdf) and extensions (FortranExtensions.sdf). |
| 5 | + |
| 6 | +Features added/moved to obsolete grammar module: |
| 7 | + |
| 8 | +- old-style component initialization, between '/' '/' |
| 9 | + |
| 10 | +- AssignStmt, ActionStmt, PauseStmt |
| 11 | + |
| 12 | +3. Refactored grammar to fix ambiguities |
| 13 | + |
| 14 | + Added PrivateComponentsStmt. |
| 15 | + |
| 16 | + Added id to wait-spec-list. |
| 17 | + |
| 18 | + Fixed ambiguity in R924-R928 by adding a preference for one of the options. |
| 19 | + |
| 20 | + Added EndfileStmt |
| 21 | + |
| 22 | + Added transformation of eos to Comment for EndfileStmt. Also added R913/R914 ID. |
| 23 | + |
| 24 | + Added transformation of eos to Comment for EndfileStmt |
| 25 | + |
| 26 | + Fixed unparsing of R469 AcSpec |
| 27 | + |
| 28 | + Simplified unparsing of IfThenElse statements by removing unneeded rules used to suppress blank spaces if name not used. |
| 29 | + |
| 30 | + Cleaned up unparsing of CaseConstruct (removed unneeded optional name terms) |
| 31 | + |
| 32 | + Cleaned up unparsing of CaseConstruct (removed unneeded optional name terms) |
| 33 | + |
| 34 | + Replaced eos with Comment annotation for DefaultGuardStmt. |
| 35 | + |
| 36 | + Fixed unparsing of SelectTypeStmt. |
| 37 | + |
| 38 | + Improved handling of ambiguous io-control-spec-list so that fewer FMT-or-NML branches are required. For example, the '*' format is now recognized as FMT(STAR()) rather than MFT-or-NML(STAR()). |
| 39 | + |
| 40 | + Changed Read/Write unparsing format as part of fixing an ambiguity in an io-control-spec-list. |
| 41 | + |
| 42 | + |
| 43 | + Fixed unparsing of case constructs. |
| 44 | + |
| 45 | + Added testing of files (*.f90.no-diff) for which the unparsed file isn't expected to match the original. |
| 46 | + |
| 47 | + Removed eos from LableDoStmt. |
| 48 | + |
| 49 | + |
| 50 | + Add/Fixed EnumDef (and statements) regarding EOS. |
| 51 | + |
| 52 | + Added ppEnumerator to take care of case with no value expression. |
| 53 | + |
| 54 | + Add/Fixed EnumDef (and statements) regarding EOS. |
| 55 | + |
| 56 | + Added functionality sufficient to traverse the initial test program for the new (experimental) OFP to ROSE connection. Primarily fixed the way SgUntypedType was created and operators. |
| 57 | + |
| 58 | + Refactored expressions to use the Fortran standard syntax using Level1Expr ... This allows the standard to be followed as well as makes it easier to use SDF prefer syntax for preferences. Didn't really end up using this as in fixing ambiguities (explained below) had to remove ambiguities directly by stuffing more things into a DataRef. Removed (commented out) InitialDataTarget, StructureConstructure, DataRef -> ParentString, and FunctionReference -> Primary. This was done because things that look like function references are ambiguous with array refs to let them be DataRefs and disambiguate them later. Added SubstringRange to OptSectionSubscripts. Added Keyword '=' ActualArg and AltReturnSpec to SectionSubscript so an array can pretend to be a function reference. |
| 59 | + |
| 60 | + Added rewrite rules for removing EOS from: TypeBoundProcedureInterfaceStmt, SelectCaseStmt, CaseStmt, EndSelectStmt, SelectTypeStmt, TypeGuardStmt, ClassGuardStmt, and EndSelectTypeStmt. |
| 61 | + |
| 62 | + Added: ppDataComponentDefStmt, ppTypeParamDecl, ppTypeBoundProcedureStmt, and ppTypeParamSpec. |
| 63 | + |
| 64 | + Added PauseStmt to deleted statements. |
| 65 | + |
| 66 | + Added TypeBoundProcBinding, TypeBoundProcedureStmt, TypeBoundGenericStmt, TypeParamAttrSpec, and rules associated with CaseConstruct. |
| 67 | + |
| 68 | + Added: ppTypeParamDecl, ppTypeBoundProcedureStmt, and ppTypeParamSpec. Fixed: SelectTypeStmt, TypeGuardStmt, ClassGuardStmt, and DefaultGaurdStmt for EOS. Improved EndSelectTypeStmt for indentation. |
| 69 | + |
| 70 | + Added transformation for ppTypeBoundProcDecl (arity one) |
| 71 | + |
| 72 | + |
| 73 | + Added TypeBoundProcedureStmt. |
| 74 | + |
| 75 | + Added Comments for TypeBoundProcedureStmt. |
| 76 | + |
| 77 | + Added FortranObsolete.sdf dependency for Main.def |
| 78 | + |
| 79 | + Added: Pass(no-arg-name()) transformation, ppArrayVarLen (with rule producing it), and ppProcDecl. |
| 80 | + |
| 81 | + Added Comment annotation for ProcComponentDefStmt, fixed CHARACTER_LEN for ArrayType variables, and corrected some rules by adding <+ |
| 82 | + |
| 83 | + Added: NOPASS, ppArrayVarLen, ppProcDecl, and removed eos from ProcComponentDefStmt. |
| 84 | + |
| 85 | + Added test for type that was formerly in R443 (old rule number). |
| 86 | + |
| 87 | + Added test for type that was formerly in R443 (old rule number). |
| 88 | + |
| 89 | + Added AltReturnSpec |
| 90 | + |
| 91 | + Added testing of new feature for renaming operators. |
| 92 | + |
| 93 | + Removed constructor for UseDefinedOperator and LocalDefinedOperator. |
| 94 | + |
| 95 | + Added RenameOp |
| 96 | + |
| 97 | + Added preference of DefinedBinaryOp to LocalDefinedOperator and UseDefinedOperator in order to fix ambiguity. |
| 98 | + |
| 99 | + Completed Format edit descriptors. |
| 100 | + |
| 101 | + Fixed ambiguity between substrings, function references, and arrays DataRef/PartRef by using {prefer}. |
| 102 | + |
| 103 | + Added a nonpreferred '/' ControlEditDesc without the leading comma so that it could appear as the first descriptor in a format statement. |
| 104 | + |
| 105 | + Replaced uncommented EndXStmt with {reject}. |
| 106 | + |
| 107 | + Added no-diff testing for parsing of tricky files that won't unparse to exactly the same (alternative) syntax. |
| 108 | + |
| 109 | + Removed EndProgramStmt, EndSubroutineStmt, ... from productions of ActionStmt because it created an ambiguity for a bare END statement (without program, subroutine, ...). If the end statements don't produce an action statement they can't be added to the executable list so the parsing can now be untangled. |
| 110 | + |
| 111 | + Fixed ambiguity in DefinedOperator by prefering DefinedUnaryOp over DefinedBinaryOp (both are DOP from lex grammar) |
| 112 | + |
| 113 | + Uncommented .unaryop. and .binaryop. tests. |
| 114 | + |
| 115 | + Added all of the operators. |
| 116 | + |
| 117 | + |
| 118 | + Added more digits to some labels and used 0. |
| 119 | + |
| 120 | + Added duplicate formats that should unparse to the same thing. This should be tested somehow (by testing the resulting aterms). |
| 121 | + |
| 122 | + Added ProcComponentRef |
| 123 | + |
| 124 | + Removed DataRef % BindingName as it was ambiguous with ProcComponentRef |
| 125 | + |
| 126 | + |
| 127 | + Fixed ambiguity between Designator and FunctionReference prefering Designator. |
| 128 | + |
| 129 | + Changes to make compilable. |
| 130 | + |
| 131 | + Fixed Substring/DataRef ambiguity by using prefer |
| 132 | + |
| 133 | + |
| 134 | + Make type of ComponentInitialization a ConstantExpr rather than plain expr (mimics Initialization) |
| 135 | + |
| 136 | + Added FortranExtensions.sdf dependency to Main.def target. |
| 137 | + |
| 138 | + Added deleted initialization form '/' expr '/' |
| 139 | + |
| 140 | + Added CrayPointerStmt |
| 141 | + |
| 142 | + Fixed where constructs. |
| 143 | + |
| 144 | + Added EntryStmt. |
| 145 | + |
| 146 | + Added constructors for DataStmtRepeat |
| 147 | + |
| 148 | + Fixed BozLiteralConstant. |
| 149 | + |
| 150 | + Starting to fixup WhereConstruct. |
| 151 | + |
| 152 | + Starting to fixup WhereConstruct. Also backed out adding constructor for DataStmtRepeat. For some reason this wile break the creation of a regular tree grammar for FAST.rtg |
| 153 | + |
| 154 | + Fixed R608 Substring - already added to unit test below |
| 155 | + |
| 156 | + Fixed DataComponentDefStmt by constructing OptComponentArraySpec as ArraySpec. Also ComponentInitialization -> Init and add KeywordArgSpec to allow actual args with keywords to be parsed as PartRefs. |
| 157 | + |
| 158 | + Removed R438 opt-component-array-spec (replaced by ArraySpec in Main.sdf) |
| 159 | + |
| 160 | + Fixed DataComponentDefStmt |
| 161 | + |
| 162 | + Added AssumedClass and AssumedType. Fixed Class in a type declarations stmt. |
| 163 | + |
| 164 | + Added CrayPointerStmt support and improved handling of character declarations (EntityDecl). |
| 165 | + |
| 166 | + Added imports of FortranExtensions. |
| 167 | + |
| 168 | + Added CrayPointerStmt (ER550). |
| 169 | + |
| 170 | + Added SignedIntLiteralConstant |
| 171 | + |
| 172 | + Fixed AssumedSize constructor so that it had constant arity. |
| 173 | + |
| 174 | + Added more FormatSpec items (needs to be uncommented and tested). |
| 175 | + |
| 176 | +---------- |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | +Improvements to parsing |
| 181 | +----------------------- |
| 182 | + |
| 183 | +- modified handling of free-form comments to remove ambiguity with statements |
| 184 | + |
| 185 | +- added EXIST (R931) as part of an inquire-spec |
| 186 | + |
| 187 | +- added IncludeStmt (not actually a statement in Fortran) |
| 188 | + |
| 189 | +- added CrayPointerStmt and CrayPointerDecl |
| 190 | + |
| 191 | + Modified ATerms to reflect recent changes in Main.sdf to produce FAST terms directly rather than requiring extra transformation rules. |
| 192 | + |
| 193 | + IntVal (with arity of 1 and 2) is now being output by the parser rather than IntLiteralConstant. |
| 194 | + |
| 195 | + Added HexVal, OctVal, BinVal, and IntVal. |
| 196 | + |
| 197 | + Added several constructors leading directly to FAST terms thus reducing need for later transformations. For example, REAL with KindSelector and CHARACTER with CharSelector. Other examples: KindSelector -> Kind, RealLiteralConstant -> RealVal, BozLiteralConstant_HC -> HexVal, LogicalLiteralConstant -> TRUE/FALSE |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | +Improvements to transformations to FAST |
| 202 | +--------------------------------------- |
| 203 | + |
| 204 | +PrivateComponentsStmt statement transformations for comments |
| 205 | + |
| 206 | +Simplified EntityDecl rewrite rule transforming to a Var for character lengths. |
| 207 | + |
| 208 | + Added CHARACTER_LEN(char_length) option to transformation of EntityDecl. Previously only supported no-char-length. |
| 209 | + |
| 210 | + |
| 211 | +Improvements to unparsing |
| 212 | +------------------------- |
| 213 | + |
| 214 | +Added indentation for a Block. |
| 215 | + Added indentation for statements within a block-construct. |
| 216 | + |
| 217 | + |
| 218 | +Also fixed issue with char-length (R422) unparsing incorrectly for statements like: character*(2) |
| 219 | + |
| 220 | +Added multiple inquire-specs (in particular OPENED). |
| 221 | + |
| 222 | + Added Parens(STAR()) to replace CHARACTER_LEN(STAR) so it can be unparsed correctly. |
| 223 | + |
| 224 | + Added support for ForallStmt and indentation for ForallConstruct. |
| 225 | + |
| 226 | + |
| 227 | +Bug Fixes: |
| 228 | +---------- |
| 229 | + |
| 230 | +Issue #15: Added rewrite of PartRef with substring-section-range to Substring as part of major refactoring to fix this issue. Also added rewrite of ParensUnaryPlus/Minus to add obsolete feature for expressions, e.g., a--b to a-(-b) |
| 231 | + |
| 232 | +Issue #16: Transformed LengthSelector_STAR(CharLength(STAR())) to STAR() |
| 233 | + |
| 234 | +Issue #17: Modifications allowing simpler io-control-spec-lists (specifically UNIT=, FMT=, and NML= specifiers) as long as they are correctly ordered. The bug is that FMT can be ambiguous with NML so a new constructor was added, FMT-or-NML which will have to be figured out during analysis. |
| 235 | + |
| 236 | +Issue #18: Fixed Continuation so that blank and comment lines can appear within a continuation. Also added a transformation of a RealVal with a kind to RealVal(val,ppLiteralKind(kval)). |
| 237 | + |
| 238 | +Issue #21: Added IncludeStmt (although not actually a statement in Fortran). |
| 239 | + |
| 240 | +Issue #33: Made whitespace before continuation character '&' optional. |
| 241 | + |
| 242 | +Issue #34: Added CrayPointerStmt and CrayPointerDecl. |
| 243 | + |
| 244 | +Issue #35: Added '*' as a COMMENTCHAR in fixed format preprocessing. |
| 245 | + |
| 246 | +Issue #36: Added multiple inquire-specs (in particular OPENED). |
| 247 | + |
| 248 | + |
| 249 | +Testing: |
| 250 | +-------- |
| 251 | + |
| 252 | +Added several files to the tests/rule-tests/pp directory for the round-trip |
| 253 | +testing of Fortran rules. Also, parsing of the files in the tests/rule-tests |
| 254 | +directory as another set of tests. In addition, added tests in the tests/issues |
| 255 | +directory to ensure that issues reported on the bug tracking system at github.com |
| 256 | +remain fixed (although one outstanding bug in this directory remains to be fixed). |
| 257 | + |
| 258 | + Added additional statements to test for ambiguity. |
| 259 | + Added another statement to trigger a potential ambiguity (although since the unparsed form is being tested it won't actually be triggered, see file in parent directory ../). |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | +Some of these new tests required changes to the grammar, transformations to FAST, |
| 265 | +and the unparser. |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | +A partial list of files for unit testing added (or improved) to the |
| 270 | +tests/rule-tests/pp directory includes: |
| 271 | + |
| 272 | +R417, R437, R438, R444, R456, R468, R451, R455, R468, R469, R537, R608, R609, R618, |
| 273 | +R741, R922, R923, R924, R925, R926, R927, R928, R929, R930, R931, R1221, R1222, R1223 |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
0 commit comments