Changes in / [5bd0aad:e60e0dc]
- Files:
-
- 4 deleted
- 21 edited
-
doc/LaTeXmacros/common.tex (modified) (2 diffs)
-
doc/user/EHMHierarchy.fig (modified) (3 diffs)
-
doc/user/user.tex (modified) (19 diffs)
-
src/CodeGen/OperatorTable.cc (modified) (3 diffs)
-
src/Makefile.in (modified) (5 diffs)
-
src/Parser/DeclarationNode.cc (modified) (3 diffs)
-
src/Parser/ExpressionNode.cc (modified) (2 diffs)
-
src/Parser/ParseNode.h (modified) (4 diffs)
-
src/Parser/TypeData.cc (modified) (5 diffs)
-
src/Parser/TypeData.h (modified) (2 diffs)
-
src/Parser/lex.ll (modified) (5 diffs)
-
src/Parser/parser.yy (modified) (11 diffs)
-
src/SymTab/Autogen.cc (modified) (2 diffs)
-
src/SymTab/TreeStruct.cc (deleted)
-
src/SymTab/TreeStruct.h (deleted)
-
src/SymTab/module.mk (modified) (2 diffs)
-
src/SynTree/Constant.cc (modified) (2 diffs)
-
src/SynTree/Constant.h (modified) (2 diffs)
-
src/SynTree/Declaration.h (modified) (4 diffs)
-
src/libcfa/Makefile.am (modified) (3 diffs)
-
src/libcfa/Makefile.in (modified) (10 diffs)
-
src/libcfa/iostream.c (modified) (4 diffs)
-
src/libcfa/typeobject.c (deleted)
-
src/libcfa/typeobject.h (deleted)
-
src/tests/gmp.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/common.tex
r5bd0aad re60e0dc 11 11 %% Created On : Sat Apr 9 10:06:17 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Jul 17 10:21:17201714 %% Update Count : 3 4813 %% Last Modified On : Thu Jul 13 11:44:59 2017 14 %% Update Count : 335 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 134 134 135 135 % 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$}} 137 137 % code index (cannot use ©) 138 \newcommand{\indexc}[ 2][\@empty]{\index{#2@\lstinline[#1]$#2$}}138 \newcommand{\indexc}[1]{\index{#1@\lstinline$#1$}} 139 139 140 140 % 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.5 c1 #FIG 3.2 Produced by xfig version 3.2.5b 2 2 Landscape 3 3 Center … … 19 19 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 20 20 1 1 1.00 60.00 90.00 21 1950 1425 2925120021 1950 1425 3000 1200 22 22 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 23 23 1 1 1.00 60.00 90.00 … … 29 29 1 1 1.00 60.00 90.00 30 30 4950 1950 4950 1725 31 4 1 0 50 -1 0 13 0.0000 2 135 225 1950 1650 IO\00132 4 1 0 50 -1 0 13 0.0000 2 135 9154950 1650 Arithmetic\00133 4 1 0 50 -1 0 13 0.0000 2 150 3301350 2100 File\00134 4 1 0 50 -1 0 13 0.0000 2 135 7352550 2100 Network\00135 4 1 0 50 -1 0 13 0.0000 2 180 12153750 2100 DivideByZero\00136 4 1 0 50 -1 0 13 0.0000 2 150 810 4950 2100 Overflow\00137 4 1 0 50 -1 0 13 0.0000 2 150 915 6000 2100 Underflow\00138 4 1 0 50 -1 0 13 0.0000 2 180 8553450 1200 Exception\00131 4 1 0 100 0 0 12 0.0000 0 135 195 1950 1650 IO\001 32 4 1 0 100 0 0 12 0.0000 0 135 870 4950 1650 Arithmetic\001 33 4 1 0 100 0 0 12 0.0000 0 135 315 1350 2100 File\001 34 4 1 0 100 0 0 12 0.0000 0 135 690 2550 2100 Network\001 35 4 1 0 100 0 0 12 0.0000 0 180 1170 3750 2100 DivideByZero\001 36 4 1 0 100 0 0 12 0.0000 0 135 750 4950 2100 Overflow\001 37 4 1 0 100 0 0 12 0.0000 0 135 855 6000 2100 Underflow\001 38 4 1 0 100 0 0 12 0.0000 0 180 840 3450 1200 Exception\001 -
doc/user/user.tex
r5bd0aad re60e0dc 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Jul 17 13:06:40201714 %% Update Count : 2 82513 %% Last Modified On : Thu Jul 13 11:44:57 2017 14 %% Update Count : 2690 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 353 353 The 1999 C standard plus GNU extensions. 354 354 \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©}} 356 357 Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files. 358 }% 357 359 \end{description} 358 360 The following new \CFA options are available: … … 477 479 \end{cfa} 478 480 Existing 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©: 480 482 481 483 \begin{figure} … … 485 487 #define otype ®`®otype®`® §\C{// make keyword an identifier}§ 486 488 #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 491 493 #if defined( otype ) && defined( __CFA_BFD_H__ ) §\C{// reset only if set}§ 492 494 #undef otype 493 495 #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} 498 500 \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.1922i515 \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©.518 501 519 502 … … 939 922 int i, j; 940 923 int mem() { ®// implicit "this" parameter 941 ®i = 1; ®// this->i924 i = 1; ®// this->i 942 925 ® j = 3; ®// this->j 943 926 ® } … … 946 929 Since CFA is non-object-oriented, the equivalent object-oriented program looks like: 947 930 \begin{cfa} 948 struct S { int i, j; }; 949 int mem( S &this ) { // explicit "this" parameter 931 struct C { 932 int i, j; 933 }; 934 int mem( C &this ) { // explicit "this" parameter 950 935 ®this.®i = 1; // "this" is not elided 951 936 ®this.®j = 2; … … 953 938 \end{cfa} 954 939 but 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} 942 int mem( C &this ) ®with this® { 960 943 i = 1; ®// this.i 961 944 ® j = 2; ®// this.j … … 964 947 which extends to multiple routine parameters: 965 948 \begin{cfa} 966 struct T { double m, n; }; 967 int mem2( S &this1, T &this2 ) ®with this1, this2® { 949 struct D { 950 double m, n; 951 }; 952 int mem2( C &this1, D &this2 ) ®with this1, this2® { 968 953 i = 1; j = 2; 969 954 m = 1.0; n = 2.0; 970 955 } 971 956 \end{cfa} 957 The ©with© clause/statement comes from Pascal~\cite[\S~4.F]{Pascal}. 972 958 973 959 The statement form is used within a block: … … 979 965 // access fields of s1 without qualification 980 966 ®with s2® { // nesting 981 // access fields of s 1 and s2 without qualification967 // access fields of s2 without qualification 982 968 } 983 969 } … … 988 974 \end{cfa} 989 975 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; 976 Names clashes when opening multiple structures are ambiguous. 977 \begin{cfa} 978 struct A { int i; int j; } a, c; 979 struct B { int i; int k; } b, c; 995 980 ®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 } 1005 988 \end{cfa} 1006 989 1007 990 1008 991 \section{Exception Handling} 1009 \label{s:ExceptionHandling}1010 992 1011 993 Exception 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} 995 exception void h( int i ); 996 exception int h( int i, double d ); 997 1016 998 void 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 1020 1003 try { 1021 1004 f(...); 1022 } catch ( E e : §boolean-predicate§ ) { §\C{// termination handler}§1023 // re cover and continue1024 } catchResume( E e : §boolean-predicate§ ) { §\C{// resumption handler}§1025 // repair and return1005 } catch h( int w ) { 1006 // reset 1007 } resume h( int p, double x ) { 1008 return 17; // recover 1026 1009 } 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} 1012 So 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. 1013 The 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. 1034 1014 1035 1015 … … 1591 1571 1592 1572 \item 1593 lvalue to reference conversion: \lstinline[deletekeywords= lvalue]$lvalue-type cv1 T$converts to ©cv2 T &©, which allows implicitly converting variables to references.1573 lvalue to reference conversion: \lstinline[deletekeywords={lvalue}]@lvalue-type cv1 T@ converts to ©cv2 T &©, which allows implicitly converting variables to references. 1594 1574 \begin{cfa} 1595 1575 int x, &r = ®x®, f( int & p ); // lvalue variable (int) convert to reference (int &) … … 2700 2680 \begin{cfa}[belowskip=0pt] 2701 2681 char 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}§2682 strcpy( store, sepGet( sout ) ); 2683 sepSet( sout, "_" ); 2704 2684 sout | 1 | 2 | 3 | endl; 2705 2685 \end{cfa} … … 2708 2688 \end{cfa} 2709 2689 \begin{cfa}[belowskip=0pt] 2710 sepSet( sout, store ); §\C{// change separator back to original}§2690 sepSet( sout, store ); 2711 2691 sout | 1 | 2 | 3 | endl; 2712 2692 \end{cfa} … … 5583 5563 \Celeven prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list: 5584 5564 \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} \\ 5587 5568 \hline 5588 5569 \begin{tabular}{@{}l@{}} … … 5592 5573 \Indexc{errno.h} \\ 5593 5574 \Indexc{fenv.h} \\ 5594 \Indexc[deletekeywords=float]{float.h} \\ 5575 \Indexc{float.h} \\ 5576 \Indexc{inttypes.h} \\ 5577 \Indexc{iso646.h} \\ 5595 5578 \end{tabular} 5596 5579 & 5597 5580 \begin{tabular}{@{}l@{}} 5598 \Indexc{inttypes.h} \\5599 \Indexc{iso646.h} \\5600 5581 \Indexc{limits.h} \\ 5601 5582 \Indexc{locale.h} \\ 5602 5583 \Indexc{math.h} \\ 5603 5584 \Indexc{setjmp.h} \\ 5604 \end{tabular}5605 &5606 \begin{tabular}{@{}l@{}}5607 5585 \Indexc{signal.h} \\ 5608 5586 \Indexc{stdalign.h} \\ 5609 5587 \Indexc{stdarg.h} \\ 5610 5588 \Indexc{stdatomic.h} \\ 5611 \Indexc{stdbool.h} \\5612 \Indexc{stddef.h} \\5613 5589 \end{tabular} 5614 5590 & 5615 5591 \begin{tabular}{@{}l@{}} 5592 \Indexc{stdbool.h} \\ 5593 \Indexc{stddef.h} \\ 5616 5594 \Indexc{stdint.h} \\ 5617 5595 \Indexc{stdio.h} \\ … … 5629 5607 \Indexc{wctype.h} \\ 5630 5608 \\ 5609 \\ 5610 \\ 5631 5611 \end{tabular} 5632 5612 & … … 5634 5614 \Indexc{unistd.h} \\ 5635 5615 \Indexc{gmp.h} \\ 5616 \\ 5617 \\ 5636 5618 \\ 5637 5619 \\ … … 5673 5655 The table shows allocation routines supporting different combinations of storage-management capabilities: 5674 5656 \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 \\ 5677 5659 \hline 5678 5660 C & ©malloc© & no & no & no & no \\ … … 5681 5663 & ©memalign© & no & no & yes & no \\ 5682 5664 & ©posix_memalign© & no & no & yes & no \\ 5683 \hline5684 5665 C11 & ©aligned_alloc© & no & no & yes & no \\ 5685 \hline5686 5666 \CFA & ©alloc© & no/copy/yes & no/yes & no & yes \\ 5687 5667 & ©align_alloc© & no/yes & no & yes & yes \\ -
src/CodeGen/OperatorTable.cc
r5bd0aad re60e0dc 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 15 17:12:22 201713 // Update Count : 1 512 // Last Modified On : Tue Dec 13 14:33:05 2016 13 // Update Count : 10 14 14 // 15 15 … … 35 35 { "++?", "++", "_operator_preincr", OT_PREFIXASSIGN }, 36 36 { "--?", "--", "_operator_predecr", OT_PREFIXASSIGN }, 37 { "?\\?", "\\", "_operator_exponential", OT_INFIX },38 37 { "?*?", "*", "_operator_multiply", OT_INFIX }, 39 38 { "?/?", "/", "_operator_divide", OT_INFIX }, … … 53 52 { "?|?", "|", "_operator_bitor", OT_INFIX }, 54 53 { "?=?", "=", "_operator_assign", OT_INFIXASSIGN }, 55 { "?\\=?", "\\=", "_operator_expassign", OT_INFIXASSIGN },56 54 { "?*=?", "*=", "_operator_multassign", OT_INFIXASSIGN }, 57 55 { "?/=?", "/=", "_operator_divassign", OT_INFIXASSIGN }, -
src/Makefile.in
r5bd0aad re60e0dc 216 216 SymTab/driver_cfa_cpp-TypeEquality.$(OBJEXT) \ 217 217 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT) \ 218 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT) \219 218 SynTree/driver_cfa_cpp-Type.$(OBJEXT) \ 220 219 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) \ … … 515 514 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \ 516 515 SymTab/FixFunction.cc SymTab/ImplementationType.cc \ 517 SymTab/TypeEquality.cc SymTab/Autogen.cc Sy mTab/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 \ 519 518 SynTree/PointerType.cc SynTree/ArrayType.cc \ 520 519 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ … … 849 848 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 850 849 SymTab/$(DEPDIR)/$(am__dirstamp) 851 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT): SymTab/$(am__dirstamp) \852 SymTab/$(DEPDIR)/$(am__dirstamp)853 850 SynTree/$(am__dirstamp): 854 851 @$(MKDIR_P) SynTree … … 1036 1033 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po@am__quote@ 1037 1034 @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@1039 1035 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@ 1040 1036 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@ … … 2088 2084 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2089 2085 @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.cc2092 @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.cc2093 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po2094 @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.cc2097 2098 SymTab/driver_cfa_cpp-TreeStruct.obj: SymTab/TreeStruct.cc2099 @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.Po2101 @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`2104 2086 2105 2087 SynTree/driver_cfa_cpp-Type.o: SynTree/Type.cc -
src/Parser/DeclarationNode.cc
r5bd0aad re60e0dc 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:55:00 201713 // Update Count : 10 2012 // Last Modified On : Wed Jun 28 15:27:00 2017 13 // Update Count : 1019 14 14 // 15 15 … … 253 253 newnode->type->aggregate.fields = fields; 254 254 newnode->type->aggregate.body = body; 255 newnode->type->aggregate.tagged = false;256 newnode->type->aggregate.parent = nullptr;257 255 return newnode; 258 256 } // DeclarationNode::newAggregate … … 275 273 return newnode; 276 274 } // 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::newTreeStruct291 275 292 276 DeclarationNode * DeclarationNode::newName( string * name ) { -
src/Parser/ExpressionNode.cc
r5bd0aad re60e0dc 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 15 16:09:04201713 // Update Count : 54 912 // Last Modified On : Wed Jun 28 21:08:15 2017 13 // Update Count : 542 14 14 // 15 15 … … 231 231 } 232 232 233 // Must harmonize with OperKinds.234 233 static const char *OperName[] = { 235 234 // diadic 236 "SizeOf", "AlignOf", "OffsetOf", "?+?", "?-?", "? \\?", "?*?", "?/?", "?%?", "||", "&&",235 "SizeOf", "AlignOf", "OffsetOf", "?+?", "?-?", "?*?", "?/?", "?%?", "||", "&&", 237 236 "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?", 238 "?=?", "?@=?", "? \\=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?",237 "?=?", "?@=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?", 239 238 "?[?]", "...", 240 239 // monadic -
src/Parser/ParseNode.h
r5bd0aad re60e0dc 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 15 16:00:48201713 // Update Count : 7 8511 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 12 13:00:00 2017 13 // Update Count : 779 14 14 // 15 15 … … 141 141 }; 142 142 143 // Must harmonize with OperName.144 143 enum class OperKinds { 145 144 // diadic 146 SizeOf, AlignOf, OffsetOf, Plus, Minus, Exp,Mul, Div, Mod, Or, And,145 SizeOf, AlignOf, OffsetOf, Plus, Minus, Mul, Div, Mod, Or, And, 147 146 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, 149 148 Index, Range, 150 149 // monadic … … 249 248 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 250 249 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 254 250 DeclarationNode(); 255 251 ~DeclarationNode(); … … 336 332 337 333 static UniqueName anonymous; 338 339 // Temp to test TreeStruct340 const std::string * parent_name;341 334 }; // DeclarationNode 342 335 -
src/Parser/TypeData.cc
r5bd0aad re60e0dc 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:58:00 201713 // Update Count : 56 512 // Last Modified On : Wed Jun 28 15:28:00 2017 13 // Update Count : 564 14 14 // 15 15 … … 63 63 aggregate.fields = nullptr; 64 64 aggregate.body = false; 65 aggregate.tagged = false;66 aggregate.parent = nullptr;67 65 break; 68 66 case AggregateInst: … … 123 121 delete aggregate.actuals; 124 122 delete aggregate.fields; 125 delete aggregate.parent;126 123 // delete aggregate; 127 124 break; … … 195 192 newtype->aggregate.kind = aggregate.kind; 196 193 newtype->aggregate.body = aggregate.body; 197 newtype->aggregate.tagged = aggregate.tagged;198 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;199 194 break; 200 195 case AggregateInst: … … 624 619 switch ( td->aggregate.kind ) { 625 620 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 }631 621 case DeclarationNode::Coroutine: 632 622 case DeclarationNode::Monitor: -
src/Parser/TypeData.h
r5bd0aad re60e0dc 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:57:00 201713 // Update Count : 18 712 // Last Modified On : Wed Jun 28 15:29:00 2017 13 // Update Count : 186 14 14 // 15 15 … … 31 31 DeclarationNode * fields; 32 32 bool body; 33 34 bool tagged;35 const std::string * parent;36 33 }; 37 34 -
src/Parser/lex.ll
r5bd0aad re60e0dc 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sat Jul 15 15:46:34 201713 * Update Count : 5 4212 * Last Modified On : Wed Jul 12 18:04:44 2017 13 * Update Count : 535 14 14 */ 15 15 … … 125 125 op_unary {op_unary_only}|{op_unary_binary}|{op_unary_pre_post} 126 126 127 op_binary_only "/"|"%"|" \\"|"^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"\\="|"&="|"|="|"^="|"<<="|">>="127 op_binary_only "/"|"%"|"^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"&="|"|="|"^="|"<<="|">>=" 128 128 op_binary_over {op_unary_binary}|{op_binary_only} 129 129 // op_binary_not_over "?"|"->"|"."|"&&"|"||"|"@=" … … 136 136 137 137 %% 138 /* line directives */138 /* line directives */ 139 139 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 140 140 /* " stop highlighting */ … … 337 337 "-" { ASCIIOP_RETURN(); } 338 338 "*" { ASCIIOP_RETURN(); } 339 "\\" { ASCIIOP_RETURN(); } // CFA, exponentiation340 339 "/" { ASCIIOP_RETURN(); } 341 340 "%" { ASCIIOP_RETURN(); } … … 362 361 "+=" { NAMEDOP_RETURN(PLUSassign); } 363 362 "-=" { NAMEDOP_RETURN(MINUSassign); } 364 "\\=" { NAMEDOP_RETURN(EXPassign); } // CFA, exponentiation365 363 "*=" { NAMEDOP_RETURN(MULTassign); } 366 364 "/=" { NAMEDOP_RETURN(DIVassign); } -
src/Parser/parser.yy
r5bd0aad re60e0dc 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jul 17 12:17:00201713 // Update Count : 24 5511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 13 14:38:54 2017 13 // Update Count : 2431 14 14 // 15 15 … … 151 151 %token ELLIPSIS // ... 152 152 153 %token EXPassign MULTassign DIVassign MODassign // \= *= /= %=153 %token MULTassign DIVassign MODassign // *= /= %=/ 154 154 %token PLUSassign MINUSassign // += -= 155 155 %token LSassign RSassign // <<= >>= … … 168 168 %type<op> ptrref_operator unary_operator assignment_operator 169 169 %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 175 174 %type<en> comma_expression comma_expression_opt 176 %type<en> argument_expression_list argument_expression default_initialize_opt175 %type<en> argument_expression_list argument_expression assignment_opt 177 176 %type<fctl> for_control_expression 178 177 %type<en> subrange … … 574 573 ; 575 574 576 exponential_expression:575 multiplicative_expression: 577 576 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 585 578 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mul, $1, $3 ) ); } 586 | multiplicative_expression '/' exponential_expression579 | multiplicative_expression '/' cast_expression 587 580 { $$ = new ExpressionNode( build_binary_val( OperKinds::Div, $1, $3 ) ); } 588 | multiplicative_expression '%' exponential_expression581 | multiplicative_expression '%' cast_expression 589 582 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mod, $1, $3 ) ); } 590 583 ; … … 685 678 '=' { $$ = OperKinds::Assign; } 686 679 | ATassign { $$ = OperKinds::AtAssn; } 687 | EXPassign { $$ = OperKinds::ExpAssn; }688 680 | MULTassign { $$ = OperKinds::MulAssn; } 689 681 | DIVassign { $$ = OperKinds::DivAssn; } … … 980 972 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); } 981 973 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 ) ) ); } 991 978 ; 992 979 … … 1680 1667 | aggregate_key attribute_list_opt typegen_name // CFA 1681 1668 { $$ = $3->addQualifiers( $2 ); } 1682 1683 // Temp, testing TreeStruct1684 | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name1685 {1686 typedefTable.makeTypedef( *$4 ); // create typedef1687 if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $1688 forall = false; // reset1689 }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 TYPEDEFname1696 {1697 typedefTable.makeTypedef( *$4 ); // create typedef1698 if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $1699 forall = false; // reset1700 }1701 '{' field_declaration_list '}'1702 {1703 $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,1704 $4, $5, nullptr, $8, true )->addQualifiers( $3 );1705 }1706 1669 ; 1707 1670 … … 1882 1845 cfa_parameter_declaration: // CFA, new & old style parameter declaration 1883 1846 parameter_declaration 1884 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize_opt1847 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name assignment_opt 1885 1848 { $$ = $1->addName( $2 ); } 1886 | cfa_abstract_tuple identifier_or_type_name default_initialize_opt1849 | cfa_abstract_tuple identifier_or_type_name assignment_opt 1887 1850 // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator). 1888 1851 { $$ = $1->addName( $2 ); } 1889 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize_opt1852 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name assignment_opt 1890 1853 { $$ = $2->addName( $3 )->addQualifiers( $1 ); } 1891 1854 | cfa_function_specifier … … 1904 1867 parameter_declaration: 1905 1868 // No SUE declaration in parameter list. 1906 declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt1869 declaration_specifier_nobody identifier_parameter_declarator assignment_opt 1907 1870 { 1908 1871 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1909 1872 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 1910 1873 } 1911 | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt1874 | declaration_specifier_nobody type_parameter_redeclarator assignment_opt 1912 1875 { 1913 1876 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 1917 1880 1918 1881 abstract_parameter_declaration: 1919 declaration_specifier_nobody default_initialize_opt1882 declaration_specifier_nobody assignment_opt 1920 1883 { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); } 1921 | declaration_specifier_nobody abstract_parameter_declarator default_initialize_opt1884 | declaration_specifier_nobody abstract_parameter_declarator assignment_opt 1922 1885 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 1923 1886 ; … … 3082 3045 ; 3083 3046 3084 default_initialize_opt:3047 assignment_opt: 3085 3048 // empty 3086 3049 { $$ = nullptr; } -
src/SymTab/Autogen.cc
r5bd0aad re60e0dc 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:41:00 201713 // Update Count : 6 212 // Last Modified On : Wed Jun 28 15:30:00 2017 13 // Update Count : 61 14 14 // 15 15 … … 401 401 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) { 402 402 // Builtins do not use autogeneration. 403 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin CFA||403 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin || 404 404 aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) { 405 405 return; -
src/SymTab/module.mk
r5bd0aad re60e0dc 10 10 ## Author : Richard C. Bilson 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 ## Last Modified By : Andrew Beach13 ## Last Modified On : Wed Jul 12 13:06:00 201714 ## Update Count : 312 ## Last Modified By : Rob Schluntz 13 ## Last Modified On : Tue Jul 07 16:22:23 2015 14 ## Update Count : 2 15 15 ############################################################################### 16 16 … … 21 21 SymTab/ImplementationType.cc \ 22 22 SymTab/TypeEquality.cc \ 23 SymTab/Autogen.cc \ 24 SymTab/TreeStruct.cc 23 SymTab/Autogen.cc -
src/SynTree/Constant.cc
r5bd0aad re60e0dc 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 14:50:00 201713 // Update Count : 2 912 // Last Modified On : Thr Jun 22 10:11:00 2017 13 // Update Count : 28 14 14 // 15 15 … … 46 46 } 47 47 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 59 48 unsigned long long Constant::get_ival() const { 60 49 assertf( safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." ); -
src/SynTree/Constant.h
r5bd0aad re60e0dc 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 13:33:00 201713 // Update Count : 1 612 // Last Modified On : Thr Jun 22 10:13:00 2017 13 // Update Count : 15 14 14 // 15 15 … … 44 44 static Constant from_double( double d ); 45 45 46 /// generates a null pointer value for the given type. void * if omitted.47 static Constant null( Type * ptrtype = nullptr );48 49 46 virtual void accept( Visitor & v ) { v.visit( this ); } 50 47 virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); } -
src/SynTree/Declaration.h
r5bd0aad re60e0dc 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:59:00 201713 // Update Count : 12 312 // Last Modified On : Tus Jun 27 15:31:00 2017 13 // Update Count : 122 14 14 // 15 15 … … 266 266 typedef AggregateDecl Parent; 267 267 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 ) {} 270 269 StructDecl( const StructDecl &other ) : Parent( other ) {} 271 270 … … 274 273 bool is_thread() { return kind == DeclarationNode::Thread; } 275 274 276 // Tagged/Tree Structure Excetion277 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 282 275 virtual StructDecl *clone() const { return new StructDecl( *this ); } 283 276 virtual void accept( Visitor &v ) { v.visit( this ); } … … 286 279 DeclarationNode::Aggregate kind; 287 280 virtual std::string typeString() const; 288 289 bool tagged;290 std::string parent_name;291 281 }; 292 282 -
src/libcfa/Makefile.am
r5bd0aad re60e0dc 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Fri Jun 14 17:00:00 201714 ## Update Count : 21 613 ## Last Modified On : Wed Jun 28 15:36:00 2017 14 ## Update Count : 215 15 15 ############################################################################### 16 16 … … 51 51 52 52 libobjs = ${headers:=.o} 53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \ 54 exception.c typeobject.c 53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} exception.c 55 54 56 55 # not all platforms support concurrency, add option do disable it … … 69 68 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 70 69 71 libcfa_a-typeobject.o : typeobject.c72 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<73 74 70 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 75 71 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 76 72 77 73 libcfa_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.c81 74 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 82 75 -
src/libcfa/Makefile.in
r5bd0aad re60e0dc 154 154 concurrency/coroutine.c concurrency/thread.c \ 155 155 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 159 158 am__dirstamp = $(am__leading_dot)dirstamp 160 159 @BUILD_CONCURRENCY_TRUE@am__objects_1 = concurrency/libcfa_d_a-coroutine.$(OBJEXT) \ … … 178 177 libcfa_d_a-interpose.$(OBJEXT) \ 179 178 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) 182 180 am_libcfa_d_a_OBJECTS = $(am__objects_4) 183 181 libcfa_d_a_OBJECTS = $(am_libcfa_d_a_OBJECTS) … … 190 188 concurrency/coroutine.c concurrency/thread.c \ 191 189 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 195 192 @BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \ 196 193 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-thread.$(OBJEXT) \ … … 212 209 libcfa_a-interpose.$(OBJEXT) \ 213 210 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) 216 212 am_libcfa_a_OBJECTS = $(am__objects_8) 217 213 libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS) … … 421 417 libobjs = ${headers:=.o} 422 418 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \ 423 exception.c typeobject.c$(am__append_4)419 exception.c $(am__append_4) 424 420 libcfa_a_SOURCES = ${libsrc} 425 421 libcfa_a_CFLAGS = -nodebug -O2 … … 597 593 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-rational.Po@am__quote@ 598 594 @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@600 595 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-assert.Po@am__quote@ 601 596 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-exception.Po@am__quote@ … … 609 604 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-rational.Po@am__quote@ 610 605 @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@612 606 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@ 613 607 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-alarm.Po@am__quote@ … … 934 928 @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` 935 929 936 libcfa_d_a-typeobject.obj: typeobject.c937 @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.Po939 @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 943 930 concurrency/libcfa_d_a-alarm.o: concurrency/alarm.c 944 931 @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 … … 1241 1228 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1242 1229 @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.c1245 @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.Po1247 @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`1250 1230 1251 1231 concurrency/libcfa_a-alarm.o: concurrency/alarm.c … … 1541 1521 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 1542 1522 1543 libcfa_a-typeobject.o : typeobject.c1544 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<1545 1546 1523 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 1547 1524 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1548 1525 1549 1526 libcfa_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.c1553 1527 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1554 1528 -
src/libcfa/iostream.c
r5bd0aad re60e0dc 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jul 16 21:12:03201713 // Update Count : 39 812 // Last Modified On : Thu Jul 6 18:14:17 2017 13 // Update Count : 396 14 14 // 15 15 … … 125 125 forall( dtype ostype | ostream( ostype ) ) 126 126 ostype * ?|?( 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 129 132 return os; 130 133 } // ?|? … … 132 135 forall( dtype ostype | ostream( ostype ) ) 133 136 ostype * ?|?( 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 136 142 return os; 137 143 } // ?|? … … 139 145 forall( dtype ostype | ostream( ostype ) ) 140 146 ostype * ?|?( 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 143 152 return os; 144 153 } // ?|? -
src/tests/gmp.c
r5bd0aad re60e0dc 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 13 16:35:01201713 // Update Count : 54 112 // Last Modified On : Wed May 24 22:05:38 2017 13 // Update Count : 540 14 14 // 15 15 … … 95 95 // Local Variables: // 96 96 // tab-width: 4 // 97 // compile-command: "cfa gmp.c -l gmp" //97 // compile-command: "cfa gmp.c -l gmp" // 98 98 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.