Skip to content

Commit

Permalink
Introduce Directive Hierarchy (#76)
Browse files Browse the repository at this point in the history
* Introduce Directive Hierarchy

to classify grammatical declarations that modify the behavior of a C++ translator

* Remove `DeclSort::UsingDirective`

in favor of defined `DirSort::Using`

* Add a field for the result of `DirSort::DeclUse`

* Add `specifiers` and `access` to `DeclSort::Barren`

* Clarify `DirExpr::Using` and `DirSort::DeclUse`

* Embed directives in `StmtSort`

* Update `Phases`

* Introduce directive heap

Update `DirSort::Tuple`
  • Loading branch information
GabrielDosReis committed May 22, 2023
1 parent 87aef54 commit 505f2ce
Show file tree
Hide file tree
Showing 6 changed files with 405 additions and 24 deletions.
44 changes: 24 additions & 20 deletions ltx/decls.tex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
\enumerator{Destructor}
\enumerator{Reference}
\enumerator{UsingDeclaration}
\enumerator{UsingDirective}
\enumerator{Unused0}
\enumerator{Friend}
\enumerator{Expansion}
\enumerator{DeductionGuide}
Expand Down Expand Up @@ -696,6 +696,8 @@ \subsection{\valueTag{DeclSort::PartialSpecialization}}

\partition{decl.partial-specialization}

\note{Future revision will represent partial a specialization as a directive.}


\subsection{\valueTag{DeclSort::Specialization}}
\label{sec:ifc:DeclSort:Specialization}
Expand Down Expand Up @@ -1171,26 +1173,14 @@ \subsection{\valueTag{DeclSort::UsingDeclaration}}

\partition{decl.using-declaration}

\note{This representation is subject to change.}


\subsection{\valueTag{DeclSort::UsingDirective}}
\label{sec:ifc:DeclSort:UsingDirective}
\note{This representation is subject to change. Future revision will represents this as the result of executing a \grammar{using-declaration} (\sortref{DeclUse}{DirSort}) directive.}

A \type{DeclIndex} abstract reference with tag \valueTag{DeclSort::UsingDirective} designates a using directive.

\subsection{\valueTag{DeclSort::Unused0}}
\label{sec:ifc:DeclSort:Unused0}

%
\begin{figure}[H]
\centering
TBD.
\end{figure}
%

\note{The structure of this declaration is not yet defined.}

\partition{decl.using-directive}

\diffNote{This tag was previously named \valueTag{DeclSort::UsingDirective} but had no defined structure and was never emitted.
For \grammar{using-directive}, see \sortref{Using}{DirSort}.}

\subsection{\valueTag{DeclSort::Friend}}
\label{sec:ifc:DeclSort:Friend}
Expand Down Expand Up @@ -1269,15 +1259,29 @@ \subsection{\valueTag{DeclSort::Barren}}
\label{sec:ifc:DeclSort:Barren}

A \type{DeclIndex} abstract reference with tag \valueTag{DeclSort::Barren} designates
a declaration that introduces no name, e.g. \grammar{asm-declaration}, \grammar{static\_assert-declaration}, \grammar{attribute-declaration}, \grammar{empty-declaration}.
a declaration that introduces no name, i.e. a directive (\secref{sec:ifc-directives}) That is
the case, for example, of
\grammar{asm-declaration}, \grammar{static\_assert-declaration}, \grammar{attribute-declaration}, \grammar{empty-declaration}, etc.
The \field{index} field is an index into the barren declaration partition. Each entry
in that partition is a structure with the following layout
%
\begin{figure}[H]
\centering
TBD.
\structure{
\DeclareMember{directive}{DirIndex} \\
\DeclareMember{specifiers}{BasicSpecifiers} \\
\DeclareMember{access}{Access} \\
}
\caption{Structure of a barren declaration}
\label{fig:ifc:DeclSort:Barren}
\end{figure}
%
with the following meanings for the fields
\begin{itemize}
\item \field{directive} denotes the directive (\secref{sec:ifc-directives}) to be executed
\item \field{specifiers} denotes the \type{BasicSpecifiers} that apply to the result of executing the \field{directive}
\item \field{access} denotes the \type{Access} applied to the result of executing the \field{directive}
\end{itemize}

\partition{decl.barren}

Expand Down
Loading

0 comments on commit 505f2ce

Please sign in to comment.