Changes in / [31f4837:acb33f15]
- Files:
-
- 124 added
- 123 deleted
- 90 edited
-
doc/theses/jiada_liang_MMath/CFAenum.tex (modified) (6 diffs)
-
doc/theses/jiada_liang_MMath/background.tex (modified) (3 diffs)
-
doc/theses/jiada_liang_MMath/intro.tex (modified) (1 diff)
-
doc/theses/jiada_liang_MMath/relatedwork.tex (modified) (20 diffs)
-
doc/theses/mike_brooks_MMath/background.tex (modified) (5 diffs)
-
driver/cfa.cc (modified) (1 diff)
-
libcfa/src/enum.hfa (modified) (1 diff)
-
src/AST/Decl.cpp (modified) (1 diff)
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/AST/Inspect.cpp (modified) (1 diff)
-
src/AST/Label.hpp (modified) (1 diff)
-
src/AST/LinkageSpec.cpp (modified) (1 diff)
-
src/AST/LinkageSpec.hpp (modified) (1 diff)
-
src/AST/Node.hpp (modified) (1 diff)
-
src/AST/ParseNode.hpp (modified) (1 diff)
-
src/AST/Pass.hpp (modified) (1 diff)
-
src/AST/Pass.proto.hpp (modified) (2 diffs)
-
src/AST/Print.hpp (modified) (1 diff)
-
src/AST/Stmt.hpp (modified) (1 diff)
-
src/AST/SymbolTable.cpp (modified) (1 diff)
-
src/AST/SymbolTable.hpp (modified) (1 diff)
-
src/AST/Type.cpp (modified) (1 diff)
-
src/AST/TypeEnvironment.cpp (modified) (1 diff)
-
src/AST/TypeEnvironment.hpp (modified) (1 diff)
-
src/AST/TypeSubstitution.cpp (modified) (1 diff)
-
src/AST/TypeSubstitution.hpp (modified) (2 diffs)
-
src/AST/Util.cpp (modified) (1 diff)
-
src/BasicTypes-gen.cpp (modified) (3 diffs)
-
src/CodeGen/CodeGenerator.cpp (modified) (1 diff)
-
src/CodeGen/CodeGenerator.hpp (modified) (1 diff)
-
src/CodeGen/FixMain.cc (added)
-
src/CodeGen/FixMain.cpp (deleted)
-
src/CodeGen/FixMain.h (added)
-
src/CodeGen/FixMain.hpp (deleted)
-
src/CodeGen/FixNames.cc (added)
-
src/CodeGen/FixNames.cpp (deleted)
-
src/CodeGen/FixNames.h (added)
-
src/CodeGen/FixNames.hpp (deleted)
-
src/CodeGen/GenType.cc (added)
-
src/CodeGen/GenType.cpp (deleted)
-
src/CodeGen/GenType.h (added)
-
src/CodeGen/GenType.hpp (deleted)
-
src/CodeGen/Generate.cc (added)
-
src/CodeGen/Generate.cpp (deleted)
-
src/CodeGen/Generate.h (added)
-
src/CodeGen/Generate.hpp (deleted)
-
src/CodeGen/LinkOnce.cc (added)
-
src/CodeGen/LinkOnce.cpp (deleted)
-
src/CodeGen/LinkOnce.h (added)
-
src/CodeGen/LinkOnce.hpp (deleted)
-
src/CodeGen/OperatorTable.cc (added)
-
src/CodeGen/OperatorTable.cpp (deleted)
-
src/CodeGen/OperatorTable.h (added)
-
src/CodeGen/OperatorTable.hpp (deleted)
-
src/CodeGen/Options.h (added)
-
src/CodeGen/Options.hpp (deleted)
-
src/CodeGen/module.mk (modified) (1 diff)
-
src/Common/Assert.cc (added)
-
src/Common/Assert.cpp (deleted)
-
src/Common/CodeLocation.h (added)
-
src/Common/CodeLocation.hpp (deleted)
-
src/Common/CodeLocationTools.cpp (modified) (1 diff)
-
src/Common/DebugMalloc.cc (added)
-
src/Common/DebugMalloc.cpp (deleted)
-
src/Common/DeclStats.cpp (modified) (1 diff)
-
src/Common/ErrorObjects.h (added)
-
src/Common/ErrorObjects.hpp (deleted)
-
src/Common/Eval.cc (added)
-
src/Common/Eval.cpp (deleted)
-
src/Common/Eval.h (added)
-
src/Common/Eval.hpp (deleted)
-
src/Common/Examine.cc (added)
-
src/Common/Examine.cpp (deleted)
-
src/Common/Examine.h (added)
-
src/Common/Examine.hpp (deleted)
-
src/Common/FilterCombos.h (added)
-
src/Common/FilterCombos.hpp (deleted)
-
src/Common/Indenter.cc (added)
-
src/Common/Indenter.cpp (deleted)
-
src/Common/Indenter.h (added)
-
src/Common/Indenter.hpp (deleted)
-
src/Common/PersistentMap.h (added)
-
src/Common/PersistentMap.hpp (deleted)
-
src/Common/ResolvProtoDump.cpp (modified) (1 diff)
-
src/Common/ScopedMap.h (added)
-
src/Common/ScopedMap.hpp (deleted)
-
src/Common/SemanticError.cc (added)
-
src/Common/SemanticError.cpp (deleted)
-
src/Common/SemanticError.h (added)
-
src/Common/SemanticError.hpp (deleted)
-
src/Common/Stats.h (added)
-
src/Common/Stats.hpp (deleted)
-
src/Common/Stats/Base.h (added)
-
src/Common/Stats/Base.hpp (deleted)
-
src/Common/Stats/Counter.cc (added)
-
src/Common/Stats/Counter.cpp (deleted)
-
src/Common/Stats/Counter.h (added)
-
src/Common/Stats/Counter.hpp (deleted)
-
src/Common/Stats/Heap.cc (added)
-
src/Common/Stats/Heap.cpp (deleted)
-
src/Common/Stats/Heap.h (added)
-
src/Common/Stats/Heap.hpp (deleted)
-
src/Common/Stats/ResolveTime.cc (added)
-
src/Common/Stats/ResolveTime.cpp (deleted)
-
src/Common/Stats/ResolveTime.h (added)
-
src/Common/Stats/ResolveTime.hpp (deleted)
-
src/Common/Stats/Stats.cc (added)
-
src/Common/Stats/Stats.cpp (deleted)
-
src/Common/Stats/Time.cc (added)
-
src/Common/Stats/Time.cpp (deleted)
-
src/Common/Stats/Time.h (added)
-
src/Common/Stats/Time.hpp (deleted)
-
src/Common/UniqueName.cc (added)
-
src/Common/UniqueName.cpp (deleted)
-
src/Common/UniqueName.h (added)
-
src/Common/UniqueName.hpp (deleted)
-
src/Common/Utility.hpp (deleted)
-
src/Common/VectorMap.h (added)
-
src/Common/VectorMap.hpp (deleted)
-
src/Common/module.mk (modified) (1 diff)
-
src/Common/utility.h (added)
-
src/CompilationState.cpp (modified) (1 diff)
-
src/Concurrency/Corun.cpp (modified) (1 diff)
-
src/Concurrency/Keywords.cpp (modified) (2 diffs)
-
src/Concurrency/Keywords.h (added)
-
src/Concurrency/Keywords.hpp (deleted)
-
src/Concurrency/Waitfor.cpp (modified) (1 diff)
-
src/Concurrency/Waitfor.h (added)
-
src/Concurrency/Waitfor.hpp (deleted)
-
src/Concurrency/Waituntil.cpp (modified) (1 diff)
-
src/Concurrency/Waituntil.hpp (modified) (1 diff)
-
src/Concurrency/module.mk (modified) (1 diff)
-
src/ControlStruct/ExceptDecl.cpp (modified) (2 diffs)
-
src/ControlStruct/ExceptDecl.h (added)
-
src/ControlStruct/ExceptDecl.hpp (deleted)
-
src/ControlStruct/ExceptTranslate.cpp (modified) (1 diff)
-
src/ControlStruct/ExceptTranslate.h (added)
-
src/ControlStruct/ExceptTranslate.hpp (deleted)
-
src/ControlStruct/module.mk (modified) (1 diff)
-
src/GenPoly/Box.cpp (modified) (2 diffs)
-
src/GenPoly/Box.h (added)
-
src/GenPoly/Box.hpp (deleted)
-
src/GenPoly/ErasableScopedMap.h (added)
-
src/GenPoly/ErasableScopedMap.hpp (deleted)
-
src/GenPoly/FindFunction.cc (added)
-
src/GenPoly/FindFunction.cpp (deleted)
-
src/GenPoly/FindFunction.h (added)
-
src/GenPoly/FindFunction.hpp (deleted)
-
src/GenPoly/GenPoly.cc (added)
-
src/GenPoly/GenPoly.cpp (deleted)
-
src/GenPoly/GenPoly.h (added)
-
src/GenPoly/GenPoly.hpp (deleted)
-
src/GenPoly/InstantiateGeneric.cpp (modified) (2 diffs)
-
src/GenPoly/InstantiateGeneric.h (added)
-
src/GenPoly/InstantiateGeneric.hpp (deleted)
-
src/GenPoly/Lvalue.cpp (modified) (2 diffs)
-
src/GenPoly/Lvalue.h (added)
-
src/GenPoly/Lvalue.hpp (deleted)
-
src/GenPoly/Lvalue2.cc (added)
-
src/GenPoly/Lvalue2.cpp (deleted)
-
src/GenPoly/ScopedSet.h (added)
-
src/GenPoly/ScopedSet.hpp (deleted)
-
src/GenPoly/ScrubTypeVars.cpp (modified) (1 diff)
-
src/GenPoly/ScrubTypeVars.hpp (modified) (1 diff)
-
src/GenPoly/Specialize.cpp (modified) (2 diffs)
-
src/GenPoly/Specialize.h (added)
-
src/GenPoly/Specialize.hpp (deleted)
-
src/GenPoly/module.mk (modified) (1 diff)
-
src/InitTweak/FixGlobalInit.cc (added)
-
src/InitTweak/FixGlobalInit.cpp (deleted)
-
src/InitTweak/FixGlobalInit.h (added)
-
src/InitTweak/FixGlobalInit.hpp (deleted)
-
src/InitTweak/FixInit.cpp (modified) (2 diffs)
-
src/InitTweak/FixInit.h (added)
-
src/InitTweak/FixInit.hpp (deleted)
-
src/InitTweak/GenInit.cc (added)
-
src/InitTweak/GenInit.cpp (deleted)
-
src/InitTweak/GenInit.h (added)
-
src/InitTweak/GenInit.hpp (deleted)
-
src/InitTweak/InitTweak.cc (added)
-
src/InitTweak/InitTweak.cpp (deleted)
-
src/InitTweak/InitTweak.h (added)
-
src/InitTweak/InitTweak.hpp (deleted)
-
src/InitTweak/module.mk (modified) (1 diff)
-
src/MakeLibCfa.cpp (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/Parser/DeclarationNode.cc (added)
-
src/Parser/DeclarationNode.cpp (deleted)
-
src/Parser/DeclarationNode.h (added)
-
src/Parser/DeclarationNode.hpp (deleted)
-
src/Parser/ExpressionNode.cc (added)
-
src/Parser/ExpressionNode.cpp (deleted)
-
src/Parser/ExpressionNode.h (added)
-
src/Parser/ExpressionNode.hpp (deleted)
-
src/Parser/InitializerNode.cc (added)
-
src/Parser/InitializerNode.cpp (deleted)
-
src/Parser/InitializerNode.h (added)
-
src/Parser/InitializerNode.hpp (deleted)
-
src/Parser/ParseNode.cc (added)
-
src/Parser/ParseNode.cpp (deleted)
-
src/Parser/ParseNode.h (added)
-
src/Parser/ParseNode.hpp (deleted)
-
src/Parser/ParserTypes.h (added)
-
src/Parser/ParserTypes.hpp (deleted)
-
src/Parser/ParserUtility.hpp (deleted)
-
src/Parser/RunParser.cpp (modified) (1 diff)
-
src/Parser/StatementNode.cc (added)
-
src/Parser/StatementNode.cpp (deleted)
-
src/Parser/StatementNode.h (added)
-
src/Parser/StatementNode.hpp (deleted)
-
src/Parser/TypeData.cc (added)
-
src/Parser/TypeData.cpp (deleted)
-
src/Parser/TypeData.h (added)
-
src/Parser/TypeData.hpp (deleted)
-
src/Parser/TypedefTable.cc (added)
-
src/Parser/TypedefTable.cpp (deleted)
-
src/Parser/TypedefTable.h (added)
-
src/Parser/TypedefTable.hpp (deleted)
-
src/Parser/lex.ll (modified) (1 diff)
-
src/Parser/module.mk (modified) (1 diff)
-
src/Parser/parser.yy (modified) (1 diff)
-
src/Parser/parserutility.h (added)
-
src/ResolvExpr/AdjustExprType.cc (added)
-
src/ResolvExpr/AdjustExprType.cpp (deleted)
-
src/ResolvExpr/Candidate.hpp (modified) (1 diff)
-
src/ResolvExpr/CandidateFinder.cpp (modified) (3 diffs)
-
src/ResolvExpr/CandidatePrinter.cpp (modified) (1 diff)
-
src/ResolvExpr/CastCost.cc (added)
-
src/ResolvExpr/CastCost.cpp (deleted)
-
src/ResolvExpr/CastCost.hpp (modified) (2 diffs)
-
src/ResolvExpr/CommonType.cc (added)
-
src/ResolvExpr/CommonType.cpp (deleted)
-
src/ResolvExpr/CommonType.hpp (modified) (1 diff)
-
src/ResolvExpr/ConversionCost.cc (added)
-
src/ResolvExpr/ConversionCost.cpp (deleted)
-
src/ResolvExpr/ConversionCost.h (added)
-
src/ResolvExpr/ConversionCost.hpp (deleted)
-
src/ResolvExpr/Cost.h (added)
-
src/ResolvExpr/Cost.hpp (deleted)
-
src/ResolvExpr/CurrentObject.cc (added)
-
src/ResolvExpr/CurrentObject.cpp (deleted)
-
src/ResolvExpr/CurrentObject.h (added)
-
src/ResolvExpr/CurrentObject.hpp (deleted)
-
src/ResolvExpr/ExplodedArg.cpp (modified) (1 diff)
-
src/ResolvExpr/ExplodedArg.hpp (modified) (1 diff)
-
src/ResolvExpr/FindOpenVars.cc (added)
-
src/ResolvExpr/FindOpenVars.cpp (deleted)
-
src/ResolvExpr/FindOpenVars.h (added)
-
src/ResolvExpr/FindOpenVars.hpp (deleted)
-
src/ResolvExpr/PolyCost.cc (added)
-
src/ResolvExpr/PolyCost.cpp (deleted)
-
src/ResolvExpr/PtrsAssignable.cc (added)
-
src/ResolvExpr/PtrsAssignable.cpp (deleted)
-
src/ResolvExpr/PtrsCastable.cc (added)
-
src/ResolvExpr/PtrsCastable.cpp (deleted)
-
src/ResolvExpr/RenameVars.cc (added)
-
src/ResolvExpr/RenameVars.cpp (deleted)
-
src/ResolvExpr/RenameVars.h (added)
-
src/ResolvExpr/RenameVars.hpp (deleted)
-
src/ResolvExpr/ResolveTypeof.cc (added)
-
src/ResolvExpr/ResolveTypeof.cpp (deleted)
-
src/ResolvExpr/ResolveTypeof.h (added)
-
src/ResolvExpr/ResolveTypeof.hpp (deleted)
-
src/ResolvExpr/Resolver.cc (added)
-
src/ResolvExpr/Resolver.cpp (deleted)
-
src/ResolvExpr/Resolver.h (added)
-
src/ResolvExpr/Resolver.hpp (deleted)
-
src/ResolvExpr/SatisfyAssertions.cpp (modified) (2 diffs)
-
src/ResolvExpr/SpecCost.cc (added)
-
src/ResolvExpr/SpecCost.cpp (deleted)
-
src/ResolvExpr/Typeops.hpp (deleted)
-
src/ResolvExpr/Unify.cc (added)
-
src/ResolvExpr/Unify.cpp (deleted)
-
src/ResolvExpr/Unify.h (added)
-
src/ResolvExpr/Unify.hpp (deleted)
-
src/ResolvExpr/WidenMode.h (added)
-
src/ResolvExpr/WidenMode.hpp (deleted)
-
src/ResolvExpr/module.mk (modified) (2 diffs)
-
src/ResolvExpr/typeops.h (added)
-
src/SymTab/Demangle.cc (added)
-
src/SymTab/Demangle.cpp (deleted)
-
src/SymTab/Demangle.h (added)
-
src/SymTab/Demangle.hpp (deleted)
-
src/SymTab/FixFunction.cc (added)
-
src/SymTab/FixFunction.cpp (deleted)
-
src/SymTab/FixFunction.h (added)
-
src/SymTab/FixFunction.hpp (deleted)
-
src/SymTab/GenImplicitCall.cpp (modified) (1 diff)
-
src/SymTab/GenImplicitCall.hpp (modified) (1 diff)
-
src/SymTab/Mangler.cc (added)
-
src/SymTab/Mangler.cpp (deleted)
-
src/SymTab/Mangler.h (added)
-
src/SymTab/Mangler.hpp (deleted)
-
src/SymTab/ManglerCommon.cc (added)
-
src/SymTab/ManglerCommon.cpp (deleted)
-
src/SymTab/demangler.cc (added)
-
src/SymTab/demangler.cpp (deleted)
-
src/SymTab/module.mk (modified) (1 diff)
-
src/Tuples/Explode.cc (added)
-
src/Tuples/Explode.cpp (deleted)
-
src/Tuples/Explode.h (added)
-
src/Tuples/Explode.hpp (deleted)
-
src/Tuples/TupleAssignment.cc (added)
-
src/Tuples/TupleAssignment.cpp (deleted)
-
src/Tuples/TupleExpansion.cpp (modified) (1 diff)
-
src/Tuples/Tuples.cc (added)
-
src/Tuples/Tuples.cpp (deleted)
-
src/Tuples/Tuples.h (added)
-
src/Tuples/Tuples.hpp (deleted)
-
src/Tuples/module.mk (modified) (1 diff)
-
src/Validate/Autogen.cpp (modified) (2 diffs)
-
src/Validate/CompoundLiteral.cpp (modified) (1 diff)
-
src/Validate/EliminateTypedef.cpp (modified) (1 diff)
-
src/Validate/EnumAndPointerDecay.cpp (modified) (1 diff)
-
src/Validate/FindSpecialDecls.cpp (modified) (1 diff)
-
src/Validate/FindSpecialDecls.h (added)
-
src/Validate/FindSpecialDecls.hpp (deleted)
-
src/Validate/FixQualifiedTypes.cpp (modified) (1 diff)
-
src/Validate/FixReturnTypes.cpp (modified) (1 diff)
-
src/Validate/ForallPointerDecay.cpp (modified) (1 diff)
-
src/Validate/ImplementEnumFunc.cpp (modified) (1 diff)
-
src/Validate/ReplacePseudoFunc.hpp (added)
-
src/Validate/ReplaceTypedef.cpp (modified) (1 diff)
-
src/Validate/VerifyCtorDtorAssign.cpp (modified) (1 diff)
-
src/Validate/module.mk (modified) (3 diffs)
-
src/Virtual/ExpandCasts.cc (added)
-
src/Virtual/ExpandCasts.cpp (deleted)
-
src/Virtual/ExpandCasts.h (added)
-
src/Virtual/ExpandCasts.hpp (deleted)
-
src/Virtual/Tables.cc (added)
-
src/Virtual/Tables.cpp (deleted)
-
src/Virtual/Tables.h (added)
-
src/Virtual/Tables.hpp (deleted)
-
src/Virtual/module.mk (modified) (1 diff)
-
src/include/cassert (modified) (1 diff)
-
src/include/optional (modified) (1 diff)
-
src/main.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/jiada_liang_MMath/CFAenum.tex
r31f4837 racb33f15 11 11 12 12 C already provides @const@-style aliasing using the unnamed enumerator \see{\VRef{s:TypeName}}, even if the name @enum@ is misleading (@const@ would be better). 13 Given the existence of this form, it is straightforward to extend it with types other than @int@.13 Given the existence of this form, it is straightforward to extend it with types other than integers. 14 14 \begin{cfa} 15 15 enum E { Size = 20u, PI = 3.14159L, Jack = L"John" }; … … 21 21 22 22 23 \section{Enumerator Visibility}24 \label{s:Enumerator Visibility}25 26 In C, unscoped enumerators present a \newterm{naming problem} when multiple enumeration types appear in the same scope with duplicate enumerator names.23 \section{Enumerator Unscoping} 24 \label{s:EnumeratorUnscoping} 25 26 In C, unscoped enumerators presents a \newterm{naming problem} when multiple enumeration types appear in the same scope with duplicate enumerator names. 27 27 There is no mechanism in C to resolve these naming conflicts other than renaming one of the duplicates, which may be impossible. 28 28 … … 33 33 enum E1 { First, Second, Third, Fourth }; 34 34 enum E2 { @Fourth@, @Third@, @Second@, @First@ }; $\C{// same enumerator names}$ 35 E1 p() { return Third; } $\C{// return}$35 E1 p() { return Third; } $\C{// correctly resolved duplicate names}$ 36 36 E2 p() { return Fourth; } 37 37 void foo() { … … 54 54 enum RGB @!@ { Red, Green, Blue }; 55 55 \end{cfa} 56 Now the enumerators \emph{must} be qualified with the associated enumeration type.56 Now the enumerators \emph{must} be qualified with the associated enumeration. 57 57 \begin{cfa} 58 58 Week week = @Week.@Mon; … … 68 68 } 69 69 \end{cfa} 70 As in Section~\ref{s:Enumerator Visibility}, opening multiple scoped enumerations in a @with@ can result in duplicate enumeration names, but \CFA implicit type resolution and explicit qualification/casting handleambiguities.70 As in Section~\ref{s:EnumeratorUnscoping}, opening multiple scoped enumerations in a @with@ can result in duplicate enumeration names, but \CFA implicit type resolution and explicit qualification/casting handles ambiguities. 71 71 72 72 \section{Enumeration Trait} … … 344 344 \end{cfa} 345 345 which make @Third == First@ and @Fourth == Second@, causing a compilation error because of duplicase @case@ clauses. 346 To better match with programmer intuition, \CFA toggles between value and position semantics dep ending on the language context.346 To better match with programmer intuition, \CFA toggles between value and position semantics depneding on the language context. 347 347 For conditional clauses and switch statments, \CFA uses the robust position implementation. 348 348 \begin{cfa} -
doc/theses/jiada_liang_MMath/background.tex
r31f4837 racb33f15 74 74 However, it is restricted to integral values. 75 75 \begin{clang} 76 enum { Size = 20, Max = 10, MaxPlus10 = Max + 10, @Max10Plus1@, Fred = -7 };76 enum { Size = 20, Max = 10, MaxPlus10 = Max + 10, Max10Plus1, Fred = -7 }; 77 77 \end{clang} 78 78 Here, the aliased constants are: 20, 10, 20, 21, and -7. 79 79 Direct initialization is by a compile-time expression generating a constant value. 80 Indirect initialization (without initialization, @Max10Plus1@)is \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.80 An enumerator without initialization is \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@. 81 81 Because multiple independent enumerators can be combined, enumerators with the same values can occur. 82 82 The enumerators are rvalues, so assignment is disallowed. … … 88 88 \begin{cfa} 89 89 typedef struct /* unnamed */ { ... } S; 90 struct /* unnamed */ { ... } x, y, z; $\C{// questionable}$90 struct /* unnamed */ { ... } x, y, z; $\C{// questionable}$ 91 91 struct S { 92 union /* unnamed */ { $\C{// unscoped fields}$92 union /* unnamed */ { $\C{// unscoped fields}$ 93 93 int i; double d ; char ch; 94 94 }; … … 107 107 enum Week { 108 108 Thu@ = 10@, Fri, Sat, Sun, 109 Mon@ = 0@, Tue, Wed@,@ $\C{// terminating comma}$ 110 }; 109 Mon@ = 0@, Tue, Wed@,@ }; // terminating comma 111 110 \end{clang} 112 111 Note, the comma in the enumerator list can be a terminator or a separator, allowing the list to end with a dangling comma.\footnote{ -
doc/theses/jiada_liang_MMath/intro.tex
r31f4837 racb33f15 135 135 136 136 \subsection{Algebraic Data Type} 137 \label{s:AlgebraicDataType}138 137 139 138 An algebraic data type (ADT)\footnote{ADT is overloaded with abstract data type.} is another language feature often linked with enumeration, where an ADT conjoins an arbitrary type, possibly a \lstinline[language=C++]{class} or @union@, and a named constructor. -
doc/theses/jiada_liang_MMath/relatedwork.tex
r31f4837 racb33f15 18 18 \end{comment} 19 19 20 Enumeration-like features exist in many popular programming languages, both past and present, \eg Pascal~\cite{Pascal}, Ada~\cite{Ada}, \Csharp~\cite{Csharp}, OCaml~\cite{OCaml} \CC, Go~\cite{Go}, Haskell~\cite{Haskell}, Java~\cite{Java}, Rust~\cite{Rust}, Swift~\cite{Swift}, Python~\cite{Python}.20 Enumeration-like features exist in many popular programming languages, both past and present, \eg Pascal~\cite{Pascal}, Ada~\cite{Ada}, \Csharp~\cite{Csharp}, OCaml~\cite{OCaml} \CC, Go~\cite{Go}, Haskell~\cite{Haskell}, Java~\cite{Java}, Modula-3~\cite{Modula-3}, Rust~\cite{Rust}, Swift~\cite{Swift}, Python~\cite{Python}. 21 21 Among theses languages, there are a large set of overlapping features, but each language has its own unique extensions and restrictions. 22 22 … … 24 24 \label{s:Pascal} 25 25 26 Classic Pascal introducedthe \lstinline[language=Pascal]{const} aliasing declaration binding a name to a constant literal/expression.26 Classic Pascal has the \lstinline[language=Pascal]{const} aliasing declaration binding a name to a constant literal/expression. 27 27 \begin{pascal} 28 28 const one = 0 + 1; Vowels = set of (A,E,I,O,U); NULL = NIL; … … 62 62 type Traffic_Light is ( @Red@, Yellow, @Green@ ); 63 63 \end{ada} 64 Like \CFA, Ada uses a type-resolution algorithm including the left-hand side of assignmenteto disambiguate among overloaded identifiers.64 Like \CFA, Ada uses an advanced type-resolution algorithm, including the left-hand side of assignment, to disambiguate among overloaded identifiers. 65 65 \VRef[Figure]{f:AdaEnumeration} shows how ambiguity is handled using a cast, \ie \lstinline[language=ada]{RGB'(Red)}. 66 66 … … 97 97 Ada provides an alias mechanism, \lstinline[language=ada]{renames}, for aliasing types, which is useful to shorten package identifiers. 98 98 \begin{ada} 99 @OtherRed@: RGB renames Red;99 OtherRed : RGB renames Red; 100 100 \end{ada} 101 101 which suggests a possible \CFA extension to @typedef@. … … 160 160 Hence, the ordering of the enumerators is crucial to provide the necessary ranges. 161 161 162 An enumeration type can be used in the Ada \lstinline[language=ada]{case} (all enumerators must appear or a @default@) or iterating constructs.162 An enumeration type can be used in the Ada \lstinline[language=ada]{case} (all enumerators must appear or a default) or iterating constructs. 163 163 \begin{cquote} 164 164 \setlength{\tabcolsep}{15pt} … … 241 241 whereas C @const@ declarations without @static@ are marked @R@. 242 242 243 The following \CC non-backwards compatible changes are made \see{\cite[\S~7.2]{ANSI98: c++}}.243 The following \CC non-backwards compatible changes are made \see{\cite[\S~7.2]{ANSI98:C++}}. 244 244 \begin{cquote} 245 245 Change: \CC objects of enumeration type can only be assigned values of the same enumeration type. … … 248 248 \begin{c++} 249 249 enum color { red, blue, green }; 250 color c = 1; $\C{// valid C, invalid c++}$250 color c = 1; $\C{// valid C, invalid C++}$ 251 251 \end{c++} 252 252 \textbf{Rationale}: The type-safe nature of \CC. \\ … … 263 263 enum e { A }; 264 264 sizeof(A) == sizeof(int) $\C{// in C}$ 265 sizeof(A) == sizeof(e) $\C{// in c++}$265 sizeof(A) == sizeof(e) $\C{// in C++}$ 266 266 /* and sizeof(int) is not necessary equal to sizeof(e) */ 267 267 \end{c++} … … 279 279 int i = A; i = e; $\C{// implicit casts to int}$ 280 280 \end{c++} 281 \CC{11} added a scoped enumeration, \lstinline[language=c++]{enum class} (or \lstinline[language=c++]{enum struct})\footnote{ 282 The use of keyword \lstinline[language=c++]{class} is resonable because default visibility is \lstinline[language=c++]{private} (scoped). 283 However, default visibility for \lstinline[language=c++]{struct} is \lstinline[language=c++]{public} (unscoped) making it an odd choice.}, 284 where the enumerators are accessed using type qualification. 281 \CC{11} added a scoped enumeration, \lstinline[language=c++]{enum class} (or \lstinline[language=c++]{enum struct}), where the enumerators are accessed using type qualification. 285 282 \begin{c++} 286 283 enum class E { A, B, C }; … … 294 291 E e = A; e = B; $\C{// direct access}$ 295 292 \end{c++} 296 \CC{11} added the ability to explicitly declare only anunderlying \emph{integral} type for \lstinline[language=c++]{enum class}.293 \CC{11} added the ability to explicitly declare the underlying \emph{integral} type for \lstinline[language=c++]{enum class}. 297 294 \begin{c++} 298 295 enum class RGB @: long@ { Red, Green, Blue }; … … 305 302 char ch = rgb::Red; ch = crgb; $\C{// error}$ 306 303 \end{c++} 307 An enumeration can be used in the @if@ and @switch@ statements. 308 \begin{cquote} 309 \setlength{\tabcolsep}{15pt} 310 \begin{tabular}{@{}ll@{}} 311 \begin{c++} 312 if ( @day@ <= Fri ) 313 cout << "weekday" << endl; 314 315 316 317 318 \end{c++} 319 & 320 \begin{c++} 321 switch ( @day@ ) { 322 case Mon: case Tue: case Wed: case Thu: case Fri: 323 cout << "weekday" << endl; break; 324 case Sat: case Sun: 325 cout << "weekend" << endl; break; 326 } 327 \end{c++} 328 \end{tabular} 329 \end{cquote} 330 However, there is no mechanism to iterate through an enumeration without an unsafe cast and it does not understand the enumerator values. 331 \begin{c++} 332 enum Week { Mon, Tue, Wed, Thu = 10, Fri, Sat, Sun }; 333 for ( Week d = Mon; d <= Sun; d = @(Week)(d + 1)@ ) cout << d << ' '; 334 0 1 2 @3 4 5 6 7 8 9@ 10 11 12 13 335 \end{c++} 336 An enumeration type cannot declare an array dimension but an enumerator can be used as a subscript. 337 There is no mechanism to subtype or inherit from an enumeration. 304 Finally, enumerations can be used in the @switch@ statement but there is no mechanism to iterate through an enumeration. 305 An enumeration type cannot declare an array dimension but can be used as a subscript. 306 There is no mechanism to subtype or inherit from enumerations. 338 307 339 308 … … 342 311 343 312 % https://www.tutorialsteacher.com/codeeditor?cid=cs-mk8Ojx 313 314 \Csharp is a dynamically-typed programming-language with a scoped, integral enumeration-type similar to the C/\CC enumeration. 315 \begin{csharp} 316 enum Weekday : byte { Mon, Tue, Wed, Thu@ = 10@, Fri, Sat, Sun@,@ }; 317 \end{csharp} 318 The default underlying type is @int@, with auto-incrementing, implicit/explicit initialization, terminator comma, and optional integral typing (default @int@). 319 A method cannot be defined in an enumeration type. 320 As well, there is an explicit bidirectional conversion between an enumeration and its integral type, and an implicit conversion to the enumerator label in display contexts. 321 \begin{csharp} 322 int day = (int)Weekday.Fri; $\C{// day == 10}$ 323 Weekday weekday = (Weekdays)42; $\C{// weekday == 42, logically invalid}$ 324 Console.WriteLine( Weekday.Fri ); $\C{// print Fri}$ 325 string mon = Weekday.Mon.ToString(); $\C{// mon == "Mon"}$ 326 \end{csharp} 327 328 The @Enum.GetValues@ pseudo-method retrieves an array of the enumeration constants for looping over an enumeration type or variable (expensive operation). 329 \begin{csharp} 330 foreach ( Weekday constant in @Enum.GetValues@( typeof(Weekday) ) ) { 331 Console.WriteLine( constant + " " + (int)constant ); // label, position 332 } 333 \end{csharp} 334 335 The @Flags@ attribute creates a bit-flags enumeration, allowing bitwise operators @&@, @|@, @~@ (complement), @^@ (xor). 336 \begin{csharp} 337 @[Flags]@ public enum Weekday { 338 None = 0x0, Mon = 0x1, Tue = 0x2, Wed = 0x4, 339 Thu = 0x8, Fri = 0x10, Sat = 0x20, Sun = 0x40, 340 Weekend = @Sat | Sun@, 341 Weekdays = @Mon | Tue | Wed | Thu | Fri@ 342 } 343 Weekday meetings = @Weekday.Mon | Weekday.Wed@; // 0x5 344 \end{csharp} 345 346 \VRef[Figure]{CsharpFreeVersusClass} shows an enumeration with free routines for manipulation, and embedding the enumeration and operations into an enumeration class. 347 The key observation is that an enumeration class is just a structuring mechanism without any additional semantics. 348 344 349 % https://learn.microsoft.com/en-us/dotnet/api/system.enum?view=net-8.0 345 % https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/enums 346 347 \Csharp is a dynamically-typed programming-language with a scoped, integral enumeration similar to \CC \lstinline[language=C++]{enum class}. 350 351 \begin{figure} 352 \centering 353 \begin{tabular}{@{}l|l@{}} 354 \multicolumn{1}{@{}c|}{non-object oriented} & \multicolumn{1}{c@{}}{object oriented} \\ 355 \hline 348 356 \begin{csharp} 349 enum Week : @long@ { Mon, Tue, Wed, Thu@ = 10@, Fri, Sat, Sun@,@ } // terminating comma 350 enum RGB { Red, Green, Blue } 351 \end{csharp} 352 The default underlying integral type is @int@ (no @char@), with auto-incrementing, implicit/explicit initialization, and terminating comma. 353 A method cannot be defined in an enumeration type (extension methods are possible). 354 There is an explicit bidirectional conversion between an enumeration and its integral type, and an implicit conversion to the enumerator label in display contexts. 355 \begin{csharp} 356 int iday = (int)Week.Fri; $\C{// day == 11}$ 357 Week day = @(Week)@42; $\C{// day == 42, unsafe}$ 358 string mon = Week.Mon.ToString(); $\C{// mon == "Mon"}$ 359 RGB rgb = RGB.Red; $\C{// rgb == "Red"}$ 360 day = @(Week)@rgb; $\C{// day == "Mon", unsafe}$ 361 Console.WriteLine( Week.Fri ); $\C{// print label Fri}$ 362 \end{csharp} 363 The majority of the integral operators (relational and arithmetic) work with enumerations, except @*@ and @/@. 364 \begin{csharp} 365 day = day++ - 5; $\C{// unsafe}$ 366 day = day & day; 367 \end{csharp} 368 369 An enumeration can be used in the @if@ and @switch@ statements. 370 \begin{cquote} 371 \setlength{\tabcolsep}{15pt} 372 \begin{tabular}{@{}ll@{}} 373 \begin{csharp} 374 if ( @day@ <= Week.Fri ) 375 Console.WriteLine( "weekday" ); 376 377 378 379 380 357 public class Program { 358 359 enum Weekday { 360 Mon, Tue, Wed, Thu, Fri, Sat, Sun }; 361 362 static bool isWeekday( Weekday wd ) { 363 return wd <= Weekday.Fri; 364 } 365 static bool isWeekend( Weekday wd ) { 366 return Weekday.Sat <= wd; 367 } 368 369 370 public static void Main() { 371 Weekday day = Weekday.Sat; 372 373 Console.WriteLine( isWeekday( day ) ); 374 Console.WriteLine( isWeekend( day ) ); 375 } 376 } 381 377 \end{csharp} 382 378 & 383 379 \begin{csharp} 384 switch ( @day@ ) { 385 case Week.Mon: case Week.Tue: case Week.Wed: 386 case Week.Thu: case Week.Fri: 387 Console.WriteLine( "weekday" ); break; 388 case Week.Sat: case Week.Sun: 389 Console.WriteLine( "weekend" ); break; 380 public class Program { 381 public @class@ WeekDay : Enumeration { 382 public enum Day { 383 Mon, Tue, Wed, Thu, Fri, Sat, Sun }; 384 public enum Day2 : Day { 385 XXX, YYY }; 386 Day day; 387 public bool isWeekday() { 388 return day <= Day.Fri; 389 } 390 public bool isWeekend() { 391 return day > Day.Fri; 392 } 393 public WeekDay( Day d ) { day = d; } 394 } 395 public static void Main() { 396 WeekDay cday = new 397 WeekDay( WeekDay.Day.Sat ); 398 Console.WriteLine( cday.isWeekday() ); 399 Console.WriteLine( cday.isWeekend() ); 400 } 390 401 } 391 402 \end{csharp} 392 403 \end{tabular} 393 \end{cquote} 394 However, there is no mechanism to iterate through an enumeration without an unsafe cast to increment and positions versus values is not handled. 395 \begin{csharp} 396 for ( Week d = Mon; d <= Sun; @d += 1@ ) { 397 Console.Write( d + " " ); 398 } 399 Mon Tue Wed @3 4 5 6 7 8 9@ Thu Fri Sat Sun 400 \end{csharp} 401 The @Enum.GetValues@ pseudo-method retrieves an array of the enumeration constants for looping over an enumeration type or variable (expensive operation). 402 \begin{csharp} 403 foreach ( Week d in @Enum.GetValues@( typeof(Week) ) ) { 404 Console.WriteLine( d + " " + (int)d + " " ); // label, position 405 } 406 Mon 0, Tue 1, Wed 2, Thu 10, Fri 11, Sat 12, Sun 13, 407 \end{csharp} 408 409 An enumeration type cannot declare an array dimension but an enumerator can be used as a subscript. 410 There is no mechanism to subtype or inherit from an enumeration. 411 412 The @Flags@ attribute creates a bit-flags enumeration, making bitwise operators @&@, @|@, @~@ (complement), @^@ (xor) sensible. 413 \begin{csharp} 414 @[Flags]@ public enum Week { 415 None = 0x0, Mon = 0x1, Tue = 0x2, Wed = 0x4, 416 Thu = 0x8, Fri = 0x10, Sat = 0x20, Sun = 0x40, 417 Weekdays = @Mon | Tue | Wed | Thu | Fri@ $\C{// Weekdays == 0x1f}$ 418 Weekend = @Sat | Sun@, $\C{// Weekend == 0x60}$ 419 } 420 Week meetings = @Week.Mon | Week.Wed@; $\C{// 0x5}$ 421 \end{csharp} 404 \caption{\Csharp: Free Routine Versus Class Enumeration} 405 \label{CsharpFreeVersusClass} 406 \end{figure} 422 407 423 408 424 409 \section{Golang} 425 410 426 Golang has a no enumeration. 427 It has @const@ aliasing declarations, similar to \CC \see{\VRef{s:C++RelatedWork}}, for basic types with type inferencing and static initialization (constant expression). 411 Golang provides pseudo-enumeration similar to classic Pascal \lstinline[language=pascal]{const}, binding a name to a constant literal/expression. 428 412 \begin{Go} 429 const R @int@ = 0; const G @uint@ = 1; const B = 2; $\C{// explicit typing and type inferencing}$ 430 const Fred = "Fred"; const Mary = "Mary"; const Jane = "Jane"; 431 const S = 0; const T = 0; 432 const USA = "USA"; const U = "USA"; 433 const V = 3.1; const W = 3.1; 434 \end{Go} 435 Since these declarations are unmutable variables, they are unscoped and Golang has no overloading. 436 437 Golang provides an enumeration-like feature to group together @const@ declaration into a block and introduces a form of auto-initialization. 438 \begin{Go} 439 const ( R = 0; G; B ) $\C{// implicit initialization: 0 0 0}$ 440 const ( Fred = "Fred"; Mary = "Mary"; Jane = "Jane" ) $\C{// explicit initialization: Fred Mary Jane}$ 413 const ( R = 0; G; B ) $\C{// implicit: 0 0 0}$ 414 const ( Fred = "Fred"; Mary = "Mary"; Jane = "Jane" ) $\C{// explicit: Fred Mary Jane}$ 441 415 const ( S = 0; T; USA = "USA"; U; V = 3.1; W ) $\C{// type change, implicit/explicit: 0 0 USA USA 3.1 3.1}$ 442 416 \end{Go} 443 The first identifier \emph{must} be explicitly initialized; 444 subsequent identifiers can be implicitly or explicitly initialized. 445 Implicit initialization is the \emph{previous} (predecessor) identifier value. 446 447 Each @const@ declaration provides an implicit integer counter starting at zero, called \lstinline[language=Go]{iota}. 448 Using \lstinline[language=Go]{iota} outside of a @const@ block always sets the identifier to zero. 449 \begin{Go} 450 const R = iota; $\C{// 0}$ 451 \end{Go} 452 Inside a @const@ block, \lstinline[language=Go]{iota} is implicitly incremented for each \lstinline[language=golang]{const} identifier and used to initialize the next uninitialized identifier. 417 Constant identifiers are unscoped and must be unique (no overloading). 418 The first enumerator \emph{must} be explicitly initialized; 419 subsequent enumerators can be implicitly or explicitly initialized. 420 Implicit initialization is the previous (predecessor) enumerator value. 421 422 Auto-incrementing is supported by the keyword \lstinline[language=Go]{iota}, available only in the \lstinline[language=Go]{const} declaration. 423 The \lstinline[language=Go]{iota} is a \emph{per \lstinline[language=golang]{const} declaration} integer counter, starting at zero and implicitly incremented by one for each \lstinline[language=golang]{const} identifier (enumerator). 453 424 \begin{Go} 454 425 const ( R = @iota@; G; B ) $\C{// implicit: 0 1 2}$ … … 459 430 const ( O1 = iota + 1; @_@; O3; @_@; O5 ) // 1, 3, 5 460 431 \end{Go} 461 Auto-in itialization reverts from \lstinline[language=Go]{iota} to the previous value after an explicit initialization, but auto-incrementing of \lstinline[language=Go]{iota} continues.432 Auto-incrementing stops after an explicit initialization. 462 433 \begin{Go} 463 434 const ( Mon = iota; Tue; Wed; // 0, 1, 2 464 @Thu = 10@; Fri; Sat; Sun = itoa ) // 10, 10, 10, 6435 @Thu = 10@; Fri; Sat; Sun ) // 10, 10, 10, 10 465 436 \end{Go} 466 Auto-in itialization from \lstinline[language=Go]{iota} is restarted and \lstinline[language=Go]{iota} reinitialized with an expression containing as most\emph{one} \lstinline[language=Go]{iota}.437 Auto-incrementing can be restarted with an expression containing \emph{one} \lstinline[language=Go]{iota}. 467 438 \begin{Go} 468 const ( V1 = iota; V2; @V3 = 7;@ V4 = @iota@ + 1; V5 ) // 0 1 7 4 5439 const ( V1 = iota; V2; @V3 = 7;@ V4 = @iota@; V5 ) // 0 1 7 3 4 469 440 const ( Mon = iota; Tue; Wed; // 0, 1, 2 470 @Thu = 10;@ Fri = @iota - Wed + Thu - 1@; Sat; Sun ) // 10, 11, 12, 13441 @Thu = 10;@ Fri = @iota - Wed + Thu - 1@; Sat; Sun ) // 10, 11, 12, 13 471 442 \end{Go} 472 Here, @V4@ and @Fri@ restart auto-incrementing from \lstinline[language=Go]{iota} and reset \lstinline[language=Go]{iota} to 4 and 11, respectively, because of the intialization expressions containing \lstinline[language=Go]{iota}. 473 Note, because \lstinline[language=Go]{iota} is incremented for an explicitly initialized identifier or @_@, 474 at @Fri@ \lstinline[language=Go]{iota} is 4 requiring the minus one to compute the value for @Fri@. 443 Note, \lstinline[language=Go]{iota} is advanced for an explicitly initialized enumerator, like the underscore @_@ identifier. 475 444 476 445 Basic switch and looping are possible. 477 446 \begin{cquote} 478 \setlength{\tabcolsep}{ 20pt}447 \setlength{\tabcolsep}{15pt} 479 448 \begin{tabular}{@{}ll@{}} 480 449 \begin{Go} 481 day := Mon; // := $\(\Rightarrow\)$ type inferencing482 switch @day@{450 day := Mon; 451 switch day { 483 452 case Mon, Tue, Wed, Thu, Fri: 484 453 fmt.Println( "weekday" ); … … 490 459 \begin{Go} 491 460 492 for i := @Mon@; i <= @Sun@; i += 1 {461 for i := Mon; i <= Sun; i += 1 { 493 462 fmt.Println( i ) 494 463 } … … 501 470 However, the loop prints the values from 0 to 13 because there is no actual enumeration. 502 471 503 A constant variable can be used as an array dimension or a subscript.504 \begin{Go}505 var ar[@Sun@] int506 ar[@Mon@] = 3507 \end{Go}508 509 472 510 473 \section{Java} 511 474 512 Java provides an enumeration using a specializedclass.513 A basic Java enumeration is an opaque enumeration, where the enumerators are constants. 475 Every enumeration in Java is an enumeration class. 476 For a basic enumeration 514 477 \begin{Java} 515 enum Week { 516 Mon, Tue, Wed, Thu, Fri, Sat, Sun; 517 } 518 Week day = Week.Sat; 478 enum Weekday { Mon, Tue, Wed, Thu, Fri, Sat, Sun }; 479 Weekday day = Weekday.Sat; 519 480 \end{Java} 520 The enumerators members are scoped and cannot be made \lstinline[language=java]{public}, hence require qualification.521 The value of an enumeration instance is restricted to its enumerators.522 523 The position (ordinal) and label are accessible but there is no value.481 the scoped enumerators are an ordered list of @final@ methods of type integer, ordered left to right starting at 0, increasing by 1. 482 The value of an enumeration instance is restricted to the enumeration's enumerators. 483 There is an implicit @int@ variable in the enumeration used to store the value of an enumeration instance. 484 The position (ordinal) and label are accessible, where the value is the same as the position. 524 485 \begin{Java} 525 System.out.println( day.!ordinal()! + " " + !day! + " " + day.!name()! ); 526 5 Sat Sat 486 System.out.println( day.!ordinal()! + " " + day.!name()! ); // 5 Sat 527 487 \end{Java} 528 Since @day@ has no value, it prints its label (name). 529 The member @valueOf@ is the inverse of @name@ converting a string to enumerator. 488 There is an inverse function @valueOf@ from string to enumerator. 530 489 \begin{Java} 531 day = Week .valueOf( "Wed" );490 day = Weekday.valueOf( "Wed" ); 532 491 \end{Java} 533 Extra members can be added to provide specialized operations. 492 There are no implicit conversions to/from an enumerator and its underlying type. 493 Like \Csharp, \VRef[Figure]{f:JavaFreeVersusClass} shows the same example for an enumeration with free routines for manipulation, and embedding the enumeration and operations into an enumeration class. 494 495 \begin{figure} 496 \centering 497 \begin{tabular}{@{}l|l@{}} 498 \multicolumn{1}{@{}c|}{non-object oriented} & \multicolumn{1}{c@{}}{object oriented} \\ 499 \hline 534 500 \begin{Java} 535 public boolean isWeekday() { return !ordinal()! <= Fri.ordinal(); } 536 public boolean isWeekend() { return Fri.ordinal() < !ordinal()!; } 537 \end{Java} 538 Notice the unqualified calls to @ordinal@ in the members implying a \lstinline[language=Java]{this} to some implicit implementation variable, likely an @int@. 539 540 Enumerator values require an enumeration type (any Java type may be used) and implementation member. 541 \begin{Java} 542 enum Week { 543 Mon!(1)!, Tue!(2)!, Wed!(3)!, Thu!(4)!, Fri!(5)!, Sat!(6)!, Sun!(7)!; // must appear first 544 private !long! day; $\C{// enumeration type and implementation member}$ 545 private Week( !long! d ) { day = d; } $\C{// enumerator initialization}$ 546 }; 547 Week day = Week.Sat; 548 \end{Java} 549 The position, value, and label are accessible. 550 \begin{Java} 551 System.out.println( !day.ordinal()! + " " + !day.day! + " " + !day.name()! ); 552 5 6 Sat 553 \end{Java} 554 If the implementation member is \lstinline[language=Java]{public}, the enumeration is unsafe, as any value of the underlying type can be assigned to it, \eg @day = 42@. 555 The implementation constructor must be private since it is only used internally to initialize the enumerators. 556 Initialization occurs at the enumeration-type declaration for each enumerator in the first line. 557 558 Enumerations can be used in the @if@ and @switch@ statements but only for equality tests. 559 \begin{cquote} 560 \setlength{\tabcolsep}{15pt} 561 \begin{tabular}{@{}ll@{}} 562 \begin{Java} 563 if ( !day! == Week.Fri ) 564 System.out.println( "Fri" ); 565 566 567 568 501 enum Weekday !{! 502 Mon, Tue, Wed, Thu, Fri, Sat, Sun !}!; 503 504 static boolean isWeekday( Weekday wd ) { 505 return wd.ordinal() <= Weekday.Fri.ordinal(); 506 } 507 static boolean isWeekend( Weekday wd ) { 508 return Weekday.Fri.ordinal() < wd.ordinal(); 509 } 510 511 public static void main( String[] args ) { 512 Weekday day = Weekday.Sat; 513 System.out.println( isWeekday( day ) ); 514 System.out.println( isWeekend( day ) ); 515 } 569 516 \end{Java} 570 517 & 571 518 \begin{Java} 572 switch ( !day! ) { 573 case Mon: case Tue: case Wed: case Thu: case Fri: 574 System.out.println( "weekday" ); break; 575 case Sat: case Sun: 576 System.out.println( "weekend" ); break; 519 enum Weekday !{! 520 Mon, Tue, Wed, Thu, Fri, Sat, Sun; 521 522 public boolean isWeekday() { 523 return ordinal() <= Weekday.Fri.ordinal(); 524 } 525 public boolean isWeekend() { 526 return Weekday.Fri.ordinal() < ordinal(); 527 } 528 !}! 529 public static void main( String[] args ) { 530 WeekDay day = WeekDay.Sat; 531 System.out.println( day.isWeekday() ); 532 System.out.println( day.isWeekend() ); 577 533 } 578 534 \end{Java} 579 535 \end{tabular} 580 \ end{cquote}581 Notice enumerators in the @switch@ statement do not require qualification. 582 583 There are no arithemtic operations on enumerations, so there is no arithmetic way to iterate through an enumeration without making the implementation type \lstinline[language=Java]{public}. 584 Like \Csharp, looping over an enumeration is done using method @values@, which returns an array of enumerator values (expensive operation).536 \caption{Java: Free Routine Versus Class Enumeration} 537 \label{f:JavaFreeVersusClass} 538 \end{figure} 539 540 To explicitly assign enumerator values and/or use a non-@int@ enumeration type (any Java type may be used), the enumeration must specify an explicit type in the enumeration class and a constructor. 585 541 \begin{Java} 586 for ( Week d : Week.values() ) { 587 System.out.print( d.ordinal() + d.day + " " + d.name() + ", " ); 542 enum Weekday { 543 Mon!(1)!, Tue!(2)!, Wed!(3)!, Thu!(4)!, Fri!(5)!, Sat!(6)!, Sun!(7)!; // must appear first 544 private !long! day; $\C{// underlying enumeration type}$ 545 private Weekday( !long! d ) { day = d; } $\C{// used to initialize enumerators}$ 546 }; 547 Weekday day = Weekday.Sat; 548 \end{Java} 549 If an enumerator initialization is a runtime expression, the expression is executed once at the point the enumeration is declaraed. 550 551 The position, value, and label are accessible. 552 \begin{Java} 553 System.out.println( !day.ordinal()! + " " + !day.day! + " " + !day.name()! ); // 5 6 Sat 554 \end{Java} 555 The constructor is private so only initialization or assignment can be used to set an enumeration, which ensures only corresponding enumerator values are allowed. 556 557 An enumeration can appear in a @switch@ statement, but no ranges. 558 \begin{Java} 559 switch ( day ) { 560 case Mon: case Tue: case Wed: case Thu: case Fri: 561 System.out.println( "weekday" ); 562 break; 563 case Sat: case Sun: 564 System.out.println( "weekend" ); 565 break; 566 } 567 \end{Java} 568 Like \Csharp, looping over an enumeration is done using method @values@, which returns the array of enumerator values (expensive operation). 569 \begin{Java} 570 for ( Weekday iday : Weekday.values() ) { 571 System.out.print( iday.ordinal() + iday.day + " " + iday.name() + ", " ); 588 572 } 589 573 0 1 Mon, 1 2 Tue, 2 3 Wed, 3 4 Thu, 4 5 Fri, 5 6 Sat, 6 7 Sun, 590 574 \end{Java} 591 575 592 An enumeration type cannot declare an array dimension nor can an enumerator be used as a subscript. 593 Enumeration inheritence is disallowed because an enumeration is \lstinline[language=Java]{final}. 594 595 Java provides an @EnumSet@ where the underlying type is an efficient set of bits, one per enumeration \see{\Csharp \lstinline{Flags}, \VRef{s:Csharp}}, providing (logical) operations on groups of enumerators. 576 As well, Java provides an @EnumSet@ where the underlying type is an efficient set of bits, one per enumeration \see{\Csharp \lstinline{Flags}, \VRef{s:Csharp}}, providing (logical) operations on groups of enumerators. 596 577 There is also a specialized version of @HashMap@ with enumerator keys, which has performance benefits. 597 578 579 Enumeration inheritence is disallowed because an enumeration is @final@. 580 581 582 583 \section{Modula-3} 584 585 598 586 599 587 \section{Rust} 600 601 588 % https://doc.rust-lang.org/reference/items/enumerations.html 602 589 603 Rust @enum@ provides two largely independent mechanisms: an ADT and an enumeration. 604 When @enum@ is an ADT, pattern matching is used to discriminate among the variant types. 590 Rust provides a scoped enumeration based on variant types. 591 % An enumeration, also referred to as an enum, is a simultaneous definition of a nominal enumerated type as well as a set of constructors, that can be used to create or pattern-match values of the corresponding enumerated type. 592 An enumeration without constructors is called field-less. 593 \begin{rust} 594 enum Week { Mon, Tues, Wed, Thu, Fri, Sat, Sun@,@ } 595 let mut week: Week = Week::Mon; 596 week = Week::Fri; 597 \end{rust} 598 A field-less enumeration with only unit variants is called unit-only. 599 \begin{rust} 600 enum Week { Mon = 0, Tues = 1, Wed = 2, Thu = 3, Fri = 4, Sat = 5, Sun = 6 } 601 \end{rust} 602 Enum constructors can have either named or unnamed fields: 603 \begin{rust} 604 enum Animal { 605 Dog( String, f64 ), 606 Cat{ name: String, weight: f64 }, 607 } 608 let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2); 609 a = Animal::Cat { name: "Spotty".to_string(), weight: 2.7 }; 610 \end{rust} 611 Here, @Dog@ is an @enum@ variant, whereas @Cat@ is a struct-like variant. 612 613 Each @enum@ type has an implicit integer tag (discriminant), with a unique value for each variant type. 614 Like a C enumeration, the tag values for the variant types start at 0 with auto incrementing. 615 The tag is re-purposed for enumeration by allowing it to be explicitly set, and auto incrmenting continues from that value. 605 616 \begin{cquote} 606 \sf\setlength{\tabcolsep}{20pt} 607 \begin{tabular}{@{}ll@{}} 608 \begin{rust} 609 struct S { 610 i : isize, j : isize 611 } 612 enum @ADT@ { 613 I(isize), // int 614 F(f64), // float 615 S(S), // struct 616 } 617 \end{rust} 618 & 619 \begin{rust} 620 let mut s = S{ i : 3, j : 4 }; 621 let mut adt : ADT; 622 adt = ADT::I(3); adt = ADT::F(3.5); adt = ADT::S(s); // init examples 623 @match@ adt { 624 ADT::I(i) => println!( "{:?}", i ), 625 ADT::F(f) => println!( "{:?}", f ), 626 ADT::S(s) => println!( "{:?} {:?}", s.i, s.j ), 627 } 628 \end{rust} 617 \sf\setlength{\tabcolsep}{3pt} 618 \begin{tabular}{rcccccccr} 619 @enum@ Week \{ & Mon, & Tue, & Wed = 2, & Thu = 10, & Fri, & Sat = 5, & Sun & \}; \\ 620 \rm tags & 0 & 1 & 2 & 10 & 11 & 5 & 6 & \\ 629 621 \end{tabular} 630 622 \end{cquote} 631 When the variant types are the unit type, the ADT is still not an enumeration because there is no enumerating \see{\VRef{s:AlgebraicDataType}}.623 In general, the tag can only be read as an opaque reference for comparison. 632 624 \begin{rust} 633 enum Week { Mon, Tues, Wed, Thu, Fri, Sat, Sun@,@ } // terminating comma 634 let mut week : Week = Week::Mon; 635 match week { 636 Week::Mon => println!( "Mon" ), 637 ... 638 Week::Sun => println!( "Sun" ), 639 } 625 if mem::discriminant(&week) == mem::discriminant(&Week::Mon) ... 640 626 \end{rust} 641 642 However, Rust allows direct setting of the ADT constructor, which means it is actually a tag. 643 \begin{cquote} 644 \sf\setlength{\tabcolsep}{15pt} 645 \begin{tabular}{@{}ll@{}} 627 If the enumeration is unit-only, or field-less with no explicit discriminants and where only unit variants are explicit, then the discriminant is accessible with a numeric cast. 646 628 \begin{rust} 647 enum Week { 648 Mon, Tues, Wed, // start 0 649 Thu @= 10@, Fri, 650 Sat, Sun, 651 } 652 629 if week as isize == Week::Mon as isize ... 653 630 \end{rust} 654 &655 \begin{rust}656 #[repr(u8)]657 enum ADT {658 I(isize) @= 5@, // ???659 F(f64) @= 10@,660 S(S) @= 0@,661 }662 \end{rust}663 \end{tabular}664 \end{cquote}665 Through this integral tag, it is possible to enumerate, and when all tags represent the unit type, it behaves like \CC \lstinline[language=C++]{enum class}.666 When tags represent non-unit types, Rust largely precludes accessing the tag because the semantics become meaningless.667 Hence, the two mechanisms are largely disjoint, and ony the enumeration component is discussed.668 669 In detail, the @enum@ type has an implicit integer tag (discriminant), with a unique value for each variant type.670 Direct initialization is by a compile-time expression generating a constant value.671 Indirect initialization (without initialization, @Fri@/@Sun@) is auto-initialized: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.672 There is an explicit cast from the tag to integer.673 \begin{rust}674 let mut mon : isize = Week::Mon as isize;675 \end{rust}676 An enumeration can be used in the @if@ and \lstinline[language=rust]{match} (@switch@) statements.677 \begin{cquote}678 \setlength{\tabcolsep}{8pt}679 \begin{tabular}{@{}ll@{}}680 \begin{c++}681 if @week as isize@ == Week::Mon as isize {682 println!( "{:?}", week );683 }684 685 686 \end{c++}687 &688 \begin{c++}689 match @week@ {690 Week::Mon | Week:: Tue | Week::Wed | Week::Thu691 | Week::Fri => println!( "weekday" ),692 Week::Sat | Week:: Sun => println!( "weekend" ),693 }694 \end{c++}695 \end{tabular}696 \end{cquote}697 However, there is no mechanism to iterate through an enumeration without an casting to integral and positions versus values is not handled.698 \begin{c++}699 for d in Week::Mon as isize ..= Week::Sun as isize {700 print!( "{:?} ", d );701 }702 0 1 2 @3 4 5 6 7 8 9@ 10 11 12 13703 \end{c++}704 An enumeration type cannot declare an array dimension nor as a subscript.705 There is no mechanism to subtype or inherit from an enumeration.706 631 707 632 … … 2237 2162 A basic variant is a list of nullary datatype constructors, which is like an unscoped, opaque enumeration. 2238 2163 \begin{ocaml} 2239 type week = Mon | Tue | Wed | Thu | Fri | Sat | Sun2240 let day : week @= Mon@ $\C{(* bind *)}$2241 let take_class( d : week ) =2164 type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun 2165 let day : weekday @= Mon@ $\C{(* bind *)}$ 2166 let take_class( d : weekday ) = 2242 2167 @match@ d with $\C{(* matching *)}$ 2243 2168 Mon | Wed -> Printf.printf "CS442\n" | … … 2250 2175 The only operations are binding and pattern matching (equality), where the variant name is logically the implementation tag stored in the union for discriminating the value in the object storage. 2251 2176 After compilation, variant names are mapped to an opague ascending intergral type discriminants, starting from 0. 2252 Here, function @take_class@ has a @week @ parameter, and returns @"CS442"@, if the weekvalue is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@.2253 The ``@_@'' is a wildcard matching any @week @ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases.2177 Here, function @take_class@ has a @weekday@ parameter, and returns @"CS442"@, if the weekday value is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@. 2178 The ``@_@'' is a wildcard matching any @weekday@ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases. 2254 2179 Since the variant has no type, it has a \newterm{0-arity constructor}, \ie no parameters. 2255 Because @week @ is a union of values @Mon@ to @Sun@, it is a \newterm{union type} in turns of the functional-programming paradigm.2180 Because @weekday@ is a union of values @Mon@ to @Sun@, it is a \newterm{union type} in turns of the functional-programming paradigm. 2256 2181 2257 2182 Each variant can have an associated heterogeneous type, with an n-ary constructor for creating a corresponding value. … … 2317 2242 term "tag" further. 2318 2243 2319 <<Because week is a summation of values Mon to Sun, it is a sum type in2244 <<Because weekday is a summation of values Mon to Sun, it is a sum type in 2320 2245 turns of the functional-programming paradigm>> 2321 2246 … … 2334 2259 > I've marked 3 places with your name to shows places with enum ordering. 2335 2260 > 2336 > type week = Mon | Tue | Wed | Thu | Fri | Sat | Sun2337 > let day : week = Mon2338 > let take_class( d : week ) =2261 > type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun 2262 > let day : weekday = Mon 2263 > let take_class( d : weekday ) = 2339 2264 > if d <= Fri then (* Gregor *) 2340 > Printf.printf "week \n"2265 > Printf.printf "weekday\n" 2341 2266 > else if d >= Sat then (* Gregor *) 2342 2267 > Printf.printf "weekend\n"; … … 2549 2474 loop & & & & & & & & & & & & & \CM \\ 2550 2475 \hline 2551 array /subscript& & & & & & & & & & & \CM & & \CM \\2476 array & & & & & & & & & & & \CM & & \CM \\ 2552 2477 \hline 2553 2478 subtype & & & & & & & & & & & & & \CM \\ -
doc/theses/mike_brooks_MMath/background.tex
r31f4837 racb33f15 437 437 class seqnode : public uSeqable { ... } 438 438 %] 439 A node inheriting from @uSeqable@ can appear in a sequence/collection but a node inher iting from @uColable@ can only appear in a collection.439 A node inheriting from @uSeqable@ can appear in a sequence/collection but a node inherting from @uColable@ can only appear in a collection. 440 440 Along with providing the appropriate link fields, the types @uColable@ and @uSeqable@ also provide one member routine: 441 441 %[ … … 604 604 supplying the link fields by inheritance makes them implicit and relies on compiler placement, such as the start or end of @req@. 605 605 An example of an explicit attribute is cache alignment of the link fields in conjunction with other @req@ fields, improving locality and/or avoiding false sharing. 606 Wrapped reference has no control over the link fields, but the sep arate data allows some control;606 Wrapped reference has no control over the link fields, but the seperate data allows some control; 607 607 wrapped value has no control over data or links. 608 608 … … 690 690 Each group of intrusive links become the links for each separate STL list. 691 691 The upside is the unlimited number of a lists a node can be associated with simultaneously, any number of STL lists can be created dynamically. 692 The downside is the dynamic allocation of the link nodes and man aging multiple lists.692 The downside is the dynamic allocation of the link nodes and manging multiple lists. 693 693 Note, it might be possible to wrap the multiple lists in another type to hide this implementation issue. 694 694 … … 776 776 \section{String} 777 777 778 A string is a sequence of symbols, where the form of a symbolcan vary significantly: 7/8-bit characters (ASCII/Latin-1), or 2/4/8-byte (UNICODE) characters/symbols or variable length (UTF-8/16/32) characters.778 A string is a logical sequence of symbols, where the form of the symbols can vary significantly: 7/8-bit characters (ASCII/Latin-1), or 2/4/8-byte (UNICODE) characters/symbols or variable length (UTF-8/16/32) characters. 779 779 A string can be read left-to-right, right-to-left, top-to-bottom, and have stacked elements (Arabic). 780 780 781 A C character constant is an ASCII/Latin-1 character enclosed in single-quotes, \eg @'x'@, @'@\textsterling@'@. 782 A wide C character constant is the same, except prefixed by the letter @L@, @u@, or @U@, \eg @u'\u25A0'@ (black square), where the @\u@ identifies a universal character name. 783 A character can be formed from an escape sequence, which expresses a non-typable character (@'\n'@), a delimiter character @'\''@, or a raw character @'\x2f'@. 784 785 A character sequence is zero or more regular, wide, or escape characters enclosed in double-quotes @"xyz\n"@. 786 The kind of characters in the string is denoted by a prefix: UTF-8 characters are prefixed by @u8@, wide characters are prefixed by @L@, @u@, or @U@. 787 788 For UTF-8 string literals, the array elements have type @char@ and are initialized with the characters of the multibyte character sequences, \eg @u8"\xe1\x90\x87"@ (Canadian syllabics Y-Cree OO). 789 For wide string literals prefixed by the letter @L@, the array elements have type @wchar_t@ and are initialized with the wide characters corresponding of the multibyte character sequence, \eg @L"abc@$\mu$@"@ and read/print using @wsanf@/@wprintf@. 790 The value of a wide-character is implementation-defined, usually a UTF-16 character. 791 For wide string literals prefixed by the letter @u@ or @U@, the array elements have type @char16_t@ or @char32_t@, respectively, and are initialized with wide characters corresponding to the multibyte character sequence, \eg @u"abc@$\mu$@"@, @U"abc@$\mu$@"@. 792 The value of a @"u"@ character is an UTF-16 character; 793 the value of a @"U"@ character is an UTF-32 character. 781 An integer character constant is a sequence of one or more multibyte characters enclosed in single-quotes, as in @'x'@. 782 A wide character constant is the same, except prefixed by the letter @L@, @u@, or @U@. 783 Except for escape sequences, the elements of the sequence are any members of the source character set; 784 they are mapped in an implementation-defined manner to members of the execution character set. 785 786 A C character-string literal is a sequence of zero or more multibyte characters enclosed in double-quotes, as in @"xyz"@. 787 A UTF-8 string literal is the same, except prefixed by @u8@. 788 A wide string literal is the same, except prefixed by the letter @L@, @u@, or @U@. 789 790 For UTF-8 string literals, the array elements have type @char@, and are initialized with the characters of the multibyte character sequence, as encoded in UTF-8. 791 For wide string literals prefixed by the letter @L@, the array elements have type @wchar_t@ and are initialized with the sequence of wide characters corresponding to the multibyte character sequence, as defined by the @mbstowcs@ function with an implementation-defined current locale. 792 For wide string literals prefixed by the letter @u@ or @U@, the array elements have type @char16_t@ or @char32_t@, respectively, and are initialized with the sequence of wide characters corresponding to the multibyte character sequence, as defined by successive calls to the @mbrtoc16@, or @mbrtoc32@ function as appropriate for its type, with an implementation-defined current locale. 794 793 The value of a string literal containing a multibyte character or escape sequence not represented in the execution character set is implementation-defined. 795 794 796 C strings are null-terminated rather than maintaining a separate string length. 795 796 Another bad C design decision is to have null-terminated strings rather than maintaining a separate string length. 797 797 \begin{quote} 798 798 Technically, a string is an array whose elements are single characters. … … 800 800 This representation means that there is no real limit to how long a string can be, but programs have to scan one completely to determine its length. 801 801 \end{quote} 802 Unfortunately, this design decision is both unsafe and inefficient.803 It is common error in C to forget the space in a character array for the terminator or overwrite the terminator, resulting in array overruns in string operations.804 The need to repeatedly scan an entire string to determine its length can result in significant cost, as it is not possible to cache the length in many cases.805 806 C strings are fixed size because arrays are used for the implementation.807 However, string manipulation commonly results in dynamically-sized temporary and final string values.808 As a result, storage management for C strings is a nightmare, quickly resulting in array overruns and incorrect results.809 810 Collectively, these design decisions make working with strings in C, awkward, time consuming, and very unsafe.811 While there are companion string routines that take the maximum lengths of strings to prevent array overruns, that means the semantics of the operation can fail because strings are truncated.812 Suffice it to say, C is not a go-to language for string applications, which is why \CC introduced the @string@ type. -
driver/cfa.cc
r31f4837 racb33f15 26 26 #include <sys/stat.h> 27 27 28 #include "Common/SemanticError.h pp"28 #include "Common/SemanticError.h" 29 29 #include "config.h" // configure info 30 30 -
libcfa/src/enum.hfa
r31f4837 racb33f15 26 26 forall(E | TypedEnum(T, E)) { 27 27 // comparison 28 int ?==?(E l, E r); // true if l and r are same enumerators29 int ?!=?(E l, E r); // true if l and r are different enumerators30 int ?!=?(E l, zero_t); // true if l is not the first enumerator31 int ?<?(E l, E r); // true if l is an enuemerator before r32 int ?<=?(E l, E r); // true if l before or the same as r33 int ?>?(E l, E r); // true if l is an enuemrator after r34 int ?>=?(E l, E r); // true if l after or the same as r28 int ?==?(E l, E r); 29 int ?!=?(E l, E r); 30 int ?!=?(E l, zero_t); 31 int ?<?(E l, E r); 32 int ?<=?(E l, E r); 33 int ?>?(E l, E r); 34 int ?>=?(E l, E r); 35 35 } 36 36 } -
src/AST/Decl.cpp
r31f4837 racb33f15 20 20 #include <unordered_map> 21 21 22 #include "Common/Eval.h pp"// for eval23 #include "Common/SemanticError.h pp"22 #include "Common/Eval.h" // for eval 23 #include "Common/SemanticError.h" 24 24 25 25 #include "Fwd.hpp" // for UniqueId -
src/AST/Expr.cpp
r31f4837 racb33f15 27 27 #include "Type.hpp" 28 28 #include "TypeSubstitution.hpp" 29 #include "Common/ Utility.hpp"30 #include "Common/SemanticError.h pp"31 #include "GenPoly/Lvalue.h pp"// for referencesPermissable32 #include "ResolvExpr/Unify.h pp"// for extractResultType33 #include "Tuples/Tuples.h pp"// for makeTupleType29 #include "Common/utility.h" 30 #include "Common/SemanticError.h" 31 #include "GenPoly/Lvalue.h" // for referencesPermissable 32 #include "ResolvExpr/Unify.h" // for extractResultType 33 #include "Tuples/Tuples.h" // for makeTupleType 34 34 35 35 namespace ast { -
src/AST/Inspect.cpp
r31f4837 racb33f15 24 24 #include "AST/Stmt.hpp" 25 25 #include "AST/Type.hpp" 26 #include "CodeGen/OperatorTable.h pp"26 #include "CodeGen/OperatorTable.h" 27 27 28 28 namespace ast { -
src/AST/Label.hpp
r31f4837 racb33f15 21 21 22 22 #include "Node.hpp" 23 #include "Common/CodeLocation.h pp"23 #include "Common/CodeLocation.h" 24 24 25 25 namespace ast { -
src/AST/LinkageSpec.cpp
r31f4837 racb33f15 20 20 #include <string> 21 21 22 #include "Common/CodeLocation.h pp"23 #include "Common/SemanticError.h pp"22 #include "Common/CodeLocation.h" 23 #include "Common/SemanticError.h" 24 24 25 25 namespace ast { -
src/AST/LinkageSpec.hpp
r31f4837 racb33f15 19 19 20 20 #include "Bitfield.hpp" 21 #include "Common/CodeLocation.h pp"21 #include "Common/CodeLocation.h" 22 22 23 23 namespace ast { -
src/AST/Node.hpp
r31f4837 racb33f15 20 20 #include <iosfwd> 21 21 22 #include "Common/ErrorObjects.h pp" // for SemanticErrorException22 #include "Common/ErrorObjects.h" // for SemanticErrorException 23 23 24 24 namespace ast { -
src/AST/ParseNode.hpp
r31f4837 racb33f15 18 18 #include "Node.hpp" 19 19 20 #include "Common/CodeLocation.h pp"20 #include "Common/CodeLocation.h" 21 21 22 22 namespace ast { -
src/AST/Pass.hpp
r31f4837 racb33f15 423 423 } 424 424 425 #include "Common/Stats.h pp"425 #include "Common/Stats.h" 426 426 427 427 namespace ast { -
src/AST/Pass.proto.hpp
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Pass. proto.hpp --7 // Pass.impl.hpp -- 8 8 // 9 9 // Author : Thierry Delisle … … 18 18 19 19 #include "Common/Iterate.hpp" 20 #include "Common/Stats/Heap.h pp"21 #include "Common/ Utility.hpp"20 #include "Common/Stats/Heap.h" 21 #include "Common/utility.h" 22 22 namespace ast { 23 23 template<typename core_t> class Pass; -
src/AST/Print.hpp
r31f4837 racb33f15 19 19 20 20 #include "AST/Fwd.hpp" 21 #include "Common/Indenter.h pp"21 #include "Common/Indenter.h" 22 22 23 23 namespace ast { -
src/AST/Stmt.hpp
r31f4837 racb33f15 24 24 #include "ParseNode.hpp" 25 25 #include "Visitor.hpp" 26 #include "Common/CodeLocation.h pp"26 #include "Common/CodeLocation.h" 27 27 28 28 // Must be included in *all* AST classes; should be #undef'd at the end of the file -
src/AST/SymbolTable.cpp
r31f4837 racb33f15 23 23 #include "Inspect.hpp" 24 24 #include "Type.hpp" 25 #include "CodeGen/OperatorTable.h pp"// for isCtorDtorAssign26 #include "Common/SemanticError.h pp"27 #include "Common/Stats/Counter.h pp"28 #include "GenPoly/GenPoly.h pp"29 #include "InitTweak/InitTweak.h pp"30 #include "ResolvExpr/Cost.h pp"25 #include "CodeGen/OperatorTable.h" // for isCtorDtorAssign 26 #include "Common/SemanticError.h" 27 #include "Common/Stats/Counter.h" 28 #include "GenPoly/GenPoly.h" 29 #include "InitTweak/InitTweak.h" 30 #include "ResolvExpr/Cost.h" 31 31 #include "ResolvExpr/CandidateFinder.hpp" // for referenceToRvalueConversion 32 #include "ResolvExpr/Unify.h pp"33 #include "SymTab/Mangler.h pp"32 #include "ResolvExpr/Unify.h" 33 #include "SymTab/Mangler.h" 34 34 35 35 namespace ast { -
src/AST/SymbolTable.hpp
r31f4837 racb33f15 21 21 #include "Fwd.hpp" 22 22 #include "Node.hpp" // for ptr, readonly 23 #include "Common/CodeLocation.h pp"24 #include "Common/PersistentMap.h pp"23 #include "Common/CodeLocation.h" 24 #include "Common/PersistentMap.h" 25 25 26 26 namespace ResolvExpr { -
src/AST/Type.cpp
r31f4837 racb33f15 23 23 #include "Init.hpp" 24 24 #include "Inspect.hpp" 25 #include "Common/ Utility.hpp"// for copy, move26 #include "Tuples/Tuples.h pp"// for isTtype25 #include "Common/utility.h" // for copy, move 26 #include "Tuples/Tuples.h" // for isTtype 27 27 28 28 namespace ast { -
src/AST/TypeEnvironment.cpp
r31f4837 racb33f15 29 29 #include "Print.hpp" 30 30 #include "Type.hpp" 31 #include "Common/Indenter.h pp"32 #include "ResolvExpr/ Typeops.hpp" // for occurs33 #include "ResolvExpr/WidenMode.h pp"34 #include "ResolvExpr/Unify.h pp" // for unifyInexact35 #include "Tuples/Tuples.h pp" // for isTtype31 #include "Common/Indenter.h" 32 #include "ResolvExpr/typeops.h" // for occurs 33 #include "ResolvExpr/WidenMode.h" 34 #include "ResolvExpr/Unify.h" // for unifyInexact 35 #include "Tuples/Tuples.h" // for isTtype 36 36 #include "CompilationState.hpp" 37 37 -
src/AST/TypeEnvironment.hpp
r31f4837 racb33f15 28 28 #include "Type.hpp" 29 29 #include "TypeSubstitution.hpp" 30 #include "Common/Indenter.h pp"31 #include "ResolvExpr/WidenMode.h pp"30 #include "Common/Indenter.h" 31 #include "ResolvExpr/WidenMode.h" 32 32 33 33 namespace ast { -
src/AST/TypeSubstitution.cpp
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypeSubstitution.c pp--7 // TypeSubstitution.cc -- 8 8 // 9 9 // Author : Richard C. Bilson -
src/AST/TypeSubstitution.hpp
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypeSubstitution.h pp--7 // TypeSubstitution.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 16 16 #pragma once 17 17 18 #include <cassert> // for assert19 #include <list> // for list<>::iterator, _List_iterator18 #include <cassert> // for assert 19 #include <list> // for list<>::iterator, _List_iterator 20 20 #include <unordered_map> 21 21 #include <unordered_set> 22 #include <string> // for string, operator!=23 #include <utility> // for pair22 #include <string> // for string, operator!= 23 #include <utility> // for pair 24 24 25 #include "Fwd.hpp" // for UniqueId25 #include "Fwd.hpp" // for UniqueId 26 26 #include "ParseNode.hpp" 27 27 #include "Type.hpp" 28 #include "Common/SemanticError.h pp" // for SemanticError28 #include "Common/SemanticError.h" // for SemanticError 29 29 #include "Visitor.hpp" 30 30 #include "Decl.hpp" -
src/AST/Util.cpp
r31f4837 racb33f15 20 20 #include "Pass.hpp" 21 21 #include "TranslationUnit.hpp" 22 #include "Common/ Utility.hpp"23 #include "GenPoly/ScopedSet.h pp"22 #include "Common/utility.h" 23 #include "GenPoly/ScopedSet.h" 24 24 25 25 #include <vector> -
src/BasicTypes-gen.cpp
r31f4837 racb33f15 326 326 327 327 328 #define ConversionCost TOP_SRCDIR "src/ResolvExpr/ConversionCost.c pp"328 #define ConversionCost TOP_SRCDIR "src/ResolvExpr/ConversionCost.cc" 329 329 resetInput( file, ConversionCost, buffer, code, str ); 330 330 … … 405 405 406 406 407 #define CommonType TOP_SRCDIR "src/ResolvExpr/CommonType.c pp"407 #define CommonType TOP_SRCDIR "src/ResolvExpr/CommonType.cc" 408 408 resetInput( file, CommonType, buffer, code, str ); 409 409 … … 446 446 447 447 448 #define ManglerCommon TOP_SRCDIR "src/SymTab/ManglerCommon.c pp"448 #define ManglerCommon TOP_SRCDIR "src/SymTab/ManglerCommon.cc" 449 449 resetInput( file, ManglerCommon, buffer, code, str ); 450 450 -
src/CodeGen/CodeGenerator.cpp
r31f4837 racb33f15 17 17 18 18 #include "AST/Print.hpp" 19 #include "OperatorTable.h pp"// for OperatorInfo, operatorLookup20 #include "CodeGen/GenType.h pp"// for genType19 #include "OperatorTable.h" // for OperatorInfo, operatorLookup 20 #include "CodeGen/GenType.h" // for genType 21 21 #include "Common/ToString.hpp" // for toString 22 #include "Common/UniqueName.h pp"// for UniqueName22 #include "Common/UniqueName.h" // for UniqueName 23 23 24 24 namespace CodeGen { -
src/CodeGen/CodeGenerator.hpp
r31f4837 racb33f15 20 20 #include "AST/Fwd.hpp" 21 21 #include "AST/Pass.hpp" // for WithGuards, WithShortCircuiting, ... 22 #include "CodeGen/Options.h pp"// for Options23 #include "Common/Indenter.h pp"// for Indenter22 #include "CodeGen/Options.h" // for Options 23 #include "Common/Indenter.h" // for Indenter 24 24 25 25 -
src/CodeGen/module.mk
r31f4837 racb33f15 18 18 CodeGen/CodeGenerator.cpp \ 19 19 CodeGen/CodeGenerator.hpp \ 20 CodeGen/GenType.c pp\21 CodeGen/GenType.h pp\22 CodeGen/OperatorTable.c pp\23 CodeGen/OperatorTable.h pp20 CodeGen/GenType.cc \ 21 CodeGen/GenType.h \ 22 CodeGen/OperatorTable.cc \ 23 CodeGen/OperatorTable.h 24 24 25 25 SRC += $(SRC_CODEGEN) \ 26 CodeGen/ FixMain.cpp\27 CodeGen/ FixMain.hpp\28 CodeGen/Fix Names.cpp\29 CodeGen/Fix Names.hpp\30 CodeGen/ Generate.cpp\31 CodeGen/ Generate.hpp\32 CodeGen/LinkOnce.c pp\33 CodeGen/LinkOnce.h pp\34 CodeGen/Options.h pp26 CodeGen/Generate.cc \ 27 CodeGen/Generate.h \ 28 CodeGen/FixMain.cc \ 29 CodeGen/FixMain.h \ 30 CodeGen/FixNames.cc \ 31 CodeGen/FixNames.h \ 32 CodeGen/LinkOnce.cc \ 33 CodeGen/LinkOnce.h \ 34 CodeGen/Options.h 35 35 36 36 SRCDEMANGLE += $(SRC_CODEGEN) -
src/Common/CodeLocationTools.cpp
r31f4837 racb33f15 20 20 #include "AST/Pass.hpp" 21 21 #include "AST/TranslationUnit.hpp" 22 #include "Common/CodeLocation.h pp"22 #include "Common/CodeLocation.h" 23 23 24 24 namespace { -
src/Common/DeclStats.cpp
r31f4837 racb33f15 19 19 #include "AST/Pass.hpp" 20 20 #include "AST/Print.hpp" 21 #include "Common/VectorMap.h pp"21 #include "Common/VectorMap.h" 22 22 23 23 #include <iostream> -
src/Common/ResolvProtoDump.cpp
r31f4837 racb33f15 26 26 #include "AST/TranslationUnit.hpp" 27 27 #include "AST/Type.hpp" 28 #include "CodeGen/OperatorTable.h pp"28 #include "CodeGen/OperatorTable.h" 29 29 30 30 namespace { -
src/Common/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_COMMON = \ 18 Common/Assert.c pp\19 Common/CodeLocation.h pp\18 Common/Assert.cc \ 19 Common/CodeLocation.h \ 20 20 Common/CodeLocationTools.hpp \ 21 21 Common/CodeLocationTools.cpp \ 22 22 Common/DeclStats.hpp \ 23 23 Common/DeclStats.cpp \ 24 Common/ErrorObjects.h pp\25 Common/Eval.c pp\26 Common/Eval.h pp\27 Common/Examine.c pp\28 Common/Examine.h pp\29 Common/FilterCombos.h pp\30 Common/Indenter.h pp\31 Common/Indenter.c pp\24 Common/ErrorObjects.h \ 25 Common/Eval.cc \ 26 Common/Eval.h \ 27 Common/Examine.cc \ 28 Common/Examine.h \ 29 Common/FilterCombos.h \ 30 Common/Indenter.h \ 31 Common/Indenter.cc \ 32 32 Common/Iterate.hpp \ 33 Common/PersistentMap.h pp\33 Common/PersistentMap.h \ 34 34 Common/ResolvProtoDump.hpp \ 35 35 Common/ResolvProtoDump.cpp \ 36 Common/ScopedMap.h pp\37 Common/SemanticError.c pp\38 Common/SemanticError.h pp\39 Common/Stats.h pp\40 Common/Stats/Base.h pp\41 Common/Stats/Counter.c pp\42 Common/Stats/Counter.h pp\43 Common/Stats/Heap.c pp\44 Common/Stats/Heap.h pp\45 Common/Stats/ResolveTime.c pp\46 Common/Stats/ResolveTime.h pp\47 Common/Stats/Stats.c pp\48 Common/Stats/Time.c pp\49 Common/Stats/Time.h pp\36 Common/ScopedMap.h \ 37 Common/SemanticError.cc \ 38 Common/SemanticError.h \ 39 Common/Stats.h \ 40 Common/Stats/Base.h \ 41 Common/Stats/Counter.cc \ 42 Common/Stats/Counter.h \ 43 Common/Stats/Heap.cc \ 44 Common/Stats/Heap.h \ 45 Common/Stats/ResolveTime.cc \ 46 Common/Stats/ResolveTime.h \ 47 Common/Stats/Stats.cc \ 48 Common/Stats/Time.cc \ 49 Common/Stats/Time.h \ 50 50 Common/ToString.hpp \ 51 Common/UniqueName.c pp\52 Common/UniqueName.h pp\53 Common/ Utility.hpp\54 Common/VectorMap.h pp51 Common/UniqueName.cc \ 52 Common/UniqueName.h \ 53 Common/utility.h \ 54 Common/VectorMap.h 55 55 56 56 SRC += $(SRC_COMMON) \ 57 Common/DebugMalloc.c pp57 Common/DebugMalloc.cc 58 58 59 59 SRCDEMANGLE += $(SRC_COMMON) -
src/CompilationState.cpp
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CompilationState.c pp--7 // CompilationState.cc -- 8 8 // 9 9 // Author : Rob Schluntz -
src/Concurrency/Corun.cpp
r31f4837 racb33f15 19 19 #include "AST/Stmt.hpp" 20 20 #include "AST/TranslationUnit.hpp" 21 #include "Common/UniqueName.h pp"21 #include "Common/UniqueName.h" 22 22 using namespace ast; 23 23 using namespace std; -
src/Concurrency/Keywords.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Concurrency/Keywords.h pp"16 #include "Concurrency/Keywords.h" 17 17 18 18 #include <iostream> … … 26 26 #include "AST/DeclReplacer.hpp" 27 27 #include "AST/TranslationUnit.hpp" 28 #include "CodeGen/OperatorTable.h pp"29 #include "Common/Examine.h pp"30 #include "Common/ Utility.hpp"31 #include "Common/UniqueName.h pp"28 #include "CodeGen/OperatorTable.h" 29 #include "Common/Examine.h" 30 #include "Common/utility.h" 31 #include "Common/UniqueName.h" 32 32 #include "ControlStruct/LabelGenerator.hpp" 33 #include "InitTweak/InitTweak.h pp"34 #include "Virtual/Tables.h pp"33 #include "InitTweak/InitTweak.h" 34 #include "Virtual/Tables.h" 35 35 36 36 namespace Concurrency { -
src/Concurrency/Waitfor.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Waitfor.h pp"16 #include "Waitfor.h" 17 17 18 18 #include <string> 19 19 20 20 #include "AST/Pass.hpp" 21 #include "Common/UniqueName.h pp"22 #include "InitTweak/InitTweak.h pp"23 #include "ResolvExpr/Resolver.h pp"21 #include "Common/UniqueName.h" 22 #include "InitTweak/InitTweak.h" 23 #include "ResolvExpr/Resolver.h" 24 24 25 25 #include "AST/Print.hpp" -
src/Concurrency/Waituntil.cpp
r31f4837 racb33f15 24 24 #include "AST/Stmt.hpp" 25 25 #include "AST/Type.hpp" 26 #include "Common/UniqueName.h pp"26 #include "Common/UniqueName.h" 27 27 28 28 using namespace ast; -
src/Concurrency/Waituntil.hpp
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Wait until.hpp--7 // Waitfor.h -- 8 8 // 9 9 // Author : Thierry Delisle -
src/Concurrency/module.mk
r31f4837 racb33f15 21 21 Concurrency/Corun.hpp \ 22 22 Concurrency/Keywords.cpp \ 23 Concurrency/Keywords.h pp\23 Concurrency/Keywords.h \ 24 24 Concurrency/Waitfor.cpp \ 25 Concurrency/Waitfor.h pp\25 Concurrency/Waitfor.h \ 26 26 Concurrency/Waituntil.cpp \ 27 27 Concurrency/Waituntil.hpp -
src/ControlStruct/ExceptDecl.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "ExceptDecl.h pp"16 #include "ExceptDecl.h" 17 17 18 18 #include <sstream> … … 23 23 #include "AST/Print.hpp" 24 24 #include "AST/Type.hpp" 25 #include "Virtual/Tables.h pp"25 #include "Virtual/Tables.h" 26 26 27 27 namespace ControlStruct { -
src/ControlStruct/ExceptTranslate.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "ExceptTranslate.h pp"16 #include "ExceptTranslate.h" 17 17 18 18 #include "AST/Expr.hpp" -
src/ControlStruct/module.mk
r31f4837 racb33f15 17 17 SRC += \ 18 18 ControlStruct/ExceptDecl.cpp \ 19 ControlStruct/ExceptDecl.h pp\19 ControlStruct/ExceptDecl.h \ 20 20 ControlStruct/ExceptTranslate.cpp \ 21 ControlStruct/ExceptTranslate.h pp\21 ControlStruct/ExceptTranslate.h \ 22 22 ControlStruct/FixLabels.cpp \ 23 23 ControlStruct/FixLabels.hpp \ -
src/GenPoly/Box.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Box.h pp"16 #include "Box.h" 17 17 18 18 #include "AST/Decl.hpp" // for Decl, FunctionDecl, ... … … 24 24 #include "AST/Vector.hpp" // for vector 25 25 #include "AST/GenericSubstitution.hpp" // for genericSubstitution 26 #include "CodeGen/OperatorTable.h pp"// for isAssignment26 #include "CodeGen/OperatorTable.h" // for isAssignment 27 27 #include "Common/Iterate.hpp" // for group_iterate 28 #include "Common/ScopedMap.h pp"// for ScopedMap28 #include "Common/ScopedMap.h" // for ScopedMap 29 29 #include "Common/ToString.hpp" // for toCString 30 #include "Common/UniqueName.h pp"// for UniqueName31 #include "GenPoly/FindFunction.h pp"// for findFunction32 #include "GenPoly/GenPoly.h pp"// for getFunctionType, ...33 #include "GenPoly/Lvalue.h pp"// for generalizedLvalue34 #include "GenPoly/ScopedSet.h pp"// for ScopedSet30 #include "Common/UniqueName.h" // for UniqueName 31 #include "GenPoly/FindFunction.h" // for findFunction 32 #include "GenPoly/GenPoly.h" // for getFunctionType, ... 33 #include "GenPoly/Lvalue.h" // for generalizedLvalue 34 #include "GenPoly/ScopedSet.h" // for ScopedSet 35 35 #include "GenPoly/ScrubTypeVars.hpp" // for scrubTypeVars, scrubAllTypeVars 36 #include "ResolvExpr/Unify.h pp"// for typesCompatible37 #include "SymTab/Mangler.h pp"// for mangle, mangleType36 #include "ResolvExpr/Unify.h" // for typesCompatible 37 #include "SymTab/Mangler.h" // for mangle, mangleType 38 38 39 39 namespace GenPoly { -
src/GenPoly/InstantiateGeneric.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "InstantiateGeneric.h pp"16 #include "InstantiateGeneric.h" 17 17 18 18 #include <cassert> // for assertf, assert … … 27 27 #include "AST/TranslationUnit.hpp" // for TranslationUnit 28 28 #include "AST/Vector.hpp" // for vector 29 #include "CodeGen/OperatorTable.h pp"// for isAssignment30 #include "Common/ScopedMap.h pp"// for ScopedMap31 #include "Common/UniqueName.h pp"// for UniqueName32 #include "GenPoly/GenPoly.h pp"// for isPolyType, typesPolyCompatible29 #include "CodeGen/OperatorTable.h" // for isAssignment 30 #include "Common/ScopedMap.h" // for ScopedMap 31 #include "Common/UniqueName.h" // for UniqueName 32 #include "GenPoly/GenPoly.h" // for isPolyType, typesPolyCompatible 33 33 #include "GenPoly/ScrubTypeVars.hpp" // for scrubAllTypeVars 34 34 #include "ResolvExpr/AdjustExprType.hpp" // for adjustExprType 35 #include "ResolvExpr/Unify.h pp"// for typesCompatible35 #include "ResolvExpr/Unify.h" // for typesCompatible 36 36 37 37 namespace GenPoly { -
src/GenPoly/Lvalue.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Lvalue.h pp"16 #include "Lvalue.h" 17 17 18 18 #include <set> … … 24 24 #include "AST/LinkageSpec.hpp" // for Linkage 25 25 #include "AST/Pass.hpp" 26 #include "Common/SemanticError.h pp"// for SemanticWarning26 #include "Common/SemanticError.h" // for SemanticWarning 27 27 #include "Common/ToString.hpp" // for toCString 28 #include "Common/UniqueName.h pp"// for UniqueName29 #include "GenPoly/GenPoly.h pp"// for genFunctionType30 #include "ResolvExpr/ Typeops.hpp"// for typesCompatible31 #include "ResolvExpr/Unify.h pp"// for unify28 #include "Common/UniqueName.h" // for UniqueName 29 #include "GenPoly/GenPoly.h" // for genFunctionType 30 #include "ResolvExpr/typeops.h" // for typesCompatible 31 #include "ResolvExpr/Unify.h" // for unify 32 32 33 33 #if 0 -
src/GenPoly/ScrubTypeVars.cpp
r31f4837 racb33f15 16 16 #include "ScrubTypeVars.hpp" 17 17 18 #include <utility> // for pair18 #include <utility> // for pair 19 19 20 20 #include "AST/Pass.hpp" 21 #include "GenPoly.h pp" // for mangleType, TyVarMap, align...22 #include "GenPoly/ErasableScopedMap.h pp" // for ErasableScopedMap<>::const_...23 #include "SymTab/Mangler.h pp" // for mangleType21 #include "GenPoly.h" // for mangleType, TyVarMap, alignof... 22 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::const_it... 23 #include "SymTab/Mangler.h" // for mangleType 24 24 25 25 namespace GenPoly { -
src/GenPoly/ScrubTypeVars.hpp
r31f4837 racb33f15 19 19 20 20 #include "AST/Fwd.hpp" // for Node 21 #include "GenPoly.h pp"// for TypeVarMap21 #include "GenPoly.h" // for TypeVarMap 22 22 23 23 namespace GenPoly { -
src/GenPoly/Specialize.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Specialize.h pp"16 #include "Specialize.h" 17 17 18 18 #include "AST/Copy.hpp" // for deepCopy … … 20 20 #include "AST/Pass.hpp" // for Pass 21 21 #include "AST/TypeEnvironment.hpp" // for OpenVarSet, AssertionSet 22 #include "Common/UniqueName.h pp"// for UniqueName23 #include "GenPoly/GenPoly.h pp"// for getFunctionType24 #include "ResolvExpr/FindOpenVars.h pp"// for findOpenVars22 #include "Common/UniqueName.h" // for UniqueName 23 #include "GenPoly/GenPoly.h" // for getFunctionType 24 #include "ResolvExpr/FindOpenVars.h" // for findOpenVars 25 25 26 26 namespace GenPoly { -
src/GenPoly/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_GENPOLY = \ 18 GenPoly/GenPoly.c pp\19 GenPoly/GenPoly.h pp\20 GenPoly/Lvalue2.c pp\21 GenPoly/Lvalue.h pp18 GenPoly/GenPoly.cc \ 19 GenPoly/GenPoly.h \ 20 GenPoly/Lvalue2.cc \ 21 GenPoly/Lvalue.h 22 22 23 23 SRC += $(SRC_GENPOLY) \ 24 24 GenPoly/Box.cpp \ 25 GenPoly/Box.h pp\26 GenPoly/ErasableScopedMap.h pp\27 GenPoly/FindFunction.c pp\28 GenPoly/FindFunction.h pp\25 GenPoly/Box.h \ 26 GenPoly/ErasableScopedMap.h \ 27 GenPoly/FindFunction.cc \ 28 GenPoly/FindFunction.h \ 29 29 GenPoly/InstantiateGeneric.cpp \ 30 GenPoly/InstantiateGeneric.h pp\30 GenPoly/InstantiateGeneric.h \ 31 31 GenPoly/Lvalue.cpp \ 32 GenPoly/ScopedSet.h pp\32 GenPoly/ScopedSet.h \ 33 33 GenPoly/ScrubTypeVars.cpp \ 34 34 GenPoly/ScrubTypeVars.hpp \ 35 35 GenPoly/Specialize.cpp \ 36 GenPoly/Specialize.h pp36 GenPoly/Specialize.h 37 37 38 38 SRCDEMANGLE += $(SRC_GENPOLY) -
src/InitTweak/FixInit.cpp
r31f4837 racb33f15 1 #include "FixInit.h pp"1 #include "FixInit.h" 2 2 3 3 #include <stddef.h> // for NULL … … 22 22 #include "AST/SymbolTable.hpp" 23 23 #include "AST/Type.hpp" 24 #include "CodeGen/OperatorTable.h pp"// for isConstructor, isCtorDtor, isD...25 #include "Common/SemanticError.h pp"// for SemanticError24 #include "CodeGen/OperatorTable.h" // for isConstructor, isCtorDtor, isD... 25 #include "Common/SemanticError.h" // for SemanticError 26 26 #include "Common/ToString.hpp" // for toCString 27 #include "Common/UniqueName.h pp"// for UniqueName28 #include "FixGlobalInit.h pp"// for fixGlobalInit29 #include "GenInit.h pp"// for genCtorDtor30 #include "GenPoly/GenPoly.h pp"// for getFunctionType31 #include "ResolvExpr/Resolver.h pp"// for findVoidExpression32 #include "ResolvExpr/Unify.h pp"// for typesCompatible27 #include "Common/UniqueName.h" // for UniqueName 28 #include "FixGlobalInit.h" // for fixGlobalInit 29 #include "GenInit.h" // for genCtorDtor 30 #include "GenPoly/GenPoly.h" // for getFunctionType 31 #include "ResolvExpr/Resolver.h" // for findVoidExpression 32 #include "ResolvExpr/Unify.h" // for typesCompatible 33 33 #include "SymTab/GenImplicitCall.hpp" // for genImplicitCall 34 34 -
src/InitTweak/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_INITTWEAK = \ 18 InitTweak/GenInit.c pp\19 InitTweak/GenInit.h pp\20 InitTweak/InitTweak.c pp\21 InitTweak/InitTweak.h pp18 InitTweak/GenInit.cc \ 19 InitTweak/GenInit.h \ 20 InitTweak/InitTweak.cc \ 21 InitTweak/InitTweak.h 22 22 23 23 SRC += $(SRC_INITTWEAK) \ 24 InitTweak/FixGlobalInit.c pp\25 InitTweak/FixGlobalInit.h pp\24 InitTweak/FixGlobalInit.cc \ 25 InitTweak/FixGlobalInit.h \ 26 26 InitTweak/FixInit.cpp \ 27 InitTweak/FixInit.h pp27 InitTweak/FixInit.h 28 28 29 29 SRCDEMANGLE += $(SRC_INITTWEAK) -
src/MakeLibCfa.cpp
r31f4837 racb33f15 19 19 #include "AST/Fwd.hpp" 20 20 #include "AST/Pass.hpp" 21 #include "CodeGen/OperatorTable.h pp"22 #include "Common/UniqueName.h pp"21 #include "CodeGen/OperatorTable.h" 22 #include "Common/UniqueName.h" 23 23 24 24 namespace LibCfa { -
src/Makefile.am
r31f4837 racb33f15 53 53 include Virtual/module.mk 54 54 55 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.c pp ResolvExpr/CommonType.cpp SymTab/ManglerCommon.cpp) : $(srcdir)/AST/BasicKind.hpp55 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/AST/BasicKind.hpp 56 56 57 57 $(srcdir)/AST/BasicKind.hpp : BasicTypes-gen.cpp … … 73 73 cfa_cpplib_PROGRAMS += $(DEMANGLER) 74 74 EXTRA_PROGRAMS = ../driver/demangler 75 ___driver_demangler_SOURCES = SymTab/demangler.c pp# test driver for the demangler, also useful as a sanity check that libdemangle.a is complete75 ___driver_demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete 76 76 ___driver_demangler_LDADD = libdemangle.a -ldl # yywrap 77 77 noinst_LIBRARIES = $(LIBDEMANGLE) -
src/Parser/RunParser.cpp
r31f4837 racb33f15 18 18 #include "AST/TranslationUnit.hpp" // for TranslationUnit 19 19 #include "Common/CodeLocationTools.hpp" // for forceFillCodeLocations 20 #include "Parser/DeclarationNode.h pp"// for DeclarationNode, buildList21 #include "Parser/TypedefTable.h pp"// for TypedefTable20 #include "Parser/DeclarationNode.h" // for DeclarationNode, buildList 21 #include "Parser/TypedefTable.h" // for TypedefTable 22 22 23 23 // Variables global to the parsing code. -
src/Parser/lex.ll
r31f4837 racb33f15 44 44 45 45 #include "config.h" // configure info 46 #include "DeclarationNode.h pp"// for DeclarationNode47 #include "ExpressionNode.h pp"// for LabelNode48 #include "InitializerNode.h pp"// for InitializerNode49 #include "ParseNode.h pp"50 #include "ParserTypes.h pp"// for Token51 #include "StatementNode.h pp"// for CondCtl, ForCtrl52 #include "TypedefTable.h pp"46 #include "DeclarationNode.h" // for DeclarationNode 47 #include "ExpressionNode.h" // for LabelNode 48 #include "InitializerNode.h" // for InitializerNode 49 #include "ParseNode.h" 50 #include "ParserTypes.h" // for Token 51 #include "StatementNode.h" // for CondCtl, ForCtrl 52 #include "TypedefTable.h" 53 53 // This (generated) header must come late as it is missing includes. 54 54 #include "parser.hh" // generated info -
src/Parser/module.mk
r31f4837 racb33f15 20 20 21 21 SRC += \ 22 Parser/DeclarationNode.c pp\23 Parser/DeclarationNode.h pp\24 Parser/ExpressionNode.c pp\25 Parser/ExpressionNode.h pp\26 Parser/InitializerNode.c pp\27 Parser/InitializerNode.h pp\22 Parser/DeclarationNode.cc \ 23 Parser/DeclarationNode.h \ 24 Parser/ExpressionNode.cc \ 25 Parser/ExpressionNode.h \ 26 Parser/InitializerNode.cc \ 27 Parser/InitializerNode.h \ 28 28 Parser/lex.ll \ 29 Parser/ParseNode.c pp\30 Parser/ParseNode.h pp\29 Parser/ParseNode.cc \ 30 Parser/ParseNode.h \ 31 31 Parser/parser.yy \ 32 Parser/ParserTypes.h pp\33 Parser/ ParserUtility.hpp\32 Parser/ParserTypes.h \ 33 Parser/parserutility.h \ 34 34 Parser/RunParser.cpp \ 35 35 Parser/RunParser.hpp \ 36 Parser/StatementNode.c pp\37 Parser/StatementNode.h pp\38 Parser/TypeData.c pp\39 Parser/TypeData.h pp\40 Parser/TypedefTable.c pp\41 Parser/TypedefTable.h pp36 Parser/StatementNode.cc \ 37 Parser/StatementNode.h \ 38 Parser/TypeData.cc \ 39 Parser/TypeData.h \ 40 Parser/TypedefTable.cc \ 41 Parser/TypedefTable.h 42 42 43 MOSTLYCLEANFILES += \ 44 Parser/lex.cc \ 45 Parser/parser.cc \ 46 Parser/parser.hh \ 47 Parser/parser.output 43 MOSTLYCLEANFILES += Parser/lex.cc Parser/parser.cc Parser/parser.hh Parser/parser.output -
src/Parser/parser.yy
r31f4837 racb33f15 48 48 using namespace std; 49 49 50 #include "DeclarationNode.h pp"// for DeclarationNode, ...51 #include "ExpressionNode.h pp"// for ExpressionNode, ...52 #include "InitializerNode.h pp"// for InitializerNode, ...53 #include "ParserTypes.h pp"54 #include "StatementNode.h pp"// for build_...55 #include "TypedefTable.h pp"56 #include "TypeData.h pp"50 #include "DeclarationNode.h" // for DeclarationNode, ... 51 #include "ExpressionNode.h" // for ExpressionNode, ... 52 #include "InitializerNode.h" // for InitializerNode, ... 53 #include "ParserTypes.h" 54 #include "StatementNode.h" // for build_... 55 #include "TypedefTable.h" 56 #include "TypeData.h" 57 57 #include "AST/Type.hpp" // for BasicType, BasicKind 58 #include "Common/SemanticError.h pp"// error_str59 #include "Common/ Utility.hpp"// for maybeMoveBuild, maybeBuild, CodeLo...58 #include "Common/SemanticError.h" // error_str 59 #include "Common/utility.h" // for maybeMoveBuild, maybeBuild, CodeLo... 60 60 61 61 // lex uses __null in a boolean context, it's fine. -
src/ResolvExpr/Candidate.hpp
r31f4837 racb33f15 20 20 #include <vector> 21 21 22 #include "Cost.h pp"22 #include "Cost.h" 23 23 #include "AST/Node.hpp" 24 24 #include "AST/TypeEnvironment.hpp" 25 #include "Common/Indenter.h pp"25 #include "Common/Indenter.h" 26 26 27 27 namespace ast { -
src/ResolvExpr/CandidateFinder.cpp
r31f4837 racb33f15 17 17 18 18 #include <deque> 19 #include <iterator> // for back_inserter19 #include <iterator> // for back_inserter 20 20 #include <sstream> 21 21 #include <string> … … 25 25 #include "AdjustExprType.hpp" 26 26 #include "Candidate.hpp" 27 #include "CastCost.hpp" // for castCost27 #include "CastCost.hpp" // for castCost 28 28 #include "CompilationState.hpp" 29 #include "ConversionCost.h pp" // for conversionCast30 #include "Cost.h pp"29 #include "ConversionCost.h" // for conversionCast 30 #include "Cost.h" 31 31 #include "ExplodedArg.hpp" 32 32 #include "PolyCost.hpp" 33 #include "RenameVars.h pp" // for renameTyVars34 #include "Resolver.h pp"35 #include "ResolveTypeof.h pp"33 #include "RenameVars.h" // for renameTyVars 34 #include "Resolver.h" 35 #include "ResolveTypeof.h" 36 36 #include "SatisfyAssertions.hpp" 37 37 #include "SpecCost.hpp" 38 #include " Typeops.hpp" // for combos39 #include "Unify.h pp"40 #include "WidenMode.h pp"38 #include "typeops.h" // for combos 39 #include "Unify.h" 40 #include "WidenMode.h" 41 41 #include "AST/Expr.hpp" 42 42 #include "AST/Node.hpp" … … 45 45 #include "AST/SymbolTable.hpp" 46 46 #include "AST/Type.hpp" 47 #include "Common/ Utility.hpp" // for move, copy48 #include "SymTab/Mangler.h pp"49 #include "Tuples/Tuples.h pp" // for handleTupleAssignment50 #include "InitTweak/InitTweak.h pp" // for getPointerBase51 52 #include "Common/Stats/Counter.h pp"47 #include "Common/utility.h" // for move, copy 48 #include "SymTab/Mangler.h" 49 #include "Tuples/Tuples.h" // for handleTupleAssignment 50 #include "InitTweak/InitTweak.h" // for getPointerBase 51 52 #include "Common/Stats/Counter.h" 53 53 54 54 #include "AST/Inspect.hpp" // for getFunctionName -
src/ResolvExpr/CandidatePrinter.cpp
r31f4837 racb33f15 24 24 #include "AST/TranslationUnit.hpp" 25 25 #include "ResolvExpr/CandidateFinder.hpp" 26 #include "ResolvExpr/Resolver.h pp"26 #include "ResolvExpr/Resolver.h" 27 27 28 28 namespace ResolvExpr { -
src/ResolvExpr/CastCost.hpp
r31f4837 racb33f15 16 16 #pragma once 17 17 18 #include "ResolvExpr/Cost.h" // for Cost 19 18 20 namespace ast { 19 21 class SymbolTable; … … 23 25 24 26 namespace ResolvExpr { 25 26 class Cost;27 27 28 28 Cost castCost( -
src/ResolvExpr/CommonType.hpp
r31f4837 racb33f15 18 18 #include "AST/Fwd.hpp" 19 19 #include "AST/TypeEnvironment.hpp" // for AssertionSet, OpenVarSet 20 #include "WidenMode.h pp"// for WidenMode20 #include "WidenMode.h" // for WidenMode 21 21 22 22 namespace ResolvExpr { -
src/ResolvExpr/ExplodedArg.cpp
r31f4837 racb33f15 16 16 #include "ExplodedArg.hpp" 17 17 18 #include "Tuples/Explode.h pp" // for Tuples::explode18 #include "Tuples/Explode.h" // for Tuples::explode 19 19 20 20 namespace ResolvExpr { -
src/ResolvExpr/ExplodedArg.hpp
r31f4837 racb33f15 19 19 20 20 #include "Candidate.hpp" // for Candidate, CandidateList 21 #include "Cost.h pp"// for Cost21 #include "Cost.h" // for Cost 22 22 #include "AST/Expr.hpp" 23 23 #include "AST/Node.hpp" // for ptr -
src/ResolvExpr/SatisfyAssertions.cpp
r31f4837 racb33f15 28 28 #include "CandidateFinder.hpp" 29 29 #include "CommonType.hpp" 30 #include "Cost.h pp"31 #include "RenameVars.h pp"30 #include "Cost.h" 31 #include "RenameVars.h" 32 32 #include "SpecCost.hpp" 33 #include " Typeops.hpp"34 #include "Unify.h pp"33 #include "typeops.h" 34 #include "Unify.h" 35 35 #include "AST/Decl.hpp" 36 36 #include "AST/Expr.hpp" … … 40 40 #include "AST/SymbolTable.hpp" 41 41 #include "AST/TypeEnvironment.hpp" 42 #include "FindOpenVars.h pp"43 #include "Common/FilterCombos.h pp"44 #include "Common/Indenter.h pp"45 #include "GenPoly/GenPoly.h pp"46 #include "SymTab/Mangler.h pp"42 #include "FindOpenVars.h" 43 #include "Common/FilterCombos.h" 44 #include "Common/Indenter.h" 45 #include "GenPoly/GenPoly.h" 46 #include "SymTab/Mangler.h" 47 47 48 48 namespace ResolvExpr { -
src/ResolvExpr/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_RESOLVEXPR = \ 18 ResolvExpr/AdjustExprType.c pp\18 ResolvExpr/AdjustExprType.cc \ 19 19 ResolvExpr/AdjustExprType.hpp \ 20 20 ResolvExpr/Candidate.cpp \ … … 22 22 ResolvExpr/CandidateFinder.hpp \ 23 23 ResolvExpr/Candidate.hpp \ 24 ResolvExpr/CastCost.c pp\24 ResolvExpr/CastCost.cc \ 25 25 ResolvExpr/CastCost.hpp \ 26 ResolvExpr/CommonType.c pp\26 ResolvExpr/CommonType.cc \ 27 27 ResolvExpr/CommonType.hpp \ 28 ResolvExpr/ConversionCost.c pp\29 ResolvExpr/ConversionCost.h pp\30 ResolvExpr/Cost.h pp\31 ResolvExpr/CurrentObject.c pp\32 ResolvExpr/CurrentObject.h pp\28 ResolvExpr/ConversionCost.cc \ 29 ResolvExpr/ConversionCost.h \ 30 ResolvExpr/Cost.h \ 31 ResolvExpr/CurrentObject.cc \ 32 ResolvExpr/CurrentObject.h \ 33 33 ResolvExpr/ExplodedArg.cpp \ 34 34 ResolvExpr/ExplodedArg.hpp \ 35 ResolvExpr/FindOpenVars.c pp\36 ResolvExpr/FindOpenVars.h pp\37 ResolvExpr/PolyCost.c pp\35 ResolvExpr/FindOpenVars.cc \ 36 ResolvExpr/FindOpenVars.h \ 37 ResolvExpr/PolyCost.cc \ 38 38 ResolvExpr/PolyCost.hpp \ 39 ResolvExpr/PtrsAssignable.c pp\39 ResolvExpr/PtrsAssignable.cc \ 40 40 ResolvExpr/PtrsAssignable.hpp \ 41 ResolvExpr/PtrsCastable.c pp\41 ResolvExpr/PtrsCastable.cc \ 42 42 ResolvExpr/PtrsCastable.hpp \ 43 ResolvExpr/RenameVars.c pp\44 ResolvExpr/RenameVars.h pp\45 ResolvExpr/Resolver.c pp\46 ResolvExpr/Resolver.h pp\47 ResolvExpr/ResolveTypeof.c pp\48 ResolvExpr/ResolveTypeof.h pp\43 ResolvExpr/RenameVars.cc \ 44 ResolvExpr/RenameVars.h \ 45 ResolvExpr/Resolver.cc \ 46 ResolvExpr/Resolver.h \ 47 ResolvExpr/ResolveTypeof.cc \ 48 ResolvExpr/ResolveTypeof.h \ 49 49 ResolvExpr/ResolveMode.hpp \ 50 50 ResolvExpr/SatisfyAssertions.cpp \ 51 51 ResolvExpr/SatisfyAssertions.hpp \ 52 ResolvExpr/SpecCost.c pp\52 ResolvExpr/SpecCost.cc \ 53 53 ResolvExpr/SpecCost.hpp \ 54 ResolvExpr/ Typeops.hpp\55 ResolvExpr/Unify.c pp\56 ResolvExpr/Unify.h pp\57 ResolvExpr/WidenMode.h pp54 ResolvExpr/typeops.h \ 55 ResolvExpr/Unify.cc \ 56 ResolvExpr/Unify.h \ 57 ResolvExpr/WidenMode.h 58 58 59 59 SRC += $(SRC_RESOLVEXPR) \ -
src/SymTab/GenImplicitCall.cpp
r31f4837 racb33f15 23 23 #include "AST/Stmt.hpp" // for ExprStmt 24 24 #include "AST/Type.hpp" // for ArrayType, BasicType, ... 25 #include "CodeGen/OperatorTable.h pp"// for isCtorDtor26 #include "Common/UniqueName.h pp"// for UniqueName27 #include "Common/ Utility.hpp"// for splice25 #include "CodeGen/OperatorTable.h" // for isCtorDtor 26 #include "Common/UniqueName.h" // for UniqueName 27 #include "Common/utility.h" // for splice 28 28 29 29 namespace SymTab { -
src/SymTab/GenImplicitCall.hpp
r31f4837 racb33f15 16 16 #pragma once 17 17 18 #include "InitTweak/InitTweak.h pp" // for InitExpander18 #include "InitTweak/InitTweak.h" // for InitExpander 19 19 20 20 namespace SymTab { -
src/SymTab/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_SYMTAB = \ 18 SymTab/FixFunction.c pp\19 SymTab/FixFunction.h pp\18 SymTab/FixFunction.cc \ 19 SymTab/FixFunction.h \ 20 20 SymTab/GenImplicitCall.cpp \ 21 21 SymTab/GenImplicitCall.hpp \ 22 SymTab/Mangler.c pp\23 SymTab/ManglerCommon.c pp\24 SymTab/Mangler.h pp22 SymTab/Mangler.cc \ 23 SymTab/ManglerCommon.cc \ 24 SymTab/Mangler.h 25 25 26 26 SRC += $(SRC_SYMTAB) 27 27 28 28 SRCDEMANGLE += $(SRC_SYMTAB) \ 29 SymTab/Demangle.c pp\30 SymTab/Demangle.h pp29 SymTab/Demangle.cc \ 30 SymTab/Demangle.h -
src/Tuples/TupleExpansion.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Tuples.h pp"16 #include "Tuples.h" 17 17 18 18 #include "AST/Pass.hpp" 19 #include "Common/ScopedMap.h pp"19 #include "Common/ScopedMap.h" 20 20 21 21 namespace Tuples { -
src/Tuples/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_TUPLES = \ 18 Tuples/Explode.c pp\19 Tuples/Explode.h pp\20 Tuples/TupleAssignment.c pp\18 Tuples/Explode.cc \ 19 Tuples/Explode.h \ 20 Tuples/TupleAssignment.cc \ 21 21 Tuples/TupleExpansion.cpp \ 22 Tuples/Tuples.c pp\23 Tuples/Tuples.h pp22 Tuples/Tuples.cc \ 23 Tuples/Tuples.h 24 24 25 25 SRC += $(SRC_TUPLES) -
src/Validate/Autogen.cpp
r31f4837 racb33f15 16 16 #include "Autogen.hpp" 17 17 18 #include <algorithm> // for count_if19 #include <cassert> // for strict_dynamic_cast, assert, a...20 #include <iterator> // for back_insert_iterator, back_ins...21 #include <list> // for list, _List_iterator, list<>::...22 #include <set> // for set, _Rb_tree_const_iterator23 #include <utility> // for pair24 #include <vector> // for vector18 #include <algorithm> // for count_if 19 #include <cassert> // for strict_dynamic_cast, assert, assertf 20 #include <iterator> // for back_insert_iterator, back_inserter 21 #include <list> // for list, _List_iterator, list<>::iter... 22 #include <set> // for set, _Rb_tree_const_iterator 23 #include <utility> // for pair 24 #include <vector> // for vector 25 25 26 26 #include "AST/Attribute.hpp" … … 34 34 #include "AST/Stmt.hpp" 35 35 #include "AST/SymbolTable.hpp" 36 #include "CodeGen/OperatorTable.h pp"// for isCtorDtor, isCtorDtorAssign37 #include "Common/ScopedMap.h pp" // for ScopedMap<>::const_iterator, S...38 #include "Common/ Utility.hpp"// for cloneAll, operator+39 #include "GenPoly/ScopedSet.h pp"// for ScopedSet, ScopedSet<>::iterator40 #include "InitTweak/GenInit.h pp"// for fixReturnStatements41 #include "InitTweak/InitTweak.h pp"// for isAssignment, isCopyConstructor36 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 37 #include "Common/ScopedMap.h" // for ScopedMap<>::const_iterator, Scope... 38 #include "Common/utility.h" // for cloneAll, operator+ 39 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::iterator 40 #include "InitTweak/GenInit.h" // for fixReturnStatements 41 #include "InitTweak/InitTweak.h" // for isAssignment, isCopyConstructor 42 42 #include "SymTab/GenImplicitCall.hpp" // for genImplicitCall 43 #include "SymTab/Mangler.h pp"// for Mangler43 #include "SymTab/Mangler.h" // for Mangler 44 44 #include "CompilationState.hpp" 45 45 -
src/Validate/CompoundLiteral.cpp
r31f4837 racb33f15 20 20 #include "AST/Pass.hpp" 21 21 #include "AST/TranslationUnit.hpp" 22 #include "Common/UniqueName.h pp"22 #include "Common/UniqueName.h" 23 23 24 24 namespace Validate { -
src/Validate/EliminateTypedef.cpp
r31f4837 racb33f15 21 21 #include "AST/Pass.hpp" 22 22 #include "AST/Stmt.hpp" 23 #include "Common/ Utility.hpp"23 #include "Common/utility.h" 24 24 25 25 namespace Validate { -
src/Validate/EnumAndPointerDecay.cpp
r31f4837 racb33f15 20 20 #include "AST/Pass.hpp" 21 21 #include "AST/Type.hpp" 22 #include "SymTab/FixFunction.h pp"22 #include "SymTab/FixFunction.h" 23 23 #include "Validate/NoIdSymbolTable.hpp" 24 24 -
src/Validate/FindSpecialDecls.cpp
r31f4837 racb33f15 14 14 // 15 15 16 #include "Validate/FindSpecialDecls.h pp"16 #include "Validate/FindSpecialDecls.h" 17 17 18 18 #include "AST/Decl.hpp" -
src/Validate/FixQualifiedTypes.cpp
r31f4837 racb33f15 21 21 #include "AST/TranslationUnit.hpp" 22 22 #include "Common/ToString.hpp" // for toString 23 #include "SymTab/Mangler.h pp"// for Mangler23 #include "SymTab/Mangler.h" // for Mangler 24 24 #include "Validate/NoIdSymbolTable.hpp" 25 25 -
src/Validate/FixReturnTypes.cpp
r31f4837 racb33f15 20 20 #include "AST/Type.hpp" 21 21 #include "CodeGen/CodeGenerator.hpp" 22 #include "ResolvExpr/Unify.h pp"22 #include "ResolvExpr/Unify.h" 23 23 24 24 namespace Validate { -
src/Validate/ForallPointerDecay.cpp
r31f4837 racb33f15 20 20 #include "AST/DeclReplacer.hpp" 21 21 #include "AST/Pass.hpp" 22 #include "CodeGen/OperatorTable.h pp"23 #include "Common/CodeLocation.h pp"22 #include "CodeGen/OperatorTable.h" 23 #include "Common/CodeLocation.h" 24 24 #include "Common/ToString.hpp" 25 #include "Common/ Utility.hpp"26 #include "SymTab/FixFunction.h pp"25 #include "Common/utility.h" 26 #include "SymTab/FixFunction.h" 27 27 28 28 namespace Validate { -
src/Validate/ImplementEnumFunc.cpp
r31f4837 racb33f15 2 2 #include "AST/Pass.hpp" 3 3 #include "AST/TranslationUnit.hpp" 4 #include "CodeGen/OperatorTable.h pp" // for isCtorDtor, isCtorDtorAssign5 #include "InitTweak/InitTweak.h pp" // for isAssignment, isCopyConstructor4 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 5 #include "InitTweak/InitTweak.h" // for isAssignment, isCopyConstructor 6 6 namespace Validate { 7 7 -
src/Validate/ReplaceTypedef.cpp
r31f4837 racb33f15 18 18 #include "AST/Copy.hpp" 19 19 #include "AST/Pass.hpp" 20 #include "Common/ScopedMap.h pp"21 #include "Common/UniqueName.h pp"22 #include "ResolvExpr/Unify.h pp"20 #include "Common/ScopedMap.h" 21 #include "Common/UniqueName.h" 22 #include "ResolvExpr/Unify.h" 23 23 24 24 namespace Validate { -
src/Validate/VerifyCtorDtorAssign.cpp
r31f4837 racb33f15 17 17 18 18 #include "AST/Pass.hpp" 19 #include "CodeGen/OperatorTable.h pp"19 #include "CodeGen/OperatorTable.h" 20 20 21 21 namespace Validate { -
src/Validate/module.mk
r31f4837 racb33f15 16 16 17 17 SRC_VALIDATE = \ 18 Validate/FindSpecialDecls.h pp18 Validate/FindSpecialDecls.h 19 19 20 20 SRC += $(SRC_VALIDATE) \ … … 40 40 Validate/HoistTypeDecls.cpp \ 41 41 Validate/HoistTypeDecls.hpp \ 42 Validate/ImplementEnumFunc.cpp \43 Validate/ImplementEnumFunc.hpp \44 42 Validate/InitializerLength.cpp \ 45 43 Validate/InitializerLength.hpp \ … … 54 52 Validate/ReturnCheck.hpp \ 55 53 Validate/VerifyCtorDtorAssign.cpp \ 56 Validate/VerifyCtorDtorAssign.hpp 54 Validate/VerifyCtorDtorAssign.hpp \ 55 Validate/ImplementEnumFunc.cpp \ 56 Validate/ImplementEnumFunc.hpp 57 57 58 58 SRCDEMANGLE += $(SRC_VALIDATE) -
src/Virtual/module.mk
r31f4837 racb33f15 16 16 17 17 SRC += \ 18 Virtual/ExpandCasts.c pp\19 Virtual/ExpandCasts.h pp\20 Virtual/Tables.c pp\21 Virtual/Tables.h pp\18 Virtual/ExpandCasts.cc \ 19 Virtual/ExpandCasts.h \ 20 Virtual/Tables.cc \ 21 Virtual/Tables.h \ 22 22 Virtual/VirtualDtor.cpp \ 23 23 Virtual/VirtualDtor.hpp -
src/include/cassert
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // cassert--7 // assert.h -- 8 8 // 9 9 // Author : Peter A. Buhr -
src/include/optional
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // optional --7 // optional.h -- 8 8 // 9 9 // Author : Michael L. Brooks -
src/main.cpp
r31f4837 racb33f15 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // main.c pp--7 // main.cc -- 8 8 // 9 9 // Author : Peter Buhr and Rob Schluntz … … 35 35 #include "CompilationState.hpp" 36 36 #include "../config.h" // for CFA_LIBDIR 37 #include "CodeGen/FixMain.h pp"// for FixMain38 #include "CodeGen/FixNames.h pp"// for fixNames39 #include "CodeGen/Generate.h pp"// for generate40 #include "CodeGen/LinkOnce.h pp"// for translateLinkOnce37 #include "CodeGen/FixMain.h" // for FixMain 38 #include "CodeGen/FixNames.h" // for fixNames 39 #include "CodeGen/Generate.h" // for generate 40 #include "CodeGen/LinkOnce.h" // for translateLinkOnce 41 41 #include "Common/CodeLocationTools.hpp" // for forceFillCodeLocations 42 42 #include "Common/DeclStats.hpp" // for printDeclStats 43 43 #include "Common/ResolvProtoDump.hpp" // for dumpAsResolverProto 44 #include "Common/Stats.h pp"// for Stats45 #include "Common/ Utility.hpp"// for deleteAll, filter, printAll44 #include "Common/Stats.h" // for Stats 45 #include "Common/utility.h" // for deleteAll, filter, printAll 46 46 #include "Concurrency/Actors.hpp" // for implementActors 47 47 #include "Concurrency/Corun.hpp" // for implementCorun 48 #include "Concurrency/Keywords.h pp"// for implementMutex, implement...49 #include "Concurrency/Waitfor.h pp"// for generateWaitfor48 #include "Concurrency/Keywords.h" // for implementMutex, implement... 49 #include "Concurrency/Waitfor.h" // for generateWaitfor 50 50 #include "Concurrency/Waituntil.hpp" // for generateWaitUntil 51 #include "ControlStruct/ExceptDecl.h pp"// for translateExcept52 #include "ControlStruct/ExceptTranslate.h pp"// for translateThrows, translat...51 #include "ControlStruct/ExceptDecl.h" // for translateExcept 52 #include "ControlStruct/ExceptTranslate.h" // for translateThrows, translat... 53 53 #include "ControlStruct/FixLabels.hpp" // for fixLabels 54 54 #include "ControlStruct/HoistControlDecls.hpp" // hoistControlDecls 55 #include "GenPoly/Box.h pp"// for box56 #include "GenPoly/InstantiateGeneric.h pp"// for instantiateGeneric57 #include "GenPoly/Lvalue.h pp"// for convertLvalue58 #include "GenPoly/Specialize.h pp"// for convertSpecializations59 #include "InitTweak/FixInit.h pp"// for fix60 #include "InitTweak/GenInit.h pp"// for genInit55 #include "GenPoly/Box.h" // for box 56 #include "GenPoly/InstantiateGeneric.h" // for instantiateGeneric 57 #include "GenPoly/Lvalue.h" // for convertLvalue 58 #include "GenPoly/Specialize.h" // for convertSpecializations 59 #include "InitTweak/FixInit.h" // for fix 60 #include "InitTweak/GenInit.h" // for genInit 61 61 #include "MakeLibCfa.hpp" // for makeLibCfa 62 62 #include "Parser/RunParser.hpp" // for buildList, dumpParseTree,... 63 63 #include "ResolvExpr/CandidatePrinter.hpp" // for printCandidates 64 64 #include "ResolvExpr/EraseWith.hpp" // for eraseWith 65 #include "ResolvExpr/Resolver.h pp"// for resolve66 #include "Tuples/Tuples.h pp"// for expandMemberTuples, expan...65 #include "ResolvExpr/Resolver.h" // for resolve 66 #include "Tuples/Tuples.h" // for expandMemberTuples, expan... 67 67 #include "Validate/Autogen.hpp" // for autogenerateRoutines 68 #include "Validate/ImplementEnumFunc.hpp" // for implementEnumFunc 68 69 #include "Validate/CompoundLiteral.hpp" // for handleCompoundLiterals 69 70 #include "Validate/EliminateTypedef.hpp" // for eliminateTypedef 70 71 #include "Validate/EnumAndPointerDecay.hpp" // for decayEnumsAndPointers 71 #include "Validate/FindSpecialDecls.h pp"// for findGlobalDecls72 #include "Validate/FindSpecialDecls.h" // for findGlobalDecls 72 73 #include "Validate/FixQualifiedTypes.hpp" // for fixQualifiedTypes 73 74 #include "Validate/FixReturnTypes.hpp" // for fixReturnTypes … … 76 77 #include "Validate/HoistStruct.hpp" // for hoistStruct 77 78 #include "Validate/HoistTypeDecls.hpp" // for hoistTypeDecls 78 #include "Validate/ImplementEnumFunc.hpp" // for implementEnumFunc79 79 #include "Validate/InitializerLength.hpp" // for setLengthFromInitializer 80 80 #include "Validate/LabelAddressFixer.hpp" // for fixLabelAddresses … … 83 83 #include "Validate/ReturnCheck.hpp" // for checkReturnStatements 84 84 #include "Validate/VerifyCtorDtorAssign.hpp" // for verifyCtorDtorAssign 85 #include "Virtual/ExpandCasts.h pp"// for expandCasts85 #include "Virtual/ExpandCasts.h" // for expandCasts 86 86 #include "Virtual/VirtualDtor.hpp" // for implementVirtDtors 87 87
Note:
See TracChangeset
for help on using the changeset viewer.