Branch: refs/heads/master
Revision: 4d01687
Author: dlongnecke-cray
Log Message:
Merge pull request #17658 from dlongnecke-cray/next-add-for
next: Add AST node for For loops (#17658)
This is for compiler/next
.
Add AST interfaces for for loops, as well as parser rules for parsing
for loops that appear at a statement level.
Add a new abstract class IndexableLoop
that is a child of Loop
.
It represents any kind of loop which is "indexable", such as For
,
Forall
, Coforall
. It contains methods to get the index variable
and iterand of the loop.
After discussion, we settled on having one index variable and one
iterand per IndexableLoop (as opposed to having N iterands and N
index variables). The zip()
construct will have its own AST node
which will represent it as an iterand.
Reviewed by @mppf and @vasslitvinov. Thanks!
TESTING:
- [x] All
compiler/next
tests pass
Signed-off-by: David Longnecker dlongnecke-cray@users.noreply.github.com
Modified Files:
A compiler/next/include/chpl/uast/ControlFlow.h
A compiler/next/include/chpl/uast/For.h
A compiler/next/include/chpl/uast/IndexableLoop.h
A compiler/next/include/chpl/uast/Loop.h
A compiler/next/lib/uast/ControlFlow.cpp
A compiler/next/lib/uast/For.cpp
A compiler/next/lib/uast/IndexableLoop.cpp
A compiler/next/lib/uast/Loop.cpp
A compiler/next/test/frontend/testParseFor.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/Variable.h
M compiler/next/lib/frontend/Parser/ParserContext.h
M compiler/next/lib/frontend/Parser/ParserContextImpl.h
M compiler/next/lib/frontend/Parser/chapel.ypp
M compiler/next/lib/frontend/Parser/parser-dependencies.h
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/test/frontend/CMakeLists.txt
Compare: https://github.com/chapel-lang/chapel/compare/3736bee8b87e...4d01687f83ce