Changes in / [5bd0aad:e60e0dc]


Ignore:
Files:
4 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.tex

    r5bd0aad re60e0dc  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Jul 17 10:21:17 2017
    14 %% Update Count     : 348
     13%% Last Modified On : Thu Jul 13 11:44:59 2017
     14%% Update Count     : 335
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    134134
    135135% inline text and code index (cannot use ©)
    136 \newcommand{\Indexc}[2][\@empty]{\lstinline[#1]$#2$\index{#2@\lstinline[#1]$#2$}}
     136\newcommand{\Indexc}[1]{\lstinline$#1$\index{#1@\lstinline$#1$}}
    137137% code index (cannot use ©)
    138 \newcommand{\indexc}[2][\@empty]{\index{#2@\lstinline[#1]$#2$}}
     138\newcommand{\indexc}[1]{\index{#1@\lstinline$#1$}}
    139139
    140140% Denote newterms in particular font and index them without particular font and in lowercase, e.g., \newterm{abc}.
  • doc/user/EHMHierarchy.fig

    r5bd0aad re60e0dc  
    1 #FIG 3.2  Produced by xfig version 3.2.5c
     1#FIG 3.2  Produced by xfig version 3.2.5b
    22Landscape
    33Center
     
    19192 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    2020        1 1 1.00 60.00 90.00
    21          1950 1425 2925 1200
     21         1950 1425 3000 1200
    22222 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    2323        1 1 1.00 60.00 90.00
     
    2929        1 1 1.00 60.00 90.00
    3030         4950 1950 4950 1725
    31 4 1 0 50 -1 0 13 0.0000 2 135 225 1950 1650 IO\001
    32 4 1 0 50 -1 0 13 0.0000 2 135 915 4950 1650 Arithmetic\001
    33 4 1 0 50 -1 0 13 0.0000 2 150 330 1350 2100 File\001
    34 4 1 0 50 -1 0 13 0.0000 2 135 735 2550 2100 Network\001
    35 4 1 0 50 -1 0 13 0.0000 2 180 1215 3750 2100 DivideByZero\001
    36 4 1 0 50 -1 0 13 0.0000 2 150 810 4950 2100 Overflow\001
    37 4 1 0 50 -1 0 13 0.0000 2 150 915 6000 2100 Underflow\001
    38 4 1 0 50 -1 0 13 0.0000 2 180 855 3450 1200 Exception\001
     314 1 0 100 0 0 12 0.0000 0 135 195 1950 1650 IO\001
     324 1 0 100 0 0 12 0.0000 0 135 870 4950 1650 Arithmetic\001
     334 1 0 100 0 0 12 0.0000 0 135 315 1350 2100 File\001
     344 1 0 100 0 0 12 0.0000 0 135 690 2550 2100 Network\001
     354 1 0 100 0 0 12 0.0000 0 180 1170 3750 2100 DivideByZero\001
     364 1 0 100 0 0 12 0.0000 0 135 750 4950 2100 Overflow\001
     374 1 0 100 0 0 12 0.0000 0 135 855 6000 2100 Underflow\001
     384 1 0 100 0 0 12 0.0000 0 180 840 3450 1200 Exception\001
  • doc/user/user.tex

    r5bd0aad re60e0dc  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Jul 17 13:06:40 2017
    14 %% Update Count     : 2825
     13%% Last Modified On : Thu Jul 13 11:44:57 2017
     14%% Update Count     : 2690
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    353353The 1999 C standard plus GNU extensions.
    354354\item
    355 \Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]$-fgnu89-inline$}}
     355{\lstset{deletekeywords={inline}}
     356\Indexc{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{©-fgnu89-inline©}}
    356357Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files.
     358}%
    357359\end{description}
    358360The following new \CFA options are available:
     
    477479\end{cfa}
    478480Existing C programs with keyword clashes can be converted by enclosing keyword identifiers in backquotes, and eventually the identifier name can be changed to a non-keyword name.
    479 \VRef[Figure]{f:HeaderFileInterposition} shows how clashes in C header files (see~\VRef{s:StandardHeaders}) can be handled using preprocessor \newterm{interposition}: ©#include_next© and ©-I filename©:
     481\VRef[Figure]{f:InterpositionHeaderFile} shows how clashes in C header files (see~\VRef{s:StandardHeaders}) can be handled using preprocessor \newterm{interposition}: ©#include_next© and ©-I filename©:
    480482
    481483\begin{figure}
     
    485487#define otype ®`®otype®`®               §\C{// make keyword an identifier}§
    486488#define __CFA_BFD_H__
    487 #endif
    488 
    489 ®#include_next <bfd.h>                  §\C{// must have internal check for multiple expansion}§
    490 ®
     489#endif // ! otype
     490
     491#®include_next® <bfd.h>                 §\C{// must have internal check for multiple expansion}§
     492
    491493#if defined( otype ) && defined( __CFA_BFD_H__ )        §\C{// reset only if set}§
    492494#undef otype
    493495#undef __CFA_BFD_H__
    494 #endif
    495 \end{cfa}
    496 \caption{Header-File Interposition}
    497 \label{f:HeaderFileInterposition}
     496#endif // otype && __CFA_BFD_H__
     497\end{cfa}
     498\caption{Interposition of Header File}
     499\label{f:InterpositionHeaderFile}
    498500\end{figure}
    499 
    500 
    501 \section{Exponentiation Operator}
    502 
    503 C, \CC, and Java (and many other programming languages) have no exponentiation operator\index{exponentiation!operator}\index{operator!exponentiation}, \ie $x^y$, and instead use a routine, like \Indexc{pow}, to perform the exponentiation operation.
    504 \CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@\lstinline$?\?$} and ©?\=?©\index{?\\=?@\lstinline$?\=?$}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$.
    505 The priority of the exponentiation operator is between the cast and multiplicative operators, so that ©w * (int)x \ (int)y * z© is parenthesized as ©((w * (((int)x) \ ((int)y))) * z)©.
    506 
    507 As for \Index{division}, there are exponentiation operators for integral and floating-point types, including the builtin \Index{complex} types.
    508 Unsigned integral exponentiation\index{exponentiation!unsigned integral} is performed with repeated multiplication (or shifting if the base is 2).
    509 Signed integral exponentiation\index{exponentiation!signed integral} is performed with repeated multiplication (or shifting if the base is 2), but yields a floating-point result because $b^{-e}=1/b^e$.
    510 Hence, it is important to designate exponent integral-constants as unsigned or signed: ©3 \ 3u© return an integral result, while ©3 \ 3© returns a floating-point result.
    511 Floating-point exponentiation\index{exponentiation!floating point} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the base cannot be negative.
    512 \begin{cfa}
    513 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi) | endl;
    514 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    515 \end{cfa}
    516 Parenthesis are necessary for the complex constants or the expresion is parsed as ©1.0f+(2.0fi \ 3.0f)+2.0fi©.
    517 The exponentiation operator is available for all the basic types, but for user-defined types, only the integral version is available, if the user type defines multiplication, ©*©, and one, ©1©.
    518501
    519502
     
    939922        int i, j;
    940923        int mem() {              ®// implicit "this" parameter
    941 ®               i = 1;          ®// this->i
     924                i = 1;          ®// this->i
    942925®               j = 3;          ®// this->j
    943926®       }
     
    946929Since CFA is non-object-oriented, the equivalent object-oriented program looks like:
    947930\begin{cfa}
    948 struct S { int i, j; };
    949 int mem( S &this ) {    // explicit "this" parameter
     931struct C {
     932        int i, j;
     933};
     934int mem( C &this ) {    // explicit "this" parameter
    950935        ®this.®i = 1;                     // "this" is not elided
    951936        ®this.®j = 2;
     
    953938\end{cfa}
    954939but it is cumbersome having to write "©this.©" many times in a member.
    955 
    956 \CFA provides a ©with© clause/statement to elided the "©this.©" by opening a scope containing field identifiers and changing the qualified fields into variables, giving an opportunity for optimizing qualified references.\footnote{
    957 The ©with© statement comes from Pascal~\cite[\S~4.F]{Pascal}.}
    958 \begin{cfa}
    959 int mem( S &this ) ®with this® {
     940\CFA provides a ©with© clause/statement to elided the "©this.©".
     941\begin{cfa}
     942int mem( C &this ) ®with this® {
    960943        i = 1;                  ®// this.i
    961944®       j = 2;                  ®// this.j
     
    964947which extends to multiple routine parameters:
    965948\begin{cfa}
    966 struct T { double m, n; };
    967 int mem2( S &this1, T &this2 ) ®with this1, this2® {
     949struct D {
     950        double m, n;
     951};
     952int mem2( C &this1, D &this2 ) ®with this1, this2® {
    968953        i = 1; j = 2;
    969954        m = 1.0; n = 2.0;
    970955}
    971956\end{cfa}
     957The ©with© clause/statement comes from Pascal~\cite[\S~4.F]{Pascal}.
    972958
    973959The statement form is used within a block:
     
    979965                // access fields of s1 without qualification
    980966                ®with s2® {  // nesting
    981                         // access fields of s1 and s2 without qualification
     967                        // access fields of s2 without qualification
    982968                }
    983969        }
     
    988974\end{cfa}
    989975
    990 When opening multiple structures, fields with the same name and type are ambiguous and must be fully qualified.
    991 For fields with the same name but different type, context/cast can be used to disambiguate.
    992 \begin{cfa}
    993 struct S { int i; int j; double m; } a, c;
    994 struct T { int i; int k; int m } b, c;
     976Names clashes when opening multiple structures are ambiguous.
     977\begin{cfa}
     978struct A { int i; int j; } a, c;
     979struct B { int i; int k; } b, c;
    995980®with a, b® {
    996         j + k;                                          §\C{// unambiguous, unique names define unique type}§
    997         i;                                                      §\C{// ambiguous, same name and type}§
    998         a.i + b.i;                                      §\C{// unambiguous, qualification defines unique type}§
    999         m;                                                      §\C{// ambiguous, no context to define unique type}§
    1000         m = 5.0;                                        §\C{// unambiguous, context defines unique type}§
    1001         m = 1;                                          §\C{// unambiguous, context defines unique type}§
    1002 }
    1003 ®with c® { ... }                                §\C{// ambiguous, no context}§
    1004 ®with (S)c® { ... }                             §\C{// unambiguous, cast defines unique type}§
     981        j + k;                                          §\C{// unambiguous}§
     982        i;                                                      §\C{// ambiguous}§
     983        a.i + b.i;                                      §\C{// unambiguous}§
     984}
     985®with c® {                                              §\C{// ambiguous}§
     986        // ...
     987}
    1005988\end{cfa}
    1006989
    1007990
    1008991\section{Exception Handling}
    1009 \label{s:ExceptionHandling}
    1010992
    1011993Exception handling provides two mechanism: change of control flow from a raise to a handler, and communication from the raise to the handler.
    1012 Transfer of control can be local, within a routine, or non-local, among routines.
    1013 Non-local transfer can cause stack unwinding, i.e., non-local routine termination, depending on the kind of raise.
    1014 \begin{cfa}
    1015 exception_t E {};                               §\C{// exception type}§
     994\begin{cfa}
     995exception void h( int i );
     996exception int h( int i, double d );
     997
    1016998void f(...) {
    1017         ... throw E{}; ...                      §\C{// termination}§
    1018         ... throwResume E{}; ...        §\C{// resumption}§
    1019 }
     999        ... throw h( 3 );
     1000        ... i = resume h( 3, 5.1 );
     1001}
     1002
    10201003try {
    10211004        f(...);
    1022 } catch( E e : §boolean-predicate§ ) {                  §\C{// termination handler}§
    1023         // recover and continue
    1024 } catchResume( E e : §boolean-predicate§ ) {    §\C{// resumption handler}§
    1025         // repair and return
     1005} catch h( int w ) {
     1006        // reset
     1007} resume h( int p, double x ) {
     1008        return 17;  // recover
    10261009} finally {
    1027         // always executed
    1028 }
    1029 \end{cfa}
    1030 The kind of raise and handler match: ©throw© with ©catch© and @throwResume@ with @catchResume@.
    1031 Then the exception type must match along with any additonal predicate must be true.
    1032 The ©catch© and ©catchResume© handlers may appear in any oder.
    1033 However, the ©finally© clause must
     1010}
     1011\end{cfa}
     1012So the type raised would be the mangled name of the exception prototype and that name would be matched at the handler clauses by comparing the strings.
     1013The arguments for the call would have to be packed in a message and unpacked at handler clause and then a call made to the handler.
    10341014
    10351015
     
    15911571
    15921572\item
    1593 lvalue to reference conversion: \lstinline[deletekeywords=lvalue]$lvalue-type cv1 T$ converts to ©cv2 T &©, which allows implicitly converting variables to references.
     1573lvalue to reference conversion: \lstinline[deletekeywords={lvalue}]@lvalue-type cv1 T@ converts to ©cv2 T &©, which allows implicitly converting variables to references.
    15941574\begin{cfa}
    15951575int x, &r = ®x®, f( int & p ); // lvalue variable (int) convert to reference (int &)
     
    27002680\begin{cfa}[belowskip=0pt]
    27012681char store[®sepSize®];                                          §\C{// sepSize is the maximum separator size}§
    2702 strcpy( store, sepGet( sout ) );                          §\C{// copy current separator}§
    2703 sepSet( sout, "_" );                                            §\C{// change separator to underscore}§
     2682strcpy( store, sepGet( sout ) );
     2683sepSet( sout, "_" );
    27042684sout | 1 | 2 | 3 | endl;
    27052685\end{cfa}
     
    27082688\end{cfa}
    27092689\begin{cfa}[belowskip=0pt]
    2710 sepSet( sout, store );                                          §\C{// change separator back to original}§
     2690sepSet( sout, store );
    27112691sout | 1 | 2 | 3 | endl;
    27122692\end{cfa}
     
    55835563\Celeven prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list:
    55845564\begin{quote2}
    5585 \begin{tabular}{@{}lllll|l@{}}
    5586 \multicolumn{5}{c|}{C11} & \multicolumn{1}{c}{\CFA}             \\
     5565\lstset{deletekeywords={float}}
     5566\begin{tabular}{@{}llll|l@{}}
     5567\multicolumn{4}{c|}{C11} & \multicolumn{1}{c}{\CFA}             \\
    55875568\hline
    55885569\begin{tabular}{@{}l@{}}
     
    55925573\Indexc{errno.h}                \\
    55935574\Indexc{fenv.h}                 \\
    5594 \Indexc[deletekeywords=float]{float.h} \\
     5575\Indexc{float.h}                \\
     5576\Indexc{inttypes.h}             \\
     5577\Indexc{iso646.h}               \\
    55955578\end{tabular}
    55965579&
    55975580\begin{tabular}{@{}l@{}}
    5598 \Indexc{inttypes.h}             \\
    5599 \Indexc{iso646.h}               \\
    56005581\Indexc{limits.h}               \\
    56015582\Indexc{locale.h}               \\
    56025583\Indexc{math.h}                 \\
    56035584\Indexc{setjmp.h}               \\
    5604 \end{tabular}
    5605 &
    5606 \begin{tabular}{@{}l@{}}
    56075585\Indexc{signal.h}               \\
    56085586\Indexc{stdalign.h}             \\
    56095587\Indexc{stdarg.h}               \\
    56105588\Indexc{stdatomic.h}    \\
    5611 \Indexc{stdbool.h}              \\
    5612 \Indexc{stddef.h}               \\
    56135589\end{tabular}
    56145590&
    56155591\begin{tabular}{@{}l@{}}
     5592\Indexc{stdbool.h}              \\
     5593\Indexc{stddef.h}               \\
    56165594\Indexc{stdint.h}               \\
    56175595\Indexc{stdio.h}                \\
     
    56295607\Indexc{wctype.h}               \\
    56305608                                                \\
     5609                                                \\
     5610                                                \\
    56315611\end{tabular}
    56325612&
     
    56345614\Indexc{unistd.h}               \\
    56355615\Indexc{gmp.h}                  \\
     5616                                                \\
     5617                                                \\
    56365618                                                \\
    56375619                                                \\
     
    56735655The table shows allocation routines supporting different combinations of storage-management capabilities:
    56745656\begin{center}
    5675 \begin{tabular}{@{}r|r|l|l|l|l@{}}
    5676 \multicolumn{1}{c}{}&           & \multicolumn{1}{c|}{fill}     & resize        & alignment     & array \\
     5657\begin{tabular}{@{}lr|l|l|l|l@{}}
     5658                &                                       & \multicolumn{1}{c|}{fill}     & resize        & alignment     & array \\
    56775659\hline
    56785660C               & ©malloc©                      & no                    & no            & no            & no    \\
     
    56815663                & ©memalign©            & no                    & no            & yes           & no    \\
    56825664                & ©posix_memalign©      & no                    & no            & yes           & no    \\
    5683 \hline
    56845665C11             & ©aligned_alloc©       & no                    & no            & yes           & no    \\
    5685 \hline
    56865666\CFA    & ©alloc©                       & no/copy/yes   & no/yes        & no            & yes   \\
    56875667                & ©align_alloc©         & no/yes                & no            & yes           & yes   \\
  • src/CodeGen/OperatorTable.cc

    r5bd0aad re60e0dc  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 15 17:12:22 2017
    13 // Update Count     : 15
     12// Last Modified On : Tue Dec 13 14:33:05 2016
     13// Update Count     : 10
    1414//
    1515
     
    3535                        {       "++?",          "++",   "_operator_preincr",                    OT_PREFIXASSIGN         },
    3636                        {       "--?",          "--",   "_operator_predecr",                    OT_PREFIXASSIGN         },
    37                         {       "?\\?",         "\\",   "_operator_exponential",                OT_INFIX                        },
    3837                        {       "?*?",          "*",    "_operator_multiply",                   OT_INFIX                        },
    3938                        {       "?/?",          "/",    "_operator_divide",                             OT_INFIX                        },
     
    5352                        {       "?|?",          "|",    "_operator_bitor",                              OT_INFIX                        },
    5453                        {       "?=?",          "=",    "_operator_assign",                             OT_INFIXASSIGN          },
    55                         {       "?\\=?",        "\\=",  "_operator_expassign",                  OT_INFIXASSIGN          },
    5654                        {       "?*=?",         "*=",   "_operator_multassign",                 OT_INFIXASSIGN          },
    5755                        {       "?/=?",         "/=",   "_operator_divassign",                  OT_INFIXASSIGN          },
  • src/Makefile.in

    r5bd0aad re60e0dc  
    216216        SymTab/driver_cfa_cpp-TypeEquality.$(OBJEXT) \
    217217        SymTab/driver_cfa_cpp-Autogen.$(OBJEXT) \
    218         SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT) \
    219218        SynTree/driver_cfa_cpp-Type.$(OBJEXT) \
    220219        SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) \
     
    515514        SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \
    516515        SymTab/FixFunction.cc SymTab/ImplementationType.cc \
    517         SymTab/TypeEquality.cc SymTab/Autogen.cc SymTab/TreeStruct.cc \
    518         SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \
     516        SymTab/TypeEquality.cc SymTab/Autogen.cc SynTree/Type.cc \
     517        SynTree/VoidType.cc SynTree/BasicType.cc \
    519518        SynTree/PointerType.cc SynTree/ArrayType.cc \
    520519        SynTree/FunctionType.cc SynTree/ReferenceToType.cc \
     
    849848SymTab/driver_cfa_cpp-Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \
    850849        SymTab/$(DEPDIR)/$(am__dirstamp)
    851 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT): SymTab/$(am__dirstamp) \
    852         SymTab/$(DEPDIR)/$(am__dirstamp)
    853850SynTree/$(am__dirstamp):
    854851        @$(MKDIR_P) SynTree
     
    10361033@AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po@am__quote@
    10371034@AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po@am__quote@
    1038 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po@am__quote@
    10391035@AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@
    10401036@AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@
     
    20882084@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    20892085@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Autogen.obj `if test -f 'SymTab/Autogen.cc'; then $(CYGPATH_W) 'SymTab/Autogen.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Autogen.cc'; fi`
    2090 
    2091 SymTab/driver_cfa_cpp-TreeStruct.o: SymTab/TreeStruct.cc
    2092 @am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-TreeStruct.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo -c -o SymTab/driver_cfa_cpp-TreeStruct.o `test -f 'SymTab/TreeStruct.cc' || echo '$(srcdir)/'`SymTab/TreeStruct.cc
    2093 @am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po
    2094 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SymTab/TreeStruct.cc' object='SymTab/driver_cfa_cpp-TreeStruct.o' libtool=no @AMDEPBACKSLASH@
    2095 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    2096 @am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-TreeStruct.o `test -f 'SymTab/TreeStruct.cc' || echo '$(srcdir)/'`SymTab/TreeStruct.cc
    2097 
    2098 SymTab/driver_cfa_cpp-TreeStruct.obj: SymTab/TreeStruct.cc
    2099 @am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-TreeStruct.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo -c -o SymTab/driver_cfa_cpp-TreeStruct.obj `if test -f 'SymTab/TreeStruct.cc'; then $(CYGPATH_W) 'SymTab/TreeStruct.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/TreeStruct.cc'; fi`
    2100 @am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po
    2101 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SymTab/TreeStruct.cc' object='SymTab/driver_cfa_cpp-TreeStruct.obj' libtool=no @AMDEPBACKSLASH@
    2102 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    2103 @am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-TreeStruct.obj `if test -f 'SymTab/TreeStruct.cc'; then $(CYGPATH_W) 'SymTab/TreeStruct.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/TreeStruct.cc'; fi`
    21042086
    21052087SynTree/driver_cfa_cpp-Type.o: SynTree/Type.cc
  • src/Parser/DeclarationNode.cc

    r5bd0aad re60e0dc  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:55:00 2017
    13 // Update Count     : 1020
     12// Last Modified On : Wed Jun 28 15:27:00 2017
     13// Update Count     : 1019
    1414//
    1515
     
    253253        newnode->type->aggregate.fields = fields;
    254254        newnode->type->aggregate.body = body;
    255         newnode->type->aggregate.tagged = false;
    256         newnode->type->aggregate.parent = nullptr;
    257255        return newnode;
    258256} // DeclarationNode::newAggregate
     
    275273        return newnode;
    276274} // DeclarationNode::newEnumConstant
    277 
    278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {
    279         assert( name );
    280         DeclarationNode * newnode = new DeclarationNode;
    281         newnode->type = new TypeData( TypeData::Aggregate );
    282         newnode->type->aggregate.kind = kind;
    283         newnode->type->aggregate.name = name;
    284         newnode->type->aggregate.actuals = actuals;
    285         newnode->type->aggregate.fields = fields;
    286         newnode->type->aggregate.body = body;
    287         newnode->type->aggregate.tagged = true;
    288         newnode->type->aggregate.parent = parent;
    289         return newnode;
    290 } // DeclarationNode::newTreeStruct
    291275
    292276DeclarationNode * DeclarationNode::newName( string * name ) {
  • src/Parser/ExpressionNode.cc

    r5bd0aad re60e0dc  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 15 16:09:04 2017
    13 // Update Count     : 549
     12// Last Modified On : Wed Jun 28 21:08:15 2017
     13// Update Count     : 542
    1414//
    1515
     
    231231}
    232232
    233 // Must harmonize with OperKinds.
    234233static const char *OperName[] = {
    235234        // diadic
    236         "SizeOf", "AlignOf", "OffsetOf", "?+?", "?-?", "?\\?", "?*?", "?/?", "?%?", "||", "&&",
     235        "SizeOf", "AlignOf", "OffsetOf", "?+?", "?-?", "?*?", "?/?", "?%?", "||", "&&",
    237236        "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?",
    238         "?=?", "?@=?", "?\\=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?",
     237        "?=?", "?@=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?",
    239238        "?[?]", "...",
    240239        // monadic
  • src/Parser/ParseNode.h

    r5bd0aad re60e0dc  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:28:16 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 15 16:00:48 2017
    13 // Update Count     : 785
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jun 12 13:00:00 2017
     13// Update Count     : 779
    1414//
    1515
     
    141141};
    142142
    143 // Must harmonize with OperName.
    144143enum class OperKinds {
    145144        // diadic
    146         SizeOf, AlignOf, OffsetOf, Plus, Minus, Exp, Mul, Div, Mod, Or, And,
     145        SizeOf, AlignOf, OffsetOf, Plus, Minus, Mul, Div, Mod, Or, And,
    147146        BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq,
    148         Assign, AtAssn, ExpAssn, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn,
     147        Assign, AtAssn, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn,
    149148        Index, Range,
    150149        // monadic
     
    249248        static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement
    250249
    251         // Perhaps this would best fold into newAggragate.
    252         static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body );
    253 
    254250        DeclarationNode();
    255251        ~DeclarationNode();
     
    336332
    337333        static UniqueName anonymous;
    338 
    339         // Temp to test TreeStruct
    340         const std::string * parent_name;
    341334}; // DeclarationNode
    342335
  • src/Parser/TypeData.cc

    r5bd0aad re60e0dc  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:58:00 2017
    13 // Update Count     : 565
     12// Last Modified On : Wed Jun 28 15:28:00 2017
     13// Update Count     : 564
    1414//
    1515
     
    6363                aggregate.fields = nullptr;
    6464                aggregate.body = false;
    65                 aggregate.tagged = false;
    66                 aggregate.parent = nullptr;
    6765                break;
    6866          case AggregateInst:
     
    123121                delete aggregate.actuals;
    124122                delete aggregate.fields;
    125                 delete aggregate.parent;
    126123                // delete aggregate;
    127124                break;
     
    195192                newtype->aggregate.kind = aggregate.kind;
    196193                newtype->aggregate.body = aggregate.body;
    197                 newtype->aggregate.tagged = aggregate.tagged;
    198                 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;
    199194                break;
    200195          case AggregateInst:
     
    624619        switch ( td->aggregate.kind ) {
    625620          case DeclarationNode::Struct:
    626                 if ( td->aggregate.tagged ) {
    627                         at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage );
    628                         buildForall( td->aggregate.params, at->get_parameters() );
    629                         break;
    630                 }
    631621          case DeclarationNode::Coroutine:
    632622          case DeclarationNode::Monitor:
  • src/Parser/TypeData.h

    r5bd0aad re60e0dc  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:57:00 2017
    13 // Update Count     : 187
     12// Last Modified On : Wed Jun 28 15:29:00 2017
     13// Update Count     : 186
    1414//
    1515
     
    3131                DeclarationNode * fields;
    3232                bool body;
    33 
    34                 bool tagged;
    35                 const std::string * parent;
    3633        };
    3734
  • src/Parser/lex.ll

    r5bd0aad re60e0dc  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sat Jul 15 15:46:34 2017
    13  * Update Count     : 542
     12 * Last Modified On : Wed Jul 12 18:04:44 2017
     13 * Update Count     : 535
    1414 */
    1515
     
    125125op_unary {op_unary_only}|{op_unary_binary}|{op_unary_pre_post}
    126126
    127 op_binary_only "/"|"%"|"\\"|"^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"\\="|"&="|"|="|"^="|"<<="|">>="
     127op_binary_only "/"|"%"|"^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"&="|"|="|"^="|"<<="|">>="
    128128op_binary_over {op_unary_binary}|{op_binary_only}
    129129                                // op_binary_not_over "?"|"->"|"."|"&&"|"||"|"@="
     
    136136
    137137%%
    138                                 /* line directives */
     138                                   /* line directives */
    139139^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" {
    140140        /* " stop highlighting */
     
    337337"-"                             { ASCIIOP_RETURN(); }
    338338"*"                             { ASCIIOP_RETURN(); }
    339 "\\"                    { ASCIIOP_RETURN(); }                                   // CFA, exponentiation
    340339"/"                             { ASCIIOP_RETURN(); }
    341340"%"                             { ASCIIOP_RETURN(); }
     
    362361"+="                    { NAMEDOP_RETURN(PLUSassign); }
    363362"-="                    { NAMEDOP_RETURN(MINUSassign); }
    364 "\\="                   { NAMEDOP_RETURN(EXPassign); }                  // CFA, exponentiation
    365363"*="                    { NAMEDOP_RETURN(MULTassign); }
    366364"/="                    { NAMEDOP_RETURN(DIVassign); }
  • src/Parser/parser.yy

    r5bd0aad re60e0dc  
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Sep  1 20:22:55 2001
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 17 12:17:00 2017
    13 // Update Count     : 2455
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 13 14:38:54 2017
     13// Update Count     : 2431
    1414//
    1515
     
    151151%token ELLIPSIS                                                                                 // ...
    152152
    153 %token EXPassign        MULTassign      DIVassign       MODassign       // \=   *=      /=      %=
     153%token MULTassign       DIVassign       MODassign                               // *=   /=      %=/
    154154%token PLUSassign       MINUSassign                                                     // +=   -=
    155155%token LSassign         RSassign                                                        // <<=  >>=
     
    168168%type<op> ptrref_operator                               unary_operator                          assignment_operator
    169169%type<en> primary_expression                    postfix_expression                      unary_expression
    170 %type<en> cast_expression                               exponential_expression          multiplicative_expression       additive_expression
    171 %type<en> shift_expression                              relational_expression           equality_expression
    172 %type<en> AND_expression                                exclusive_OR_expression         inclusive_OR_expression
    173 %type<en> logical_AND_expression                logical_OR_expression
    174 %type<en> conditional_expression                constant_expression                     assignment_expression           assignment_expression_opt
     170%type<en> cast_expression                               multiplicative_expression       additive_expression                     shift_expression
     171%type<en> relational_expression                 equality_expression                     AND_expression                          exclusive_OR_expression
     172%type<en> inclusive_OR_expression               logical_AND_expression          logical_OR_expression           conditional_expression
     173%type<en> constant_expression                   assignment_expression           assignment_expression_opt
    175174%type<en> comma_expression                              comma_expression_opt
    176 %type<en> argument_expression_list              argument_expression                     default_initialize_opt
     175%type<en> argument_expression_list              argument_expression                     assignment_opt
    177176%type<fctl> for_control_expression
    178177%type<en> subrange
     
    574573        ;
    575574
    576 exponential_expression:
     575multiplicative_expression:
    577576        cast_expression
    578         | exponential_expression '\\' cast_expression
    579                 { $$ = new ExpressionNode( build_binary_val( OperKinds::Exp, $1, $3 ) ); }
    580         ;
    581 
    582 multiplicative_expression:
    583         exponential_expression
    584         | multiplicative_expression '*' exponential_expression
     577        | multiplicative_expression '*' cast_expression
    585578                { $$ = new ExpressionNode( build_binary_val( OperKinds::Mul, $1, $3 ) ); }
    586         | multiplicative_expression '/' exponential_expression
     579        | multiplicative_expression '/' cast_expression
    587580                { $$ = new ExpressionNode( build_binary_val( OperKinds::Div, $1, $3 ) ); }
    588         | multiplicative_expression '%' exponential_expression
     581        | multiplicative_expression '%' cast_expression
    589582                { $$ = new ExpressionNode( build_binary_val( OperKinds::Mod, $1, $3 ) ); }
    590583        ;
     
    685678        '='                                                                                     { $$ = OperKinds::Assign; }
    686679        | ATassign                                                                      { $$ = OperKinds::AtAssn; }
    687         | EXPassign                                                                     { $$ = OperKinds::ExpAssn; }
    688680        | MULTassign                                                            { $$ = OperKinds::MulAssn; }
    689681        | DIVassign                                                                     { $$ = OperKinds::DivAssn; }
     
    980972                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); }
    981973
    982         | handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop
    983                 { $$ = new StatementNode( build_catch( $1, $5, nullptr, $9 ) ); }
    984         | handler_clause handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop
    985                 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $10 ) ) ); }
    986         ;
    987 
    988 handler_predicate_opt:
    989         //empty
    990         | ';' conditional_expression
     974        | handler_key '(' push push exception_declaration pop ')' compound_statement pop
     975                { $$ = new StatementNode( build_catch( $1, $5, nullptr, $8 ) ); }
     976        | handler_clause handler_key '(' push push exception_declaration pop ')' compound_statement pop
     977                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $9 ) ) ); }
    991978        ;
    992979
     
    16801667        | aggregate_key attribute_list_opt typegen_name         // CFA
    16811668                { $$ = $3->addQualifiers( $2 ); }
    1682 
    1683 // Temp, testing TreeStruct
    1684     | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name
    1685         {
    1686             typedefTable.makeTypedef( *$4 );            // create typedef
    1687             if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $
    1688             forall = false;                             // reset
    1689         }
    1690       '{' field_declaration_list '}'
    1691         {
    1692             $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,
    1693                 $4, nullptr, nullptr, $7, true )->addQualifiers( $3 );
    1694         }
    1695     | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name TYPEDEFname
    1696         {
    1697             typedefTable.makeTypedef( *$4 );            // create typedef
    1698             if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $
    1699             forall = false;                             // reset
    1700         }
    1701       '{' field_declaration_list '}'
    1702         {
    1703             $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,
    1704                 $4, $5, nullptr, $8, true )->addQualifiers( $3 );
    1705         }
    17061669        ;
    17071670
     
    18821845cfa_parameter_declaration:                                                              // CFA, new & old style parameter declaration
    18831846        parameter_declaration
    1884         | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize_opt
     1847        | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name assignment_opt
    18851848                { $$ = $1->addName( $2 ); }
    1886         | cfa_abstract_tuple identifier_or_type_name default_initialize_opt
     1849        | cfa_abstract_tuple identifier_or_type_name assignment_opt
    18871850                // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator).
    18881851                { $$ = $1->addName( $2 ); }
    1889         | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize_opt
     1852        | type_qualifier_list cfa_abstract_tuple identifier_or_type_name assignment_opt
    18901853                { $$ = $2->addName( $3 )->addQualifiers( $1 ); }
    18911854        | cfa_function_specifier
     
    19041867parameter_declaration:
    19051868                // No SUE declaration in parameter list.
    1906         declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt
     1869        declaration_specifier_nobody identifier_parameter_declarator assignment_opt
    19071870                {
    19081871                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    19091872                        $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr );
    19101873                }
    1911         | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt
     1874        | declaration_specifier_nobody type_parameter_redeclarator assignment_opt
    19121875                {
    19131876                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    19171880
    19181881abstract_parameter_declaration:
    1919         declaration_specifier_nobody default_initialize_opt
     1882        declaration_specifier_nobody assignment_opt
    19201883                { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); }
    1921         | declaration_specifier_nobody abstract_parameter_declarator default_initialize_opt
     1884        | declaration_specifier_nobody abstract_parameter_declarator assignment_opt
    19221885                { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); }
    19231886        ;
     
    30823045        ;
    30833046
    3084 default_initialize_opt:
     3047assignment_opt:
    30853048        // empty
    30863049                { $$ = nullptr; }
  • src/SymTab/Autogen.cc

    r5bd0aad re60e0dc  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:41:00 2017
    13 // Update Count     : 62
     12// Last Modified On : Wed Jun 28 15:30:00 2017
     13// Update Count     : 61
    1414//
    1515
     
    401401        void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) {
    402402                // Builtins do not use autogeneration.
    403                 if ( aggregateDecl->get_linkage() == LinkageSpec::BuiltinCFA ||
     403                if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin ||
    404404                         aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) {
    405405                        return;
  • src/SymTab/module.mk

    r5bd0aad re60e0dc  
    1010## Author           : Richard C. Bilson
    1111## Created On       : Mon Jun  1 17:49:17 2015
    12 ## Last Modified By : Andrew Beach
    13 ## Last Modified On : Wed Jul 12 13:06:00 2017
    14 ## Update Count     : 3
     12## Last Modified By : Rob Schluntz
     13## Last Modified On : Tue Jul 07 16:22:23 2015
     14## Update Count     : 2
    1515###############################################################################
    1616
     
    2121       SymTab/ImplementationType.cc \
    2222       SymTab/TypeEquality.cc \
    23        SymTab/Autogen.cc \
    24        SymTab/TreeStruct.cc
     23       SymTab/Autogen.cc
  • src/SynTree/Constant.cc

    r5bd0aad re60e0dc  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 14:50:00 2017
    13 // Update Count     : 29
     12// Last Modified On : Thr Jun 22 10:11:00 2017
     13// Update Count     : 28
    1414//
    1515
     
    4646}
    4747
    48 Constant Constant::null( Type * ptrtype ) {
    49         if ( nullptr == ptrtype ) {
    50                 ptrtype = new PointerType(
    51                         Type::Qualifiers(),
    52                         new VoidType( Type::Qualifiers() )
    53                         );
    54         }
    55 
    56         return Constant( ptrtype, "0", (unsigned long long int)0 );
    57 }
    58 
    5948unsigned long long Constant::get_ival() const {
    6049        assertf( safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." );
  • src/SynTree/Constant.h

    r5bd0aad re60e0dc  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 13:33:00 2017
    13 // Update Count     : 16
     12// Last Modified On : Thr Jun 22 10:13:00 2017
     13// Update Count     : 15
    1414//
    1515
     
    4444        static Constant from_double( double d );
    4545
    46         /// generates a null pointer value for the given type. void * if omitted.
    47         static Constant null( Type * ptrtype = nullptr );
    48 
    4946        virtual void accept( Visitor & v ) { v.visit( this ); }
    5047        virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); }
  • src/SynTree/Declaration.h

    r5bd0aad re60e0dc  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:59:00 2017
    13 // Update Count     : 123
     12// Last Modified On : Tus Jun 27 15:31:00 2017
     13// Update Count     : 122
    1414//
    1515
     
    266266        typedef AggregateDecl Parent;
    267267  public:
    268         StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ), tagged( false ), parent_name( "" ) {}
    269         StructDecl( const std::string &name, const std::string *parent, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( DeclarationNode::Struct ), tagged( true ), parent_name( parent ? *parent : "" ) {}
     268        StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}
    270269        StructDecl( const StructDecl &other ) : Parent( other ) {}
    271270
     
    274273        bool is_thread() { return kind == DeclarationNode::Thread; }
    275274
    276         // Tagged/Tree Structure Excetion
    277         bool get_tagged() { return tagged; }
    278         void set_tagged( bool newValue ) { tagged = newValue; }
    279         bool has_parent() { return parent_name != ""; }
    280         std::string get_parentName() { return parent_name; }
    281 
    282275        virtual StructDecl *clone() const { return new StructDecl( *this ); }
    283276        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    286279        DeclarationNode::Aggregate kind;
    287280        virtual std::string typeString() const;
    288 
    289         bool tagged;
    290         std::string parent_name;
    291281};
    292282
  • src/libcfa/Makefile.am

    r5bd0aad re60e0dc  
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Andrew Beach
    13 ## Last Modified On : Fri Jun 14 17:00:00 2017
    14 ## Update Count     : 216
     13## Last Modified On : Wed Jun 28 15:36:00 2017
     14## Update Count     : 215
    1515###############################################################################
    1616
     
    5151
    5252libobjs = ${headers:=.o}
    53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \
    54         exception.c typeobject.c
     53libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} exception.c
    5554
    5655# not all platforms support concurrency, add option do disable it
     
    6968        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    7069
    71 libcfa_a-typeobject.o : typeobject.c
    72         ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    73 
    7470concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c
    7571        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    7672
    7773libcfa_d_a-exception.o : exception.c
    78         ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    79 
    80 libcfa_d_a-typeobject.o : typeobject.c
    8174        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    8275
  • src/libcfa/Makefile.in

    r5bd0aad re60e0dc  
    154154        concurrency/coroutine.c concurrency/thread.c \
    155155        concurrency/kernel.c concurrency/monitor.c exception.c \
    156         typeobject.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
    157         concurrency/alarm.c concurrency/invoke.c \
    158         concurrency/preemption.c
     156        concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \
     157        concurrency/invoke.c concurrency/preemption.c
    159158am__dirstamp = $(am__leading_dot)dirstamp
    160159@BUILD_CONCURRENCY_TRUE@am__objects_1 = concurrency/libcfa_d_a-coroutine.$(OBJEXT) \
     
    178177        libcfa_d_a-interpose.$(OBJEXT) \
    179178        libhdr/libcfa_d_a-libdebug.$(OBJEXT) $(am__objects_2) \
    180         libcfa_d_a-exception.$(OBJEXT) libcfa_d_a-typeobject.$(OBJEXT) \
    181         $(am__objects_3)
     179        libcfa_d_a-exception.$(OBJEXT) $(am__objects_3)
    182180am_libcfa_d_a_OBJECTS = $(am__objects_4)
    183181libcfa_d_a_OBJECTS = $(am_libcfa_d_a_OBJECTS)
     
    190188        concurrency/coroutine.c concurrency/thread.c \
    191189        concurrency/kernel.c concurrency/monitor.c exception.c \
    192         typeobject.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
    193         concurrency/alarm.c concurrency/invoke.c \
    194         concurrency/preemption.c
     190        concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \
     191        concurrency/invoke.c concurrency/preemption.c
    195192@BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \
    196193@BUILD_CONCURRENCY_TRUE@        concurrency/libcfa_a-thread.$(OBJEXT) \
     
    212209        libcfa_a-interpose.$(OBJEXT) \
    213210        libhdr/libcfa_a-libdebug.$(OBJEXT) $(am__objects_6) \
    214         libcfa_a-exception.$(OBJEXT) libcfa_a-typeobject.$(OBJEXT) \
    215         $(am__objects_7)
     211        libcfa_a-exception.$(OBJEXT) $(am__objects_7)
    216212am_libcfa_a_OBJECTS = $(am__objects_8)
    217213libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
     
    421417libobjs = ${headers:=.o}
    422418libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \
    423         exception.c typeobject.c $(am__append_4)
     419        exception.c $(am__append_4)
    424420libcfa_a_SOURCES = ${libsrc}
    425421libcfa_a_CFLAGS = -nodebug -O2
     
    597593@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-rational.Po@am__quote@
    598594@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-stdlib.Po@am__quote@
    599 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-typeobject.Po@am__quote@
    600595@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-assert.Po@am__quote@
    601596@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-exception.Po@am__quote@
     
    609604@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-rational.Po@am__quote@
    610605@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@
    611 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-typeobject.Po@am__quote@
    612606@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@
    613607@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-alarm.Po@am__quote@
     
    934928@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi`
    935929
    936 libcfa_d_a-typeobject.obj: typeobject.c
    937 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-typeobject.obj -MD -MP -MF $(DEPDIR)/libcfa_d_a-typeobject.Tpo -c -o libcfa_d_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
    938 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_d_a-typeobject.Tpo $(DEPDIR)/libcfa_d_a-typeobject.Po
    939 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='typeobject.c' object='libcfa_d_a-typeobject.obj' libtool=no @AMDEPBACKSLASH@
    940 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    941 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
    942 
    943930concurrency/libcfa_d_a-alarm.o: concurrency/alarm.c
    944931@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-alarm.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-alarm.Tpo -c -o concurrency/libcfa_d_a-alarm.o `test -f 'concurrency/alarm.c' || echo '$(srcdir)/'`concurrency/alarm.c
     
    12411228@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    12421229@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi`
    1243 
    1244 libcfa_a-typeobject.obj: typeobject.c
    1245 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libcfa_a-typeobject.obj -MD -MP -MF $(DEPDIR)/libcfa_a-typeobject.Tpo -c -o libcfa_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
    1246 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_a-typeobject.Tpo $(DEPDIR)/libcfa_a-typeobject.Po
    1247 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='typeobject.c' object='libcfa_a-typeobject.obj' libtool=no @AMDEPBACKSLASH@
    1248 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1249 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
    12501230
    12511231concurrency/libcfa_a-alarm.o: concurrency/alarm.c
     
    15411521        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    15421522
    1543 libcfa_a-typeobject.o : typeobject.c
    1544         ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    1545 
    15461523concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c
    15471524        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    15481525
    15491526libcfa_d_a-exception.o : exception.c
    1550         ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    1551 
    1552 libcfa_d_a-typeobject.o : typeobject.c
    15531527        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    15541528
  • src/libcfa/iostream.c

    r5bd0aad re60e0dc  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 16 21:12:03 2017
    13 // Update Count     : 398
     12// Last Modified On : Thu Jul  6 18:14:17 2017
     13// Update Count     : 396
    1414//
    1515
     
    125125forall( dtype ostype | ostream( ostype ) )
    126126ostype * ?|?( ostype * os, float _Complex fc ) {
    127         if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    128         fmt( os, "%g%+gi", crealf( fc ), cimagf( fc ) );
     127        os | crealf( fc );
     128        _Bool temp = sepDisable( os );                                          // disable separators within complex value
     129        if ( cimagf( fc ) >= 0 ) os | '+';                                      // negative value prints '-'
     130        os | cimagf( fc ) | 'i';
     131        sepReset( os, temp );                                                           // reset separator
    129132        return os;
    130133} // ?|?
     
    132135forall( dtype ostype | ostream( ostype ) )
    133136ostype * ?|?( ostype * os, double _Complex dc ) {
    134         if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    135         fmt( os, "%.*lg%+.*lgi", DBL_DIG, creal( dc ), DBL_DIG, cimag( dc ) );
     137        os | creal( dc );
     138        _Bool temp = sepDisable( os );                                          // disable separators within complex value
     139        if ( cimag( dc ) >= 0 ) os | '+';                                       // negative value prints '-'
     140        os | cimag( dc ) | 'i';
     141        sepReset( os, temp );                                                           // reset separator
    136142        return os;
    137143} // ?|?
     
    139145forall( dtype ostype | ostream( ostype ) )
    140146ostype * ?|?( ostype * os, long double _Complex ldc ) {
    141         if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    142         fmt( os, "%.*Lg%+.*Lgi", LDBL_DIG, creall( ldc ), LDBL_DIG, cimagl( ldc ) );
     147        os | creall( ldc );
     148        _Bool temp = sepDisable( os );                                          // disable separators within complex value
     149        if ( cimagl( ldc ) >= 0 ) os | '+';                                     // negative value prints '-'
     150        os | cimagl( ldc ) | 'i';
     151        sepReset( os, temp );                                                           // reset separator
    143152        return os;
    144153} // ?|?
  • src/tests/gmp.c

    r5bd0aad re60e0dc  
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 13 16:35:01 2017
    13 // Update Count     : 541
     12// Last Modified On : Wed May 24 22:05:38 2017
     13// Update Count     : 540
    1414//
    1515
     
    9595// Local Variables: //
    9696// tab-width: 4 //
    97 // compile-command: "cfa gmp.c -lgmp" //
     97// compile-command: "cfa gmp.c -l gmp" //
    9898// End: //
Note: See TracChangeset for help on using the changeset viewer.