[Chapel Merge] compiler/next add AST for enums and parse them

Branch: refs/heads/master
Revision: cc99117
Author: mppf
Log Message:

Merge pull request #17691 from mppf/next-enum

compiler/next add AST for enums and parse them

Enums are represented by:

  • EnumDecl, which declares
  • Enum, a TypeSymbol containing the EnumElementDecls
  • EnumElementDecl which declares
  • EnumElement

So for example in

enum myEnum {
 a, b ,c
}

myEnum is represented by an Enum (which is declared in an EnumDecl)
and a, b, and c are EnumElements (which are in turn declared with
EnumElementDecls within the Enum).

This PR also adds an iterator that can ignore Comments so that it's easy
to enumerate the EnumElementDecls or the Decls in a MultiDecl.

Modified Files:
A compiler/next/include/chpl/uast/Enum.h

A compiler/next/include/chpl/uast/EnumDecl.h
A compiler/next/include/chpl/uast/EnumElement.h
A compiler/next/include/chpl/uast/EnumElementDecl.h
A compiler/next/include/chpl/uast/TypeSym.h
A compiler/next/lib/uast/Enum.cpp
A compiler/next/lib/uast/EnumDecl.cpp
A compiler/next/lib/uast/EnumElement.cpp
A compiler/next/lib/uast/EnumElementDecl.cpp
A compiler/next/lib/uast/TypeSym.cpp
A compiler/next/test/frontend/testParseEnums.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/Comment.h
M compiler/next/include/chpl/uast/Expression.h
M compiler/next/include/chpl/uast/MultiDecl.h
M compiler/next/include/chpl/uast/VariableDecl.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
M compiler/next/test/frontend/testParseMultiVar.cpp

Compare: https://github.com/chapel-lang/chapel/compare/7ace0bfb6a2f...cc9911769a72