[flang] Resolve array specifications of entities.
Add ArraySpecVisitor to recognize the various forms of array specifications.
They are tracked in arraySpec_ and attrArraySpec_. Both are needed because
a declaration like `integer, dimension(4) :: x(2,2), y` has two different
array-specs.
The method DeclareEntity was extracted out to handle the common part for
EntityDecl, ObjectDecl, and DimensionStmt. AllocatableStmt and TargetStmt
are now handled through their contained ObjectDecl.
The test resolve07 checks the interactions between these kinds of declarations.
Rename ComponentArraySpec to ArraySpec as it doesn't just occur in components.
Fix some 'begin' and 'end' methods to start with upper-case letters.
Original-commit: flang-compiler/f18@
3d4d7430b559a135a3eddf8291449106195406a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/53